Change window navigation to Ctrl-h,j,k,l to avoid overriding vim defaults [Close #42]

This commit is contained in:
yan 2012-03-12 12:05:56 -05:00
parent 838fbadc99
commit 10ce30d811
2 changed files with 11 additions and 12 deletions

View File

@ -254,7 +254,7 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke
* `,z` - go to previous buffer (:bp) * `,z` - go to previous buffer (:bp)
* `,x` - go to next buffer (:bn) * `,x` - go to next buffer (:bn)
* `Ctrl-j` and `Ctrl-k` to move up and down roughly by functions * `Cmd-j` and `Cmd-k` to move up and down roughly by functions
* `Ctrl-o` - Old cursor position - this is a standard mapping but very useful, so included here * `Ctrl-o` - Old cursor position - this is a standard mapping but very useful, so included here
* `Ctrl-i` - opposite of Ctrl-O (again, this is standard) * `Ctrl-i` - opposite of Ctrl-O (again, this is standard)
@ -335,7 +335,7 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke
#### Window Navigation #### Window Navigation
* `H` `L` `I` `M` - to move left, right, up, down between windows * `Ctrl-h,l,j,k` - to move left, right, down, up between windows
* `Q` - Intelligent Window Killer. Close window `wincmd c` if there are multiple windows to same buffer, or kill the buffer `bwipeout` if this is the last window into it. * `Q` - Intelligent Window Killer. Close window `wincmd c` if there are multiple windows to same buffer, or kill the buffer `bwipeout` if this is the last window into it.
* `+` and `-` for resizing vertical windows * `+` and `-` for resizing vertical windows

View File

@ -71,13 +71,12 @@ nmap <D-N> :NERDTreeToggle<CR>
nmap <silent> ,qc :cclose<CR> nmap <silent> ,qc :cclose<CR>
nmap <silent> ,qo :copen<CR> nmap <silent> ,qo :copen<CR>
" move up/down quickly by using Ctrl-j, Ctrl-k " move up/down quickly by using Cmd-j, Cmd-k
" which will move us around by functions " which will move us around by functions
nnoremap <silent> <C-j> } nnoremap <silent> <D-j> }
nnoremap <silent> <C-k> { nnoremap <silent> <D-k> {
autocmd FileType ruby map <buffer> <D-j> ]m
autocmd FileType ruby map <buffer> <C-j> ]m autocmd FileType ruby map <buffer> <D-k> [m
autocmd FileType ruby map <buffer> <C-k> [m
" Open the project tree and expose current file in the nerdtree with Ctrl-\ " Open the project tree and expose current file in the nerdtree with Ctrl-\
nnoremap <silent> <C-\> :NERDTreeFind<CR> nnoremap <silent> <C-\> :NERDTreeFind<CR>
@ -112,10 +111,10 @@ nnoremap <silent> ,x :bn<CR>
" Move between split windows by using the four directions H, L, I, N " Move between split windows by using the four directions H, L, I, N
" (note that I use I and N instead of J and K because J already does " (note that I use I and N instead of J and K because J already does
" line joins and K is mapped to GitGrep the current word " line joins and K is mapped to GitGrep the current word
nnoremap <silent> H <C-w>h nnoremap <silent> <C-h> <C-w>h
nnoremap <silent> L <C-w>l nnoremap <silent> <C-l> <C-w>l
nnoremap <silent> I <C-w>k nnoremap <silent> <C-k> <C-w>k
nnoremap <silent> M <C-w>j nnoremap <silent> <C-j> <C-w>j
" Move between tabs with Ctrl-Shift-H and Ctrl-Shift-L " Move between tabs with Ctrl-Shift-H and Ctrl-Shift-L
map <silent> <C-H> :tabprevious<cr> map <silent> <C-H> :tabprevious<cr>