Compare commits

...

3 commits

Author SHA1 Message Date
Kevin MacMartin
b95d4d487b Allow moving the cursor with ctrl+hjkl 2024-10-16 22:02:17 -04:00
Kevin MacMartin
3afbf830b8 Use alt+direction for screen movement instead of alt+arrows 2024-10-16 21:57:16 -04:00
Kevin MacMartin
93ecc605e6 Clarify the comments for ctrl+arrows 2024-10-16 21:42:08 -04:00
3 changed files with 56 additions and 41 deletions

View file

@ -109,7 +109,7 @@ A more complete list of key bindings exists at the top of `vim/config/keyboard.v
### Complete Reference ### Complete Reference
For a complete list of mappings specific to **darkcloud-nvimconfig**, check the list in the comments at the top of [vim/config/keyboard.vim](https://github.com/prurigro/darkcloud-nvimconfig/blob/master/vim/config/keyboard.vim) For a complete list of mappings specific to **darkcloud-nvimconfig**, check the list in the comments at the top of [vim/config/keyboard.vim](https://github.com/prurigro/darkcloud-nvimconfig/blob/master/vim/config/keyboard.vim) and the various plugin configs.
## Plugins ## Plugins

View file

@ -123,24 +123,24 @@
" "
" <Ctrl-Up> | (N) -> move four lines up " <Ctrl-Up> | (N) -> move four lines up
" <Ctrl-Down> | (N) -> move four lines down " <Ctrl-Down> | (N) -> move four lines down
" <Ctrl-k> | (N) -> move four lines up
" <Ctrl-j> | (N) -> move four lines down
"
" <Ctrl-Right> | (N) -> move one word right " <Ctrl-Right> | (N) -> move one word right
" <Ctrl-Left> | (N) -> move one word left " <Ctrl-Left> | (N) -> move one word left
" <Ctrl-l> | (N) -> move one word right
" <Ctrl-h> | (N) -> move one word left
" "
" <Alt-Up> | (A) -> move the screen up " <Alt-k> | (A) -> move the screen up
" <Alt-Down> | (A) -> move the screen down " <Alt-j> | (A) -> move the screen down
" <Alt-Right> | (A) -> move the screen to the right " <Alt-l> | (A) -> move the screen to the right
" <Alt-Left> | (A) -> move the screen to the left " <Alt-h> | (A) -> move the screen to the left
" "
" <Shift-Up> | (N) -> move to the beginning of the document " <Shift-Up> | (N) -> move to the beginning of the document
" <Shift-Down> | (N) -> move to the end of the document " <Shift-Down> | (N) -> move to the end of the document
" <Shift-Right> | (N) -> move to the end of the line " <Shift-Right> | (N) -> move to the end of the line
" <Shift-Left> | (N) -> move to the beginning of the non-whitespace " <Shift-Left> | (N) -> move to the beginning of the non-whitespace
" "
" <Shift-Ctrl-Up> | (V) -> vim-move: move a block up one line
" <Shift-Ctrl-Down> | (V) -> vim-move: move a block down one line
" <Shift-Ctrl-Up> | (N) -> vim-move: move a line up one line
" <Shift-Ctrl-Down> | (N) -> vim-move: move a line down one line
"
" ]g | (N) -> next difference (vimdiff/signify) " ]g | (N) -> next difference (vimdiff/signify)
" [g | (N) -> previous difference (vimdiff/signify) " [g | (N) -> previous difference (vimdiff/signify)
" >> | (N) -> next difference (vimdiff/signify) " >> | (N) -> next difference (vimdiff/signify)
@ -489,36 +489,43 @@
nnoremap = + nnoremap = +
nnoremap _ - nnoremap _ -
"map ctrl+direction to shifting the screen in that direction "map ctrl+up/down to moving the cursor up and down by 4 lines
nnoremap <C-Up> 4k nnoremap <C-Up> 4k
nnoremap <C-Down> 4j nnoremap <C-Down> 4j
nnoremap <C-k> 4k
nnoremap <C-j> 4j
"map ctrl+right/left to moving the cursor left and right by one word
nnoremap <C-Right> <S-Right> nnoremap <C-Right> <S-Right>
nnoremap <C-Left> <S-Left> nnoremap <C-Left> <S-Left>
nnoremap <C-l> <S-Right>
nnoremap <C-h> <S-Left>
noremap <A-Up> <ScrollWheelUp> "map alt+direction to moving the viewport in that direction
nnoremap <A-Up> <ScrollWheelUp> noremap <A-k> <ScrollWheelUp>
xnoremap <A-Up> <ScrollWheelUp> nnoremap <A-k> <ScrollWheelUp>
snoremap <A-Up> <ScrollWheelUp> xnoremap <A-k> <ScrollWheelUp>
vnoremap <A-Up> <ScrollWheelUp> snoremap <A-k> <ScrollWheelUp>
inoremap <A-Up> <ScrollWheelUp> vnoremap <A-k> <ScrollWheelUp>
noremap <A-Down> <ScrollWheelDown> inoremap <A-k> <ScrollWheelUp>
nnoremap <A-Down> <ScrollWheelDown> noremap <A-j> <ScrollWheelDown>
xnoremap <A-Down> <ScrollWheelDown> nnoremap <A-j> <ScrollWheelDown>
snoremap <A-Down> <ScrollWheelDown> xnoremap <A-j> <ScrollWheelDown>
vnoremap <A-Down> <ScrollWheelDown> snoremap <A-j> <ScrollWheelDown>
inoremap <A-Down> <ScrollWheelDown> vnoremap <A-j> <ScrollWheelDown>
noremap <A-Right> 4zl inoremap <A-j> <ScrollWheelDown>
nnoremap <A-Right> 4zl noremap <A-l> 4zl
xnoremap <A-Right> 4zl nnoremap <A-l> 4zl
snoremap <A-Right> 4zl xnoremap <A-l> 4zl
vnoremap <A-Right> 4zl snoremap <A-l> 4zl
inoremap <A-Right> <C-O>4zl vnoremap <A-l> 4zl
noremap <A-Left> 4zh inoremap <A-l> <C-O>4zl
nnoremap <A-Left> 4zh noremap <A-h> 4zh
xnoremap <A-Left> 4zh nnoremap <A-h> 4zh
snoremap <A-Left> 4zh xnoremap <A-h> 4zh
vnoremap <A-Left> 4zh snoremap <A-h> 4zh
inoremap <A-Left> <C-O>4zh vnoremap <A-h> 4zh
inoremap <A-h> <C-O>4zh
"remap keys to scroll to the end in a direction "remap keys to scroll to the end in a direction
nnoremap <S-Up> gg0 nnoremap <S-Up> gg0
@ -526,12 +533,6 @@
nnoremap <S-Right> $ nnoremap <S-Right> $
nnoremap <S-Left> ^ nnoremap <S-Left> ^
"remap shift+ctrl+up/down to move blocks up/down a line with vim-move
vmap <S-C-Up> <Plug>MoveBlockUp
vmap <S-C-Down> <Plug>MoveBlockDown
nmap <S-C-Up> <Plug>MoveLineUp
nmap <S-C-Down> <Plug>MoveLineDown
"move to next/previous difference (vimdiff/signify) "move to next/previous difference (vimdiff/signify)
nmap ]g <plug>(signify-next-hunk) nmap ]g <plug>(signify-next-hunk)
nmap [g <plug>(signify-prev-hunk) nmap [g <plug>(signify-prev-hunk)

View file

@ -0,0 +1,14 @@
"don't use default mappings
let g:move_map_keys = 0
"visual mode mappings
vmap <S-C-Up> <Plug>MoveBlockUp
vmap <S-C-Down> <Plug>MoveBlockDown
vmap <S-C-Right> <Plug>MoveBlockRight
vmap <S-C-Left> <Plug>MoveBlockLeft
"normal mode mappings
nmap <S-C-Up> <Plug>MoveLineUp
nmap <S-C-Down> <Plug>MoveLineDown
nmap <S-C-Right> <Plug>MoveCharRight
nmap <S-C-Left> <Plug>MoveCharLeft