개인 프로젝트/Vim
[Vim] vimrc 파일
겨울엔군고구마한잔
2022. 4. 17. 15:53
[ vimrc 파일 ]
[ zshrc 파일 ]
[ vimrc 파일 코드 ]
1 " Basic Settings
2
3 map <F3> <ESC>:NERDTreeToggle<CR>
4 map <F5> :tabnew<CR>
5 map <F4> :bn<CR>
6
7 colorscheme jellybeans
8 set termguicolors
9 syntax on
10 set number
11 set nu
12 set hlsearch
13 set ignorecase
14 set tabstop=4
15 set softtabstop=4
16 set shiftwidth=4
17 set expandtab
18 autocmd FileType make setlocal noexpandtab
19
20 " Key Settings
21 nnoremap <F2> :set invpaste paste?<CR>
22 set pastetoggle=<F2>
23 let mapleader = ","
24 nnoremap <leader>q :bp<CR>
25 nnoremap <leader>w :bn<CR>
26
27 " Key Setting - resize windows
28 nnoremap <silent> <Leader>= :exe "resize +3"<CR>
29 nnoremap <silent> <Leader>- :exe "resize -3"<CR>
30 nnoremap <silent> <Leader>] :exe "vertical resize +8"<CR>
31 nnoremap <silent> <Leader>[ :exe "vertical resize -8"<CR>
32
33 nnoremap <silent> <Leader>+ :exe "resize " . (winheight(0) * 3/2)<CR>
34 nnoremap <silent> <Leader>_ :exe "resize " . (winheight(0) * 2/3)<CR>
35 nnoremap <silent> <Leader>} :exe "vertical resize " . (winheight(0) * 3/2)<CR>
36 nnoremap <silent> <Leader>{ :exe "vertical resize " . (winheight(0) * 2/3)<CR>
37
38 " Vundle
39 set nocompatible " be iMproved, required
40 filetype off " required
41
42 " set the runtime path to include Vundle and initialize
43 set rtp+=~/.vim/bundle/Vundle.vim
44 call vundle#begin()
45 " alternatively, pass a path where Vundle should install plugins
46 "call vundle#begin('~/some/path/here')
47
48 " let Vundle manage Vundle, required
49 Plugin 'VundleVim/Vundle.vim'
50
51 " Keep Plugin commands between vundle#begin/end.
52
53 Plugin 'vim-airline/vim-airline'
54 Plugin 'vim-airline/vim-airline-themes'
55 Plugin 'The-NERD-Tree'
56 Plugin 'terryma/vim-multiple-cursors'
57 Plugin 'terryma/vim-smooth-scroll'
58 Plugin 'Raimondi/delimitMate'
59 Plugin 'SirVer/ultisnips'
60 Plugin 'honza/vim-snippets'
61 Plugin 'Syntastic'
62 Plugin 'Shougo/deoplete.nvim'
63 Plugin 'Rip-Rip/clang_complete'
64 Plugin 'roxma/nvim-yarp'
65 Plugin 'roxma/vim-hug-neovim-rpc'
66 Plugin 'morhetz/gruvbox'
67
68 " All of your Plugins must be added before the following line
69 call vundle#end() " required
70 filetype plugin indent on " required
71 " To ignore plugin indent changes, instead use:
72 "filetype plugin on
73 "
74 " Brief help
75 " :PluginList - lists configured plugins
76 " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
77 " :PluginSearch foo - searches for foo; append `!` to refresh local cache
78 " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
79 "
80 " see :h vundle for more details or wiki for FAQ
81 " Put your non-Plugin stuff after this line
82
83 " for vim-airline
84 let g:airline#extensions#tabline#enabled = 1 " turn on buffer list
85 " Smarter tab line 활성화: 모든 파일 버퍼 출력
86 let g:airline#extensions#tabline#enabled = 1
87
88 " Tab line 구분자 '|' 로 설정
89 let g:airline#extensions#tabline#left_sep = ' '
90 let g:airline#extensions#tabline#left_alt_sep = '|'
91
92 " Tab line 에 파일명만 출력되도록 설정
93 let g:airline#extensions#tabline#formatter = 'unique_tail'
94
95 " Powerline-font 활성화
96 let g:airline_powerline_fonts = 1
97 let g:airline_theme='hybrid'
98 set laststatus=2 " turn on bottom bar
99
100 " The-NERD-Tree
101 autocmd BufEnter * lcd %:p:h
102 autocmd VimEnter * if !argc() | NERDTree | endif
103 nmap <leader>ne :NERDTreeToggle<cr>
104 let NERDTreeShowLineNumbers=1
105 let g:NERDTreeWinPos = "right"
106
107 " gruvbox
108 let g:gruvbox_contrast_dark="hard"
109 set background=dark
110 autocmd vimenter * colorscheme gruvbox
111
112 " vim-multiple-cursor
113 let g:multi_cursor_use_default_mapping=0
114 " Default mapping
115 let g:multi_cursor_next_key='<C-n>'
116 let g:multi_cursor_prev_key='<C-p>'
117 let g:multi_cursor_skip_key='<C-x>'
118 let g:multi_cursor_quit_key='<Esc>'
119
120 " vim-smooth-scroll
121 noremap <silent> <c-b> :call smooth_scroll#up(&scroll*2, 10, 5)<CR>
122 noremap <silent> <c-f> :call smooth_scroll#down(&scroll*2, 10, 5)<CR>
123 noremap <silent> <c-u> :call smooth_scroll#up(&scroll, 10, 3)<CR>
124 noremap <silent> <c-d> :call smooth_scroll#down(&scroll, 10, 3)<CR>
125
126 " delimitMate
127 let delimitMate_expand_cr=1
128
129 " UltiSnips
130 let g:UltiSnipsExpandTrigger="<tab>"
131 let g:UltiSnipsJumpForwardTrigger="<tab>"
132 let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
133 let g:UltiSnipsEditSplit="vertical"
134
135 " Syntastic
136 set statusline+=%#warningmsg#
137 set statusline+=%{SyntasticStatuslineFlag()}
138 set statusline+=%*
139
140 let g:syntastic_always_populate_loc_list = 1
141 let g:syntastic_auto_loc_list = 1
142 let g:syntastic_check_on_open = 1
143 let g:syntastic_check_on_wq = 0
144
145 let g:syntastic_cpp_compiler = 'g++'
146 let g:syntastic_cpp_compiler_options = "-std=c++11 -Wall -Wextra -Wpedantic"
147 let g:syntastic_c_compiler_options = "-std=c11 -Wall -Wextra -Wpedantic"
148
149 " Deoplete.
150 let g:deoplete#enable_at_startup = 1
151
152 " clang_complete
153 set completeopt-=preview