-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathln_vimrc
More file actions
290 lines (243 loc) · 7.74 KB
/
ln_vimrc
File metadata and controls
290 lines (243 loc) · 7.74 KB
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
let mapleader = ' '
let maplocalleader = ' '
" Use Vim settings, rather then Vi settings (much better!).
" " This must be first, because it changes other options as a side effect.
set nocompatible
" Tweaks
" slow cursor issues https://github.com/groenewege/vim-less/issues/56
"
set re=1
set lazyredraw
" ================ Undofile ======================
set undodir=~/.vim/undo
set undofile
set undolevels=1000 "maximum number of changes that can be undone
set undoreload=10000 "maximum number lines to save for undo on a buffer reload
" ================ Indentation ======================
set autoindent
set smartindent
set smarttab
set shiftwidth=2
set softtabstop=2
set tabstop=2
set expandtab
" ================ Max column length indicator ======================
set colorcolumn=80
" ================ Search ===========================
set incsearch " Find the next match as we type the search
set hlsearch " Highlight searches by default
set ignorecase " Ignore case when searching...
set smartcase " ...unless we type a capital
" Show line numbers
set number relativenumber
" Toggle line numbers from none at all
noremap <F5> :set invnumber relativenumber!<CR>
noremap <C-F5> :set relativenumber!<CR>
" Rendering
set ttyfast
syntax enable " Enable syntax highlighting
filetype on " Enable filetype detection
filetype indent on " Enable filetype-specific indenting
filetype plugin on " Enable filetype-specific plugins
" ================ Panes/Splits ====================
" more natural new window creation
set splitbelow
set splitright
" nawigate w/o Ctrl-w
" nnoremap <C-J> <C-W><C-J>
" nnoremap <C-K> <C-W><C-K>
" nnoremap <C-L> <C-W><C-L>
" nnoremap <C-H> <C-W><C-H>
" better splitting
nnoremap <C-W>- :sp<CR>
nnoremap <C-W><bar> :vsp<CR>
" Tabs
" next/prev with Shift
nnoremap H gT
nnoremap L gt
" Vim-like tab navigation
nnoremap th :tabfirst<CR>
nnoremap tk :tabnext<CR>
nnoremap tj :tabprev<CR>
nnoremap tl :tablast<CR>
nnoremap tt :tabedit<Space>
nnoremap tn :tabnext<Space>
nnoremap tm :tabm<Space>
nnoremap td :tabclose<CR>
" ============== Spellcheck
" keystrokes: s] [s z= 1z=
" zg to add word to word list
" zw to reverse
" zug to remove word from word list
" z= to get list of possibilities
nmap <silent> <leader>s :set spell!<CR>
set spell spelllang=en_us
set complete+=kspell
"=========================================
" ================ Turn Off Swap Files ==============
"
set noswapfile
set nobackup
set nowb
map <C-s> <esc>:w<CR>
imap <C-s> <esc>:w<CR>
" Quit
nnoremap <Leader>q :q<cr>
nnoremap <Leader>Q :qa!<cr>
" =============== VIM-PLUG BLOCK ==================
call plug#begin('~/.vim/plugged')
" == Browse
" Plug 'wincent/command-t'
Plug 'scrooloose/nerdtree'
"{{{
inoremap <F10> <esc>:NERDTreeToggle<cr>
nnoremap <F10> :NERDTreeToggle<cr>
inoremap <F11> <esc>:NERDTreeFind<cr>
nnoremap <F11> :NERDTreeFind<cr>
let g:NERDTreeWinSize=30
let g:NERDTreeNodeDelimiter = "\u00a0"
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
"}}}
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'FelikZ/ctrlp-py-matcher'
Plug 'dkprice/vim-easygrep'
" Navigation
Plug 'christoomey/vim-tmux-navigator'
Plug 'edkolev/tmuxline.vim'
Plug 'terryma/vim-multiple-cursors'
Plug 'ludovicchabant/vim-gutentags'
Plug 'szw/vim-maximizer'
Plug 'tpope/vim-fugitive'
Plug 'jeffkreeftmeijer/vim-numbertoggle'
Plug 'simeji/winresizer'
" Plug 'mileszs/ack.vim'
" == Code
Plug 'pangloss/vim-javascript'
Plug 'plasticboy/vim-markdown'
Plug 'vim-ruby/vim-ruby'
Plug 'tpope/vim-haml'
Plug 'tpope/vim-rails'
Plug 'thoughtbot/vim-rspec'
Plug 'tpope/vim-endwise'
Plug 'sheerun/vim-polyglot'
Plug 'jiangmiao/auto-pairs'
Plug 'vim-scripts/comments.vim'
Plug 'Chiel92/vim-autoformat'
Plug 'vim-airline/vim-airline'
Plug 'dart-lang/dart-vim-plugin'
Plug 'natebosch/vim-lsc'
"{{{
let g:lsc_auto_map = v:true
"}}}
Plug 'natebosch/vim-lsc-dart'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
"{{{
let g:airline#extensions#ale#enabled = 1
let g:airline#extensions#tmuxline#enabled = 0
let g:airline#extensions#tabline#enabled = 0
"}}}
Plug 'vim-airline/vim-airline-themes'
"{{{
let g:airline_theme = 'solarized'
let g:airline_solarized_bg='dark'
"}}}
Plug 'w0rp/ale'
"{{{
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = '✹ Error'
let g:ale_echo_msg_format = '[#%linter%#] %s [%severity%]'
let g:ale_echo_msg_warning_str = '⚠ Warning'
let g:ale_enabled = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_save = 0
let g:ale_lint_on_text_changed = 1
let g:ale_linter_aliases = {}
" let g:ale_linters = {'vim': ['vint'], 'markdown': ['mdl'], 'sh': ['shellcheck'], 'html': ['tidy'], 'javascript': ['eslint'], 'python': ['flake8']}
let g:ale_open_list = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_error = '>>'
let g:ale_sign_warning = '--'
let g:ale_statusline_format = ['E•%d', 'W•%d', 'OK']
let g:ale_warn_about_trailing_whitespace = 1
highlight clear ALEWarningSign
"}}}
" Plug 'Valloric/YouCompleteMe', { 'do': './install.py' }
" Plug 'junegunn/vim-easy-align'
" == Filesystem
Plug 'pbrisbin/vim-mkdir'
Plug 'djoshea/vim-autoread'
" == Console
Plug 'ConradIrwin/vim-bracketed-paste'
" == Theme
Plug 'altercation/vim-colors-solarized'
" Plug 'junegunn/seoul256.vim'
" Plug 'vim-airline/vim-airline'
" Plug 'vim-airline/vim-airline-themes'
call plug#end()
" Color scheme (terminal)
set t_Co=256
set background=dark
let g:solarized_termcolors=256
let g:solarized_termtrans=1
" Workaround for docker
colorscheme solarized
"--------------- Spellcheck colors
highlight clear SpellBad
highlight SpellBad term=standout ctermfg=1 term=underline,bold cterm=underline,bold
highlight clear SpellCap
highlight SpellCap term=underline,bold cterm=underline,bold
highlight clear SpellRare
highlight SpellRare term=underline,bold cterm=underline,bold
highlight clear SpellLocal
highlight SpellLocal term=underline,bold cterm=underline,bold
" -----------------------------
"
" ==== gutentags settings ====
" Exclude css, html, js files from generating tag files
let g:gutentags_ctags_exclude = ['*.css', '*.html', '*.js', '*.json', '*.xml',
\ '*.phar', '*.ini', '*.rst', '*.md']
" Where to store tag files
let g:gutentags_cache_dir = '~/.vim/gutentags'
" ==== End gutentags settings ====
" ==== CtrlP settings ====
" Open CtrlP buffers
map <tab> :CtrlPBuffer<cr>
map <leader>tb :CtrlPBufTagAll<cr>
map <leader>ta :CtrlPTag<cr>
" Jump to definition
map <silent> <leader>jd :CtrlPTag<cr><C-\>w
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files . -co --exclude-standard', 'find %s -type f']
let g:ctrlp_match_current_file = 1
let g:ctrlp_lazy_update = 1
let g:ctrlp_extensions = ['tag', 'buffertag']
let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' }
let g:ctrlp_use_caching = 0
" ==== End CtrlP settings ====
" ==== Autoformat settings ====
noremap <F4> :Autoformat<CR>
" au BufWrite *.rb :Autoformat
" let g:autoformat_autoindent = 0
" let g:autoformat_retab = 0
" let g:autoformat_remove_trailing_spaces = 0
" ==== End Autoformat settings ====
" ==== CoC.nvim settings ====
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" ==== End Coc.nvim settings ====
" ==== pg_format settings ====
au FileType sql setl formatprg=/usr/local/bin/pg_format\ -
" ==== End pg_format settings ====
" Local config
if filereadable($HOME . "/.vimrc.local")
source ~/.vimrc.local
endif