-
Notifications
You must be signed in to change notification settings - Fork 0
/
keybindings.vim
74 lines (62 loc) · 2.09 KB
/
keybindings.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
63
64
65
66
67
68
69
70
71
72
73
74
nnoremap <Leader>q :nohlsearch<CR>
nnoremap <leader>h <C-w>5<
nnoremap <leader>l <C-w>5>
nnoremap <leader>j <C-w>5-
nnoremap <leader>k <C-w>5+
nnoremap <leader>ev :e $MYVIMRC<cr>
nnoremap <leader>sv :source $MYVIMRC<cr>
nnoremap <leader>ek :e $HOME/.vim/keybindings.vim<cr>
" remap <esc> and disable arrows
inoremap jk <esc>
" disable EX mode
nnoremap Q <nop>
" git mappings
nnoremap <leader>gf :Git fetch<cr>
nnoremap <leader>gs :Gstatus<cr>
nnoremap <leader>gu :Git push<cr>
nnoremap <leader>gl :Git log --decorate --oneline --graph --all<cr>
" switching for relative line numbers
function! NumberToggle()
if (&relativenumber == 1)
set norelativenumber
else
set relativenumber
endif
endfunc
nnoremap <C-n> :call NumberToggle()<cr>
set pastetoggle=<F2>
" nnoremap <F2> :set invpaste<CR>
" special buffer delete
nnoremap <leader>x :Bdelete<cr>
nnoremap <leader>X :bdelete<cr>
" a subset of unimpaired, with modifications
nnoremap [q :cprevious<cr>
nnoremap ]q :cnext<cr>
nnoremap [Q :cfirst<cr>
nnoremap ]Q :clast<cr>
nnoremap [l :lprevious<cr>
nnoremap ]l :lnext<cr>
nnoremap [L :lfirst<cr>
nnoremap ]L :llast<cr>
nnoremap [b :bprevious<cr>
nnoremap ]b :bnext<cr>
nnoremap [B :bfirst<cr>
nnoremap ]B :blast<cr>
nnoremap [t :tabprevious<cr>
nnoremap ]t :tabnext<cr>
nnoremap [T :tabfirst<cr>
nnoremap ]T :tablast<cr>
" Unite.vim mappings
let g:unite_source_file_rec_max_cache_files=65535
call unite#custom#source('file_rec/async', 'ignore_pattern', '.*\(node_modules\|\.git\)/.*$')
nnoremap <leader>fs :Unite -start-insert -default-action=split file_rec/async<cr>
nnoremap <leader>fv :Unite -start-insert -default-action=vsplit file_rec/async<cr>
nnoremap <leader>fc :Unite -start-insert file_rec/async<cr>
nnoremap <leader>F :Unite file<cr>
nnoremap <leader>bs :Unite -start-insert -default-action=split buffer<cr>
nnoremap <leader>bv :Unite -start-insert -default-action=vsplit buffer<cr>
nnoremap <leader>bc :Unite -start-insert buffer<cr>
nnoremap <leader>s :Unite grep:.<cr>
nnoremap <leader>t :Unite -start-insert tag<cr>
" use unite to search help
nnoremap <F1> :Unite -start-insert help<cr>