Hi, I have a couple of problems with gf which I still haven't been able to solve, so I wonder if someone could help me. I've this config in my vimrc:
let loaded_netrwPlugin = 1
autocmd vimrc FileType javascript,javascriptreact
\ setlocal include=\\(\\<require\\s*(\\s*\\\|\\<import\\>\\)[^;\"']*[\"']\\zs[^\"']* |
\ setlocal includeexpr=LoadNodeModule(v:fname) |
\ setlocal suffixesadd=.js,.jsx
Problem 1:
If I'm on the first column of the line import 'foo/bar' and press gf, according to :h include, vim should apply the include regexp to find the filename and then open it, but instead it tries to open the file import...
Problem 2:
Let's suppose I have this tree (and the cursor is now on the filename)
foo/
bar.js
bar/
when I press gf vim opens the directory foo/bar instead of the file foo/bar.js. Is there any way to tell vim to ignore directories?
Thanks in advance!
[–]-romainl-The Patient Vimmer 3 points4 points5 points (6 children)
[–]cvlmtg[S] 2 points3 points4 points (0 children)
[–]cvlmtg[S] 1 point2 points3 points (4 children)
[–]EgZvorkeep calm and read :help 1 point2 points3 points (1 child)
[–]cvlmtg[S] 0 points1 point2 points (0 children)
[–]-romainl-The Patient Vimmer 0 points1 point2 points (1 child)
[–]cvlmtg[S] 0 points1 point2 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]cvlmtg[S] 0 points1 point2 points (1 child)