1
0
mirror of https://github.com/chylex/dotfiles.git synced 2025-10-17 00:39:36 +02:00

Compare commits

...

15 Commits

Author SHA1 Message Date
c9c8216e64 Update .ideavimrc (change binding to extend/shrink selection) 2025-09-30 15:37:36 +02:00
21904bbb62 Update .vimrc & .ideavimrc (change binding to navigate to the end of previous word) 2025-09-30 15:37:36 +02:00
d76b82721d Update .vimrc (disable bell sound) 2025-09-10 14:04:01 +02:00
580a47aa9b Update .ideavimrc (work around broken shortcuts in Rider) 2025-08-18 23:38:28 +02:00
946f464aca Update .vimrc (use Ctrl-S to save) 2025-08-17 10:01:24 +02:00
1e5c7a752e Update .vimrc (fix pasting via Ctrl-V in insert mode) 2025-08-17 09:51:13 +02:00
c1fac762be Update .ideavimrc (add bindings to move statement/element) 2025-08-15 18:45:41 +02:00
8cd0b37833 Update .ideavimrc (add bindings to extend/shrink selection) 2025-08-15 02:34:16 +02:00
5cbaf5587d Update .vimrc & .ideavimrc (indent current line with just '<' or '>') 2025-08-06 23:47:48 +02:00
7b5bbf7bb7 Update .vimrc & .ideavimrc (fix 'ů' mapping with matchit) 2025-07-28 02:01:32 +02:00
6d1840a48c Update .vimrc (always show leading and trailing spaces) 2025-07-22 13:34:25 +02:00
4a77b0588b Update .vimrc & .ideavimrc (move some commands closer on Czech keyboard layout) 2025-07-20 12:41:39 +02:00
a9bfe13277 Update .vimrc (fix Ctrl-A in visual mode) 2025-07-20 09:14:12 +02:00
be2bdafe78 Update .vimrc (selection & clipboard) 2025-07-08 16:25:26 +02:00
cda970bfc2 Update .vimrc (GUI configuration & consistency) 2025-07-08 16:25:26 +02:00
2 changed files with 110 additions and 31 deletions

View File

