Skip to main content

Questions tagged [vim]

vim (Vi IMproved) is a text editor supporting different editing modes.

482 votes
6 answers
461k views

I know I've probably looked over this a million times in all the vi documents I've read, but I can't seem to find the delete from cursor to end of line command.
Falmarri's user avatar
  • 13.6k
441 votes
5 answers
280k views

I have a config-file that I keep open in vim, but that sometimes gets changed on disk, without these changes being reflected on the terminal. Can I refresh the content on the screen without closing ...
twan163's user avatar
  • 5,800
413 votes
15 answers
381k views

How would you compare these editors? What are the pros and cons of each? [note] This is not meant to be answered by those who "hate one and love another" or those who haven't used both.
375 votes
2 answers
230k views

I came across a sentence in vimdoc: Note: CTRL-S does not work on all terminals and might block further input, use CTRL-Q to get going again. and using CTRL-S indeed hangs my vim. I ...
Hongxu Chen's user avatar
  • 5,928
353 votes
14 answers
552k views

When I open the file in Vim, I see strange ^M characters. Unfortunately, the world's favorite search engine does not do well with special characters in queries, so I'm asking here: What is this ^M ...
Christoph Wurm's user avatar
329 votes
12 answers
345k views

Mostly I edit Ruby files, although shell script file comments are also # Currently my comments show as dark blue on black which is really hard to read. See screenshot. How can I change their color? ...
Michael Durrant's user avatar
253 votes
11 answers
353k views

I know I can open multiple files with vim by doing something like vim 2011-12*.log, but how can I switch between files and close the files one at a time? Also, how can I tell the file name of the ...
cwd's user avatar
  • 47.2k
239 votes
4 answers
341k views

I believe I can do something like export EDITOR=vi, but I'm not sure what exactly to enter, and where. How can I set "vi" as my default editor?
Donny P's user avatar
  • 2,601
224 votes
7 answers
487k views

How can I delete a line in VI? Here what I am doing right now: Open up the terminal alt + ctrl + t vi a.txt I move my cursor to the line which I wan to delete, then what key-combination is should use ...
I-M-JM's user avatar
  • 2,351
217 votes
2 answers
84k views

Any quicker navigation trick to place the line at which the cursor is at the moment to the top of the screen? center of the screen? bottom of the screen?
mtk's user avatar
  • 28.7k
212 votes
9 answers
252k views

I have two files opened in vim, each in one tmux pane. I would like to copy let's say 10 lines from one file to another. How can I accomplish this not using the mouse's Copy -> Paste ?
Patryk's user avatar
  • 14.8k
191 votes
17 answers
115k views

I have some text in my paste buffer, e.g. I did a yw (yank word) and now I have 'foo' in my buffer. I now go to the word 'bar', and I want to replace it with my paste buffer. To replace the text ...
Michael Durrant's user avatar
171 votes
1 answer
100k views

When comparing files, and updating a source code repository, I like to use vimdiff. To copy changes made from one file to the other, I usually use a key sequence like this:- Shift + V (select line) k ...
Alex Leach's user avatar
  • 8,190
168 votes
9 answers
146k views

I have to edit some files placed on some server I could reach via ssh. I would prefer to edit these files in customized vim on my workstation (I have not rights to change vim settings on remote ...
Loom's user avatar
  • 4,103
156 votes
6 answers
83k views

In Vim, if I paste this script: #!/bin/sh VAR=1 while ((VAR < 10)) do echo "VAR1 is now $VAR" ((VAR = VAR +2)) done echo "finish" I get these strange results: #!/bin/...
elbarna's user avatar
  • 14.8k

15 30 50 per page
1
2 3 4 5
126