The vim itself is enough
This talk focuses on enhancing users' understanding of Vim by exploring powerful features that can improve productivity without relying on plugins. The speaker emphasizes practical tools and technique
Published: 12:00 am · 15 Jan 2025
vim
bash
notes
The Goal
- Increase Vim Understanding: Help users become more proficient with Vim.
- Offer Powerful Options: Introduce built-in features that enhance workflow.
Not A Goal
- Hate Vim Plugins: The speaker does not express disdain for plugins.
- Discourage Plugin Use: The aim is not to convince users to stop using plugins.
Finding Files
- Fuzzy File Search: Search through subfolders with tab-completion.
set path+=**
- Display all matching files when we tab complete
set wildmenu
- Usage: Use
:find
with partial matches and*
for fuzzy searching, Autocomplete open buffers with:b
.
Tag Jumping
- Creating Tags: Generate a tags file using ctags.
command! MakeTags !ctags -R .
- Navigation: Jump to tags using
^]
, handle ambiguous tags withg^]
, and return to previous tags with^t
.
Autocomplete
- Insert Mode Completion: Various completion options available in insert mode.
^x^n
for just this file^x^f
for filename (works with our path track!)^x^]
for tags only^n
for everything specified by the complete option
- Navigation: Use ^n and ^p to cycle through suggestions.
File Browsing
- Netrw Configuration: Customize file browsing settings.
let g:netrw_banner=0 # disable annowing banner
let g:netrw_browse_split=4 # Open pointer window
let g:netrw_altv=1 # open splits to the right
let g:netrw_liststyle=3 # tree view
let g:netrw_list_hide=netrw_gitignoreHide()
let g:netrw_list_hide=',\(^\|\s\s)\zs\.\S\+'
- Usage: Open a file browser with
:edit
, and use<CR>/v/t
for split/tab options. - Check |netrw-browse-maps| for more mappings
Snippets
- HTML Template Insertion: Quickly insert a skeleton HTML template.
nnoremap ,html :-1read $HOME/.vim/.skeleton.html<CR>3jwf>a
- Usage: Type
,html
in normal mode to import the template.
Build Integration
- RSpec Integration: Configure Vim to run RSpec tests.
set makeprg=bundle\ exec\ rspec\ -f\ QuickFixFormatter
- Usage: Run tests with
:make
, list errors with:cl
, and navigate errors using:cc#
,:cn
, and:cp
.
Additional Helpful Tips
- Access help documentation easily:
:help ^n
:help i_^n
:help c_^n
:helpgrep windows # to search through all help doc and print result but windows
This talk provides practical insights into leveraging Vim’s built-in features, encouraging users to explore and utilize these tools for a more efficient coding experience.