Questions tagged [path]

Questions about the usage of the Vim's path variable. this variable lists the directories which will be searched with commands like `gf`, [f, ]f, ^Wf, `:find`, `:sfind`, `:tabfind`

Filter by
Sorted by
Tagged with
2
votes
1answer
33 views

file search with :e

When open a file with :e, it have to be tell the exact path of the file, and even the temporary file will be listed, is there anyway to do Open a file with only name, and let it automatically search ...
0
votes
1answer
22 views

Adding directory (header and source) to autocompletition search

I use Ctrl+P and Ctrl-N for autocompletition, and since I have library sources in another directory, like /opt/ST/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/inc /opt/ST/...
0
votes
1answer
26 views

How to use variables in a user defined command? [duplicate]

I have this user defined command: command! PS silent! w | PlugSnapshot! ~/.vim/plugins/plugins.lock How could I change it to take the filepath from a variable, something like this: let ...
0
votes
1answer
63 views

Expanding variables in path

Background I work a lot in the twig template language, and make use of path variables. For example, an include might look like {% include "@my_path_var/my_folder/my-template.twig" %} The @...
0
votes
1answer
132 views

How to compile vim for user only and use git to track it?

How can I compile vim for my user only so set source path to /home/user/ ? And how can I track changes with git. Basically I want to build and compile vim from source, and store it on my github repo....
1
vote
1answer
67 views

Automatically update import path if file is moved in Vim

Is there a way in which if you move file A to another location and there are other files that have imported file A, the import path will change accordingly in Vim? PyCharm has this and I was ...
0
votes
1answer
162 views

Error occurs while echoing system('echo %PATH%')

I'm currently using gvim 8.0 on Windows 10. When I try to do the following command, :echo system('echo %PATH%') I get the following error. E484: Can't open file C:/Users/BITS_A~1/AppData/Local/Temp/...
1
vote
2answers
505 views

shortcut of the current directory path when vsplit/split

I very often need to open files through vsplit/split. Very often I want to open files in the same directory. Still, I must pass their paths to vsplit/split. :vsplit @/siblingfile.txt @ is an alias ...
2
votes
1answer
857 views

How to set the vim path to your bash PATH?

I'd like my $PATH to be available to vim when running commands with !. How do I set vim's set path= to my environment variable $PATH?
1
vote
2answers
170 views

User command with modified 'path' completion?

I'm trying to write a wrapper command around :edit or :find specifically to open either my vimrc or a subpath of ~/.vim/ (e.g. ~.vim/autoloads/foo.vim). If I run the command with no arguments, it ...
3
votes
2answers
829 views

path seperator in vim

I have a vim script, which uses Unix type path separator as: "Prg: Expand snippets {{{! let s:plugin_dir=filter(split(&rtp, ','), 'v:val =~ "/vimf90"')[0] let s:templatedir=s:plugin_dir . '/...
1
vote
0answers
65 views

Why is filetype not set after :find from autocmd?

Objective I want vi file to act like :find file if file doesn't exist. That is, I want to be able to edit a file by name, without giving a path to the file, from the command line: mkdir -p a/b/c ...
1
vote
1answer
42 views

Getting the path with a function key

I need to get the path and file name out of the open file. Wrinkle .. The file is FTP'd to my Desktop and I need the Linux path. I found this on the web that prints the path file name noremap <...
1
vote
1answer
411 views

vim cannot access variable in autocmd

I am trying to configure prettier-eslint and prettier-standard as the js formatter with neoformat: " neoformat should try formatprg where available let g:neoformat_try_formatprg = 1 augroup vimrc " ...
5
votes
1answer
2k views

Ignore folders when performing :find command

I'm using the :find command as my "fuzzy file searcher" in Vim. My setup: set path=,,** nnoremap <leader>f :find * However, I'm having trouble ignoring folders. Huge folders that contain ...
2
votes
2answers
515 views

vim sometimes displays full path of file instead of just the filename?

This may seem a little nit-picky, but I like using the wildmenu to switch between buffers: I do :b and then hit tab until I get to the file I want. The problem is that sometimes, vim shows the entire ...
2
votes
0answers
222 views

syntastic not working on macvim, but works perfectly fine on the terminal

I have an issue where in MacVim, I don't get any syntastic/eslint related functionality. When I run !which eslint in macvim, I get "eslint not found" - eslint is definitely installed. If I run !...
1
vote
1answer
53 views

Is it possible to define the pwd for an external command runs in without changing VIM's pwd?

Im experiencing some problems running a command that reports paths based on the $PWD. To correctly parse its output I need it to run from a different directory, however, I would rather not have to cd ...
4
votes
1answer
509 views

directory path search for :read

When I use :read <filename> in Vim, does it only look in the current working directory? Is there a way to set up vim to have the :read read reference multiple directories when attempting to ...
2
votes
0answers
99 views

The $path used by “:!start cmd” is different from my system $path in windows

So I do a lot of python work in GVim on Windows 7, and I'm running into an annoying roadblock. This might be more of a Windows question, but it's happening in Vim, so ... I have this in my python.vim ...
0
votes
2answers
5k views

Access a file under subdirectories of a path through gf command

I am using perl. When I press gf while having the cursor on Testcase, it shows E447: Can't find file "Testcase.pm" in path. So I added that path. It works for files under particular path which ...
4
votes
1answer
380 views

Current VimL script path from inside a function

How do I get the path to the currently executing VimL script from inside a function? I know from outside a function, you can use expand('<sfile>'), but if you call that inside a function, you ...
3
votes
2answers
619 views

How do I get “~” (tilde) to expand when using File Name Completion in Insert Mode?

I often complete file paths in Vim using Ctrl-x Ctrl-f in insert mode, but there is one annoyance: the tilde character does not expand. This is fine for things like bash, but for Python (which does ...
10
votes
2answers
2k views

Is Vim's default 'path' option redundant?

From Vim's help document (see: :help 'path'): 'path' String(default on Unix: ".,/usr/include,,") -To search relative to the directory of the current file, use: :set path=. -To search in ...
4
votes
1answer
119 views

Prevent ^X^F from expanding $HOME

For example, I want to write $HOME/.vim/ and complete the path with i_CTRL-X_CTRL-F so that it becomes: $HOME/.vim/syntax/ But what I get is: /home/username/.vim/syntax/ One workaround I've ...
5
votes
3answers
2k views

How to return to netrw from a file

Suppose that I'm editing a file, then I press :w to store it. And then I use :e. to navigate its containing folder in the netrw. Suppose its containing folder is ./A/B/. In netrw, I open a file with ...
2
votes
1answer
154 views

How to show the path to the current opened file?

If I open a file in vi like: vi /etc/httpd/conf/httpd.conf Then vi shows in the bottom left corner of the window: "/etc/httpd/conf/httpd.conf" 1009L, 34418C But when I edit the file with a or i ...
6
votes
1answer
4k views

Set path to location of tags file

I think this is not quite a duplicate, although it's close. I often work with multiple, slightly different, checkouts of the same multi-directory project. I'd like to be able to jump around using ...
11
votes
3answers
1k views

Efficient way to find & open files deep in a project tree?

Without plugins like ctrlp and NERDTree, what would be the most efficient way to find and open files deep in a project tree? Setting the path to **/* results in useless files in .git and other ...
4
votes
2answers
1k views

Quickfix with makeprg running in a different directory

How can I start a build with my makeprg running in a different directory than the working directory of vim and still catch errors in quickfix so that I can jump between them? The problem is that ...