[vim] NewFromFile snippet

看板Editor (編輯器(vim/emacs))作者 (c9s)時間15年前 (2010/02/06 17:28), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
http://gist.github.com/296629 fun! s:NewFromFile(file) let file = a:file if strlen( a:file ) == 0 let file = expand('%') endif let newfile = input('New Filename:',file,'file') cal system(printf('cp %s %s',file,newfile)) exec 'tabedit ' . newfile endf com! -nargs=? -complete=file NewFromFile :cal s:NewFromFile(<q-args>) " Usage: :NewFromFile (current editing file) :NewFromFile path/to/file completion supported. -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.38.15.179 ※ 編輯: kornelius 來自: 114.38.15.179 (02/06 17:28)
文章代碼(AID): #1BRJPDkr (Editor)
文章代碼(AID): #1BRJPDkr (Editor)