Questions tagged [vim]
Vim is a text editor which can use various commands to edit text. Note that challenges that require the answers to be in a specific language are generally discouraged.
9 questions
5
votes
3
answers
1k
views
Use an editor to write "Hello, World" [closed]
Objective
Use any editor or IDE (vim, emacs, IntelliJ, etc) to write a valid "Hello, World" program in any C-like language. The "!" is optional, but you get style points if you use ...
7
votes
2
answers
329
views
Tips for golfing in V
What general tips do you have for golfing in V? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to V (e.g. "remove comments" is not an ...
38
votes
13
answers
4k
views
Tips for golfing in vim
I've recently realized how vim works great for golfing, especially for kolmogorov-complexity. Also, according to meta vim is a perfectly acceptable 'programming language' at least, for the scope of ...
10
votes
2
answers
1k
views
Reverse every word in a line in vim
Your task is to build a vim script or provide a sequence of keystrokes that will operate on a single line of text with up to 140 printable ASCII characters (anywhere in a file, with the cursor ...
30
votes
2
answers
2k
views
Vim - surround comment line with comment character
Today I realised that I often like to define sections in my code like so:
####################
# Helper Functions #
####################
But that it's tedious to ...
2
votes
4
answers
932
views
Write a Vim command that reads as English text [closed]
Once you grok vi, your muscle memory learns tricks like ggVGx to delete all the text in a file. Trouble is, ggVGx is not an ...
19
votes
2
answers
959
views
Type out Green Eggs and Ham in vim
The book Green Eggs and Ham by Dr. Seuss is famous for only having 50 different words in the entire story of the book.
Your task is to create a sequence of keystrokes that will result in the entire ...
12
votes
5
answers
1k
views
Most destructive "forgot-to-enter-insert-mode" sequence in Vim
Pretend you have an arbitrary text file (which you may choose).
Give the sequence of keystrokes that is most destructive (*) if it was intended to be inserted to the text, but instead was entered in ...
16
votes
3
answers
1k
views
Compose a Vim quine! [closed]
Goal:
Create and save file in Vim containing at least 25 ASCII characters. The exact keystrokes used during the creation and saving of this file must also produce identical contents in Windows ...