Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [command-history]

Questions about how Vim records the commands issues by the user and how to customize this behavior.

1
vote
0answers
28 views

How do you remap keys in :history or :highlight?

I use Colemak hnei for nav in normal mode, but my keys default to hjkl when when I'm viewing :history and :highlight. How do I remap these keys? My guess is that the program may be switching to more....
0
votes
2answers
56 views

How to go up to previous command when in terminal mode in Vim 8?

I am new to Vim. I managed to use :terminal and :vertical terminal to have a terminal side by side with my code. This works great, I can move between my code and the terminals. However, how do I go ...
1
vote
1answer
134 views

Commands history for vim commandline and :terminal [closed]

I want a way in which we can access a history of commands in terminal mode (and Vim/NeoVim's internal command line), just like in a normal bash terminal; i.e. if I press the up key it will scroll ...
0
votes
1answer
27 views

Remap Enter in command history edit window only

I currently have <Enter> mapped to :nohlsearch in normal mode. This allows me to leave search highlighting on for all new searches, but easily turn it off when it (soon after usually) becomes a ...
0
votes
1answer
101 views

Sharing vim commands history across different users and computers

I have configured .dotfiles. Eg. see here https://wiki.archlinux.org/index.php/Dotfiles So now I can do dgit push or dgit pull on whichever computer I want, and I have all my config files (including ....
2
votes
2answers
55 views

How to search and replace in the history

Is there a way edit command line or search history? I have read Is there search and replace history in vim? and tried using q: to open the history and do changes there, but all it seems to be able to ...
1
vote
0answers
36 views

How to view the command that was just un(re)done

Is it possible to see the sequence of key presses that are undone/redone when using u and Ctrl-r commands?
1
vote
2answers
302 views

reverse-i-search à la Bash Ctrl-r

I would like to be able to search through the previous commands starting with : that I entered, using an interactive incremental search, as it is possible in some shells (example: with Ctrl-r in bash)....
4
votes
1answer
47 views

Open command window dynamically

I am trying to use the command line window in a vimscript. Unfortunately, the experiment I have with is not good and I am not able to achieve the following: normal! q: This should open the command ...
5
votes
1answer
104 views

Equivalent of !n in bash in vim for ex commands?

I'd like to be able to view the last n commands, similar to the history command in bash, and then be able to execute the nth command similar to the way it is done in bash by using !<command number&...
9
votes
1answer
124 views

Use backspace to modify the current command in normal mode?

Sometimes when entering a command in normal mode you may make a typo, for example if I intend to type 10dk, I might accidentally start typing 19d. Since the command has not been completed/committed ...
18
votes
3answers
795 views

How does vim determine the size of a single “edit” when using “u” and “CTL-R”?

When using u or CTL-R to undo or re-do an edit in vim, I seem to alter chunks of text, not just the most recent keystroke. What determines the size of the chunk that is considered to be a single ...
7
votes
1answer
467 views

How to have endless vim history?

According to h: help: Use the 'history' option to set the number of lines that are remembered (default: 20) I know I can set the number of lines higher, yet is there an "endless" option that ...
0
votes
0answers
27 views

Cycle through edit command history [duplicate]

In Vim, i can cycle through edit locations with g, and g;, and jump to locations with Ctrl-I and Ctrl-O. Is there any way to similarly cycle through edit commands? This would be something similar to ...
9
votes
2answers
2k views

How to further increase cmdline history size?

I have already put the following setting in my .vimrc file: set history=1000 It's been there for a while, I work in vim on a daily basis, so there have been many commands executed by now. I know ...
8
votes
2answers
628 views

Is there a way to share vim command history?

Can I share Vim command history across instances in real time? By that I mean what people do in bash this way: export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND" That is, ...
8
votes
2answers
226 views

How to access recently used files by choosing from a list?

I would like to have a keystroke to show a list of recently used files to choose one to edit. What do I need to provide that? And related, How do I manage the history of recently used files ...
64
votes
5answers
8k views

How do I jump to the location of my last edit?

I often make changes to the middle of a big file, use gg to jump to the top to check something, and then realize I forgot to set a mark where I was editing. Is there a built-in way to jump to the ...
3
votes
1answer
972 views

How to display invoked keystrokes and commands in normal mode? [duplicate]

How I can activate option which will display my pressed keystrokes or executed commands in normal mode on the screen? Especially it would be good, if it would give a slight info what specific ...
12
votes
1answer
166 views

Prevent Vim from recording events for certain filetypes

To add to this stackoverflow question, what should one put in their .vimrc to ensure 'private editing' of certain file extensions (e.g. .gpg files). Without compromising the effectiveness of the ...
34
votes
2answers
8k views

How can I view and edit my recording (i.e. recorded macro)?

I'm using complex repeats to record my operations (qq to record, some operations, q to stop) and I did a mistake. It is possible to see what I've recorded and correct the mistake, instead of doing it ...
10
votes
2answers
2k views

Showing command history with showcmd

When using set showcmd Vim shows partial commands in the last line of the screen. For example, in Normal mode when typing the command dt. the last line shows dt and then, when you hit . the command is ...
30
votes
2answers
2k views

Can I see the history of key presses in normal mode?

I know that Vim keeps history for ex commands, searches, jump locations, changes, and possibly others. With showcmd set, Vim also shows you what keys you have entered so far for a normal mode command,...
13
votes
1answer
501 views

How is command history resolved between multiple instances of Vim?

Vim keeps a history of ex commands (accessible via :↑ and q:), and that history persists after quitting. If I run multiple instances of Vim (same user, same home directory), how does Vim arbitrate ...
6
votes
1answer
1k views

How to cache file editing history in Vim, that it would not disappear after switching the file?

When I open another file in a Vim session all editing history for the other files disappears. Is it possible to configure Vim that it would automatically save and restore file editing history when ...