summaryrefslogtreecommitdiff
path: root/.config/nvim/global-mappings.vim
blob: 6fddc08a6e7c0bbad5ab41d41cc94a824bee1c6b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
" Windows navigation.
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>

" Mkdir for the current file.
command MkCurDir :!mkdir %:h:S -p

" Copy the last used register to the clipboard.
command Clipboard :call system('cclip', @")

" Reload settings.
command Source :source $MYVIMRC

" Automatically starts terminal emulator in insert mode.
autocmd TermOpen * startinsert
tnoremap <C-h> <C-\><C-n><C-w>h
" Workaround since <C-h> isn't working in neovim right now
" tnoremap <C-w>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