mirror of
https://github.com/jbranchaud/til
synced 2026-01-04 23:58:01 +00:00
Add Quit When There Is An Argument List as a vim til
This commit is contained in:
22
vim/quit-when-there-is-an-argument-list.md
Normal file
22
vim/quit-when-there-is-an-argument-list.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Quit When There Is An Argument List
|
||||
|
||||
To start a Vim session with multiple files in the argument list, name
|
||||
multiple files when invoking Vim:
|
||||
|
||||
```bash
|
||||
$ vim README.md LICENSE
|
||||
```
|
||||
|
||||
The first file in the argument list, and the current buffer, is `README.md`.
|
||||
The last file in the argument list is `LICENSE`.
|
||||
|
||||
At this point if you try to quit, Vim will prevent you saying `1 more file
|
||||
to edit`. If we look at the docs for `:q` and `:wq`, we see something along
|
||||
the lines of:
|
||||
|
||||
> This fails when the last file in the argument list has not been edited.
|
||||
|
||||
Vim wants to ensure that you've paid attention to every file that you loaded
|
||||
up into your argument list. If you'd like to quit regardless. then this is
|
||||
where the `:q!` and `:wq!` variants come in handy. This commands will skip
|
||||
the argument list check.
|
||||
Reference in New Issue
Block a user