포터블로 바꾸는게 덜 귀찮을 듯도..
"""""""""""""""""""""""""""""""""""""
" basic set "
"""""""""""""""""""""""""""""""""""""
syntax on
set cindent
set nu
set ruler
set title
set ts=4 sw=4 sts=4 "set tabstop, shiftwidth, softtabstop
set ls=2 "set laststatus
"colorscheme slate
set fileencodings=utf-8,euc-kr
set nobackup
"set ic "ignorecase
set hlsearch
set path=.,../include
"set makeprg=colormake
set viminfo=
"set cursorline
"set cursorcolumn
set nocompatible
set cino=(0 "http://stackoverflow.com/questions/88931/lining-up-function-parameter-lists-with-vim
"http://stackoverflow.com/questions/1551231/highlight-variable-under-cursor-in-vim-like-in-netbeans
autocmd CursorMoved * exe printf('match IncSearch /\V\<%s\>/', escape(expand('<cword>'), '/\'))
au BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "norm g`\"" |
\ endif
func! ManPage()
let sm = expand("
exe "!man -S 2:3:4:5:6:7:8:9:tcl:n:1:p:o ".sm
endfunc
nnoremap
"copen "for quickfix list. used with cn and cp command. make is only executed in vim-command-mode.
set tags=tags,../tags,../../tags,../../../tags,../../../../tags,../../../../../tags,
set tags+=/usr/include/tags
"""""""""""""""""""""""""""""""""""""
" for code folding "
"""""""""""""""""""""""""""""""""""""
set foldmethod=syntax
set nofoldenable
"""""""""""""""""""""""""""""""""""""
" gvim only "
"""""""""""""""""""""""""""""""""""""
set guifont=consolas:h8
au guienter * winsize 180 64
set guioptions-=T "remove Toolbar
set guioptions-=m "remove Menubar
"Set the window position automatically
"http://jentshin.new21.org/v2006/bbs/view.php?id=study&no=156
augroup my_winpos_au
au!
au GUIEnter * let x=getwinposx()
au GUIEnter * let y=getwinposy()
au GUIEnter * if x > 560
au GUIEnter * let x=560
au GUIEnter * elseif x < 16
au GUIEnter * let x=16
au GUIEnter * endif
au GUIEnter * if y > 170
au GUIEnter * let y=170
au GUIEnter * elseif y < 16
au GUIEnter * let y=16
au GUIEnter * endif
au GUIEnter * exe "winpos " . x y
au GUIEnter * unlet x y
au GUIEnter * au! my_winpos_au
augroup END
"mswin.vim 은 주석처리 @_@
"slate 색 파일에서 PreProc 주석
ctags
- Summary
코드 들의 태그파일<tags> 를 생성
- Usage
command prompt> ctags -R
헤더파일에서 함수 proto-type 가져올 땐 -c-types=+p옵션 추가
- URL
http://ctags.sourceforge.net/
taglist
- Summary
ctags 로 생성된 코드 태그에서 함수/매크로/변수 등을 출력하여 vsw에서 보여줌
- Usage
vim command mode> :Tlist
- URL
http://www.vim.org/scripts/script.php?script_id=273
- Tip
오른쪽에 띄우고 싶으면 플러그인 파일을 열어서 "Tlist_Use_Right_Window" 를 1로 설정
svncommand
- Summary
Subversion (svn) integration plugin
- Usage
- URL
http://www.vim.org/scripts/script.php?script_id=922
- Tip
vim에서 \sv 하면 :SVNVimDiff
NERDTree
- Summary
Explorering filesystem in vim
- Usage
:NERDTree<tab>
- URL
https://raw.github.com/scrooloose/nerdtree/master/plugin/NERD_tree.vim
- Summary
explore code
- Usage
1. make shell-script as following and execute
rm -rf cscope.files
find `pwd` \( -name '*.c' -o -name '*.cpp' -o -name '*.h' \) -print > cscope.files
echo -n "^d" | cscope -i cscope.files
: cs add <cscope.out file path>
: set csverb
3. .vimrc
nmap <C-[>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-[>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-[>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-[>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-[>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-[>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-[>d :cs find d <C-R>=expand("<cword>")<CR><CR>
- 출처 : http://kdsoo.com/1243
- URL
http://cscope.sourceforge.net
- example in vim
: cs find s <SYMBOL>
폴더 컨텍스트 메뉴 레지스트리 (gVim)
- Summary
Windows에서 폴더내의 tags를 자동으로 읽기 위한 컨텍스트 메뉴 (gVim for Windows)
- Usage
폴더명 컨텍스트 메뉴 - gVim
- Download
vim_dir_ctx_menu.reg
for VS6
1.
Tools - Customize - Tools
Cmd : C:\Program Files\Vim\vim73\gvim.exe
Args : $(FilePath) +$(CurLine)
Init Dir : $(FileDir)
2.
Tools - Customize - Keyboard
Category : Tools
Cmd : UserTool8
단축키 할당 (Shift + Alt + G)
/////////////////////////////////
for VS9 ( In vim, :help visvim )
1.
도구 - 외부 도구
Add
Title - Vim
Command - C:\Program Files\Vim\vim73\gvim.exe
Arguments - --servername VS_NET --remote-silent "+call cursor($(CurLine), $(CurCol))" $(ItemPath)
Init Dir - $(ItemDir)
2.
도구 - 옵션 - 환경 - 키보드
"도구.외부명령8"으로 검색하여 단축키 할당 (Shift + Alt + G)
1. vimdiff with subversion on Linux
# Configure your favorite diff program here.
DIFF="/usr/bin/vimdiff"
# Subversion provides the paths we need as the sixth and seventh
# parameters.
LEFT=${6}
RIGHT=${7}
# Call the diff command (change the following line to make sense for
# your merge program).
$DIFF $LEFT $RIGHT
# Return an errorcode of 0 if no differences were detected, 1 if some were.
# Any other errorcode will be treated as fatal.
저장을
그냥 cgdb (http://cgdb.github.io/) 까는게 답이다.
$HOME/.cgdb/cgdbrc 에서 vimrc 포맷대로 소스 윈도우 스타일을 조금 설정할 수 있음.
'Dev./Sec. Study > Tools/Settings' 카테고리의 다른 글
Line Numbers add-in for Visual C++ 6 (0) | 2014.11.24 |
---|---|
MS Visual C++ 6에서 debug 중지 시, 프로세스 좀비되는 버그 (0) | 2014.11.10 |
${HOME}/.emacs (0) | 2013.08.23 |