Tag: vim

56 votes
14 answers
995 views
How to paste in a new line with vim?

I often have to paste some stuff on a new line in vim. What I usually do is: o<Esc>p Which inserts a

avatar
Arline
0 1 0 9
asked 07 September, 2021
63 votes
6 answers
778 views
Delete text in between HTML tags in vim?

I know di< will delete in an HTML tag itself. Is there an easy way to delete text in between two tags?

avatar
Basil
0 1 0 9
asked 07 September, 2021
65 votes
6 answers
990 views
Saving vim macros

Does anyone know how to properly save/reuse macros recorded inside of a vim editor?

avatar
Shantay
0 1 0 9
asked 07 September, 2021
63 votes
13 answers
2.6K views
How to comment out a block of Python code in Vim

I was wondering if there was any key mapping in Vim to allow me to indent certain lines of code (whether those

avatar
Luis
0 1 0 9
asked 07 September, 2021
57 votes
11 answers
3K views
How do you return from &apos;gf&apos; in Vim

I am using Vim for windows installed in Unix mode. Thanks to this site I now use the gf command to go to a fil

avatar
Robyn
0 1 0 9
asked 07 September, 2021
55 votes
10 answers
2.5K views
Disabling swap files creation in vim

Is there a way to disable .swp files creation in vim? or at least create them all in one place so I can find a

avatar
Sena
0 1 0 9
asked 07 September, 2021
55 votes
4 answers
2.7K views
Go to first line in a file in vim?

How do I go to first line in a file in vim ?

avatar
Brianne
0 1 0 9
asked 07 September, 2021
50 votes
12 answers
2.9K views
How can I swap positions of two open files (in splits) in vim?

Assume I've got some arbitrary layout of splits in vim. ____________________ | one | two | |

avatar
Serina
0 1 0 9
asked 07 September, 2021
47 votes
10 answers
1.4K views
Using Vim&apos;s tabs like buffers

I have looked at the ability to use tabs in Vim (with :tabe, :tabnew, etc.) as a replacement for my current pr

avatar
Louetta
0 1 0 9
asked 07 September, 2021
42 votes
26 answers
1.7K views
Copy all the lines to clipboard

Is there any way to copy all lines from open file to clipboard in VI editor. I tried yG but it's not usin

avatar
Jeff
0 1 0 9
asked 07 September, 2021
56 votes
30 answers
3.1K views
Differences between Emacs and Vim

Without getting into a religious argument about why one is better than the other, what are the practical diffe

avatar
Corrin
0 1 0 9
asked 07 September, 2021
61 votes
30 answers
3K views
How to make vim paste from (and copy to) system&apos;s clipboard?

Unlike other editors, vim stores copied text in its own clipboard. So, it's very hard for me to copy some

avatar
Carmelina
0 1 0 9
asked 07 September, 2021
65 votes
15 answers
551 views
How do I move to end of line in Vim?

I know how to generally move around in command mode, specifically, jumping to lines, etc. But what is the comm

avatar
Trudy
0 1 0 9
asked 07 September, 2021
51 votes
24 answers
831 views
Turning off auto indent when pasting text into vim

I am making the effort to learn Vim. When I paste code into my document from the clipboard, I get extra space

avatar
Mikki
0 1 0 9
asked 07 September, 2021
62 votes
21 answers
2.3K views
How to duplicate a whole line in Vim?

How do I duplicate a whole line in Vim in a similar way to Ctrl+D in IntelliJ IDEA/ Resharper or Ctrl+Alt+↑/

avatar
Thurman
0 1 0 9
asked 07 September, 2021
53 votes
30 answers
412 views
Indent multiple lines quickly in vi

It should be trivial, and it might even be in the help, but I can't figure out how to navigate it. How do

avatar
Wei
0 1 0 9
asked 07 September, 2021
57 votes
27 answers
1.5K views
Convert DOS line endings to Linux line endings in Vim

If I open files I created in Windows, the lines all end with ^M. How do I delete these characters all at once?

avatar
Daniel
0 1 0 9
asked 07 September, 2021
58 votes
29 answers
3.1K views
How do I make Git use the editor of my choice for commits?

I would prefer to write my commit messages in Vim, but it is opening them in Emacs. How do I configure Git to

avatar
Hallie
0 1 0 9
asked 07 September, 2021