On Wed, 21 Jun 2006, A.J.Mechelynck wrote:
Tom Purl wrote:
I've become a very big fan of using the pyGTD <http://96db.com/pyGTD/>
script from within Vim 7. pyGTD creates file output that looks
similar to this:
3.61 1:00 Get your hair cut
C=0 P=4 CRC=33B0 I=4 U=4 T=1H [EMAIL PROTECTED],@Work ID=5
[./inboxes/Shopping-Errands.txt]
3.61 1:00 Cancel Comcast cable internet service
C=0 P=4 CRC=A32D I=4 U=4 T=1H D=2006-06-21 [EMAIL
PROTECTED],@Work ID=7
[./inboxes/Shopping-Errands.txt]
On Linux, I'm able to place my cursor over the file names between
brackets and navigate to them using the `gf` command. On Windows,
however, I get the following error:
E447: Can't find file "[./inboxes/Shopping-Errands.txt]" in path
`gf` works without the brackets on Windows, so I guess I need to find a
way to filter out the brackets when I use that command. Does anyone
have a clue as to how I can do this? Or would this be considered a bug?
Thanks in advance!
Tom Purl
It's not a bug: [] are 'isfname' characters on W32 but not on Unix. IOW, on
Windows (but not on Linux), brackets can be part of a filename.
The quick and dirty solution is ":set isf-=[ isf-=]", but it might break
something else. A possibly less dirty solution would be yi[ (in Normal mode:
yank inner [] block) followed by ":e <Ctrl-R>"<Enter>" (edit the file whose
name is in the unnamed register). If you want a mapping:
:map <F6> yi[:e <C-R>"<CR>
Actually,
vi[gf
would do just fine. If you'd like a count of 3 for 'gf', then do
vi[3gf
See
:help v_gf
:help i[
:help i]
HTH.
--
Gerald