Vim
The best text editing experience you will ever get. It is worth learning it as you will start thinking about text editing differently.
I use some kind of vim bindings in any app I use and if there is a vim plugin for the app, I often use it. I use vim editor often when connecting to remote sessions and when I need a console editor.
I use Neovim instead of vim and my vimrc can be found here. And here are all the plugins I use with it.
I switch between Ayu Light and Ayu Mirage themes as I change between macOS appearances.
Ayu Light
Ayu Mirage
I also use a little trick where I change the cursor from thin block in insert mode to underline when in normal mode. This lets me quickly know which mode I am in.
Notesβ
- I can profile vim startup time with startuptime.
- I can run
:CheckHealth
to see if there is anything wrong with my installation (only Neovim). - Get plugins that meet your needs.
- You're more likely to find useful plugins if you approach it the other way around: I want to do X, vim can't do it nicely by itself, which plugin can help me do it.
- If something doesn't work in vimrc, put the binding in the bottom of vimrc (perhaps something overrides it).
- I care about reducing friction, and Vim's editing language is very good at that.
Codeβ
" Insert text in the end of each line
" s/ - substitute.
" $ - the end of the line.
" / - change it to.
" , - a comma.
:%s/$/,
" Lowercase line
Vu
" Find char backwards
F<char>
" Delete backwards until char
dT<char>
" Visually select until char
v/<char><return>
" Delete all lines in file
:%d
" Yank two inner words
" Yanks first and second words (with the trailing space) in the unnamed register
y2aw
" Delete until start of line
d0
" Yank entire file
:%y+
" Select entire block
Vat
" Visually select until end of line
v$
" Visually select paragraph or function
V}
" See whats in a buffer
" See insides of q buffer
:echo @q
" See registers
:registers
" Delete until end of file
VGx
" Visually select block
V%
" Start recording macro
" Record to register d
qd
" Delete char under cursor
x
" Yank inside tag. Can yank an XML tag for example
yat
" Make multi line search. https://vim.fandom.com/wiki/Search_across_multiple_lines
" Will carry over to new line
\_s
" Inclusive search
/foo/e
" Delete until searched string. Won't delete string itself.
d/string
" Search and replace
:%s/<search>/<replace>/g
" Run command on startup
" Run ':Goyo' on startup. Put it in .vimrc
autocmd VimEnter * Goyo"
" Insert text at start of each line in file
" Insert // at start of each line in file
:%s!^!//!
" Replay last macro
@@
" Delete until character
df<char>
" Centre current line
zz
" Put results of command into a register
" In normal mode, will put results of d$ command into _ (black hole register)
"_d$
" Run macro on whole file
:%normal @x " will run macro x
Linksβ
- You don't grok vim
- How to start learning Vim
- Vim Koans - Quite funny.
- Macros
- Seven habits of effective text editing
- Go client for neovim
- Vim Golf
- Vim Is Not About hjkl
- Ask HN: What is one Vim trick most people don't know? (2018)
- Vim Proverbs
- tpope's Vim Config and Plugins (2014)
- veonim - Simple modal IDE built on neovim.
- The Last Statusline For Vim (2018)
- How I revamped my Vim setup (2019)
- Intermediate vim (Lobsters) (HN)
- vi Complete Key Binding List
- Effective VimScript (2019) (Reddit)
- Lobsters: Whats your vim setup like? (2019)
- nvim-lsp - Common configurations for Neovim Language Servers.
- We can have nice things (2019) (Slides)
- Vim like apps/plugins (HN)
- pack - Missing vim8 package manager.
- Neovide - No Nonsense Neovim Client in Rust.
- Lisp in Vim with Slimv or Vlime (2019)
- Build Your Own Vim Emulation for VS Code (2020) (HN)
- 130+ Essential Vim Commands (2020)
- libvim - Core Vim editing engine as a minimal C library.
- diagnostic-nvim - Wrapper for neovim built in LSP diagnosis config.
- Mastering Vim Quickly
- Missing Semester VIM lecture (2020) (HN)
- Make Vim Amazing videos
- Vim Life videos
- General purpose Language Server that integrate with linter to support diagnostic features
- Neovim Async Tutorial (2020)
- How Did Vim Become So Popular (2020) (HN) (Lobsters) (Reddit)
- Vim's Versatile CLI (2020) (Lobsters)
- GNvim - Rich Neovim GUI without any web bloat.
- Why Should You Learn Vim in 2020 (Lobsters) (HN)
- Vim Search, Find and Replace: a Detailed Guide (2020)
- Neovim 0.5.0: Language Server Protocol (2020)
- Neovim for macOS - Fast, minimal, Neovim GUI for macOS.
- VimTricks - Weekly Vim tips, tricks, guides, screencasts, and more.
- Learn Vim (the Smart Way) (HN)
- VIM quick-start, cheat-sheet, and links (2013)
- VimConf - Virtual vim conference.
- Vim: Sharpening the Axe (2020)
- Using LibUV in Neovim
- Beyond basic modal editing. Using vim's command-line mode (2020)
- Vimscript Language Server
- Vim Registers: What, How, and Macros (2020)
- GoNeovim - Neovim GUI written in Go, using a Qt binding for Go.
- pyvim - Pure Python Vim clone.
- NeoVims built-in Language Server Client and why you should use it (2020)
- Getting started using Lua in Neovim
- Firenvim - Embed Neovim in your browser.
- Why I teach vim (2020) (HN)
- Improving Vim Workflow With fzf (2020) (Lobsters)
- Vim Script Parser written in Go
- glrnvim - Fast & stable neovim GUI could be accelated by GPU.
- Five lines I put in a blank .vimrc (2020) (HN) (Lobsters)
- neovim-editor - WebComponent to embed Neovim to your app with great ease.
- How do you index code in your projects? (2020)
- At least one Vim trick you might not know (2019) (HN)
- A Vim Guide for Intermediate Users (2020) (Lobsters)
- The ABCs of vim (2020)
- Customizing Neovim LSP (nvim-lsp) (2020)
- popfix - Neovim lua API for highly extensible quickfix window.
- vim9jit - Vimscript but in Lua and fast.
- sql.nvim - SQLite/LuaJIT binding for lua and neovim.
- Neovim client for Julia
- neovim-lib - Rust library for Neovim clients.
- Your First VimRC 2021
- vim.so - Learn and Master Vim faster with interactive exercises. (HN)
- lspsaga.nvim - Light-weight lsp plugin based on neovim built-in lsp with highly performance UI.
- nlua.nvim - Lua Development for Neovim.
- Configuring Neovim using Lua (2021)
- A Vim Guide for Advanced Users (2021) (HN) (Reddit)
- Extreme Vim Macros for Traditionalist Catholics (2021) (Reddit)
- Vim is Turing-Complete (2021)
- nvcode - Ultimate Neovim Config NVCode.
- Vim normal mode grammar
- Vim Tips You Probably Never Heard of (2021)
- Neovim 0.5 Is Overpowering (2021) (HN) (Lobsters)
- Xcode 13 Vim Mode
- Vim Cheat Sheet (Code)
- A Vim Guide For Veteran Users (2021)
- Neovim Discourse
- HN: Neovim v0.5 (2021)
- Vim is actually worth it (2021)
- Neovim News #11 - The Christmas Issue (2021)
- A Vim Guide For Experts
- Moving to modern Neovim (2021) (Lobsters)
- NVUI - NeoVim GUI written in C++ and Qt. (HN)
- Vim.is - Interactive Vim Exercises. (HN)
- Neovim and Tmux for JavaScript Development (2021)
- My workflow using Vim (2021)
- DIY quality of life improvements - Anton Kastritskiy - Vimconf 2021
- vimconf.live [2021]: Buffer is King
- How to turn Vim into a powerful and beautiful IDE | Jess Archer, Vimconf 2021
- Lisp in Vim (2019)
- nvim-treesitter - Nvim Treesitter configurations and abstraction layer.
- Whatβs your favorite vim shortcut/hack (2022)
- Vim Reference Guide (HN) (Code)
- Vim University - Curriculum for leveling up your Vim.
- Why I love Vim: Itβs the lesser-known features that make it so amazing (2016)
- Interview with a VIM Enthusiast 2022
- Git Jump to Vim Quickfix (2022)
- Neovim 0.7 (2022)
- What's New in Neovim 0.7 (2022)
- Learnings after 500 commits to my vimrc (2022)
- Neovim 0.7 Release (2022) (HN)
- Learn Neovim The Practical Way (2021) (Code)
- nvim-oxi - Rust bindings to all things Neovim.
- Neovim -- First Lua Config (2022)
- Vim 9.0 Released (2022) (HN) (HN) (Lobsters)
- Learn Vim the Simple Way (HN)
- VIM A-Z: A Text Object for Every Letter in the Alphabet (2022)
- History and effective use of Vim (2019) (HN)
- This Week In Neovim (Contents)