Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What sets vim history?

Tags:

vim

I have had the command

set history=10000

in my .vimrc for a while, and realized that it wasn't setting the history -

:set history

prints 20.

I then moved set history=10000 to the end of my .vimrc and re-sourced it, and now history=10000 as requested.

There are no other instances of set history in my .vimrc. What other commands set the history length? Is it possible that function definitions override history? Are there other settings I should be worried about overriding?

like image 263
keflavich Avatar asked Jan 19 '12 17:01

keflavich


People also ask

Does Vim have history?

Vim text editor is capable of recording the history of all the commands that we enter on the command line prompt. There are two ways of recalling the command history: dialling up the command line window or scrolling through the past command lines using the cursor keys.

Where does Vim store command history?

you may need to check $HOME/. viminfo file. it keeps command history in it.

What does set do in Vim?

There are two ways to use the Vim setting options: 1. Enable the options for an individual file inside the Vim session using :set Open the desired file in Vim, type any option using the :set command in the Normal mode, and press Enter.


1 Answers

Type:

:verbose set history

This will tell you from where 'history' was last set.

N.B: If it says:

  history=20
        Last set from ~/.vimrc

...and you don't have either set hi=20 or set history=20 in your .vimrc, you need to ensure that you have set history=10000 after set nocp, as highlighted by ZyX's answer. This is probably why you found that it worked when you moved this to the end of your initialisation file.

like image 133
Johnsyweb Avatar answered Oct 31 '22 19:10

Johnsyweb