💾 Archived View for warpengineer.space › entries › useful-vim-settings-without-plugins.gmi captured on 2024-08-31 at 11:40:18. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-

Here are some settings that I use in Vim to make it useful without having to install a ton of plugins.

File Search

" Vim File Search Settings<br> set path+=** set wildmenu

Setting the path variable will allow Vim to search subdirectories and turn on tab completion.

Setting the wildmenu will show a list of matching files in a popup line when tab completion is used.

Once these two are set, you can use :find with tab and * to autocomplete and wildcard-match files.

Tag Jumping

" Vim Tag Jumping<br> command! MakeTags !ctags -R .

To use this, `ctags` must be installed. When this command is issued, a tags file is created. Then, you can use `^]` to jump to a tag that's under the cursor. Use `g^]` for an ambiguous tag search. Use `^t` to jump back to where you were. Issue the command as needed to update the tags file. (^ means the control key.)

Autocomplete

To autocomplete words while typing, use control x to start the autocomplete.

Then use control n for local completes (from within the file), control f for file name completes, and control ] for tag completes.