-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc_plugins
More file actions
399 lines (321 loc) · 17.4 KB
/
vimrc_plugins
File metadata and controls
399 lines (321 loc) · 17.4 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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
""" 레퍼런스
" http://vim-ko.github.io/doc/quickref.html
" http://wujek2.ia.pw.edu.pl/wujek/wa/prog/vim/options.html
" http://vimdoc.sourceforge.net/
" vundle
set nocompatible " nocp; 오리지널 Vi 와의 호환성을 없애고, Vim 만의 기능들을 쓸 수 있게 함. vundle 쓰려면 필수
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim' " let Vundle manage Vundle, required
""Plugin 'spf13/vim-autoclose' " Inserts matching bracket, paren, brace or quote. auto-pairs가 더 좋음. 나중에 혹시 중복해서 쓸까봐 남겨둠
Plugin 'jiangmiao/auto-pairs' " insert or delete brackets, parens, quotes in pair
Plugin 'SearchComplete' " Tab completion of words inside of a search ('/')
Plugin 'bling/vim-airline' " lean & mean status/tabline for vim that's light as air
Plugin 'vim-airline/vim-airline-themes' "https://github.com/vim-airline/vim-airline-themes
Plugin 'fugitive.vim' " a Git wrapper so awesome, it should be illegal
Plugin 'nathanaelkane/vim-indent-guides' " A Vim plugin for visually displaying indent levels in code
Plugin 'neocomplcache' " Ultimate auto-completion system for Vim
Plugin 'terryma/vim-multiple-cursors' " True Sublime Text style multiple selections for Vim
Plugin 'scrooloose/nerdcommenter' " Vim plugin for intensely orgasmic commenting
Plugin 'sheerun/vim-polyglot' " A solid language pack for Vim
Plugin 'scrooloose/nerdtree' " A tree explorer plugin for vim
Plugin 'tpope/vim-surround' " quoting/parenthesizing made simple
Plugin 'scrooloose/syntastic' " Syntax checking hacks for vim
Plugin 'gcmt/wildfire.vim' " Smart selection of the closest text object
Plugin 'othree/javascript-libraries-syntax.vim' " Syntax file for JavaScript libraries
Plugin 'jelera/vim-javascript-syntax' "https://github.com/jelera/vim-javascript-syntax
Plugin 'pangloss/vim-javascript' "Vastly improved Javascript indentation and syntax support in Vim.
Plugin 'mxw/vim-jsx' "React JSX syntax highlighting and indenting for vim.
Plugin 'Lokaltog/vim-easymotion' " EasyMotion provides a much simpler way to use some motions in vim.
Plugin 'klen/python-mode' " Vim python-mode. PyLint, Rope, Pydoc, breakpoints from box.
Plugin 'vim-scripts/Pydiction' " Tab-complete your Python
Plugin 'kana/vim-textobj-user' " Create your own text objects
Plugin 'glts/vim-textobj-indblock' " Vim text objects for blocks of indentation whitespace
Plugin 'majutsushi/tagbar'
Plugin 'gorkunov/smartpairs.vim' " Fantastic selection for VIM
Plugin 'haya14busa/incsearch.vim' " Improved incremental searching for Vim
Plugin 'mustache/vim-mustache-handlebars' "spacebars, mustache and handlebars mode for vim
Plugin 'kshenoy/vim-signature' "Plugin to toggle, display and navigate marks
"Plugin 'marijnh/tern_for_vim' "Tern-based JavaScript editing support. required Tern and NPM.
"Plugin 'jlemetay/permut' "A vim plugin to swap columns of text separated by arbitrary characters.
Plugin 'jeetsukumaran/vim-indentwise' "Vim plugin for indent-level based motion
Plugin 'chrisbra/vim-diff-enhanced' "Better Diff options for Vim
Plugin 'zefei/vim-colortuner' "Adjust your vim colors using sliders
Plugin 'benmills/vimux' "vim plugin to interact with tmux
Plugin 'christoomey/vim-tmux-navigator' "Seamless navigation between tmux panes and vim splits
Plugin 'airblade/vim-gitgutter' "shows a git diff in the gutter (sign column) and stages/reverts hunks.
Plugin 'Yggdroot/indentLine' "display the indention levels with thin vertical lines
Plugin 'Keithbsmiley/swift.vim' "Vim runtime files for Swift
Plugin 'ryanoasis/vim-devicons' "https://github.com/ryanoasis/vim-devicons#installation
Plugin 'crusoexia/vim-javascript-lib' "https://github.com/crusoexia/vim-javascript-lib
Plugin 'editorconfig/editorconfig-vim' "https://github.com/editorconfig/editorconfig-vim
Plugin 'lilydjwg/colorizer' " https://github.com/lilydjwg/colorizer
Plugin 'posva/vim-vue' "https://github.com/posva/vim-vue
" Find files containing given regular expression
" https://github.com/mileszs/ack.vim
" required ack
" For search speed, install ag(https://github.com/ggreer/the_silver_searcher)
Plugin 'mileszs/ack.vim'
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
""" vim
set history=999 " hi; 명령어 히스토리 수
set noswapfile " noswf; swap 파일을 만들지 않음
set nobackup " nobk; 백업파일을 만들지 않음. 백업파일은 편집하는 파일 앞에 ~로 시작하는 파일
" set backupdir=~/tmp " 백업 파일을 만들 경우, 백업 파일의 경로를 지정. 미리 tmp 폴더를 만들어 두어야 함.
set wildignore=*.o,*.obj,*.bak,*.exe,*.pyc,*.DS_Store,*.db " wig; 자동 완성시키지 않을 파일들 패턴
set wildignorecase " wic; 파일명 자동 완성 시 대소문자를 무시
set lazyredraw " lz; 매크로 실행중에 화면을 다시 그리지 않음 "
set showcmd "sc; 상태 표시줄에 (입력중인) 명령을 표시. 근데 무슨 차이인지 모르겠음.
set laststatus=2 " ls; 상태 표시줄을 항상 보이도록
set wildmenu
set wildmode:list:longest,full " wmnu; 명령줄 자동 완성 시 메뉴를 사용
set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*
"set termencoding=utf-8 " tenc; 터미널의 문자 인코딩
"set lines=100 "화면에 표시되는 줄 수
"set magic " magic 기능 사용
set foldlevel=99
" 파일의 종류를 자동으로 인식
filetype plugin on
filetype indent on
" ffs; 자동으로 인식할 'fileformat' 값
set ffs=unix,mac,dos
""" key mapping
" xmllint
map <F9> <Esc>:1,$!xmllint --format -<CR>
" indentation
map <F2> <Esc>:set ts=2<CR>:set sw=2<CR>
map <F4> <Esc>:set ts=4<CR>:set sw=4<CR>
" leader 키 설정(기본키는 \)
let mapleader="\<Space>"
" <Leader> + w 만 누르면 된다.
map <Leader>w <Plug>(easymotion-bd-w)
nmap <Leader>w <Plug>(easymotion-overwin-w)
" scroll
map <C-j> <C-e> " 위로 스크롤
map <C-k> <C-y> " 아래로 스크롤
" 영역이 지정된 상태에서 Tab 과 Shift-Tab 으로 들여쓰기/내어쓰기를 할 수 있도록 함.
vmap <Tab> >gv
vmap <S-Tab> <gv
" 커서가 위치한 단어를 다음 영어사전에서 찾아줌
map <F8> :!open /Applications/Google\ Chrome.app http://dic.daum.net/search.do?q=<cword><CR>
"set keywordprg=<my command> " K를 눌렀을 때 실행할 명령어. 기본저윽로는 manpage
" 더블 탭으로 분할된 창끼리 쉽게 이동
nmap <TAB><TAB> <C-w><C-w>
" 왼쪽의 글자를 오른쪽의 글자로 자동으로 변경
" abbr은 ab로 줄일 수 있음
abbr fucntion function
abbr fales false
abbr retrun return
""" ime
"set noimd "no imdisable 이라는 의미로 한글입력기 등을 사용하게 하는 설정이라고 하는데, 이거 설정하면 한글 입력시 개판됨
set iminsert=1 " imi; 편집(insert)모드를 빠져나갈 때 (즉 ESC를 눌렀을 때) IME(한글입력기)를 off상태로 만든다.
set imsearch=-1 " ims; 찾기 패턴을 입력할 때 :lmap 이나 IM을 사용. 근데 뭔 말인지 모르겠다.
""" encoding
set encoding=utf-8 " enc; 'encoding' 옵션은 Vim에게 당신이 사용할 문자의 인코딩을 알려줍니다. 이 인코딩은 버퍼의 내용(당신이 편집중인 파일), 레지스터, Vim 스크립트 파일 등에 적용됩니다. 'encoding'을 Vim 내부의 옵션으로 생각하면 됩니다.
set fileencoding=utf-8
set fileencodings=utf-8,cp949,ucs-bom "파일을 읽어 들일때 앞에 것부터 차례로 시도 합니다. 3개 이상 써도 될겁니다. 여기서 결정된 인코딩으로 fenc 옵션이 설정됩니다. 다 실패 했다면 enc 값을 따릅니다. 이 값은 환경 변수에서 얻어옵니다.
" 관련글: https://kldp.org/node/32987
""" theme
set background=dark " bg; 배경색을 어두운 걸로
colorscheme monokai "https://github.com/sickill/vim-monokai
""" font
"set guifont=Monaco:h13 " gfn
"set guifont=BitstreamVeraSansMono\ Nerd:h12
if has("win32")
" 인코딩을 UTF-8로 한 경우, 메뉴가 깨지는 문제 방지
let $LANG = 'ko_KR.UTF-8'
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
set lines=999 columns=999 " 윈도우가 항상 최대 크기로 나오도록.
endif
if has("gui_macvim")
"set guifont=Monaco:h13
"set guifont=Bitstream\ Vera\ Sans\ Mono\ Nerd\ Font\ Complete\ Mono:h13
set guifont=Roboto\ Mono\ Light\ Nerd\ Font\ Complete\ Mono:h13
set transparency=5 "불투명도
set antialias " anti; 맥 OS X에서 부드럽고 에일리어싱 제거된 글꼴을 사용
endif
" gVim 을 사용중일 경우 클립보드를 unnamed 레지스터로 매핑
if has("gui_running") || has("xterm_clipboard")
set cb=unnamed
endif
""" editor
syntax on " 자동 문법 강조
set t_Co=256
set numberwidth=2 " nuw; 줄 번호 표시에 사용할 최소한의 열의 수.
set number " nu; 줄번호
set showmatch " sm; 괄호 입력 시 짝이 되는 괄호로 잠시 갔다가 돌아옴.
set visualbell " vb; 오류음 대신 비주얼벨 사용. 무슨 차이인지 모르겠음"
set ruler " ru; 상태표시줄 오른쪽에 커서의 위치를 보여줌.
set backspace=2 " bs; indent,eol,start. Backspace 키 동작 방식
set hlsearch " hls; 검색어 하이라이팅
set linespace=1 " lsp; 줄간격 "
set ignorecase " ic; 찾기할 때 대소문자 구분하지 않음
set tabstop=2 " ts; <TAB> 간격"
set shiftwidth=2 " sw; 자동 들여쓰기 간격 "
set softtabstop=2 " sts; 편집 시 <Tab>을 누르면 들어가는 공백의 수
set autoindent " 새로운 줄의 들여쓰기를 이전 줄에서 가져옴
set cindent " C 언어 스타일 자동 들여쓰기
set smartindent "cindent 와 비슷 하지만 #if, #ifdef, #define 등과 #으로 시작하는 전처리기 명령어에 대해서는 자동 들여쓰기를 무시하고 다음 라인의 첫번째 열로 이동한다.
set scrolloff=5 "so; 커서 위나 밑에 표시할 최소 줄 수. 정확히 뭔지 모르겠음.
set paste " 외부 텍스트를 붙여넣기 할 때 자동 들여쓰기 막기
"set textwidth=120 " tw; 한 줄에 입력할 수 있는 글자 수. 띄어쓰기가 없으면 초과되도 계속 한 줄로 입력됨.
set wrap "긴 줄을 다음 줄로 넘겨가며 모두 표시
set cursorline " cul; 현재 커서가 있는 줄을 강조
"set cursorcolumn " cuc; 현재 커서가 있는 열을 강조
set list lcs=tab:\┆\ ,trail:~ " <TAB> 부분을 ┆ (공백)으로 표시하고 줄끝 공백을 ~로 표시. 이 옵션은 vim-indent-guides로 대체.
set expandtab " et; <Tab>이 입력되면 스페이스 공백들을 삽입
""" 찾기
"set wrapscan " 찾기에서 파일의 맨 끝에 이르면 문서 처음으로 이동해서 계속 찾음
set incsearch " 찾기 패턴을 입력하는 중에도 일치하는 곳을 강조
""" plugins
" vim-indent-guides
" toggle: <Leader>ig
let g:indent_guides_enable_on_vim_startup = 0
let g:indent_guides_guide_size = 1
" 따로 색을 지정해 주지 않으면 colorscheme을 따라감.
"let g:indent_guides_auto_colors = 0
"autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=gray ctermbg=3
"autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=darkgrey ctermbg=4
" neocomplcache
let g:acp_enableAtStartup = 0
let g:neocomplcache_enable_at_startup = 1
let g:neocomplcache_enable_smart_case = 1
let g:neocomplcache_min_syntax_length = 2
let g:neocomplcache_enable_camel_case_completion = 1
if !exists('g:neocomplcache_wildcard_characters')
let g:neocomplcache_wildcard_characters = {}
endif
let g:neocomplcache_wildcard_characters._ = '-'
let g:neocomplcache_enable_underbar_completion = 1
" neocomplcache와 함께 <TAB>키로 자동완성하기 위해 필수
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr><C-y> neocomplcache#close_popup()
inoremap <expr><C-e> neocomplcache#cancel_popup()
" omni completion.
set omnifunc=syntaxcomplete#Complete
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
" syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_javascript_checkers = ['eslint'] " eslint가 설치되어 있어야 함. npm install eslint
let g:syntastic_check_on_open = 1 " 파일 열 때 체크
let g:syntastic_enable_signs = 1
let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute \"ng-"] " ng-로 시작하는 속성은 무시
let g:syntastic_python_checkers = ['pylint'] " pylint가 설치되어 있어야 함. sudo pip install pylint
" wildfire
let g:wildfire_objects = ["i'", 'i"', "i)", "i]", "i}", "ip", "it"]
" javascript-libraries-syntax
let g:used_javascript_libs = 'jquery,angularjs,angularui,requirejs,jasmine'
" easymotion
"NERDTree
let NERDTreeShowHidden = 1
" vim-multiple-cursors
" 기본값 사용
" pymode
let g:pymode_breakpoint = 1
let g:pymode_breakpoint_bind = '<leader>b'
let g:pymode_breakpoint_cmd = ''
let g:pymode_rope_completion = 0
let g:pymode_rope_complete_on_dot = 0
let g:pymode_folding = 0
let g:pymode_rope_guess_project = 0
let g:pymode_virtualenv = 1
let g:pymode_run = 1
let g:pymode_indent = 1
let g:pymode_lint = 1
let g:pymode_lint_unmodified = 1
let g:pymode_lint_checker = "pyflakes,pep8,mccabe"
let g:pymode_lint_mccabe_complexity = 8
let g:pymode_lint_ignore = "E501,E262"
let g:pymode_lint_cwindow = 1
let g:pymode_lint_message = 1
" pydiction
let g:pydiction_location = '~/.vim/bundle/Pydiction/complete-dict'
let g:pydiction_menu_height = 10
" tagbar
" required: Install ctags from brew.
" Default ctags on Mac OS X(Mavericks) doesn't work.
let g:tagbar_ctags_bin = '/usr/local/bin/ctags'
" vim-jsx
let g:jsx_ext_required = 0
" pangloss/vim-javascript
let g:javascript_enable_domhtmlcss = 1
" vim-devicons for powerline
let g:airline_powerline_fonts = 1
" NERDTress File highlighting
function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg)
exec 'autocmd FileType nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg
exec 'autocmd FileType nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#'
endfunction
call NERDTreeHighlightFile('jade', 'green', 'none', 'green', '#151515')
call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('md', 'blue', 'none', '#3366FF', '#151515')
call NERDTreeHighlightFile('yml', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('config', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('conf', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('json', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('html', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('styl', 'cyan', 'none', 'cyan', '#151515')
call NERDTreeHighlightFile('css', 'cyan', 'none', 'cyan', '#151515')
call NERDTreeHighlightFile('coffee', 'Red', 'none', 'red', '#151515')
call NERDTreeHighlightFile('js', 'Red', 'none', '#ffa500', '#151515')
call NERDTreeHighlightFile('php', 'Magenta', 'none', '#ff00ff', '#151515')
call NERDTreeHighlightFile('ds_store', 'Gray', 'none', '#686868', '#151515')
call NERDTreeHighlightFile('gitconfig', 'Gray', 'none', '#686868', '#151515')
call NERDTreeHighlightFile('gitignore', 'Gray', 'none', '#686868', '#151515')
call NERDTreeHighlightFile('bashrc', 'Gray', 'none', '#686868', '#151515')
call NERDTreeHighlightFile('bashprofile', 'Gray', 'none', '#686868', '#151515')
autocmd filetype nerdtree highlight haskell_icon ctermbg=none ctermfg=Red guifg=#ffa500
autocmd filetype nerdtree highlight html_icon ctermbg=none ctermfg=Red guifg=#ffa500
autocmd filetype nerdtree highlight go_icon ctermbg=none ctermfg=Red guifg=#ffa500
autocmd filetype nerdtree syn match haskell_icon ## containedin=NERDTreeFile
" if you are using another syn highlight for a given line (e.g.
" NERDTreeHighlightFile) need to give that name in the 'containedin' for this
" other highlight to work with it
autocmd filetype nerdtree syn match html_icon ## containedin=NERDTreeFile,html
autocmd filetype nerdtree syn match go_icon ## containedin=NERDTreeFile
autocmd FileType nerdtree setlocal nolist
" incsearch
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)
let g:WebDevIconsUnicodeGlyphDoubleWidth = 0
"let g:webdevicons_conceal_nerdtree_brackets = 1
"let g:WebDevIconsNerdTreeGitPluginForceVAlign = 0
"let g:WebDevIconsNerdTreeAfterGlyphPadding = ''
let g:WebDevIconsOS = 'Darwin'
"EditConfig
let g:EditorConfig_exclude_patterns = ['fugitive://.*']
let g:EditorConfig_exclude_patterns = ['scp://.*']
let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*']
" Ack plugin key
cnoreabbrev Ack Ack!
nnoremap <Leader>a :Ack!<Space>
" Use ack plugin with 'the-silver-searcher'
" https://github.com/ggreer/the_silver_searcher
if executable('ag')
" let g:ackprg = 'ag --vimgrep'
let g:ackprg = 'ag --nogroup --nocolor --column'
endif
" Vue syntax highlighting stops working randomly
" This is for working around it.
autocmd FileType vue syntax sync fromstart
if &diff
colorscheme monokai
endif
" autoindent가 안되서 스택오버플로우에서 찾아 넣음.
" http://stackoverflow.com/questions/3938596/vim-autoindent-not-working
autocmd VimEnter * set autoindent