31 lines
919 B
VimL
31 lines
919 B
VimL
"Insert mode
|
|
|
|
" Ensure that ctrl+u in insert mode can be reversed
|
|
" http://vim.wikia.com/wiki/Recover_from_accidental_Ctrl-U
|
|
inoremap <c-u> <c-g>u<c-u>
|
|
inoremap <c-w> <c-g>u<c-w>
|
|
|
|
" Navigate the complete menu items like CTRL+n / CTRL+p would.
|
|
" inoremap <expr> <Down> pumvisible() ? "<C-n>" :"<Down>"
|
|
" inoremap <expr> <Up> pumvisible() ? "<C-p>" : "<Up>"
|
|
|
|
" Select the complete menu item like CTRL+y would.
|
|
" inoremap <expr> <Right> pumvisible() ? "<C-y>" : "<Right>"
|
|
" inoremap <expr> <CR> pumvisible() ? "<C-y>" :"<CR>"
|
|
|
|
" Cancel the complete menu item like CTRL+e would.
|
|
inoremap <expr> <Left> pumvisible() ? "<C-e>" : "<Left>"
|
|
|
|
" Exit insert, dd line, enter insert
|
|
inoremap <A-d> <esc>ddi
|
|
|
|
" Line movements
|
|
inoremap <silent> <Home> <C-o>g<Home>
|
|
inoremap <silent> <End> <C-o>g<End>
|
|
|
|
" Alt to switch windows
|
|
inoremap <A-h> <Esc><C-w>h
|
|
inoremap <A-j> <Esc><C-w>j
|
|
inoremap <A-k> <Esc><C-w>k
|
|
inoremap <A-l> <Esc><C-w>l
|