-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeymaps.vim
53 lines (43 loc) · 1.71 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
" Ctrl+p-like file searching
nnoremap <leader>p :Unite -no-split -start-insert file<cr>
nnoremap <leader>tt :Unite -no-split -start-insert file_rec<cr>
nnoremap <leader>ts :Unite -no-split -start-insert -default-action=vsplit file_rec<cr>
nnoremap <leader>tS :Unite -no-split -start-insert -default-action=split file_rec<cr>
nnoremap <leader>tT :Unite -no-split -start-insert -default-action=tabopen file_rec<cr>
" Yank history searching
nnoremap <leader>y :Unite -no-split -start-insert history/yank<cr>
" Buffer searching
nnoremap <leader>bb :Unite -no-split -start-insert buffer<cr>
nnoremap <leader>bs :Unite -no-split -start-insert -default-action=vsplit buffer<cr>
nnoremap <leader>bS :Unite -no-split -start-insert -default-action=vsplit buffer<cr>
nnoremap <leader>bt :Unite -no-split -start-insert -default-action=tabopen buffer<cr>
" Key mapping for tab navigation
nmap <Tab> gt
nmap <S-Tab> gT
" Turning visual mode a little nicer for indentation changes
vmap < <gv
vmap > >gv
" Clearing search results
nmap <silent> <C-l> :nohl<CR>
" Enabling emacs-style movement on command line
cnoremap <C-a> <Home>
cnoremap <C-e> <End>
cnoremap <C-f> <Right>
cnoremap <C-b> <Left>
" Blocking arrow keys from work
map <Left> :echo "no!"<cr>
map <Right> :echo "no!"<cr>
map <Up> :echo "no!"<cr>
map <Down> :echo "no!"<cr>
" Running specs from inside vim
nmap <leader>s :w<bar>:call RunSpec()<cr>
" NERDTree!
nmap <silent> <C-e> :NERDTreeToggle<CR>
" Make Y yank the rest of the line (like with C and D)
nnoremap Y y$
" Remove all trailing whitespace
nnoremap <silent> <leader><space> :call RemoveTraillingSpaces()<CR>
" Alternate keymaps for splitting and such
nnoremap <leader>aa :A<cr>
nnoremap <leader>as :AV<cr>
nnoremap <leader>aS :AS<cr>