On Mon, Sep 17, 2012 at 3:34 PM, Ben Fritz <fritzophrenic@gmail.com> wrote:
I read through the command-t docs because I thought maybe it had an option to search the 'path' instead of only the current directory. It doesn't, but the plugin DOES allow for specifying the top-level path.On Sunday, September 16, 2012 8:46:42 PM UTC-5, Tony Mechelynck wrote:
> On 16/09/12 22:46, shawn wilson wrote:
>
> > On Sun, Sep 16, 2012 at 6:38 PM, Tony Mechelynck
>
> > <antoine.mechelynck@gmail.com> wrote:
>
> >> On 16/09/12 20:08, shawn wilson wrote:
>
> >>>
>
> >>> i like autochdir so that i can easily rename files and :E stuff where
>
> >>> i am. but, then if i use command-t again, it is limited to the current
>
> >>> directory. how do i make the pwd of certain commands the path vim was
>
> >>> opened in and the pwd of another set of commands the pwd of the file
>
> >>> of the current buffer?
>
> >>>
>
> >>
>
> >> What about not using 'autochdir' but
>
> >>
>
> >> :lcd %:h
>
> >>
>
> >
>
> > that's not a bad solution. is there a way of getting the directory
>
> > where i opened vim back? so, basically some way of toggling between
>
> > the path of the file and the path i opened vim in? i could map it to
>
> > an f-key and be fine with that...
>
> >
>
>
>
> Hm... I thought there was a way to unset the lcd (like there are ways to
>
> set a local option back to the global setting, or any option to the Vi
>
> or Vim default), but I can't find it in the help. So here's a
>
> workaround, to be added to your vimrc
>
>
>
> either (F5 to toggle)
>
>
>
> let <SID>curdir = getcwd()
>
> map <F5> :if getcwd() == <SID>curdir <Bar> lcd %:h <Bar> else <Bar> exe
>
> 'lcd' <SID>curdir <Bar> endif<CR>
>
>
>
> or (F5 to set, Shift-F5 to clear)
>
>
>
> let <SID>curdir = getcwd()
>
> map <F5> :lcd %:h<CR>
>
> map <S-F5> :exe 'lcd' <SID>curdir<CR>
>
>
>
> Note that :lcd %:h while "editing a directory" with netrw will set the
>
> current directory to the _parent_ of the directory being displayed. Use
>
> :lcd % (which doesn't work when editing a file) to set it to that
>
> directory itself.
>
So to simplify, you could do something like this instead:
let s:cmdt_root = getcwd()
map <F5> :exe 'CommandT' s:cmdt_root
huh, must've missed that (though i'd've failed on the script before this exchange anyway) but, now that it's done, i sorta like the manual toggle solution. i don't think i want that option taken away now that i have it :)
-- You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment