Vim
A powerful Text Editor
Getting Started
Related
- THREAD Vim Mnemonics
- Day 26 - Switch to Linux, Learn Vim
- Vim Custom Markdown Syntax
- Vim and large files
Vim Everywhere
- Vim in Obsidian with Obsidian Vimrc
- Vim in IntelliJ with ideavimrc
- Vim in Firefox with Tridactyl
- Vim in Chrome with Vimium
Quick shell commands
Run the command under the cursor with !! then sh. The command output will replace the command.
Troubleshooting
Write to log file with vim -V20vimlog README.md
Concealing Characters
see concealcursor and conceallevel to hide characters.
From Vim Custom Markdown Syntax
Counting Words
Count selected text with '<,'>write !wc -w -.
- Visually select a block of text and press
:. This will enter Command Mode. - Now complete the command like this
'<,'>write !wc -w - write !will write the selection to an external program- the command
wc -w -will tellword-countto count text from stdin wordwise
Spellchecking
# download spell file
cd /usr/share/nvim/runtime/spell
sudo wget http://ftp.vim.org/vim/runtime/spell/de.utf-8.spl
Then you can :set spell! to toggle spelling in Vim on and off.
Autocommands
" Remove trailing whitespace on save
autocmd autofixes BufWritePre * %s/\s\+$//e
" specify text width for markdown files
autocmd autofixes BufEnter *.md set textwidth=80