-
Notifications
You must be signed in to change notification settings - Fork 3
/
vimrc.local
198 lines (139 loc) · 4.46 KB
/
vimrc.local
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
186
187
188
189
190
191
192
193
194
195
196
197
"
" vim configuration by Emiliano 'AlberT' Gabrielli <[email protected]>
" feel free to use
"
set nocompatible
" enable pathogen plugin manager
runtime bundle/vim-pathogen/autoload/pathogen.vim
if ! has('python3')
let g:pathogen_blacklist = [ 'ultisnips' ]
endif
execute pathogen#infect()
syntax enable
" {{{ Color Schemes
call togglebg#map("<C-b><C-g>")
" {{{ Solarized
" https://github.com/altercation/vim-colors-solarized.git
"let g:solarized_termcolors=256
"set background=dark
"colorscheme solarized
" }}}
" {{{ Darcula
" https://github.com/blueshirts/darcula.git
"colorscheme darcula
" }}}
" {{{ Molokai
" https://github.com/tomasr/molokai.git
let g:rehash256 = 1
colorscheme molokai
" }}}
" }}}
" {{{ General
" jump to the last position when reopening a file
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
" load indentation rules and plugins according to the detected filetype.
if has("autocmd")
filetype plugin indent on
endif
" Highlight current line in insert mode.
if has("autocmd")
autocmd InsertLeave * se nocul
autocmd InsertEnter * se cul
endif
" Enable modeline
set modeline
set modelines=5
set ruler " show line and column information
set laststatus=2
set tabstop=4
set shiftwidth=4
set softtabstop=0
set expandtab
set ignorecase " caseinsensitive searches
set showmode " always show command or insert mode
set nonu nornu " Don't show line numbers by default
set foldmethod=marker " Enable folding by fold markers
set foldclose=all " Autoclose folds, when moving out of them
set incsearch " Use incremental searching
set hlsearch " Highlight search results
" vimdiff specific
if &diff
if has("unix")
let s:uname = system("uname -s")
if s:uname != "Darwin\n"
set diffopt+=iwhite
endif
endif
highlight! link DiffText Todo
endif
set fileformat=unix fileformats=unix,dos,mac
set encoding=utf-8 fileencoding=utf-8 fileencodings=utf-8
" Fix Mac backspace
if has("unix")
let s:uname = system("uname -s")
if s:uname == "Darwin\n"
set backspace=2
:fixdel
endif
endif
" }}}
" {{{ PLUGINS
" {{{ Pathogen
" https://github.com/tpope/vim-pathogen.git
set sessionoptions-=options
" }}}
" {{{ UltiSnips
" https://github.com/SirVer/ultisnips.git
if exists("b:did_autoload_ultisnips")
let g:UltiSnipsEditSplit='vertical'
let g:UltiSnipsSnippetDirectories=['my-snippets', 'vim-snippets/UltiSnips']
let g:UltiSnipsListSnippets='<C-l>'
let g:UltiSnipsExpandTrigger='<C-c>'
let g:UltiSnipsJumpForwardTrigger='<C-j>'
let g:UltiSnipsJumpBackwardTrigger='<C-k>'
inoremap <expr> <C-j> ((pumvisible())?('<C-n>'):('<C-j>'))
inoremap <expr> <C-k> ((pumvisible())?('<C-p>'):('<C-k>'))
endif
" }}}
" {{{ EditorConfig
" https://github.com/editorconfig/editorconfig-vim
let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*']
" }}}
" {{{ Indent Guides
" https://github.com/nathanaelkane/vim-indent-guides
map <Leader>ig :IndentGuidesToggle<CR>
let g:indent_guides_guide_size=1
let g:indent_guides_start_level=2
" }}}
" {{{ NERDTree
" https://github.com/scrooloose/nerdtree
"
imap <Leader>sp :NERDTreeToggle<CR>
" }}}
" {{{ Syntastic
" https://github.com/scrooloose/syntastic
"
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_loc_list_height = 5
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_sh_shellcheck_args = "--external-sources --source-path=SCRIPTDIR"
" }}}
" {{{ Terraform
" https://github.com/hashivim/vim-terraform
"
let g:terraform_align=1
" }}}
" {{{ JSON syntax
" https://github.com/hashivim/vim-terraform
"
" Disable quote concealing (It's annoing to me)
let g:vim_json_syntax_conceal=0
" }}}
" }}}