-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnavigation.vim
103 lines (74 loc) · 2.27 KB
/
navigation.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
" Opens an edit command with the path of the currently edited file filled in Normal mode: <Leader>e
map <Leader>e :e <C-R>=expand("%:p:h") . "/" <CR>
" Alternate between last opened buffers
map <Leader><Tab> <c-^>
" Close current buffer
map <Leader>x :bw<CR>
" Vmap for maintain Visual Mode after shifting > and <
vmap < <gv
vmap > >gv
" OS clipboard
vnoremap <leader>y "+y
nnoremap <leader>p "+p
" Toggle spellcheck
map <Leader>c :set spell!<CR>
" Save
map <Leader>w :w<CR>
" Show Cheatsheet
map <Leader>? :Cheat<CR>
" Indent the whole buffer
map <Leader>= ggVG=<CR>
" Open tabs
map <C-w>t :tabnew<CR>
" Open tags
map <Leader>_ :TagbarToggle<CR>
" NERDTree config
" Display file tree
nmap <Leader>- :NERDTreeToggle<CR>
" Better UI
let NERDTreeMinimalUI = 1
let NERDTreeDirArrows = 1
" Don't ask to delete a buffer once deleted in NERDTree
let NERDTreeAutoDeleteBuffer = 1
" Copy current buffer absolute path to system clipboard
nmap <silent><Leader>%y :!echo % \| pbcopy<CR>
" Clean search
map // :nohlsearch<CR>:echo 'Search highlight cleared'<CR>
" Fix Quickfix showing in the tagbar
"augroup tagbar-quickfix
" autocmd!
" autocmd FileType qf wincmd J
" augroup END
" Easily move around panes
nmap <silent> <Leader><left> :wincmd h<CR>
nmap <silent> <Leader><right> :wincmd l<CR>
nmap <silent> <Leader><up> :wincmd k<CR>
nmap <silent> <Leader><down> :wincmd j<CR>
nmap <silent> <Leader>h :wincmd h<CR>
nmap <silent> <Leader>l :wincmd l<CR>
nmap <silent> <Leader>k :wincmd k<CR>
nmap <silent> <Leader>j :wincmd j<CR>
" Focused reader
map <Leader>+ :Goyo<CR>
" Fuzzy find buffers
map <silent> <Leader><CR> :Buffers<CR>
" Fuzzy finder
if executable("ag") " when installed, use 'ag -g' as the default fzf command
let $FZF_DEFAULT_COMMAND = 'ag -g ""'
endif
map <silent> <Leader>f :FZF<CR>
" Find in project
map <silent> <Leader>F :Ag<CR>
" Fuzzy find current file tags
map <silent> <Leader>t :BTags<CR>
" Fuzzy find tags
map <silent> <Leader>t :Tags<CR>
" Fuzzy find marks
map <silent> <Leader>m :Marks<CR>
" Fuzzy find color themes
map <silent> <Leader>0 :Colors<CR>
" Complete whole filenames/lines with a quicker shortcut key in insert mode
inoremap <C-f> <C-x><C-f>
inoremap <C-l> <C-x><C-l>
" Stop concealing characters when going into navigation and edition mode
set concealcursor=nc