PracticalVim Tip34 - yszheda/wiki GitHub Wiki

Table of Contents

Tip 34: Recall Commands from History

Return to the top: <>

  • Recalling commands:
* scrolling through past command-lines with the cursor keys * dialing up the command-line window
  • Change command history limit (By default, it is 20):
  • The history persists when we quit and relaunch vim.

References:

Avoid the Cursor Keys When Recalling Commands from History

  • Alternative of `` and `Down`: `` and ``.
* Advantage of `` and ``: do not need to move our hands from the home row * Disadvantage of `` and ``: do not filter the command history
  • Solution: add the following mappings

Meet the Command-Line Window

  • `q:`: enter the command-line window

References:

  • When we press `` (``) in the command-line window, the command is executed in the context of the active window.

| Command | Action | | `q/` | Open the command-line window with history of searches | | `q:` | Open the command-line window with history of Ex commands | | `` | Switch from Command-Line mode to the command-line window |

⚠️ **GitHub.com Fallback** ⚠️