Skip to main content

Posts

Showing posts with the label vim

vi for binary

vim -b filename 으로 해서 %! xxd로 hex로 변환한 후 %! xxd -r 로 원복이 가능하나, 제대로 되지 않는 경우가 있다. 그럴 시에, bvi (binary vi)로 사용한다. 명령러 목록은 아래를 참조할 것. http://bvi.sourceforge.net/edit.html

vim cpp code completion

OmniCppComplete Ctag database와 연동하여 code complete기능을 추가한 플러그인 http://vim.wikia.com/wiki/C%2B%2B_code_completion http://www.vim.org/scripts/script.php?script_id=1520 아래와 같이 li을 입력 후, . 를 입력하면, IDE에서처럼 code complete가 표시된다. 또한, std::를 입력하면 code complete가 된다.

dotvimrc

scriptencoding=utf-8 set mouse=a set tags=./tags,../tags,../../tags,../../../tags,tags function! Komment() if getline(".") =~ '\/\*' let hls=@/ s/^\/\*// s/*\/$// let @/=hls else let hls=@/ s/^/\/*/ s/$/*\// let @/=hls endif endfunction function! C_comment() let hls=@/ s/^/\/\// let @/=hls endfunction function! C2_comment() let hls=@/ s/^/"/ let @/=hls endfunction function! C3_comment() let hls=@/ s/^/#/ let @/=hls endfunction function! HTML_comment() let hls=@/ s/^/ / let @/=hls endfunction function! UNcomment() let hls=@/ if getline(".") =~ '\/\/' s/^\/\/// "for c elseif getline(".") =~ '\"' s/^"// elseif getline(".") =~ '#' s/^#// elseif getline(".") =~ '#$' s/^#$/$/ endif let @/=hls endfunction map ,/ :call C_comment() map ,\ :call Komment() map ," :call C2_comment() map ,# :call C3_comment() map ,...
vim tips how to execute a shell command r !command 문자코드 지정 읽기 vim  "+e ++enc=cp932" filename buffer사용 open a file as buffer :badd f1.txt show list of all the existing buffers :buffers :ls :files go to next buffer :bNext back to previous buffer :bPrevious delete buffer :bdelete f1.txt :bdelete 4 Folding creating fold or delete zr : create folding zd : delete of folding symbol nearby curosr, e.g., {{{ }}} zE : delete of folding symbol all in a current file open & close folding zo : Open one fold under the cursor zO : Open all folds under the curosr recursively zc : Close one fold under the cursor zC : close all folds under the cursor recursively zR : open all folds Moving over folds [z : move to the start of the cureent open fold ]z : move to the end of the current open fold zj : move downwards to the start of the next fold zk : move upwards to the end of the previous fold Bookmark m{a-zA-Z} : set mark {a-zA-Z...

vim ctag cscope

vim + cscope + exuberant-ctags first : checking vim configure confirm: vim --enable-cscope find | grep "\.c$\|\.h$" > cscope.files cscope -b ctag -L cscope.files ;ctag is exuberant-ctags Ctrl-\ c : find the callers of a routine. Ctrl-\ s : find the uses of a symbol Ctrl-[ Ctrl-[ s : vertical split find the uses of a symbol To update a cscope database without closing vim ":!cscope -b", then ":cs reset" more information http://www.fsl.cs.sunysb.edu/~rick/cscope.html
mxmlファイル設定 1.download mxml.vim and actionscript.vim from www.vim.org 2. edit vim configure file autocmd BufRead *.mxml set filetype=mxml syntax=mxml au! FileType xml,sgml,entity,xslt,svg,xhtml,xsl,xsd \ if !exists("b:match_words") | \ let b:match_ignorecase=0 | let b:match_words = \ ' ,' . \ ' ,'. \ ' ,'. \ ' /]\+\)\%(\s\+[^>]*\%([^/]>\|$\)\|>\|$\): ,'. \ ' /]\+\)\%(\s\+[^/>]*\|$\):/>' \ | endif
set tags=./tags,../tags,../../tags,../../../tags,tags function! Komment() if getline(".") =~ '\/\*' let hls=@/ s/^\/\*// s/*\/$// let @/=hls else let hls=@/ s/^/\/*/ s/$/*\// let @/=hls endif endfunction function! C_comment() let hls=@/ s/^/\/\// let @/=hls endfunction function! C2_comment() let hls=@/ s/^/"/ let @/=hls endfunction function! C3_comment() let hls=@/ s/^/#/ let @/=hls endfunction function! UNcomment() let hls=@/ if getline(".") =~ '\/\/' s/^\/\/// "for c elseif getline(".") =~ '\"' s/^"// elseif getline(".") =~ '#' s/^#// elseif getline(".") =~ '#$' s/^#$/$/ endif let @/=hls endfunction map ,/ :call C_comment() map ,\ :call Komment() map ," :call C2_comment() map ,# :call C3_comment() map ,c :call UNcomment() colorscheme torte set nu set hlsearch set nocompatible set backspace=2 set autoindent se...
gvim 환경변수설정 vi ~/.vimrc // 추가 및 변경하자.ㅋ " customize colorscheme blue set nu set au set nocompatible " Vim 디폴트 기능들을 사용함 " set backspace=2 " 삽입 모드에서 백스페이스를 계속 허용 " set autoindent " 자동 들여쓰기 " set cindent " C 언어 자동 들여쓰기 " set smartindent " 역시 자동 들여쓰기 " set textwidth=90 " 86번째 칸을 넘어가면 자동으로 줄 바꿈 " set nowrapscan " 찾기에서 파일의 맨 끝에 이르면 계속하여 찾지 않음 " set nobackup " 백업파일을 만들지 않음 " set novisualbell " 비주얼벨 기능을 사용하지 않음 " set nojoinspaces " J 명령어로 줄을 붙일 때 마침표 뒤에 한칸만 띔 " set ruler " 상태표시줄에 커서 위치를 보여줌 " set tabstop=4 " 간격 " set shiftwidth=4 " 자동 들여쓰기 간격 " set keywordprg=man\ -a " K를 눌렀을 때 실행할 명령어 " set showcmd " (부분적인) 명령어를 상태라인에 보여줌 " set showmatch " 매치되는 괄호의 반대쪽을 보여줌 " set ignorecase " 찾기에서 대/소문자를 구별하지 않음 " set incsearch " 점진적으로 찾기 " set autowrite " :next 나 :make 같은 명령를 입력하면 자동으로 저장 " ...