Friday, July 29, 2011

Re: question about 'isfname'

On Friday, July 29, 2011 15:58:03 sc wrote:

> list--

> i like to grep and pipe the results into an unnamed hidden vim
> buffer so when i see a module i want to edit i can hit F4 on
> it

> i have F4 defined as

> map <F4> :call OpenWhat()<CR>
> function! OpenWhat()
> let testme = expand("<cfile>")
> if isdirectory(testme)
> call CdMaik()
> else
> e <cfile>
> endif
> endfunction

> the relevant portion being the edit of <cfile>

> a typical chunk of grep output might look like the following:

> hl:open(PRS, ".prime_run_start");
> hl2:open(PRS, ".prime_run_start");
> inst:echo "restoreprs restores .prime_run_start from
> save_prs" inst:echo "saveprs saves .prime_run_start to
> save_prs" nmt:open(PRS, ".prime_run_start");

> when it first comes up, F4 performs fine and i am able to edit
> for example 'hl' because the default value for 'isfname' does
> not include ':'

> however, when 'hl' is a perl module, 'isfname' gets redefined
> by $RUNTIME/ftplugin/perl.vim so when i quit or bp back to the
> unnamed buffer with the grep output my F4 no longer works --
> perl.vim adds ':' to 'isfname' and now it would try to open
> 'hl:open', creating a new file by that name

> according to the help isfname is a global option so forcing
> perl.vim to perform a setlocal would have no effect

as suggested in perl.vim i created an after/ftplugin/perl.vim
containing set isfname-=:

this works, but it bothers me for reasons i don't understand

is there a better way?

sc

--
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