Created
September 30, 2010 13:06
-
-
Save tyru/604543 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " :TabpageCD - wrapper of :cd to keep cwd for each tabpage "{{{ | |
| " AlterCommand cd TabpageCD | |
| " nnoremap ,cd :<C-u>TabpageCD %:p:h<CR> | |
| command! | |
| \ -bar -complete=dir -nargs=? | |
| \ CD | |
| \ TabpageCD <args> | |
| command! | |
| \ -bar -complete=dir -nargs=? | |
| \ TabpageCD | |
| \ execute 'cd' fnameescape(expand(<q-args>)) | |
| \ | let t:cwd = getcwd() | |
| autocmd TabEnter * | |
| \ if exists('t:cwd') && !isdirectory(t:cwd) | |
| \ | unlet t:cwd | |
| \ | endif | |
| \ | if !exists('t:cwd') | |
| \ | let t:cwd = getcwd() | |
| \ | endif | |
| \ | execute 'cd' fnameescape(expand(t:cwd)) | |
| " }}} |
Author
そこはオリジナルのkanaさんのも同じでなんとなくそのままにしちゃったんですよね。
https://github.com/kana/config/blob/master/vim/personal/dot.vimrc (700行目あたり、blobのURLどんなのだか忘れた...)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ではだめですか?