diff --git a/README.md b/README.md index 47531e8..ee14986 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud). -_1036 TILs and counting..._ +_1037 TILs and counting..._ --- @@ -1041,6 +1041,7 @@ _1036 TILs and counting..._ - [Absolute And Relative Line Numbers](vim/absolute-and-relative-line-numbers.md) - [Add A File Without Loading It](vim/add-a-file-without-loading-it.md) - [Add Custom Dictionary Words](vim/add-custom-dictionary-words.md) +- [All The Ways To Write And Quit In Vim](vim/all-the-ways-to-write-and-quit-in-vim.md) - [Allow Neovim To Copy/Paste With System Clipboard](vim/allow-neovim-to-copy-paste-with-system-clipboard.md) - [Almost The End Of The Line](vim/almost-the-end-of-the-line.md) - [Alternate Files With vim-rails](vim/alternate-files-with-vim-rails.md) diff --git a/vim/all-the-ways-to-write-and-quit-in-vim.md b/vim/all-the-ways-to-write-and-quit-in-vim.md new file mode 100644 index 0000000..faf86a9 --- /dev/null +++ b/vim/all-the-ways-to-write-and-quit-in-vim.md @@ -0,0 +1,15 @@ +# All The Ways To Write And Quit In Vim + +There are a bunch of different ways to write files, to quit out of a Vim +session, and to write and quit. + +The standard is `:wq` to write to the file and quit. There is `:xall` which +will write changes to all buffers and quit. + +`:q`, `:q!`, and `ZQ`—the latter being a normal mode command—are all ways of +quitting Vim. The first will warn of unsaved changes. The other two will +discard unsaved changes. + +Another favorite of mine, when bailing on a `git commit`, is `:cq`. + +These and more can be found in the help files by running `:h Q_wq`.