# The command-line window

Sometimes (just like on the shell command-line), you're typing a command and realize you have need for the full editing tools of a vim buffer. Enter: the command-line window. Also known as "the thing that pops up when I try to quit but mistype the keys `:q`".

Open the command-line window using:

* `ctrl-f` while on the command-line
* `q:` while in normal mode

This opens a window with your command history. If invoked from the command line, the last line will contain the command typed thus far.

```
: w
: %s/foo/bar/g
: the command I was currently typing|
[Command Line]
```

Here, you can edit the current or a previous command, and execute the command under the cursor with `CR`.

Source: `:help cmdline-window`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.eliasnorrby.com/vim/command-line-window.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
