Questions tagged [edit]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers
215 views

Restore auto-loaded file that was lost by accidently undoing edits

I accidentally removed about 1 hour of my work, how to restore? Last week I worked with file.md on my current computer and didn't save it into disk but just put my OS into a sleep mode. Yesterday I ...
0 votes
1 answer
49 views

How to traverse folders in :edit command dropdown menu

When opening a new file I use :e <tab> then a dropdown appears showing files in the PWD, I can move up and down with <tab> and <shift>+<tab> Pressing <enter> accepts the ...
0 votes
1 answer
37 views

Vim normal mode: Is there a way to explain the changes in behavior with the D (shift + d) command?

Normally, hitting Shift d erases everything from the cursor to the end of the line, but sometimes it just deletes one character backwards. This has happened more than once, but a recent example is ...
0 votes
2 answers
2k views

How to select all text and delete in vi?

Is it possible to select all the text and delete it it in vi other than hitting backspace?
1 vote
2 answers
114 views

Open buffer without loading ftplugins

I have huge file and quite slow plugin (loaded by vim-plug) for corresponding filetype. I want following: Plugin is loaded by default Option to fast open this file without loading plugin. Something ...
2 votes
1 answer
179 views

How to :edit executable from path?

Environment: Linux I apologize in advance if this question already exists somewhere and has a proper answer. It is just so difficult for me to search because the keywords are all so generic. Put ...
4 votes
4 answers
1k views

How to clear a line in Vim

I want to achieve the same thing as S ESC without entering insert mode. Is there a way to do this? The best I've come up with is d$, but then you have to make sure you're at the front of a line which ...
2 votes
1 answer
860 views

VIM error: WARNING: The file has been changed since reading it!!! How to view the changes VIM is complaining about?

Is there a quick way to see the differences VIM is describing?
1 vote
2 answers
123 views

Reloading buffers silently after an executed script changes the underlying files directly

I'm wrapping a command line script in a function and then in a command, which supplies this script with 2 arguments: nnoremap <leader>G :BxSedRi 'src/', 's/\<<C-r><C-w>\> ...
1 vote
2 answers
400 views

How to add several empty lines without entering insert mode? [duplicate]

Sometimes I want to add several empty lines for better visualization. Now I end up clicking o<Escape> multiple times. I would love to reduce number of clicks by using something like 7o instead, ...
3 votes
1 answer
1k views

W11: File has changed since editing started

When a file is changed (e.g. by checking out another git branch), and i reload it with :bufdo e, I get the message W11: Warning: File "foo.bar" has changed since editing started See ":...
3 votes
1 answer
210 views

Why is oldfiles not listing last edited file

I use vim in the following way: I open vim. Then I press i to start writing. Then I save the buffer and give the file a name by issuing the command :w some-file-name.txt Then I quit vim by :x Then ...
0 votes
0 answers
459 views

vim: is possible to use mouse to move lines around

Question: Is possible to use mouse to move lines around? Requirements & Clarification I do know keyboard solutions. normal mode ddp d2j'}p dapggp alike. cmdline commands, :co. '<,'>m'a etc....
0 votes
1 answer
345 views

How to temporarily disable deleting and editing? [closed]

I sometimes use vim for brainstorming and writing first drafts and would like to be able to temporarily disable the ability to delete or edit what I write down. Is there anyway to do this natively in ...
3 votes
1 answer
267 views

What is the difference between :find and :edit

:find and :edit both edit files and appear to need the relative or absolute path provided if the file isn't in the current directory. What is the extra part that :find brings? What is 'path'? Help ...