-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.vim
305 lines (251 loc) · 7.53 KB
/
init.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
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
call plug#begin('~/.config/nvim/plugged')
" Neovim
"Plug 'mhinz/vim-grepper'
Plug 'benekastah/neomake'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
" Appearance
Plug 'chrisbra/Colorizer'
Plug 'skwp/vim-colors-solarized'
Plug 'itchyny/lightline.vim'
Plug 'jby/tmux.vim'
Plug 'morhetz/gruvbox'
"Plug 'godlygeek/csapprox'
" Git
Plug 'gregsexton/gitv'
Plug 'mattn/gist-vim'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-git'
" Languages
Plug 'fatih/vim-go'
Plug 'sheerun/vim-polyglot'
Plug 'jtratner/vim-flavored-markdown'
Plug 'skwp/vim-html-escape'
Plug 'mxw/vim-jsx'
Plug 'tpope/vim-markdown'
Plug 'vim-syntastic/syntastic'
" Project
Plug 'jistr/vim-nerdtree-tabs'
Plug 'scrooloose/nerdtree'
Plug 'simnalamburt/vim-mundo'
" Go
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'zchee/deoplete-go', { 'do': 'make'}
Plug 'nsf/gocode', { 'rtp': 'nvim', 'do': '~/.config/nvim/plugged/gocode/nvim/symlink.sh' }
" Ruby
Plug 'tpope/vim-rails'
Plug 'tpope/vim-rake'
Plug 'tpope/vim-rvm'
Plug 'vim-ruby/vim-ruby'
Plug 'keith/rspec.vim'
Plug 'skwp/vim-iterm-rspec'
Plug 'skwp/vim-spec-finder'
Plug 'ck3g/vim-change-hash-syntax'
Plug 'tpope/vim-bundler'
" Node
Plug 'moll/vim-node'
Plug 'jelera/vim-javascript-syntax'
"Plug 'pangloss/vim-javascript'
" Search
Plug 'justinmk/vim-sneak'
Plug 'vim-scripts/IndexedSearch'
Plug 'nelstrom/vim-visual-star-search'
Plug 'skwp/greplace.vim'
Plug 'easymotion/vim-easymotion'
" Tag
Plug 'majutsushi/tagbar'
" textobjects
"Plug 'austintaylor/vim-indentobject'
"Plug 'bootleq/vim-textobj-rubysymbol'
"Plug 'coderifous/textobj-word-column.vim'
"Plug 'kana/vim-textobj-datetime'
"Plug 'kana/vim-textobj-entire'
"Plug 'kana/vim-textobj-function'
"Plug 'kana/vim-textobj-user'
"Plug 'lucapette/vim-textobj-underscore'
"Plug 'nathanaelkane/vim-indent-guides'
"Plug 'nelstrom/vim-textobj-rubyblock'
"Plug 'thinca/vim-textobj-function-javascript'
"Plug 'vim-scripts/argtextobj.vim'
" improvements
"Plug 'AndrewRadev/splitjoin.vim'
Plug 'Raimondi/delimitMate'
"Plug 'Shougo/neocomplete.git'
"Plug 'briandoll/change-inside-surroundings.vim.git'
"Plug 'godlygeek/tabular'
Plug 'tomtom/tcomment_vim'
"Plug 'vim-scripts/camelcasemotion.git'
"Plug 'vim-scripts/matchit.zip.git'
"Plug 'kristijanhusak/vim-multiple-cursors'
"Plug 'Keithbsmiley/investigate.vim'
"Plug 'chrisbra/NrrwRgn'
Plug 'christoomey/vim-tmux-navigator'
"Plug 'MarcWeber/vim-addon-mw-utils.git'
"Plug 'bogado/file-line.git'
"Plug 'mattn/webapi-vim.git'
"Plug 'sjl/gundo.vim'
"Plug 'skwp/YankRing.vim'
"Plug 'tomtom/tlib_vim.git'
Plug 'tpope/vim-abolish'
Plug 'tpope/vim-endwise'
Plug 'tpope/vim-ragtag'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-unimpaired'
"Plug 'vim-scripts/AnsiEsc.vim.git'
"Plug 'vim-scripts/AutoTag.git'
"Plug 'vim-scripts/lastpos.vim'
"Plug 'vim-scripts/sudo.vim'
"Plug 'goldfeld/ctrlr.vim'
" ryansch
Plug 'tpope/vim-eunuch'
Plug 'leafo/moonscript-vim'
Plug 'honza/dockerfile.vim'
Plug 'wesQ3/vim-windowswap'
Plug 'itspriddle/vim-marked'
Plug 'markcornick/vim-terraform'
Plug 'junegunn/goyo.vim'
Plug 'tpope/vim-obsession'
Plug 'junegunn/gv.vim'
call plug#end()
" global customizations
set number "Line numbers are good
set backspace=indent,eol,start "Allow backspace in insert mode
set history=1000 "Store lots of :cmdline history
set showcmd "Show incomplete cmds down the bottom
set showmode "Show current mode down the bottom
set gcr=a:blinkon0 "Disable cursor blink
set visualbell "No sounds
set autoread "Reload files changed outside vim
" This makes vim act like all other editors, buffers can
" exist in the background without being in a window.
" http://items.sjbach.com/319/configuring-vim-right
set hidden
"turn on syntax highlighting
syntax on
" Change leader to a comma because the backslash is too far away
" That means all \x commands turn into ,x
" The mapleader has to be set before vundle starts loading all
" the plugins.
let mapleader=","
" ================ Turn Off Swap Files ==============
set noswapfile
set nobackup
set nowb
" ================ Indentation ======================
set autoindent
set smartindent
set smarttab
set shiftwidth=2
set softtabstop=2
set tabstop=2
set expandtab
filetype plugin on
filetype indent on
" Display tabs and trailing spaces visually
set list listchars=tab:\ \ ,trail:·
set nowrap "Don't wrap lines
set linebreak "Wrap lines at convenient points
" ================ Folds ============================
" set foldmethod=indent "fold based on indent
" set foldnestmax=3 "deepest fold is 3 levels
" set nofoldenable "dont fold by default
" ================ Completion =======================
set wildmode=list:longest
set wildmenu "enable ctrl-n and ctrl-p to scroll thru matches
set wildignore=*.o,*.obj,*~ "stuff to ignore when tab completing
set wildignore+=*vim/backups*
set wildignore+=*sass-cache*
set wildignore+=*DS_Store*
set wildignore+=vendor/rails/**
set wildignore+=vendor/cache/**
set wildignore+=*.gem
set wildignore+=log/**
set wildignore+=tmp/**
set wildignore+=*.png,*.jpg,*.gif
"
" ================ Scrolling ========================
set scrolloff=8 "Start scrolling when we're 8 lines away from margins
set sidescrolloff=15
set sidescroll=1
"======================================
""""""""""""""""""""""""""""""""""""""
" LOAD SETTING VIM
so ~/.config/nvim/settings.vim
""""""""""""""""""""""""""""""""""""""
"======================================
" Ag
"command! -nargs=* -complete=file Ag Grepper! -tool ag -query <args>
" Markdown
augroup markdown
au!
au BufNewFile,BufRead *.md,*.markdown setlocal filetype=ghmarkdown
augroup END
" Lightline
let g:lightline = {
\ 'colorscheme': 'solarized',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'fugitive', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'fugitive': 'MyFugitive',
\ 'readonly': 'MyReadonly',
\ 'filename': 'MyFilename',
\ },
\ 'separator': { 'left': '⮀', 'right': '⮂' },
\ 'subseparator': { 'left': '⮁', 'right': '⮃' }
\ }
function! MyReadonly()
if &filetype == "help"
return ""
elseif &readonly
return "⭤ "
else
return ""
endif
endfunction
function! MyFugitive()
if exists("*fugitive#head")
let _ = fugitive#head()
return strlen(_) ? '⭠ '._ : ''
endif
return ''
endfunction
function! MyFilename()
return ('' != MyReadonly() ? MyReadonly() . ' ' : '') .
\ ('' != expand('%') ? expand('%') : '[NoName]')
endfunction
" Use status bar even with single buffer
set laststatus=2
set encoding=utf-8
"set clipboard+=unnamedplus
set mouse=nir
"fzf
nmap <leader><tab> <plug>(fzf-maps-n)
xmap <leader><tab> <plug>(fzf-maps-x)
omap <leader><tab> <plug>(fzf-maps-o)
" Insert mode completion
imap <c-x><c-k> <plug>(fzf-complete-word)
imap <c-x><c-f> <plug>(fzf-complete-path)
imap <c-x><c-j> <plug>(fzf-complete-file-ag)
imap <c-x><c-l> <plug>(fzf-complete-line)
nnoremap <silent> ,t :Files<CR>
nnoremap <silent> ,b :Buffers<CR>
nnoremap <silent> ,w :Windows<CR>
" neomake
let g:neomake_ruby_enabled_makers = ['mri']
let g:neomake_open_list = 2
autocmd! BufWritePost * Neomake
let mapleader = ','
"
" Auto complete
"""""""""""""""""""""""""""""""""""""
set completeopt+=noselect
" filetype plugin indent on
" " show existing tab with 4 spaces width
" set tabstop=4
" " when indenting with '>', use 4 spaces width
" set shiftwidth=4
" " On pressing tab, insert 4 spaces
" set expandtab