简体   繁体   中英

How use gvim command history?

When I close gvim, I can't press the up arrow to rerun the commands from my last vim session. How do I make it so that I can do this?

For example, I can type:

:set hls<CR>
:set<up arrow>

And I see:

:set hls

But when I close vim, typing

:set<up arrow>

does not show my last use of the set command.

After a new install of Xubuntu 13.10 I had no command history. But I noticed that my .viminfo file in my home folder was owned by root. Changing the owner and group of the file to my normal user fixed the problem.

You coud try ''set history=[number]'' in .vimrc Here is my configuration:

set history=50
set viminfo=%,'20,/100,:100,<500,f1,n~/.vim/viminfo

History is persistent now even when you close and reopen vim.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM