Questions tagged [file]
23 questions
5
votes
2 answers
Write register 0 to file
I am trying to write register 0, into a file.
One method that I have found is to use redir:
redir! /tmp/3
echo 'hello'
redir end
which gives me error invalid argument /tmp/3
and I don't know how to fix that.
Another thing I have found is to use…
john-jones
- 235
- 2
- 11
3
votes
1 answer
What is the opposite of set ff command?
I can set a file format to unix or windows by using:
:set ff=unix
Is there a way to check the file format ?
Pasan W.
- 133
- 4
2
votes
3 answers
Edit (another) file in the same directory without changing cwd
It needs to support completion.
An example use case would be: I'm on a given project (so a certain cwd) but need to update one of my Vim files. If they are already opened so navigate buffers or navigate them using MRU.
But often if I need another…
eyal karni
- 1,106
- 9
- 33
2
votes
1 answer
check if file exists without opening it with gf
gf edits the file whose name is under the cursor.
Sometimes I use gf to check if the file exist or not,
by just going to the file and coming back.
But if the file is large, then it takes time for opening it.
Is there a simple way in normal model to…
auditory
- 170
- 1
- 6
1
vote
2 answers
How can I quickly get to a set of commonly used files?
I tend to edit particular text files much more often than others. There might be 30 or 40 or so different files I tend to edit most often. Plus there are others that kind of rotate in and out as things I am temporarily working on. Even though I…
Tyler Durden
- 2,091
- 2
- 23
- 42
1
vote
0 answers
Open file from vifm in split view
I use vifm in split mode - it always shows two vertically separated windows each with a directory listing. From there I can open files using the right arrow. However when I open a text file, vifm goes to the background and vi is in the foreground…
mulllhausen
- 111
- 2
0
votes
1 answer
Using CTRL-W_f / gf on `file.name://`
A common action I perform in Vim is to do $ grep or $ git grep (in a vim :terminal), and then open the files discovered.
This works great most of the time. However, I noticed that considering the following output from grep/git grep:
my-file: some…
user22476690
- 143
- 7
0
votes
1 answer
How can I watch a file that isn't currently open?
I want vim to notify me if the contents of a certain file path/to/file changes, but that file won't be open in the vim instance.
How can I achieve this?
libby
- 111
- 4
-1
votes
3 answers
Delete comment operator(#) from beginning of selected lines
I want to remove # from line 79 to 91