-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvimrc.prev
185 lines (137 loc) · 4.58 KB
/
vimrc.prev
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
" ~/.vimrc
"
" Plugin Manager: https://github.com/junegunn/vim-plug
"
" To install, run this command
"
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
"
" -----------------------------------------------------------------------------
" Change the mapleader from \ to ,
let mapleader=","
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
" Install Plugins {{{
" ack.vim - Plugin for the Perl module / CLI script 'ack'
Plug 'mileszs/ack.vim'
" BufExplorer Plugin for Vim
Plug 'jlanzarotta/bufexplorer'
" Plugin for the fzf fuzzy finder
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
" NERDTree
Plug 'preservim/nerdtree'
"Syntax checking hacks for vim
Plug 'vim-syntastic/syntastic'
" Plugin for clang-format
Plug 'rhysd/vim-clang-format'
" Plugin for defining operators easily
Plug 'kana/vim-operator-user'
" }}}
" Initialize plugin system
call plug#end()
" Load some default settings
source ~/.vim/defaults.vim
" Configure Plugins {{{
" --- Ack settings {{{
cabbrev ack Ack
" Search for a pattern using Ack (the trailing space is important)
nnoremap ,s :Ack!
nnoremap ,S :Ack! <C-R>=expand("<cword>")<CR>
" Same, but use the location list window instead of the quickfix list window
nnoremap \s :LAck!
nnoremap \S :LAck! <C-R>=expand("<cword>")<CR>
" }}}
" --- BufExplorer settings {{{
" To use:
" '<Leader>be' normal open
" '<Leader>bs' horizontal split open
" '<Leader>bv' vertical split open
let g:bufExplorerDefaultHelp=0
"let g:bufExplorerDetailedHelp=1
let g:bufExplorerFindActive=0
let g:bufExplorerShowUnlisted=0
"let g:bufExplorerSortBy='mru'
let g:bufExplorerSplitBelow=1
let g:bufExplorerSplitOutPathName=1
let g:bufExplorerSplitRight=1
" }}}
" --- fzf.vim settings {{{
"nmap <C-P> :FZF<CR>
nmap <C-G> :FZF<CR>
" }}}
" --- NERDTree settings {{{
" Toggle the NERD Tree
nmap <silent> <Leader>n :NERDTreeToggle<CR>
" Store the bookmarks
let NERDTreeBookmarksFile=expand("$HOME/.vim/tmp/NERDTreeBookmarks")
" Show the bookmarks table on startup?
let NERDTreeShowBookmarks=0
" Show hidden files?
let NERDTreeShowFiles=1
let NERDTreeShowHidden=1
" Quit on opening files from the tree?
let NERDTreeQuitOnOpen=0
" Highlight the selected entry in the tree?
let NERDTreeHighlightCursorline=0
" 1 - Double click to open nodes
" 2 - Single click to open directories, and double click to open files
" 3 - Single click to open nodes
let NERDTreeMouseMode=3
" Don't display these kinds of files
let NERDTreeIgnore=[
\ '\.pyc$', '\.pyo$', '\.pyd$', '\.egg$',
\ '\.class$', '\.beam$', '\.obj$', '\.o$', '\.so$', '\.a$',
\ '^\.git$', '^\.svn$',
\ '^__pycache__$', '^.ipynb_checkpoints$', '^.pytest_cache$'
\ ]
" Default key to activate node is 'o'
let NERDTreeMapActivateNode='<Space>'
" See https://superuser.com/questions/184844/hide-certain-files-in-nerdtree
"set wildignore+=*.pyc,*.o,*.obj,*.svn,*.swp,*.class,*.hg,*.DS_Store,*.min.*
"let NERDTreeRespectWildIgnore=1
" }}}
" --- Syntastic settings {{{
" See also
" :help syntastic
" :help syntastic-commands
" :SyntasticToggleMode
" :SyntasticCheck
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
"let g:syntastic_check_on_open = 1
"let g:syntastic_check_on_wq = 0
let g:syntastic_mode_map = {
\ 'mode': 'passive',
\ 'active_filetypes': [],
\ 'passive_filetypes': []}
" }}}
" --- vim-clang-format settings {{{
"let g:clang_format#style_options = {
" \ "AccessModifierOffset" : -4,
" \ "AllowShortIfStatementsOnASingleLine" : "true",
" \ "AlwaysBreakTemplateDeclarations" : "true",
" \ "Standard" : "C++11"}
" Map to <Leader>cf in C++ code
autocmd FileType c,cpp,objc nnoremap <buffer><Leader>cf :<C-u>ClangFormat<CR>
autocmd FileType c,cpp,objc vnoremap <buffer><Leader>cf :ClangFormat<CR>
" If you install vim-operator-user
autocmd FileType c,cpp,objc map <buffer><Leader>x <Plug>(operator-clang-format)
" Toggle auto formatting:
nmap <Leader>C :ClangFormatAutoToggle<CR>
" }}}
" }}}
" HACK: Since Command-T doesn't have an option to filter out patterns,
" we filter out `venv` directory via `wildignore` setting.
set wildignore+=*.swp,*.bak,*.pyc,*.class,*.o,venv
" Lastly, load ~/.vim/user.vim if it exists.
" note that this file is not kept in the repository, and therefore
" we can use it to load machine-specific settings
if filereadable(expand("~/.vim/user.vim"))
source ~/.vim/user.vim
endif
" -----------------------------------------------------------------------------
" vim: fen fdl=0 fdm=marker