Track Vim Galore Updates Weekly
:mortar_board: All things Vim!
🏠 Home · 🔍 Search · 🔥 Feed · 📮 Subscribe · ❤️ Sponsor · 😺 mhinz/vim-galore · ⭐ 15K · 🏷️ Editors
Oct 01 - Oct 07, 2018
Additional resources / Screencasts
Apr 09 - Apr 15, 2018
Ranges
- Most commands act only on the current line by default. Notable exceptions are
:writeand:globalwhich act on all lines.
Jan 15 - Jan 21, 2018
True colors / Small intro
- The first line should be the same for most people and denotes the
$TERMto be used within tmux.
- The second line adds the tmux-specific
Tc(true color) capability to the other terminfo entries ofxterm-256color. Obviously this assumes that the user is usingTERM=xterm-256coloroutside of tmux.
- Read
:h 'termguicolors'.
- Put
set termguicolorsin your vimrc.
- Make sure your colorscheme has color definitions for GUIs. (It should contain
lines with
guifgandguibg.)
- Make sure your terminal emulator of choice supports true colors.
- Using tmux? Configure it to add the
Tccapability.
Nov 06 - Nov 12, 2017
Quickfix and location lists
- There is only one quickfix list. There can be multiple location lists; one per window.
- They use slightly different commands for navigation.
Jun 26 - Jul 02, 2017
Getting help offline
- VimL functions end in
(), e.g.:h reverse()
- commands start with
:, e.g.:h :echo
Apr 17 - Apr 23, 2017
Backup files
- Copying
- A full copy of the original file is created and used as backup.
- The original file gets emptied and then filled with the content of the Vim buffer.
- Renaming
- The original file is renamed to the backup file.
- The content of the Vim buffer gets written to a new file with the name of the original file.
Jan 02 - Jan 08, 2017
Vim distributions / Screencasts
Aug 01 - Aug 07, 2016
Function search undo / Screencasts
- A search pattern in a command (
/,:substitute, ...) changes the "last used search pattern". (It's saved in the/register; print it with:echo @/).
- A simple text change can be redone with
.. (It's saved in the.register; print it with:echo @.).
Mar 07 - Mar 13, 2016
Cscope
- Where is this symbol defined?
- Where is this symbol used?
- What is this global symbol's definition?
- Where did this variable get its value?
- Where is this function in the source files?
- What functions call this function?
- What functions are called by this function?
- Where does the message "out of space" come from?
- Where is this source file in the directory structure?
- What files include this header file?
Jan 18 - Jan 24, 2016
Ranges
- Many commands take ranges.
- An address denotes a certain line.
- A range is either a single address or a pair of addresses separated by either
,or;.
- Ranges tell commands which lines to act on.
Macros
- Start recording by typing
qfollowed by the register, e.g.q. (The command-line will signify this via "recording @q".)
- Stop recording by hitting
qonce again.
- Execute the macro via
[count]@q.
- Repeat the last used macro via
[count]@@.
Getting help offline (alternative)
- Options are enclosed in single quotes. So you would use
:h 'list'to go to the help topic for the list option. If you only know, you are looking for a certain option, you can also do:h options.txtto open the help page which describes all option handling and then you can search using regular expressions e.g./width. Certain options have their own namespace, e.g.:h cpo-a,:h cpo-A,:h cpo-b, and so on.
- Normal mode commands are just that. Use
:h gtto go to the help page for the "gt" command.
- Regexp items always start with "/", so
:h /\+takes you to the help item for the "+" quantifier in Vim regexes. If you need to know anything about regular expressions, start reading at:h pattern.txt.
- Key combinations. They usually start with a single letter indicating the mode
for which they can be used. E.g.
:h i_CTRL-Xtakes you to the family of CTRL-X commands for insert mode which can be used to auto complete different things. Note that certain keys will always be written the same, e.g. Control will always be CTRL. Note, for normal mode commands, the "n" is left away, e.g.:h CTRL-A. In contrast,:h c_CTRL-Rwill describe what CTRL-R does when entering commands in the command line and:h v_Ctrl-Atalks about incrementing numbers in visual mode and:h g_CTRL-Atalks about the g command (thus you have to press "g" then ). Here the "g" stand for the normal command "g" which always expect a second key before doing something similar to the commands starting with "z".
- Registers always start with "quote" so use
:h quoteto find out about the special ":" register.
- Vim script (VimL) is available at
:h eval.txt. Certain aspects of the language are available at:h expr-Xwhere 'X' is a single letter, e.g.:h expr-!will take you to the topic describing the '!' (Not) operator for VimL. Also important, see:h function-listto find a short description of all functions available.
- Mappings are talked about in the help page
:h map.txt. Use:h mapmode-ito find out about the:imapcommand. Also use:map-topicto find out about certain subtopics particular for mappings (e.g.:h :map-localfor buffer-local mappings or:h map_barfor how the '|' is handled in mappings.
- Command definitions are talked about at
:h command-*, so use :h command-bar to find out about the '!' argument for custom commands.
- Window management commands always start with CTRL-W, so you find the
corresponding help at
:h CTRL-W_*(e.g.:h CTRL-W_pfor switch to the previously accessed window). You can also access:h windows.txtand read your way through, if you are looking for window handling command.
- Ex commands always start with ":", so
:h :scovers the ":s" command.
- Use CTRL-D after typing a topic and let Vim try to complete to all available topics.
- Use
:helpgrepto search in all help pages (usually also includes help pages by installed plugins). See:h :helpgrepfor how to use it. Once you have searched for a topic, all matches are available in the quickfix (or location) window which can be opened with:copenor:lopen. There you can also use/to further filter the matches.
:h helphelpcontains some information on how to use the help.
- The user manual. This describes help topics for beginners in a rather
friendly way. Start at
:h usr_toc.txtto find the table of content (as you might have guessed). Skimming over that help to find certain topics, .e.g you will find an entry "Digraphs" and "Entering special characters" in chapter 24 (so use:h usr_24.txtto go to that particular help page).
- Highlighting groups always start with
hl-*. E.g.:h hl-WarningMsgtalks about the "WarningMsg" highlighting group.
- Syntax highlighting is namespaced to ":syn-topic", e.g.
:h :syn-concealtalks about the conceal argument for the :syn command.
- Quickfix commands usually start with ":c", while location list commands usually start with ":l".
:h BufWinLeavetalks about the BufWinLeave autocmd. Also,:h autocommands-eventstalks about all possible events.
- Startup arguments always start with "-", so
:h -ftakes you to the help of the "-f" command switch of Vim.
- Compiled extra features always start with "+", so
:h +concealtalks about the conceal support.
- Error codes can be looked up directly in the help.
:h E297takes you exactly to the description of the error message. Sometimes however, those error codes are not described, but rather are listed at the Vim command that usually causes this. E.g.:h hE128takes you directly to the:functioncommand.
- Documentation for included syntax files is usually available at
:h ft-*-syntax. E.g.:h ft-c-syntaxtalks about the C syntax file and the options it provides. Sometimes, additional sections for omni completion (:h ft-php-omni) or filetype plugins (:h ft-tex-plugin) are available.
Jan 11 - Jan 17, 2016
Cheatsheets
Jan 04 - Jan 10, 2016
Getting help offline
- options are enclosed in single quotes, e.g.
:h 'textwidth'
Vim distributions / Screencasts
Delays when using escape key in terminal / Screencasts
<esc>is used a lot for returning to normal mode or quitting an action.
- Cursor keys are encoded using escape sequences.
- Vim expects Alt (also called Meta key) to send a proper 8-bit encoding with the high bit set, but many terminal emulators don't support it (or don't enable it by default) and send an escape sequence instead.