1

Viewing your command history

2

Maybe you used some complex regex to populate an arglist, and don't feel like starting over when you realise that you

3

want to use it again? This has happened to me, and I was glad to discover that VIM keeps a history of previous commands.

4

5

You can type q: while in NORMAL mode. It will open a small buffer where you can search your previous commands and hit

6

ENTER to execute them again.

7

8
VIM command history
VIM command history
9

10

Increasing your command history

11

I use this feature quite often and it comes with a good default configuration. Whenever you enter a command that is

12

exactly the same as a previous command it will delete the older one. That way it won't just be a flood of "w wq wqa w

13

help w" in your history. However, to be sure nothing is lost, you can increase the number of lines VIM remembers by

14

using the history option. I have this in my init.lua file(Neovim):

15

16
vim.opt.history=10000 -- Increase the command history
16

17

The end

18

I usually tweet something when I've finished writing a new post. You can find me on Twitter

19

by clicking 

normalintroduction.md
||18:3

Recently Edited

Recently Edited

File name

Tags

Time to read

Created at

context

  • go
  • context
8 minutes2024-02-28

circular-buffers

  • go
  • concurrency
  • data processing
5 minutes2024-02-04

go-directives

  • go
  • compiler
  • performance
4 minutes2023-10-21

async-tree-traversals

  • node
  • trees
  • graphs
  • typescript
19 minutes2023-09-10

All Files

All Files

  • go

    5 files

  • node

    2 files

  • typescript

    1 file

  • frontend

    1 file

  • workflow

    7 files