Questions tagged [filenames]
The filenames tag has no usage guidance.
19
questions
2
votes
0
answers
52
views
`E93: More than one match` when `<C-d>` shows only one match
When jumping between buffers in Vim, most the time things work quite smoothly.
I like to jump to buffers by writing :b something1*something2, checking if the match is unique by invoking C-d, and if so ...
1
vote
2
answers
46
views
Make ":w" command throw an error on filenames starting with a colon ":"
From time to time I accidentally create files with names like ":w" or ":q". This happens when instead of writing :wq I type :w:q and sometimes, for some reason, even :w:w or :w :w. ...
2
votes
1
answer
118
views
Using :Rename from vim-eunuch with the current file name
The vim-eunuch plugin has a handy function :Rename which renames the current file without needing to pay attention to paths. This also means that if there ARE paths in the argument you are passing to ...
0
votes
1
answer
110
views
How can I display a relative path instead of a full path in the title?
Out of the box title:
filename.txt (~/projects/blabla/foo/bar) - VIM
Desired title when the current folder ~/projects/blabla/foo:
foo/bar/filename.txt 45/500
The last numbers represent current line /...
2
votes
1
answer
251
views
How to make vim forget all vestiges of a file that it opened?
I was editing ~/tmp/tmp.txt and saved it to NeatoPortDemo.bash (with capitals). I then wanted to change the file name to neatoPortDemo.bash (without leading capital). Writing to neatoPortDemo.bash ...
0
votes
2
answers
126
views
Translate file paths in quickfix list
I'm using msys + vim + ninja + MSVC on windows.
When building, the quickfix list has errors that use the windows path, ie
c:\work\folder\file.cpp
Vim handles it ok-ish, it can open the files, but ...
0
votes
0
answers
27
views
Is it possible to fix a section of buffer fixed on top even when scrolling?
I need to open 4 different files on my screen to consolidate data on diff file .
I kept forgetting which tile is which file..
All my files has file name on line 1..
Is there way to keep the line 1 ...
0
votes
1
answer
32
views
":!echo %:~" yields full path, not path relative to user's home
According to :help filename-modifiers, :!echo %:~ should echo the path of a file relative to my home directory. If I am editing ~/tmp/SomeFile.txt, I would expect tmp/SomeFile.txt. Instead, I get /...
0
votes
1
answer
814
views
Always show top bar with files names
When I open more than one tab, in the top appears a bar with the names of the focused files:
but when I close the second tab the bar disappears:
How can I keep that top bar always open?
I also want ...
0
votes
1
answer
371
views
Can I define a function with '#'-namespace in a file with hyphen '-' in its name?
I often see #-namespaces in plugins source code, e.g coc#status(), fzf#run(), fugitive#extract_git_dir. I would like to use namespaces in my own config, mappings and commands source code also. But I'm ...
3
votes
0
answers
486
views
How to sort the list of buffers
How to sort the list of buffers Vim displays on entering :b <Tab> by most recent?
I'm used to the Spacemacs ordering, which displays buffer filenames in separate rows (vertically) in the order ...
0
votes
1
answer
592
views
Select buffer from list of buffers filtered by a partial name match?
Let's say I entered a folder with many files and I opened them with vim *. I know that if I want to list all the files inside the buffer I can use the command :ls, and then I can navigate those files ...
2
votes
1
answer
110
views
gF with given word as delimiter between filename and line number
I know Vim's gF can work on this pattern:
swank.lisp:1694
However, how can I tune gF to work with the slimv's cross-reference giving pattern:
swank.lisp line 1694
Thanks!
4
votes
1
answer
83
views
Why do some Ex commands not need a white space before a path argument?
For example, why does this work:
edit/home/foo/bar.txt
(I had to enter visual to see the changes)
I was expecting a whitespace after edit, like:
edit /home/foo/bar.txt
I couldn't find a reference in ...
0
votes
1
answer
76
views
Can I create a file and read in shell command output in one line?
I want to create a file and read in function declaration to be able to edit it further.
e() { echo $FUNCNAME }
vim FILE < <(declare -f e )
but that doesn't seem to work and the filename expands ...
1
vote
2
answers
223
views
Compilation keybinds for different filetypes in vimrc
I am trying to create some keybind "scripts" for specified file types in my .vimrc.
Example :
au BufNewFile,BufRead *.cpp
\ nnoremap <C-P> :!g++ % -o %.exe <CR>
Ideally I ...
1
vote
0
answers
43
views
Newline remains after doing shellescape() on a filename
I am working with a kind of database file containing filenames and some metadata:
2020-21-03 /run/My Drive/Folder 1/image1.jpg
2020-20-03 /run/My Drive/Folder 1/image2.jpg
I am aware ...
3
votes
1
answer
452
views
How to exclude filetype with autocmd to load language specific skeleton
I have the following in order to use a different template per language. But I want English to be the default, if I don't specify .en.adoc in the filename. But the *.adoc,*.en.adoc also picks up *.fr....
2
votes
0
answers
2k
views
How to (auto) complete filenames?
Developing in nodejs I have a lot of custom module require statements in my javascript source files, like this one:
//
// my nodejs program:
// path/to/projecthome/lib/someModule.js
//
const EMOJI = ...