2020-08-08 05:20:01 +02:00
|
|
|
" Basic Key Mappings
|
2020-05-15 04:26:50 +02:00
|
|
|
|
|
|
|
imap <C-h> <C-w>h
|
|
|
|
imap <C-j> <C-w>j
|
|
|
|
imap <C-k> <C-w>k
|
|
|
|
imap <C-l> <C-w>l
|
2020-05-11 01:23:44 +02:00
|
|
|
" g Leader key
|
2020-05-09 06:36:34 +02:00
|
|
|
let mapleader=" "
|
2020-05-10 22:20:02 +02:00
|
|
|
" let localleader=" "
|
2020-05-09 06:36:34 +02:00
|
|
|
nnoremap <Space> <Nop>
|
2020-04-28 03:58:30 +02:00
|
|
|
|
2020-04-29 05:34:21 +02:00
|
|
|
" Better indenting
|
|
|
|
vnoremap < <gv
|
|
|
|
vnoremap > >gv
|
|
|
|
|
2020-08-29 18:29:11 +02:00
|
|
|
if exists('g:vscode')
|
|
|
|
|
|
|
|
" Simulate same TAB behavior in VSCode
|
|
|
|
nmap <Tab> :Tabnext<CR>
|
|
|
|
nmap <S-Tab> :Tabprev<CR>
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
" Better nav for omnicomplete
|
|
|
|
inoremap <expr> <c-j> ("\<C-n>")
|
|
|
|
inoremap <expr> <c-k> ("\<C-p>")
|
|
|
|
|
|
|
|
" I hate escape more than anything else
|
|
|
|
inoremap jk <Esc>
|
|
|
|
inoremap kj <Esc>
|
|
|
|
|
|
|
|
" Easy CAPS
|
|
|
|
" inoremap <c-u> <ESC>viwUi
|
|
|
|
" nnoremap <c-u> viwU<Esc>
|
|
|
|
|
|
|
|
" TAB in general mode will move to text buffer
|
|
|
|
nnoremap <silent> <TAB> :bnext<CR>
|
|
|
|
" SHIFT-TAB will go back
|
|
|
|
nnoremap <silent> <S-TAB> :bprevious<CR>
|
|
|
|
|
|
|
|
" Move selected line / block of text in visual mode
|
|
|
|
" shift + k to move up
|
|
|
|
" shift + j to move down
|
|
|
|
xnoremap K :move '<-2<CR>gv-gv
|
|
|
|
xnoremap J :move '>+1<CR>gv-gv
|
|
|
|
|
|
|
|
" Alternate way to save
|
|
|
|
nnoremap <silent> <C-s> :w<CR>
|
|
|
|
" Alternate way to quit
|
|
|
|
nnoremap <silent> <C-Q> :wq!<CR>
|
|
|
|
" Use control-c instead of escape
|
|
|
|
nnoremap <silent> <C-c> <Esc>
|
|
|
|
" <TAB>: completion.
|
|
|
|
inoremap <silent> <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
|
|
|
|
|
|
|
|
" Better window navigation
|
|
|
|
nnoremap <C-h> <C-w>h
|
|
|
|
nnoremap <C-j> <C-w>j
|
|
|
|
nnoremap <C-k> <C-w>k
|
|
|
|
nnoremap <C-l> <C-w>l
|
|
|
|
|
|
|
|
" Terminal window navigation
|
|
|
|
tnoremap <C-h> <C-\><C-N><C-w>h
|
|
|
|
tnoremap <C-j> <C-\><C-N><C-w>j
|
|
|
|
tnoremap <C-k> <C-\><C-N><C-w>k
|
|
|
|
tnoremap <C-l> <C-\><C-N><C-w>l
|
|
|
|
inoremap <C-h> <C-\><C-N><C-w>h
|
|
|
|
inoremap <C-j> <C-\><C-N><C-w>j
|
|
|
|
inoremap <C-k> <C-\><C-N><C-w>k
|
|
|
|
inoremap <C-l> <C-\><C-N><C-w>l
|
|
|
|
tnoremap <Esc> <C-\><C-n>
|
|
|
|
|
|
|
|
" Use alt + hjkl to resize windows
|
2020-11-05 02:06:14 +01:00
|
|
|
" nnoremap <silent> <M-j> :resize -2<CR>
|
|
|
|
" nnoremap <silent> <M-k> :resize +2<CR>
|
|
|
|
" nnoremap <silent> <M-h> :vertical resize -2<CR>
|
|
|
|
" nnoremap <silent> <M-l> :vertical resize +2<CR>
|
2020-08-29 18:29:11 +02:00
|
|
|
|
2020-11-05 02:05:30 +01:00
|
|
|
nnoremap <silent> <C-Up> :resize -2<CR>
|
|
|
|
nnoremap <silent> <C-Down> :resize +2<CR>
|
|
|
|
nnoremap <silent> <C-Left> :vertical resize -2<CR>
|
|
|
|
nnoremap <silent> <C-Right> :vertical resize +2<CR>
|
|
|
|
|
2020-11-05 02:06:49 +01:00
|
|
|
let g:elite_mode=0 " Disable arrows"
|
2020-11-05 02:05:30 +01:00
|
|
|
" Disable arrow movement, resize splits instead.
|
|
|
|
if get(g:, 'elite_mode')
|
2020-11-05 02:06:49 +01:00
|
|
|
nnoremap <C-Up> :resize -2<CR>
|
|
|
|
nnoremap <C-Down> :resize +2<CR>
|
|
|
|
nnoremap <C-Left> :vertical resize -2<CR>
|
|
|
|
nnoremap <C-Right> :vertical resize +2<CR>
|
2020-11-05 02:05:30 +01:00
|
|
|
endif
|
|
|
|
|
2020-08-29 18:29:11 +02:00
|
|
|
endif
|
2020-04-24 21:29:55 +02:00
|
|
|
|
2020-08-14 18:44:05 +02:00
|
|
|
" Better nav for omnicomplete
|
|
|
|
inoremap <expr> <c-j> ("\<C-n>")
|
|
|
|
inoremap <expr> <c-k> ("\<C-p>")
|