wiki/cards/vim.org
Gabriel Arazas c21ed1eaa7 Include cards
Even if they're not supposed to be used with anki-editor, they are a
great way to include questions in my notes. Though, I don't know how to
best include them other than straight up linking them.
2021-05-04 01:10:14 +08:00

2.0 KiB

Anki: Vim

Jump to previous jump point

Front

How to get back in previous jump point?

Back

Ctrl + O

Remember it as getting out of the current jump point and back to the previous one.

Enter jump point

Front

How to jump into a keyword?

Back

  • Ctrl + ] will enter into the definition block of a keyword.
  • K also has the same effect.

Go to file path

Front

How to go to the file path at point?

Back

gf as in goto file.

Set as a pager

Front

How to set Vim as a manpager?

Back

MANPAGER="nvim +Man!"

+Man! is a command invocation (as if entering :Man inside Vim). It can also be written as -c Man!.

The :Man! command displays the current buffer as a manual page.

Show outline/table of content

Front

How to show the table of contents of a document?

Back

gO, although the results are filetype-specific (and some don't have any). Helpful examples include for manual pages and help pages (from :help).

Detect files through filetypes

Front

How does Vim detect the files?

Back

Vim guesses the file by assigning filetypes, mainly through the file name and reading the file content. A filetype is how Vim knows what plugins to apply to the current buffer.

Vim has a few built-in filetypes such as shell, manual pages, Markdown, Asciidoc, xmodmap, patch files, and JSON among others (that are in $VIMRUNTIME/filetype.vim).

For more information, run :help filetype inside Vim.