@@ -47,14 +47,22 @@ sethandler <C-Y> a:ide
sethandler <C-\> a:ide
sethandler <A-B> a:vim
sethandler <A-E> a:vim
sethandler <A-H> a:vim
sethandler <A-J> a:vim
sethandler <A-K> a:vim
sethandler <A-L> a:vim
sethandler <A-M> a:vim
sethandler <A-N> a:vim
sethandler <A-O> a:vim
sethandler <A-P> a:vim
sethandler <A-S-B> a:vim
sethandler <A-S-E> a:vim
sethandler <A-S-H> a:vim
sethandler <A-S-J> a:vim
sethandler <A-S-K> a:vim
sethandler <A-S-L> a:vim
sethandler <A-S-M> a:vim
sethandler <A-S-O> a:vim
sethandler <A-V> a:vim
sethandler <A-X> a:vim
@@ -72,6 +80,12 @@ sethandler <C-Right> a:vim
sethandler <S-Left> a:vim
sethandler <S-Right> a:vim
if &ide =~? 'rider'
" These shortcuts are broken in Rider for some reason...
sethandler <A-S-H> a:ide
sethandler <A-S-L> a:ide
endif
" Enable plugins (https://github.com/JetBrains/ideavim/wiki/IdeaVim-Plugins)
Plug 'argtextobj.vim'
Plug 'vim-exchange'
@@ -98,10 +112,19 @@ map í 9
map é 0
" Move some commands closer on Czech keyboard layout
nnoremap ú @@
noremap § ;
map ů %
map gů g%
nnoremap ú @@
noremap , +
noremap § `
noremap §§ ``
nnoremap m§ m
sunmap ů
sunmap §
" Enter visual block mode
map <A-v> <C-v>
" Navigate camel humps
noremap L [w
@@ -110,8 +133,8 @@ nnoremap L [w
nnoremap H [b
" Navigate to end of previous word
noremap <A-b> ge
noremap <A-S-b> gE
noremap <A-e> ge
noremap <A-S-e> gE
" Navigate unmatched parentheses/braces
noremap g( [(
@@ -130,20 +153,23 @@ nnoremap go o<Esc>$
nnoremap gO O<Esc>$
nnoremap g<CR> i<CR><Esc>l
" Delete lines
" Edit current line
nnoremap C cc
xnoremap C cc
nnoremap D dd
xnoremap D dd
" Enter visual block mode
map <A-v> <C-v>
nnoremap < <<
nnoremap > >>
" Indent keeping selection
xnoremap < <gv
xnoremap > >gv
xnoremap = =gv
" Extend selection
map <A-m> <Action>(EditorSelectWord)
map <A-S-m> <Action>(EditorUnSelectWord)
" Turn capital letters into opposite actions
" nnoremap U :redo<CR> " Handled by custom version of IdeaVIM
@@ -182,6 +208,13 @@ map ] <Action>(MethodDown)
map { <Plug>(ParagraphPrevMotion)$
map } <Plug>(ParagraphNextMotion)$
" Move statement/element
map <A-S-h> <Action>(MoveElementLeft)
map <A-S-l> <Action>(MoveElementRight)
map <A-S-j> <Action>(MoveStatementDown)
map <A-S-k> <Action>(MoveStatementUp)
" Multiple carets
map <expr> <A-j> pumvisible() ? '<Action>(EditorDown)' : '<Action>(EditorCloneCaretBelow)'
map <expr> <A-k> pumvisible() ? '<Action>(EditorUp)' : '<Action>(EditorCloneCaretAbove)'

90
.vimrc
View File

@@ -1,5 +1,8 @@
set autoindent
set backspace=indent,eol,start
set encoding=utf-8
set guifont=Cascadia_Mono:h12:cANSI:qDRAFT
set guioptions-=t " Remove menu tearoff
set history=1024
set hlsearch
set ignorecase
@@ -7,19 +10,22 @@ set incsearch
set infercase
set laststatus=2
set linebreak
set listchars=space,tab:>·,trail:~,extends:>,precedes:<
set list
set listchars=lead,trail,tab:→\ ,extends:>,precedes:<
set modeline
set modelines=2
set mouse=a
set noerrorbells
set noshowcmd
set noshowmode
set number
set nrformats-=octal
set number
set relativenumber
set scrolloff=999
set shiftwidth=0
set showbreak=
set shortmess-=S " Show search count
set shortmess-=l " Show full description for lines and bytes
set showbreak=↪\
set showmatch
set sidescrolloff=999
set smartcase
@@ -27,22 +33,40 @@ set tabstop=4
set ttimeout
set ttimeoutlen=50
set ttymouse=xterm2
set virtualedit=onemore
set wildmenu
set winaltkeys=no
set wrap
" Show full description for lines and bytes
set shortmess-=l
" Show search count
set shortmess-=S
" Windows paths
set packpath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME
set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME
" Color scheme
syntax enable
colorscheme custom
highlight LineNr ctermfg=244
highlight IncSearch ctermfg=251 ctermbg=238
highlight Search ctermfg=251 ctermbg=238
highlight Visual ctermfg=240 ctermbg=250
if has("gui_running")
colorscheme retrobox
highlight NonText ctermfg=14 guifg=#7c6f64
else
colorscheme custom
highlight LineNr ctermfg=244
highlight IncSearch ctermfg=251 ctermbg=238
highlight Search ctermfg=251 ctermbg=238
highlight Visual ctermfg=240 ctermbg=250
endif
highlight SpecialKey ctermfg=8 guifg=#584f46
" Windows GUI
if has("win32") && has("gui_running")
autocmd GUIEnter * simalt ~x " Maximize window
autocmd GUIEnter * set visualbell t_vb= " Disable bell sound
set listchars+=tab:▶\
set renderoptions=type:directx " Fix unicode rendering
set showbreak=→\
endif
" Fix Alt mappings (https://github.com/vim/vim/issues/2588#issuecomment-697959290)
for ord in range(65, 90) + range(97, 122)
@@ -68,11 +92,19 @@ map í 9
map é 0
" Move some commands closer on Czech keyboard layout
nnoremap ú @@
noremap § ;
map ů %
map g%
nnoremap ú @@
noremap , +
noremap § `
noremap §§ ``
nnoremap m§ m
sunmap ů
sunmap §
" Enter visual block mode
noremap <M-v> <C-v>
" Navigate camel humps (https://github.com/vim-scripts/camelcasemotion)
map L <Plug>CamelCaseMotion_w
@@ -86,8 +118,8 @@ omap iH <Plug>CamelCaseMotion_ib
xmap iH <Plug>CamelCaseMotion_ib
" Navigate to end of previous word
noremap <M-b> ge
noremap <M-S-b> gE
noremap <M-e> ge
noremap <M-S-e> gE
" Navigate soft-wrapped lines
nnoremap <expr> j v:count ? 'j' : 'gj'
@@ -117,14 +149,13 @@ nnoremap go o<Esc>$
nnoremap gO O<Esc>$
nnoremap g<CR> i<CR><Esc>l
" Delete lines
" Edit current line
nnoremap C cc
xnoremap C cc
nnoremap D dd
xnoremap D dd
" Enter visual block mode
map <M-v> <C-v>
nnoremap < <<
nnoremap > >>
" Indent keeping selection
xnoremap < <gv
@@ -144,6 +175,21 @@ xnoremap P p
" Clear search highlights
nnoremap <Esc> :nohlsearch<Return><Esc>
" Use Ctrl for selection and clipboard
nnoremap <C-a> ggVG
xnoremap <C-a> ggoG
xnoremap <C-c> "+y
xnoremap <C-x> "+x
noremap <C-v> "+gP
inoremap <C-v> <C-o>:set paste<CR><C-r>+<C-o>:set nopaste<CR>
cnoremap <C-v> <C-r>+
nnoremap <C-s> :w<CR>
xnoremap <C-s> :<C-U>w<CR>gv
inoremap <C-s> <C-o>:w<CR>
" Update search register when using f/t
function FindChar(action, reverse, search_affix)
let t:reverse_search = a:reverse