Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Last cdargs directory #1

Merged
merged 1 commit into from over 2 years ago

2 participants

Olexiy Zamkoviy Chris Gaffney
Olexiy Zamkoviy
html commented June 04, 2011

Added ability to show last cdargs directory we entered in statusline

Chris Gaffney gaffneyc merged commit 3e4b996 into from August 31, 2011
Chris Gaffney gaffneyc closed this August 31, 2011
Chris Gaffney
Owner

Thanks! Sorry it's taken so long to get this merged in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jun 04, 2011
Olexiy Zamkoviy Added function that returns last cdargs directory we entered 223dace
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 9 additions and 0 deletions. Show diff stats Hide diff stats

  1. 9  cdargs.vim
9  cdargs.vim
@@ -35,6 +35,7 @@ let g:loaded_cdargs = 1
35 35
 
36 36
 " What file to read
37 37
 let s:cdargs_file = $HOME . '/.cdargs'
  38
+let g:cdargs_current_directory = ''
38 39
 
39 40
 " Bookmark caching
40 41
 let s:cached_bookmarks = {}
@@ -235,6 +236,10 @@ function! s:execute(command, raw)
235 236
   " Escape spaces in the path
236 237
   let l:path = substitute(s:path_for(a:raw), " ", '\\ ', "g")
237 238
 
  239
+  if a:command == 'cd'
  240
+    let g:cdargs_current_directory = split(a:raw, '/')[0]
  241
+  endif
  242
+
238 243
   if strlen(l:path)
239 244
     try
240 245
       execute a:command . ' ' . l:path
@@ -244,6 +249,10 @@ function! s:execute(command, raw)
244 249
   end
245 250
 endfunction
246 251
 
  252
+function! CdargsCurrentDirectory()
  253
+  return g:cdargs_current_directory
  254
+endfunction
  255
+
247 256
 " Change working directory to bookmark or it's subpath
248 257
 command! -nargs=1 -complete=customlist,s:directory_completion Cdb call s:execute('cd', <f-args>)
249 258
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.