나는 (I 독점적으로 SSH를 사용하기 때문에 리눅스에서 할) 콘솔에서 정력을 실행하고있어 경우에, 나는 종종 정력을 중단 CTRL-Z를 사용합니다. 그럼 내 껍질 물건을하고 fg를 vim로 돌아갑니다.
vim에서 ctags
을 사용하면 매우 유용합니다. - help tags
자세한 내용.
매우 강력한 퍼포 플러그인을 사용합니다 : http://www.vim.org/scripts/script.php?script_id=240. diff 지원은 열려있는 모든 파일을 검토하거나 파일 기록을보고 이전 버전 2 개를 비교할 수 있기 때문에 놀랍습니다. 을보십시오 : PVDiff, : PFilelog 및 : POpened을 시도하십시오.
검색 및 버퍼 창 조작과 같은 많은 매크로를 정의합니다. vim에서 살기 위해 여기에 나열된 흥미로운 매크로/함수가 있습니다.
클립 보드 :
let mapleader=","
" put from clipboard
nmap ,p "*p
" yank to clipboard
nmap ,y "*y
태그 :
" jump to tag in other window
map t :call TagJumpOtherWindow()<cr>
function! TagJumpOtherWindow()
let cw = expand("<cword>")
winc p
exec "tjump " . cw
let @/ = cw
normal z.
winc p
endfunction
스크래치 :
let mapleader=","
nmap ,x0 :e e:/work/scratch0.txt<CR>
nmap ,x1 :e e:/work/scratch1.txt<CR>
nmap ,x2 :e e:/work/scratch2.txt<CR>
nmap ,x3 :e e:/work/scratch3.txt<CR>
nmap ,x4 :e e:/work/scratch4.txt<CR>
nmap ,x5 :e e:/work/scratch5.txt<CR>
nmap ,x6 :e e:/work/scratch6.txt<CR>
nmap ,x7 :e e:/work/scratch7.txt<CR>
nmap ,x8 :e e:/work/scratch8.txt<CR>
nmap ,x9 :e e:/work/scratch9.txt<CR>
IDE : 나는 한 번에 일 오픈 한 정력 창을 유지
function! GetMsdevFile(line)
let mx = '^\s*\([a-zA-Z_/\.0-9:\- ]*\)'
let line = matchstr(a:line, mx)
let file = substitute(line, mx, '\1', '')
let file = substitute(line, '\\', '/', '')
return file
endfunction
function! GetMsdevLineNumber(line)
let mx = '^\s*\([a-zA-Z_/\.0-9:\- ]*\)(\(\d\+\))'
let line = matchstr(a:line, mx)
let linenumber = substitute(line, mx, '\2', '')
return linenumber
endfunction
function! GetMsdevFile2(line)
let file = expand("%:p:h") . "/" . GetMsdevFile(a:line)
let file
return file
endfunction
function! GetMsdevFile2(line)
let file = expand("%:p:h") . "/../" . GetMsdevFile(a:line)
let file
return file
endfunction
function! GotoMsdevMake(thiswin, version)
exec "cd ".$DIRECTORY."\\.."
let l = getline(".")
if a:version==0
let file = GetMsdevFile(l)
let linenumber = GetMsdevLineNumber(l)
elseif a:version==1
let file = GetMsdevFile2(l)
let linenumber = GetMsdevLineNumber(l)
else
let file = GetMsdevFile3(l)
let linenumber = GetMsdevLineNumber(l)
endif
if a:thiswin==1
winc p
endif
exec "e +" . linenumber. " " . file
exec "cd -"
endfunction
function! GetGCCFile(line)
let mx = '^\([a-zA-Z_/\.0-9:\- ]*\):[0-9]\+: .*'
let line = matchstr(a:line, mx)
let file = substitute(line, mx, '\1', '')
let file = substitute(file, '\\', '/', '')
return file
endfunction
function! GetGCCLineNumber(line)
let mx = '^\([a-zA-Z_/\.0-9:\- ]*\):\([0-9]\+\):.*'
let line = matchstr(a:line, mx)
let linenumber = substitute(line, mx, '\2', '')
return linenumber
endfunction
function! GotoGCCMake()
exec "cd ".$DIRECTORY."\\.."
let l = getline(".")
let file = GetGCCFile(l)
let linenumber = GetGCCLineNumber(l)
winc p
exec "e +" . linenumber. " " . file
exec "cd -"
endfunction
function! MakeOut(filename)
exec ":e " . a:filename
call MakeBuffer()
normal zz
endfunction
" use the current buffer into a Visual Studio build output buffer to jump to errors
function! MakeBuffer()
normal! gg
exec "/).*error\\|failed"
nnoremap <buffer> <cr> :call GotoMsdevMake(1, 0)<cr>
nnoremap <buffer> :call GotoMsdevMake(1, 1)<cr>
nnoremap <buffer> o :call GotoMsdevMake(1, 1)<cr>
" nnoremap <buffer> :call GotoMsdevMake(0, 0)<cr>
endfunction
" use the current buffer into a GCC build output buffer to jump to errors
function! MakeGCCErr()
normal! gg
exec "/: error:"
nnoremap <buffer> <cr> :call GotoGCCMake()<cr>
nnoremap <buffer> :call GotoGCCMake()<cr>
nnoremap <buffer> o :call GotoGCCMake()<cr>
endfunction
function! MakeGCCOut(filename)
exec ":e " . a:filename
call MakeGCCErr()
endfunction
nmap ,mr :call MakeOut("e:/perforce/branch/obj/release/BuildLog.htm")<cr>
nmap ,md :call MakeOut("e:/perforce/branch/obj/debug/BuildLog.htm")<cr>
nmap ,mm :call MakeBuffer()<CR>
nmap ,mq :call MakeGCCErr()<cr>
vim을 닫지 마십시오 ... – aqua
another open? Doe는 도움이 안돼. –
화면 세션에서 vim을 실행하여 여러 파일을 편집하는 방법은 무엇입니까? 한 번에 하나의 파일을 편집 중입니다! 플러그인에 대해 물어보기 전에 실제로 버퍼와 탭을 배우려고 노력해야합니다. –