-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmappings.vim
More file actions
75 lines (51 loc) · 1.58 KB
/
mappings.vim
File metadata and controls
75 lines (51 loc) · 1.58 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
let mapleader=';'
"Toggle text wrapping with <leader>tw
nnoremap <leader>tw :set nowrap!<cr>
"Toggle NERDTree with <leader>nt
nnoremap <leader>nt :NERDTreeToggle<cr>
"Use <leader>w to save all open buffers
nnoremap <leader>w :wa<cr>
"Close currently visible buffer in selected window(depends on bclose.vim)
nnoremap <leader>cb :Kwbd<cr>
"Switch windows with Tab in normal mode
nnoremap <tab> <c-w><c-w>
"Move always by visual line
nnoremap j gj
nnoremap k gk
"Big moves
nnoremap J 5j
nnoremap K 5k
"Toggle taglist with <leader>t
nnoremap <leader>t :TlistToggle<cr>
"Stop highlighting the last search
nnoremap <c-h> :nohlsearch<cr>
"Open mapings file in a split for quick edits
nnoremap em :vsp ~/.vim/mappings.vim<cr>
"Source vmirc
nnoremap sv :so $MYVIMRC<cr>
"Swap normal and relative line numbers
nnoremap <leader><space> :call ChangeLineNumberStyle()<cr>
"Easier movements to start/end of line
nnoremap <leader>h ^
nnoremap <leader>l $
"<c-c> is easier to use than <c-[>
inoremap <c-c> <c-[>
" J/K work as usual in nerd tree
let g:NERDTreeMapJumpFirstChild='-'
let g:NERDTreeMapJumpLastChild='-'
nnoremap <silent> <leader>? :execute 'vimgrep /'.@/.'/g %'<CR>:copen<CR>
"Write files as root
cmap w!! w !sudo tee >/dev/null %
"Start gitv with
nnoremap <leader>g :Gitv<cr>
"Navigate buffers
nnoremap <leader>j :bnext<cr>
nnoremap <leader>k :bprev<cr>
"Show error window with <leader>e
nnoremap <leader>e :Errors<cr>
"Toggle Gudno with gu
nnoremap <leader>gu :GundoToggle<cr>
"Toggle list
nnoremap <leader>tl :set list!<cr>
nnoremap <leader>gb :Gblame<cr>
nnoremap <leader>m :Multichange<cr>