diff --git a/README.md b/README.md index e506e56..5836210 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/). For a steady stream of TILs from a variety of rocketeers, checkout [til.hashrocket.com](https://til.hashrocket.com/). -_750 TILs and counting..._ +_751 TILs and counting..._ --- @@ -816,6 +816,7 @@ _750 TILs and counting..._ - [Quick Man Pages](vim/quick-man-pages.md) - [Quick Quickfix List Navigation](vim/quick-quickfix-list-navigation.md) - [Quickly Switch To A Buffer By Number](vim/quickly-switch-to-a-buffer-by-number.md) +- [Quit When There Is An Argument List](vim/quit-when-there-is-an-argument-list.md) - [Re-indenting Your Code](vim/reindenting-your-code.md) - [Read In The Contents Of A Rails File](vim/read-in-the-contents-of-a-rails-file.md) - [Rename Current File](vim/rename-current-file.md) diff --git a/vim/quit-when-there-is-an-argument-list.md b/vim/quit-when-there-is-an-argument-list.md new file mode 100644 index 0000000..939cfba --- /dev/null +++ b/vim/quit-when-there-is-an-argument-list.md @@ -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.