Questions tagged [save]
Writing files to a persistent storage medium (usually a hard drive or SSD). In Vi, this is done with the :write command.
130 questions
1 vote
3 answers
350 views
Writing a visually-selected couple of files out to a file with an open buffer
This is vim 9.1 on arm64 macOS 15.5. Let's say I open file1.txt with: vim file1.txt but some of the lines I want to write into another file. If I open that file in a buffer with: :split file2.txt or:...
1 vote
1 answer
202 views
How to write the contents of a register to a file?
I have yanked a block of text to a register "a." Now, I want to write this register to a separate/unopened file in the Vim editor.
1 vote
2 answers
156 views
Neovim doesn't open previously unopen file in horizontal split
In classic Vi/Vim when I opened a previously unopened file with ctrlp, NERDTree, etc. and the current file/buffer was unsaved, it would open the new file in a horizontal split. After switching to ...
1 vote
2 answers
87 views
Is there a default normal-mode command for `:write`?
I know ZZ will write and quit, and ZQ will quit without saving. Is there another such command to write the buffer without doing anything else, or should I map one myself? I'd like to know if there's ...
3 votes
1 answer
123 views
Can ++enc=utf-8 be made the default action for :w?
After pasting text snippets from web sites into an existing Vim file, I often have to save the file with :w ++enc=utf-8 to avoid a conversion error. Can that be made the default? I have set ...
0 votes
1 answer
247 views
How do I create key mappings for Windows and/or nano Shortcuts?
Having used text editors (mainly Notepad/++) and some IDEs on MS Windows, I've become familiar with their Alt and Ctrl shortcuts to the point that I use them automatically. Having used nano on a GNU/...
1 vote
1 answer
234 views
How can I edit a file in real-time?
I would like to edit a file using Neovim and have changes saved in real-time (changes should be written to the file as I am typing), which will be displayed by an OBS plugin. Is this possible?
1 vote
1 answer
319 views
Can't use `:wqa` with open terminal buffers
I have next problem: When I use :term buffers the :wqa command produces error: Which is quite expected because terminal buffers isn't writable. BUT the :wa and :q separatly work. This is strange. To ...
0 votes
2 answers
223 views
:updateall command to update all files
There's a :w and a :wall command but there's only an update command, there isn't a :updateall command. Why isn't there one and how would you implement it in vimscript and lua ?
0 votes
1 answer
101 views
How can I make Vim ssd friendlier?
When I append a line to an existing file with Vim, Vim will unlink that file and create a new one on :w, although that is unnecessary. Vim even does the same with ~/.viminfo every time... I found it ...
0 votes
1 answer
1k views
Prevent message when writing buffer
Whenever I write a file in Neovim, I get a message like this: "config/nvim/lua/config/keymaps.lua" 55L, 2256B Sometimes, this can cause a press ENTER or type command to continue message to ...
1 vote
2 answers
76 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. ...
1 vote
2 answers
3k views
Lost my small project, can I get it back?
I lost 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 accidentally deleted this or used the cp command with wrong ...
2 votes
3 answers
443 views
How to save a file for which I have no write permissions on Windows
I would like to edit files like C:\Widows\System32\Drivers\etc\hosts that need administrative privilege to be modified. How can save the file on Windows if Vim has not been starter with administrator ...
4 votes
1 answer
333 views
How to explain ++opt in :[range]w[rite] [++opt] !{cmd}?
Get manual with help: help :w_c: :[range]w[rite] [++opt] !{cmd} Execute {cmd} with [range] lines as standard input (note the space in front of the '!'). {cmd} is ...