Skip to content
Browse files

Merge pull request #1 from html/master

Last cdargs directory
  • Loading branch information...
2 parents 67b1ab6 + 223dace commit 3e4b99694c0e91f0fa95c1d48c6b046cc6eebaf3 @gaffneyc committed Aug 31, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 cdargs.vim
View
9 cdargs.vim
@@ -35,6 +35,7 @@ let g:loaded_cdargs = 1
" What file to read
let s:cdargs_file = $HOME . '/.cdargs'
+let g:cdargs_current_directory = ''
" Bookmark caching
let s:cached_bookmarks = {}
@@ -235,6 +236,10 @@ function! s:execute(command, raw)
" Escape spaces in the path
let l:path = substitute(s:path_for(a:raw), " ", '\\ ', "g")
+ if a:command == 'cd'
+ let g:cdargs_current_directory = split(a:raw, '/')[0]
+ endif
+
if strlen(l:path)
try
execute a:command . ' ' . l:path
@@ -244,6 +249,10 @@ function! s:execute(command, raw)
end
endfunction
+function! CdargsCurrentDirectory()
+ return g:cdargs_current_directory
+endfunction
+
" Change working directory to bookmark or it's subpath
command! -nargs=1 -complete=customlist,s:directory_completion Cdb call s:execute('cd', <f-args>)

0 comments on commit 3e4b996

Please sign in to comment.
Something went wrong with that request. Please try again.