반응형
VIM 편집기를 사용할 때, .vimrc 파일을 잘 작성하면 IDE만큼 편하게 쓸 수 있다.
각 항목을 잘 이해하고 .vimrc 파일을 설정하면 좋겠지만, 귀찮으면 그냥 아래 내용을 copy & paste하면 된다. :D
" " Filename: .vimrc " syntax on color koehler set expandtab " tab character를 whitespace로 자동 변환 set tags=./tags,/root/tags set fileencodings=utf8,euc-kr set smartcase " 대문자가 검색어 문자열에 포함될 때에는 noignorecase set ignorecase " 검색시 대소문자 무시 set hlsearch " 검색시 하이라이트(색상 강조) set incsearch " 검색 키워드 입력시 한 글자 입력할 때마다 점진 검색 set ruler " 현재 커서 위치 (row, col) 좌표 출력 set noerrorbells " 에러 알림음 끄기 set bs=indent,eol,start " backspace 키 사용 가능 set background=dark " 검정배경을 사용할 때, (이 색상에 맞춰 문법 하이라이트 색상이 달라짐.) set wmnu " tab 자동완성시 가능한 목록을 보여줌 set shiftwidth=4 " shift를 4칸으로 ( >, >>, <, << 등의 명령어) set tabstop=4 " tab을 4칸으로 "set tabstop=4 softtabstop=4 shiftwidth=4 set noimd " no imdisable 한글 입력기 관련 set ai " autoindent 자동 들여쓰기 set smartindent " 자동 들여쓰기 " set cindent " C언어 자동 들여쓰기 set laststatus=2 " 상태바를 언제나 표시할 것 set sm " 매치되는 괄호 표시 (= showmatch) set history=1000 " vi 편집기록 기억갯수 .viminfo에 기록 " 마지막으로 수정된 곳에 커서를 위치함 au BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "norm g`\"" | \ endif au BufNewFile,BufReadPost *.c,*.h set cindent au BufNewFile,BufReadPost *.cpp,*.cc source $VIM/syntax/cpp.vim au BufNewFile,BufReadPost *.cpp,*.cc set cindent au BufNewFile,BufReadPost *.go source $HOME/Git/shell_config/go.vim au BufNewFile,BufReadPost *.tex source $VIM/syntax/tex.vim au BufNewFile,BufReadPost *.tex set autoindent au BufNewFile,BufReadPost *.java source $VIM/syntax/java.vim au BufNewFile,BufReadPost *.java set cindent au BufNewFile,BufReadPost *.html,*.htm source $VIM/syntax/html.vim au BufNewFile,BufReadPost *.html,*.htm set smartindent " Move tab for multiple files open nnoremap <TAB> <C-W>w nnoremap <S-TAB> <C-W>W " vim-commentary map gc <Plug>Commentary nmap gcc <Plug>CommentaryLine imap ,for for (idx = 0; idx < ; idx++) {<ENTER>} imap ,if if () {<ENTER>}<ESC>kf(a imap ,wh while () {<ENTER>}<ESC>kf(a imap ,pr printf("%s %s(%d) \n", __func__, __FILE__, __LINE__); ab _a@ #if 0 /* I would not use the following code */ <CR>#else<CR>#endif " ctrl-j 로 라인을 분리. nnoremap <NL> i<CR><ESC> " copy , paste , select 기능 보완 ------------------------------- noremap <Space>y "+y nnoremap <Space>p "+p nnoremap <Space>a gg<S-v>G " navigation 기능 보완 --------------------------------- nnoremap <Space>h ^ nnoremap <Space>l $ noremap <Space>j 8j noremap <Space>k 8k ab _el MYLOG_ERR("%s:: \n", __func__); ab _sl MYLOG_SVC("%s::success\n", __func__); ab _dl MYLOG_DBG("%s:: \n", __func__);
'Ubuntu' 카테고리의 다른 글
openssl command example (0) | 2021.11.04 |
---|---|
.bashrc 또는 .bash_profile 설정 (0) | 2021.07.22 |
iptables and netfilter (1) | 2021.07.10 |
tcpdump로 HTTP Packet Decode 하기 및 tshark 사용법 (0) | 2021.07.10 |
sudoers 설정 (암호 입력 없이 root 사용자 권한 얻기) (0) | 2021.07.10 |