Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options questions only not deleted user 1841

Questions about the history of Vi. DO NOT use this for command history.

7 votes
5 answers
2k views

Why doesn't vimscript provide a random number generator?

EDIT Since 8.1.2342, Vim introduced a rand() function as described by @Maxim Kim's answer. I'll keep the question here for historical reference. I recently needed to generate a random number in vim a …
statox's user avatar
  • 50.6k
85 votes
1 answer
33k views

What is the select mode and when is it relevant to use it?

I accidentally pressed gh in normal mode and started a selection, so I looked up the doc and found :h Select-mode. From what I understand the select mode is close to the visual mode excepted that: …
statox's user avatar
  • 50.6k
17 votes
3 answers
4k views

What is the use of the black hole register ("_)?

I recently read about the black hole register "_ which is a write-only register. Vim documentation describes it this way: Black hole register "_ When writing to this register, nothing …
statox's user avatar
  • 50.6k
7 votes
1 answer
285 views

Why is the expression register "read only"?

I was messing with the expression register (:h @=) and noticed that it is not possible to put text directly in it. The doc says: The expression register is read-only; you cannot put text into it. …
statox's user avatar
  • 50.6k