-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvimrc.link
280 lines (254 loc) · 8.67 KB
/
vimrc.link
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
"-----------------------------------------------------------------------
" heavenk21 .vimrc
"
" https://github.com/heavenk21/vimrc.git
"-----------------------------------------------------------------------
"-----------------------------------------------------------------------
" Vundle Plugin Settings
"-----------------
" Install Vundle prior to following setting
" git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
" Activate Vi Improved Functions
set nocompatible
" Setting in accordance to nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
" alternatively, pass a path where Vundle should install plugins
" e.g.) vundle#begin('~/some/path/here')
call vundle#begin()
" let Vundle manage Vundle
Plugin 'gmarik/Vundle.vim'
" Vim-Fugitive : Git Wrapper
Plugin 'tpope/vim-fugitive'
" vim-gitgutter : Git Diff Presenter
Plugin 'airblade/vim-gitgutter'
" Vim-Airline : Improved Status Line
Plugin 'vim-airline/vim-airline'
" vim-airline-themes : airline themes
Plugin 'vim-airline/vim-airline-themes'
" The NERD Tree : Tree File System Explorer
Plugin 'scrooloose/nerdtree'
" nerdtree-git-plugin : git integration to nerd tree
Plugin 'xuyuanp/nerdtree-git-plugin'
" vim-solarized8 : Color Scheme of Choice
Plugin 'lifepillar/vim-solarized8'
" vim-numbertoggle : smarter number toggle
Plugin 'jeffkreeftmeijer/vim-numbertoggle'
" fzf : general purpose fuzzy finder
Plugin 'junegunn/fzf'
" fzf.vim : fzf :heart: vim
Plugin 'junegunn/fzf.vim'
" vim-scala : Scala Integration
Plugin 'derekwyatt/vim-scala'
" ensime-vim : Scala Integration
Plugin 'ensime/ensime-vim'
" vim-multiple-cursors : sublime-like cursors
Plugin 'terryma/vim-multiple-cursors'
" All Plugins to be added between vundle#begin and vundle#end
call vundle#end()
" turn filetype (for plugin and indent) back on
filetype plugin indent on
"-----------------------------------
"
"-----------------------------------------------------------------------
"-----------------------------------------------------------------------
" Key Mapping Settings
"-----------------------------------
" change leader key
let mapleader=","
" if caps lock configured to ctrl key, ignore below mappings and use ctrl+[
" use ;; to escape in insert mode
" inoremap ;; <esc>
" use ;; to escape in visual mode
" vnoremap ;; <esc>
" save with sudo permission
cnoremap w!! w !sudo tee > /dev/null %
" delete trailing whitespace
nnoremap <leader>W :%s/\s\+$//<CR>
" buffer maneuvering
" delete current buffer and bring next buffer to current window
command! Bn bn|bd#
" delete current buffer and bring previous buffer to current window
command! Bp bp|bd#
" delete current buffer and bring most recent buffer to current window
command! Bs b#|bd#
"
"-----------------------------------------------------------------------
"-----------------------------------------------------------------------
" Plugin Customizations
"-----------------------------------
" Airline Settings
"-----------------
" powerline symbols
let g:airline_powerline_fonts=1
" set airline specific theme
if has("nvim")
let g:airline_theme='hybridline'
else
let g:airline_theme='dark'
endif
" customize airline section a (remove spell)
"let g:airline_section_a = airline#section#create(['mode', 'crypt', ' ', 'paste', 'iminsert'])
" display buffers like tabs
let g:airline#extensions#tabline#enabled=1
" fixes bug of airline activating from second split
set laststatus=2
"
"-----------------------------------
"
"-----------------------------------
" Solarized Settings
"-----------------
" visibility of characters affected by the set list option
let g:solarized_visibility="low"
" enabling recommended when iTerm profile color is set to solarized
let g:solarized_termcolors=256
" enable the solarized color scheme (in true color)
colorscheme solarized8_dark
" with nvim, use true colors
if has("nvim")
set termguicolors
endif
" enhance solarized colors in iTerm
let g:solarized_termtrans = 1
" enable when true colors do not appear
"let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
"let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
"
"-----------------------------------
"
"-----------------------------------
" NERD TREE Settings
"-----------------
" ignore the following: [pycache directories, vim .swp files, ]
let NERDTreeIgnore=['__pycache__[[dir]]', '[/.]*.swp[[file]]']
" automatically close buffer deleted in NERDTree
let NERDTreeAutoDeleteBuffer = 1
" change Vim's cwd whenever NERDTree's root changes
let NERDTreeChDirMode = 2
"
"-----------------------------------
"
"-----------------------------------
" fzf Settings
"-----------------
" enable :Find command (requires ripgrep from shell)
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>), 1, <bang>0)
" search lines for {argument} all files under current directory
nnoremap <space>/ :Find<space>
" search files for {argument} under current directory
nnoremap <tab>/ :Files<space>
"
"-----------------------------------
"
"-----------------------------------
" Ensime Settings
"-----------------
" designate python2 location
let g:python_host_prog = '/usr/local/bin/python'
" designate python3 location
let g:python3_host_prog = '/usr/local/bin/python3'
" declaration key binding
nnoremap <leader>d :EnDeclaration<CR>
" type inspection key binding
nnoremap <leader>t :EnInspectType<CR>
" name refactoring key binding
nnoremap <leader>r :EnRename<CR>
" project search key binding
nnoremap <leader>/ :EnSearch<space>
" auto-complete key binding
inoremap <C-space> <C-x><C-o>
"
"-----------------------------------
"
"-----------------------------------------------------------------------
"-----------------------------------------------------------------------
" Vim Styling Settings
"-----------------------------------
" enable syntax highlighting
syntax on
" enable line numbering
set number
" set relative line numbering
set relativenumber
" enable status line ruler
set ruler
" enable datetime display for ruler (normally overwritten by airline)
set rulerformat=%55(%{strftime('%a\ %b\ %e\ %I:%M\ %p')}\ %5l,%-6(%c%V%)\ %P%)
" display trailing whitespace with <CTRL-V u22c5> and EOL with <CTRL-V u21b2>
set list listchars=trail:·,eol:↲
" set background type to be dark
set background=dark
" italicize comments (this command must be after all scheme setting)
highlight Comment cterm=italic
" enable current line highlighting
set cursorline
" enable current column highlighting
set cursorcolumn
" show (partial) command in the last line of the screen
set showcmd
" display line wrap as <CTRL-V u21aa>
set showbreak=↪
" Highlight lines that exceed 80 characters
" highlight OverLength ctermbg=red ctermfg=white guibg=#592929
" return to the next line, the word exceeding the line character limit
" match OverLength /\%81v.\+/
"
"-----------------------------------------------------------------------
"-----------------------------------------------------------------------
" Indentation Settings
"-----------------------------------
" align new line's indent with previous line's
set autoindent
" set number of columns for auto-indenting
set shiftwidth=4
" set number of columns for TAB/BACKSPACE
set softtabstop=4
" set insert spaces for TAB
set expandtab
" set number of columns for displaying hard TAB
set tabstop=4
"
"-----------------------------------------------------------------------
"-----------------------------------------------------------------------
" Brace Match Settings
"-----------------------------------
" visual select all contents between matching braces
noremap % v%
" briefly jump to matching brace when ending brace is inserted
set showmatch
" set showmatch jump time
set matchtime=3
" showmatch screen scroll
inoremap } }<Left><c-o>%<c-o>:sleep 500m<CR><c-o>%<c-o>a
inoremap ] ]<Left><c-o>%<c-o>:sleep 500m<CR><c-o>%<c-o>a
inoremap ) )<Left><c-o>%<c-o>:sleep 500m<CR><c-o>%<c-o>a
"
"-----------------------------------------------------------------------
"-----------------------------------------------------------------------
" Search Settings
"-----------------------------------
" autocomplete searches
set wildmenu
" highlight search results
set hlsearch
" search as characters are entered
set incsearch
" ignore case when searching
set ignorecase
" but not when upper case is explicitly used
set smartcase
"
"-----------------------------------------------------------------------
"-----------------------------------------------------------------------
" Uncategorized Essentials
"-----------------------------------
" hides unloaded buffer and keeps track of changes
set hidden
" spell checker
set spell
" pbcopy
set clipboard=unnamed
"
"-----------------------------------------------------------------------