-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
207 lines (169 loc) · 6.14 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
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
set nocp
set hi=256
set lz " 메크로 실행중 화면을 다시 그리지 않음
set nu
set ts=2
set sts=2
set expandtab "retab
set shiftwidth=2
set incsearch
set ai
set si
set cindent
set wildmenu
set wildmode=longest,full " First match only to the longest common string, then use full/wildmenu match
set scrolloff=4 " keep lines between the cursor and bottom/top
set ss=1 " Nice sidescroll
set siso=9 " Even nicer sidescroll
set nosm " No Smartmatch
set hlsearch
set backup
set nocompatible
"set backspace=2 "삽입모드에서 백스페이스를 계속 허용
set showcmd "부분적 명령을 보여줌
set pastetoggle=<Ins> "Ins키로 paste상태와 nopaste상태 전환
"set textwidth=80 "visual block으로 설정후 gq
"set wrap
set enc=utf-8 " 인코딩 설정 "
set fenc=utf-8
"set fencs=utf-8,cp949,cp932,euc-jp,shift-jis,big5,ucs-2le,latin1
set ignorecase " case insensitive search
set colorcolumn=80
syntax on
filetype on
filetype indent on
filetype plugin on
" 마지막 편집 위치 복원 기능
au BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "norm g`\"" |
\ endif
" 팁 (tip)
" 사칙연산하기 | 'ctrl+r', '=', '3+5', '엔터' 8이 입력된다
" 아스키값구하기 | 해당 문자 커서 대고 'ga' 입력하면 하단에 표시된다.
" =======================================================================
" 확장자별 설정
" =======================================================================
" See ~/.vim/ftdetect
"au BufNewFile,BufRead *.pl set kp=perldoc\ -f " perl -> perldoc
"au BufNewFile,BufRead *.pm set kp=perldoc\ -f " perl -> perldoc
"au BufNewFile,BufRead *.tt set filetype=html " template for html -> html
"autocmd BufNewFile,BufRead *.p? compiler perl " perl comiler
""au! Syntax tt source $VIM/tt.vim
"au FileType cpp,c setl mp=make\ %:t:r
" ======================================================================
" 폴더 설정이 되어 있는 파일을 열었을때 폴더 되어 있는 레벨을 설정한다.
" 기본값 0이고 모두 폴딩된다.
" ======================================================================
"set fdl=1
" ======================================================================
" 소스파일이 폴딩 되어 있을때 폴딩범위를 보여주는 컬럼의 수를 설정한다.
" ======================================================================
"set fdc=3
" This is for vertical indenting
set list
set listchars=tab:\|\
" NOTE the space char after last backslash.
hi CursorLine cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
" hi CursorColumn cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
" nnoremap <Leader>c :set cursorline! cursorcolumn!<CR>
nnoremap <Leader>c :set cursorline!<CR>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Plug-in 설정
"""'"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let Tlist_Use_Right_Window=1 "분할 창을 오른쪽에 배치
let Tlist_Inc_Winwidth = 0 "콘솔창에서 VIM 사용하기
let Tlist_Auto_Open =0 "vi 실행시 TagList 자동 실행
" OmniCppComplete plugin settings
autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
autocmd InsertLeave * if pumvisible() == 0|pclose|endif
let OmniCpp_GlobalScopeSearch = 1
let OmniCpp_NamespaceSearch = 1
let OmniCpp_DisplayMode = 0
let OmniCpp_ShowScopeInAbbr = 0
let OmniCpp_ShowPrototypeInAbbr = 0
let OmniCpp_ShowAccess = 1
let OmniCpp_DefaultNamespaces = []
let OmniCpp_MayCompleteDot = 1
let OmniCpp_MayCompleteArrow = 1
let OmniCpp_MayCompleteScope = 0
let OmniCpp_SelectFirstItem = 0
let OmniCpp_LocalSearchDecl = 0
let g:acp_enableAtStartup = 0
let g:Grep_Skip_Dirs=".svn"
let Grep_Path = '/bin/grep'
let Grep_OpenQuickfixWindow = 1
let Grep_Default_Options = '-rn'
nnoremap <silent> <F9> :Rgrep<CR>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" for numpad
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
inoremap <Esc>Oq 1
inoremap <Esc>Or 2
inoremap <Esc>Os 3
inoremap <Esc>Ot 4
inoremap <Esc>Ou 5
inoremap <Esc>Ov 6
inoremap <Esc>Ow 7
inoremap <Esc>Ox 8
inoremap <Esc>Oy 9
inoremap <Esc>Op 0
inoremap <Esc>On .
inoremap <Esc>OQ /
inoremap <Esc>OR *
inoremap <Esc>Ol +
inoremap <Esc>OS -
inoremap <silent> <C-k> <Esc>ld$a
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 단축키 설정
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 태그리스트 업데이트
"nnoremap <silent> <F7> :TlistUpdate<CR>
" 태그리스트 토글
"nnoremap <silent> <F8> :Tlist<CR>
" 현재 커서의 태그리스트 출력
"nnoremap <silent> <F9> :TlistSync<CR>
map <F2> :tabnew<CR>
nnoremap <silent> <F3> :BufExplorer<CR>
nnoremap <silent> <F4> :NERDTreeToggle<CR>
"F6은 파일 비교하기, Ctrl+F6로 파일 비교하기 해제 "
map <F6> :diffthis<CR><C-w><C-w>:diffthis<CR>
map <C-F6> :diffoff<CR><C-w><C-w>:diffoff<CR>
" F7은 Hex 모드 "
map <F7> :%!xxd<CR>
map <C-F7> :%!xxd -r<CR>
" F8은 ctags 생성 "
map <F8> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR><CR>
map <F12> :QuickRun<CR>
nmap \sh :vnew \| ConqueTerm bash<CR>
nmap \o :NERDTree<CR>
" Ctrl+k는 폴딩 접기, Ctrl+j로 폴딩 열기 "
map <C-k> v]}zf<CR>
map <C-j> zo<CR>
"F2 탭 열기. Ctrl+h,l로 이동
map <C-h> gT
map <C-l> gt
"vnoremap <C-Insert> "+y
"map <S-Insert> "+gP
" Ctrl + a 모두 클립보드로 복사
" map <C-a> mzggVG"+y`z
" emacs like movement
map <C-a> 0
map <C-e> $
" Ctrl + 위, 아래 화면 스크롤
map [1;5A <C-y>
map [1;5B <C-e>
" 전체 자동 들여쓰기
nmap == mmggVG=`m
" DifDiff
let g:DirDiffDynamicDiffText = 1
" ===========================================================
" Abbreviations
" ===========================================================
ia #i #include
ia #d #define
" ===========================================================
" Command
" ===========================================================
":Html -> syntax highlighted html
com -nargs=0 Html :so $VIMRUNTIME/syntax/2html.vim