Steps to reproduce
Default behaviour (no filetype detection)
The default value of 'path' includes . and ,,, which allow us to find files in the directory of the current file and the working directory. This makes it possible to use gf and other commands that depend on 'path' for project-wide navigation out of the box.
-
Create a test directory: $ mkdir testrubypath.
-
Change to that directory: $ cd $_.
-
Create two Ruby files: $ touch a.rb b.rb.
-
Open a.rb in a barebones Vim: $ vim -u NONE a.rb.
-
Check the global value of 'path' with :set path?. The output should be .,/usr/include,,.
-
Add the line below to the buffer and write it:
-
Press gf on the filename. You should jump to b.rb.
Current behaviour (uses $VIMRUNTIME/ftplugin/ruby.vim)
The Ruby ftplugin overrides the default 'path' value in a way that makes it impossible to use gf and other commands that depend on 'path' for project-wide navigation.
-
In the same directory as above, start a clean Vim: $ vim --clean.
-
Check the global value of 'path' with :set path?. The output should be .,/usr/include,,.
-
Open a.rb: :edit a.rb.
-
Check the local value of 'path' with :setlocal path?. The output should be a comma-separated list of Ruby-specific directories. Something like this (YMMV):
path=/Library/Ruby/Site/2.3.0,/Library/Ruby/Site/2.3.0/x86_64-darwin18,/Library/Ruby/Site/2.3.0/universal-darwin18,/Library/Ruby/Site,/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby/2.3.0,[...]
Note that the default value as disappeared, as well as the possibility to find files in the directory of the current file and the working directory.
-
Press gf on the filename. You should get an E345 error.
Expected behaviour
-
In the same directory as above, start a clean Vim: $ vim --clean.
-
Check the global value of 'path' with :set path?. The output should be .,/usr/include,,.
-
Open a.rb: :edit a.rb.
-
Check the local value of 'path' with :setlocal path?. The output should have a comma-separated list of Ruby-specific directories appended to the default value. Something like this (YMMV):
path=.,/usr/include,,/Library/Ruby/Site/2.3.0,/Library/Ruby/Site/2.3.0/x86_64-darwin18,/Library/Ruby/Site/2.3.0/universal-darwin18,/Library/Ruby/Site,/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby/2.3.0,[...]
-
Press gf on the filename. You should jump to b.rb.
Operating system
Unix-like system
Version of Vim
8.2.3455
Logs and stack traces
No response
Reactions are currently unavailable
Steps to reproduce
Default behaviour (no filetype detection)
The default value of 'path' includes . and ,,, which allow us to find files in the directory of the current file and the working directory. This makes it possible to use gf and other commands that depend on 'path' for project-wide navigation out of the box.
Create a test directory: $ mkdir testrubypath.
Change to that directory: $ cd $_.
Create two Ruby files: $ touch a.rb b.rb.
Open a.rb in a barebones Vim: $ vim -u NONE a.rb.
Check the global value of 'path' with :set path?. The output should be .,/usr/include,,.
Add the line below to the buffer and write it:
Press gf on the filename. You should jump to b.rb.
Current behaviour (uses $VIMRUNTIME/ftplugin/ruby.vim)
The Ruby ftplugin overrides the default 'path' value in a way that makes it impossible to use gf and other commands that depend on 'path' for project-wide navigation.
In the same directory as above, start a clean Vim: $ vim --clean.
Check the global value of 'path' with :set path?. The output should be .,/usr/include,,.
Open a.rb: :edit a.rb.
Check the local value of 'path' with :setlocal path?. The output should be a comma-separated list of Ruby-specific directories. Something like this (YMMV):
Note that the default value as disappeared, as well as the possibility to find files in the directory of the current file and the working directory.
Press gf on the filename. You should get an E345 error.
Expected behaviour
In the same directory as above, start a clean Vim: $ vim --clean.
Check the global value of 'path' with :set path?. The output should be .,/usr/include,,.
Open a.rb: :edit a.rb.
Check the local value of 'path' with :setlocal path?. The output should have a comma-separated list of Ruby-specific directories appended to the default value. Something like this (YMMV):
Press gf on the filename. You should jump to b.rb.
Operating system
Unix-like system
Version of Vim
8.2.3455
Logs and stack traces
No response