1
0
mirror of https://github.com/chylex/dotfiles.git synced 2025-09-17 17:24:47 +02:00

Compare commits

...

19 Commits

Author SHA1 Message Date
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
80e5b074c9 Update .ideavimrc (disable binding to negate code completion in Rider) 2025-06-17 07:37:53 +02:00
60cb335c9a Update .ideavimrc (add binding to negate code completion) 2025-06-11 19:27:53 +02:00
78866848be Update .vimrc & .ideavimrc (change bindings to create new lines) 2025-06-11 04:06:11 +02:00
f69bb44bfa Update .ideavimrc (remove custom increment/decrement binding) 2025-05-28 21:34:14 +02:00
6c4c99a98d Update .vimrc & .ideavimrc (use 'g' for navigating unmatched parentheses/brackets) 2025-05-28 21:32:04 +02:00
0023b10571 Update .ideavimrc (use Alt-J/K to navigate code completion popups) 2025-05-18 21:26:28 +02:00
2 changed files with 130 additions and 46 deletions

View File

@@ -55,6 +55,10 @@ sethandler <A-N> a:vim
sethandler <A-O> a:vim
sethandler <A-P> a:vim
sethandler <A-S-B> 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-O> a:vim
sethandler <A-V> a:vim
sethandler <A-X> a:vim
@@ -72,6 +76,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,12 +108,21 @@ map í 9
map é 0
" Move some commands closer on Czech keyboard layout
nnoremap ú @@
noremap § ;
map ů %
map gů g%
nnoremap ú @@
noremap , +
" Camel humps
noremap § `
noremap §§ ``
nnoremap m§ m
sunmap ů
sunmap §
" Enter visual block mode
map <A-v> <C-v>
" Navigate camel humps
noremap L [w
noremap H [b
nnoremap L [w
@@ -113,9 +132,11 @@ nnoremap H [b
noremap <A-b> ge
noremap <A-S-b> gE
" Increment/decrement numbers
noremap <Bar>+ <C-a>
noremap <Bar>- <C-x>
" Navigate unmatched parentheses/braces
noremap g( [(
noremap g) ])
noremap g{ [{
noremap g} ]}
" Edit from cursor to start/end of parenthesized block
nnoremap c) c])
@@ -124,25 +145,27 @@ nnoremap c( c[((
nnoremap d( c[((<Esc>l
" Create lines
nnoremap <A-o> o<Esc>$
nnoremap <A-S-o> O<Esc>$
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
xmap x <Action>(EditorSelectWord)
xmap X <Action>(EditorUnSelectWord)
" Turn capital letters into opposite actions
" nnoremap U :redo<CR> " Handled by custom version of IdeaVIM
@@ -156,6 +179,11 @@ xnoremap P p
" Clear search highlights
nnoremap <Esc> :nohlsearch<Return><Esc>
" Code completion
if &ide !~? 'rider'
imap <expr> ! pumvisible() ? '<Action>(EditorChooseLookupItem)<Esc>mzF.bi!<Esc>`zla' : '!'
endif
" Show parameter info
nmap <A-p> <Action>(ParameterInfo)
imap <A-p> <Action>(ParameterInfo)
@@ -176,12 +204,19 @@ map ] <Action>(MethodDown)
map { <Plug>(ParagraphPrevMotion)$
map } <Plug>(ParagraphNextMotion)$
" Multiple carets
map <A-j> <Action>(EditorCloneCaretBelow)
map <A-k> <Action>(EditorCloneCaretAbove)
" Move statement/element
map <A-S-h> <Action>(MoveElementLeft)
map <A-S-l> <Action>(MoveElementRight)
imap <A-j> <Action>(EditorCloneCaretBelow)
imap <A-k> <Action>(EditorCloneCaretAbove)
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)'
imap <expr> <A-j> pumvisible() ? '<Action>(EditorDown)' : '<Action>(EditorCloneCaretBelow)'
imap <expr> <A-k> pumvisible() ? '<Action>(EditorUp)' : '<Action>(EditorCloneCaretAbove)'
" Manage editor tabs
map <C-w>m <Action>(MoveEditorToOppositeTabGroup)
@@ -227,8 +262,6 @@ map gt gg<Action>(KM.GotoNextTypeInFile)
map gT <Action>(KM.GotoNextTypeInFile)
map gu <Action>(ShowUsages)
map gU <Action>(FindUsages)
map g( <Action>(KM.GotoPreviousErrorInOtherMode)
map g) <Action>(KM.GotoNextErrorInOtherMode)
" Repurpose 'z' for view actions and debugger
map za <Action>(Annotate)

91
.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
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,13 +92,21 @@ map í 9
map é 0
" Move some commands closer on Czech keyboard layout
nnoremap ú @@
noremap § ;
map ů %
map g%
sunmap ů
nnoremap ú @@
noremap , +
" Camel humps (https://github.com/vim-scripts/camelcasemotion)
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
map H <Plug>CamelCaseMotion_b
sunmap L
@@ -100,6 +132,12 @@ xnoremap gj j
nnoremap gk k
xnoremap gk k
" Navigate unmatched parentheses/braces
noremap g( [(
noremap g) ])
noremap g{ [{
noremap g} ]}
" Edit from cursor to start/end of parenthesized block
nnoremap c) c])
nnoremap d) d])
@@ -107,19 +145,17 @@ nnoremap c( c[((
nnoremap d( c[((<Esc>l
" Create lines
nnoremap <M-o> o<Esc>$
nnoremap <M-S-o> O<Esc>$ " TODO does not leave insert mode properly?
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
@@ -139,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