.vimrc 참고
set nu "set number, nonumber
set ts=4 "set tabstop=4
set sts=4 "set softtabstop=4
set sw=4 "set shiftwidth=4
set ff=unix "set fileformat=unix
set ai "set autoindent, noautoindent
set incsearch "set incsearch, noincsearch
set hlsearch "set hlsearch, nohlsearch //highlight all search matches
set numberwidth=4
set paste
set viminfo^=h
set nowrap
set showmatch
set title
set ruler
" Set 7 lines to the cursor - when moving vertically using j/k
set so=7
" Ignore compiled files
set wildignore=*.o,*~,*.pyc
"http://vim.wikia.com/wiki/Highlight_current_line
set cursorline
"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>d :set cursorline! cursorcolumn!<CR>
nnoremap <silent> <Leader>l ml:execute 'match Search /\%'.line('.').'l/'<CR>
nnoremap <silent> <Leader>c :execute 'match Search /\%'.virtcol('.').'v/'<CR>
autocmd WinEnter * setlocal cursorline
autocmd WinLeave * setlocal nocursorline
"set statusline=\ %<%l:%v\ [%P]%=%a\ %h%m%r\ %F\
set tags=./tags,../tags,../../tags,../../../tags,~/dev/tags
set completeopt=menu,preview,longest
syntax enable
filetype on
"use space instead tab on .c, .cpp, .h, .java
"au Bufenter *.\(c\|cpp\|h\|java\) set et "set expandtab, noexpandtab
set fileencodings=ucs-bom,utf-8,cp949,euc-kr,latin1
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
set termencoding=utf-8
else
set termencoding=cp949
endif
" memory the last cursor
" Only do this part when compiled with support for autocommands
if has("autocmd")
" In text files, always limit the width of text to 78 characters
autocmd BufRead *.txt set tw=78
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal! g'\"" |
\ endif
" don't write swapfile on most commonly used directories for NFS mounts or USB sticks
autocmd BufNewFile,BufReadPre /media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp
" start with spec file template
autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec
endif
" Press F4 to toggle highlighting on/off, and show current value.
noremap <F4> :set hlsearch! hlsearch?<CR>
" Press F8 to highlight matches without moving
nnoremap <F8> :let @/='\<<C-R>=expand("<cword>")<CR>\>'<CR>:set hls<CR>
"indent with tab, shift+tab
vmap <tab> >gv
vmap <s-tab> <gv
"plugin : taglist
let Tlist_Display_Tag_Scope = 1
let Tlist_Display_Prototype = 1
let Tlist_Sort_Type = "name"
"let Tlist_Use_Right_Window = 1
let Tlist_WinWidth = 40
map <F2> :Tlist<cr><c-w><c-w>
map <F3> <c-w><c-w>
"map <F5> :!clear;echo --\>update ctags\'%\';echo \$ctags -R;ctags -R<cr>
map <F5> :!clear;echo --\>update ctags \'%\';echo \$ctags -R;ctags *.c *.h include/*.h<cr>
map <F6> :!clear;echo --\>deletes \'%:r.o\';rm -rf %:r.o<cr>
map <F7> :w<cr>:!clear;echo --\>compiles \'%\';echo \$$CC_VI\ $CFLAGS_VI $LDFLAGS_VI -c -o %:r.o %;$CC_VI $CFLAGS_VI $LDFLAGS_VI -c -o %:r.o %<cr>
map <F10> :!clear;make clean;make 2> .makeout<cr>
map <F1> :!<cr>
"maximize the current split window and even back
map <F12> <C-W>_<C-W><Bar>
map <F11> <C-W>=
nmap <C-Right> :n<cr>
nmap <C-Left> :N<cr>
highlight Pmenu guibg=brown gui=bold
highlight Pmenu ctermbg=red gui=bold
"plugin : supertab
"let supertab-defaultcompletion=<c-p>
"let g:SuperTabDefaultCompletionType=<c-x><c-u>
"Switch between window splits using big J or K and expand the split to its full size.
"Move vertically in the window through the horizontal splits...
map <C-J> <C-w>j<C-w>_
map <C-K> <C-w>k<C-w>_
"Move horizontally in the window through the vertical splits...
map <C-H> <C-w>h<C-w>\|
map <C-L> <C-w>l<C-w>\|
'LINUX' 카테고리의 다른 글
리눅스 telnet (0) | 2012.09.15 |
---|---|
sendmail 관련 (0) | 2012.09.12 |
su 거부 되었을때 (0) | 2010.07.17 |
사용자 추가후 ssh 도 사용가능토록 해줌. (0) | 2010.07.15 |
useradd, adduser 차이 (0) | 2010.05.31 |