-
Notifications
You must be signed in to change notification settings - Fork 1
/
leader-maps.vim
41 lines (33 loc) · 921 Bytes
/
leader-maps.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
" Fast saving
nnoremap ,w :write<cr>
nnoremap ,d :Bdelete<cr>
nnoremap ,dd :Bdelete!<cr>
" memo: exit
nnoremap ,e :quit<cr>
nnoremap ,wd :write<cr>:bdelete<cr>
nnoremap ,we :wq<cr>
nnoremap ,ee :qa<cr>
nnoremap ,wee :wqall!<cr>
" Edit and source vimrc
" memo: vim edit
nnoremap ,ve :edit $MYVIMRC<cr>
" memo: vim vertical split
nnoremap ,vv :vsplit $MYVIMRC<cr>
" memo: vim load
nnoremap ,vl :source $MYVIMRC<cr>
" Disable highlight when ,<cr> is pressed
nnoremap <silent> ,<cr> :noh<cr>
" Switch CWD to the directory of the open buffer
nnoremap ,cd :cd %:p:h<cr>:pwd<cr>
" To open a new empty buffer
" This replaces :tabnew which I used to bind to this mapping
nnoremap ,T :enew<cr>
" Move to the next buffer
nnoremap ,l :bnext<CR>
" Move to the previous buffer
nnoremap ,j :bprevious<CR>
" Quicker shell opening
" nnoremap ,t :terminal<CR>
" Copy whole file to clipboard
" memo: Ctrl-A
nnoremap ,ca mmggVG"+y`m