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?
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.
you may need to check $HOME/. viminfo file. it keeps command history in it.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With