zhuang@linux:~/reading/practical-vim/07-open-files-and-save-to-disk/$ less

Practical Vim / chapter 07

Open Files and Save Them to Disk

$ grep tags 07-open-files-and-save-to-disk.md

This post extracts some knowledge from Chapter 7 – Open Files and Save Them to Disk.

Ex CommandShorthandEffect
:edit .:e.Open file explorer for current working directory
:Explore:EOpen file explorer for the directory of the active buffer

Think of each window as a playing card. One side of the card shows the contents of a file, and the other side shows the file explorer. After summoning the file explorer view, if we decide that we want to switch back to the buffer we were already editing, we can do so using the <C-^> command.

vim
:w !sudo tee % > /dev/null

We can set keymap at vimrc config file with :W:

vim
command! W execute 'silent w !sudo tee % > /dev/null' | edit!

zhuang@linux:~/reading/practical-vim/07-open-files-and-save-to-disk/$ comments