Questions tagged [file]
The file tag has no usage guidance.
19
questions
1
vote
1
answer
301
views
Lost my small project, can I get it back?
I am a new vim user and currently using neovim on Linux. I my whole project which I had written in one file (only 1 day of work).
There are two ways I could've lost it:
I saved the file but ...
-1
votes
3
answers
29
views
Delete comment operator(#) from beginning of selected lines [duplicate]
I want to remove # from line 79 to 91
2
votes
1
answer
108
views
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 ...
1
vote
2
answers
70
views
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 ...
0
votes
0
answers
271
views
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 ...
3
votes
2
answers
69
views
Open file under cursor which name starts from slash but force search path to the current directory?
Consider the case of html file that has a form tag with action attribute and value of /login.php:
action="/login.php"
In which case login.php will be searched in the same directory as a ...
0
votes
1
answer
429
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 ...
3
votes
2
answers
289
views
Is it possible to close all files with content that matches a regular expression on Vim?
Let's say I have opened many files on Vim with vim file1 file2 file3... And their content is like the following:
file1:
random content
random content
stringThatMatchesRegex
random content
file2:
...
0
votes
1
answer
26
views
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?
1
vote
2
answers
421
views
Pipe file list to vim and browser them like a folder
Is it possible to pipe list of files e.g. from grep and have this file list opened in vim file manager in similar fashion like when you open a folder with vim?
Note that I do not want to just write ...
2
votes
0
answers
55
views
Why does Vim create ~ files? [duplicate]
Whenever I create a file, Vim also creates a .extension~ file. For example, when I create a main.cpp file, another one appears with main.cpp~. Is the .cpp~ file an older version of my .cpp file? Is ...
1
vote
0
answers
22
views
How can you isolate the date portion of each request of a IP adress? [closed]
How can you isolate the date portion of each request of a IP address if it's at the first line of each request from a log file using awk, creating a list of distinct dates, and then using grep to ...
3
votes
1
answer
288
views
Slow write/save speed for files on network
I noticed my VIM write/save file for a network path is quite slow.
I found out VIM saves files with approximated speed of 20mbps (2.5MB/s).
Network is 1Gb/s local area network so I believe the ...
4
votes
2
answers
979
views
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 ...
6
votes
3
answers
1k
views
Vim not firing inotify events when writing file
Mentioned here as well: https://stackoverflow.com/questions/13312794/inotify-dont-treat-vim-editting-as-a-modification-event
Really frustrating issue, how can I force vim to write the file?
It ...
3
votes
1
answer
209
views
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 ?
4
votes
2
answers
638
views
How to auto-complete filenames in sub-directories when opening them for editing using e.g. `:e </path/to/file>`?
How to autocomplete filenames in sub-directories when opening them for editing using e.g. :e </path/to/file>?
When opening files in sub-directories for editing using e.g. :e </path/to/file&...
3
votes
0
answers
88
views
gf with search pattern instead of line number
vim file +80
will open file in vim, with cursor at line 80
vim file +/if/
will open file in vim, with cursor at first line containing if.
For vim file +80, inside vim, there is gF.
The question:
...
2
votes
1
answer
154
views
What is the green <92> that's in my file?
I have a file exported from some system, and in vi when I open the file, there's a green <92> in it when I open it up where an ' ought to be.
It messed up my bash script and left a line that ...