-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
172 lines (141 loc) · 4.71 KB
/
vimrc
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
" Syntax Highlighting
if has ("syntax")
syntax on
endif
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab autoindent
"filetype off
"Basic
set incsearch
set ruler
set scrolloff=5
set helplang=ko
set redrawtime=10000
set list lcs=trail:·,tab:├─
set relativenumber
set autoindent
set cindent
set expandtab "tab을 spacebar로 처리
set number
set hlsearch "검색에 음영 표시
set ignorecase smartcase "검색시 대소문자 검색 (tab 포함)
set cursorline "커서라인 강조
" You might have to force true color when using regular vim inside tmux as the
" colorscheme can appear to be grayscale with "termguicolors" option enabled.
if !has('gui_running') && &term =~ '^\%(screen\|tmux\)'
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
endif
set termguicolors
"set background=dark
set tabstop=4
set shiftwidth=4
set laststatus=2 "상태바
set statusline=\ %<%l:%v\ [%P]%=%a\ %h%m%r\ %F\
set statusline=%<%f\ %h%m%r%{kite#statusline()}%=%-14.(%l,%c%V%)\ %P
set laststatus=2 " always display the status line
set enc=utf-8
set fileencodings=utf8,euc-kr
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
let g:Powerline_symbols = 'fancy'
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'vim-airline/vim-airline' "StateBar
Plugin 'airblade/vim-gitgutter' "git state with vim-airline
Plugin 'pangloss/vim-javascript' "javascript
Plugin 'ap/vim-css-color'
Plugin 'ekalinin/Dockerfile.vim' "Dockerfile
Plugin 'majutsushi/tagbar'
"Coding
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-surround' "text wrap
Plugin 'fatih/vim-go' "Golang
Plugin 'rust-lang/rust.vim'
Plugin 'posva/vim-vue'
Plugin 'AutoComplPop'
Plugin 'scrooloose/syntastic'
Plugin 'scrooloose/nerdtree' "folder tree
Plugin 'morhetz/gruvbox'
call vundle#end() " required
filetype plugin indent on " required
" Tree 아이콘 변경
map <Leader>nt <ESC>:NERDTree<CR>
" tagbar
nmap <F8> :TagbarToggle<CR>
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
let g:netrw_sort_by="time"
let NERDTreeShowHidden=1
let g:NERDTreeSortOrder = ['\/$', '*', '\.swp$', '\.bak$', '\~$', '[[-timestamp]]']
" 파일없이 vim만 틸 경우 자동으로 NERD Tree 실행.
"autocmd StdinReadPre * let s:std_in=1
"autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" 디렉토리를 vim으로 여는 경우 NERD Tree 실행.
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
"ColorTheme
colorscheme molokai
"colorscheme gruvbox
""""""""""""""""""""""""" Golang
"let g:go_fmt_autosave = 0
set autowrite
" Go syntax highlighting
let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_operators = 1
" Auto formatting and importing
let g:go_fmt_autosave = 1
let g:go_fmt_command = "goimports"
" Status line types/signatures
let g:go_auto_type_info = 1
" Run :GoBuild or :GoTestCompile based on the go file
function! s:build_go_files()
let l:file = expand('%')
if l:file =~# '^\f\+_test\.go$'
call go#test#Test(0, 1)
elseif l:file =~# '^\f\+\.go$'
call go#cmd#Build(0)
endif
endfunction
" Map keys for most used commands.
" Ex: `\b` for building, `\r` for running and `\b` for running test.
autocmd FileType go nmap <leader>b :<C-u>call <SID>build_go_files()<CR>
autocmd FileType go nmap <leader>r <Plug>(go-run)
autocmd FileType go nmap <leader>t <Plug>(go-test)
" Rust
let g:rustfmt_autosave = 1
" Coding 자동괄호 입력
"inoremap " ""<left>
"inoremap ' ''<left>
"inoremap ( ()<left>
"inoremap [ []<left>
"inoremap { {}<left>
"inoremap {<CR> {<CR>}<ESC>O
"inoremap {;<CR> {<CR>};<ESC>O
"
"Multiple cursors
let g:multi_cursor_use_default_mapping=0
let g:multi_cursor_start_word_key = '<C-n>'
let g:multi_cursor_select_all_word_key = '<A-n>'
let g:multi_cursor_start_key = 'g<C-n>'
let g:multi_cursor_select_all_key = 'g<A-n>'
let g:multi_cursor_next_key = '<C-n>'
let g:multi_cursor_prev_key = '<C-p>'
let g:multi_cursor_skip_key = '<C-x>'
let g:multi_cursor_quit_key = '<Esc>'
"syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
"set statusline+=%{FugitiveStatusline()}
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
set rtp+=/usr/local/opt/fzf