-
Notifications
You must be signed in to change notification settings - Fork 0
/
keymaps.vim
62 lines (46 loc) · 1.35 KB
/
keymaps.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
" Disable Ex mode
nnoremap Q <Nop>
" Tab navigation
" nnoremap <C-k> :tabfirst<CR>
" nnoremap <C-l> :tabnext<CR>
" nnoremap <C-h> :tabprev<CR>
" nnoremap <C-j> :tablast<CR>
" nnoremap tt :tabedit<Space>
" nnoremap td :tabclose<CR>
"====[ Swap : and ; to make colon commands easier to type ]======
nnoremap ; :
nnoremap : ;
"====[ Swap v and CTRL-V, because Block mode is more useful that Visual mode ==
nnoremap v <C-V>
nnoremap <C-V> v
vnoremap v <C-V>
vnoremap <C-V> v
" Map F4 to paste toggle
set pastetoggle=<F4>
" Toogle cursor column with F5
nnoremap <F5> :set cursorcolumn!<CR>
" Toggle line numbers
nnoremap <F6> :set number!<CR>
" Use magic when searching
nnoremap / /\v
" center at search
nnoremap n nzz
nnoremap N Nzz
" Open the location window with back-tick
nnoremap ` :lw<cr>
" function! JoinWithLineAbove ()
" " appends the line above to the current line
" exe "normal! kddpkJ"
" endfunction
" nnoremap <silent> <C-J> :call JoinWithLineAbove()<CR>
" Allow %%/ to be expanded to current files directory, e.g. in tabedit and
" edit file
cabbr <expr> %% expand('%:p:h')
" Don't use ESC to exit normal mode
inoremap jk <esc>
" inoremap <esc> <Nop>
" Allow quick edit of vimrc
nnoremap <leader>ev :vsplit $MYVIMRC<cr>
nnoremap <leader>sv :source $MYVIMRC<cr>
" Only use CtrlP for buffersearch
let g:ctrlp_cmd = 'CtrlPBuffer'