Most Popular
1500 questions
7
votes
7 answers
Is there a vim command line option to edit last edited file?
Is there a way to run vim from command line to edit the last edited file?
Let say I first edit file giorgio.sh:
$ vi giorgio.sh
Afterwards, I exit back to terminal
$ do something...
$ do something else...
$ do something else again...
Is there a…
Giorgio Robino
- 2,044
- 2
- 17
- 30
7
votes
3 answers
Reusing search pattern in ex mode
Sometimes I want to try a pattern with / before doing :%s/ …; can I reuse it without having to type it all over? (or use the mouse.)
Toothrot
- 3,129
- 13
- 27
7
votes
1 answer
Hide statusline when more than two windows open without suffering the extra hidden empty line artifact?
I want to hide the statusline, I don't ever use nor care about what is written in it. The problem is vim doesn't offer a way to achieve that in a convenient manner. If I just do set laststatus=0 I will suffer from the artifact mentioned in this…
vexe
- 281
- 1
- 7
7
votes
2 answers
How to easily search in the list of existing mappings?
From time to time I want to search on the list of my currents mappings. I search either for mapped keys (what /a does?) or for a command (What keys are mapped on /MyFunction()?)
I know that I can output these mappings with :map (or :nmap,…
statox
- 49,782
- 19
- 148
- 225
7
votes
3 answers
How to specify the content of a new buffer from command line?
Is there a way to call Vim in such a way that it opens a buffer with some content specified on the terminal, i.e. not saved in a file?
For example, I would like to run vim and have it open a buffer with foo, bar, baz and qux written on it.
Is there…
Gonçalo Ribeiro
- 1,991
- 1
- 18
- 28
7
votes
1 answer
What is an abandoned buffer in vim?
I've been using vim for more than 5 years now, and I was surprised when I didn't know what an abandoned buffer was. The closest answer I found was in this SO answer.
So is an abandoned buffer one that was loaded but is not displayed any more? What…
stanm
- 173
- 4
7
votes
1 answer
When exactly does differ from ?
The documentation says:
When executing autocommands, is replaced with the file name
for a file read or write.
When executing autocommands, is replaced with the currently
effective buffer number (for ":r…
muru
- 24,838
- 8
- 82
- 143
7
votes
1 answer
What's the difference between the "clipboard" and "xterm_clipboard" features?
What is the difference between the clipboard and xterm_clipboard features? When do I need to enable one or the other at compilation time?
As an aside, how do these features relate to the mouse option? Is it only through the mouse middle button? …
jalalhugo
- 71
- 3
7
votes
1 answer
Can I detect whether current Vim instance is launched by git?
My .vimrc does a lot of extra things I don't want to do if it's launched by git (for example, during commit), since the purpose of that Vim instance is very specific so it makes no sense to launch many windows I would launch in normal way.
Is there…
Jason Hu
- 1,385
- 1
- 9
- 17
7
votes
3 answers
Why does my colorscheme look different when I run Vim with sudo?
I installed colorscheme "jellybeans" for Vim. Why does the colors look differently when I run Vim with and without sudo?
Example on the screen below - the left one is without sudo, the right is with sudo. The one with sudo is working properly - how…
Kossak
- 1,658
- 13
- 15
7
votes
1 answer
Is it possible to add inline comments in a multiline statement?
I have a function that looks like
fu! MultiLineTest(u, v)
if a:u != 2 &&
\ a:v != 2
return 'yes'
else
return 'no'
end
endfu
Of course, the actual function is longer and more complicated.
Now, I'd like to add…
René Nyffenegger
- 2,105
- 20
- 36
7
votes
1 answer
why can't I map to ?
I found that it's really hard for me to hit Control and other keys simultaneously, and I discovered that the space key is rarely used, so I decided to map it to Control . Thus, when I want to hit Control+ f for scrolling, I can instead hit space+ f,…
Alex
- 1,205
- 2
- 10
- 12
7
votes
2 answers
How can I change the root of my nvim-tree?
I have checked this screenshot (list of nvim-tree commands):
But there seems to be no command to change the root of my tree. Also I am hoping to setup a convenient startup location but could not find how to do that either.
samuelnihoul
- 615
- 1
- 6
- 20
7
votes
1 answer
How can I spell check an entire buffer?
Is there a built-in command or plugin available to trigger spell checking over the entire current buffer, prompting me for each word it detects to either ignore, add to dictionary, or correct spelling?
I've been using ]s to skip through spelling…
Mu Mind
- 485
- 3
- 10
7
votes
1 answer
Move cursor by percentage
I know that you can go to the Nth % percentage of a file by typing N% in normal mode. Is it possible to advance the line by a given percentage?
To clarify, for an example, can I type something to advance to 10% of the file, then the same thing to…
aatish
- 173
- 3