I'll never get used to it. Let's get started and learn..
save with sudo¶
I need it every day, I just can't remember it. needs to be on the top. when you get this (opening and editing a file as a regular user but the file is owned by someone else):
'readonly' option is set (add ! to override), do this:
indent multiple lines by
n is 2 in this example
select multiple lines with
v (visual mode) and do
< to go the other way
- select the lines you want with
le4where 4 is the number of spaces
V for visual mode,
jj for selecting two lines (you can also use your arrow keys),
:le4 to indent by 4 spaces)
prepend text / multiple cursors¶
control + vto go into visual block mode
- select your lines, either with the arrow keys or
shift + istart whatever you want to prepend, like
#to comment something out
convert tabs to spaces¶
create new file¶
create new file while vim is open:
paste from external clipboard¶
search and replace within the whole document:
search and replace interactively term by term:
switch to nerdtree window¶
toggle nerdtree window¶
open, close, open, close. bed up, bed down, bed up, bed down
that's the default:
add something like this to your `~/.vimrc`` file
with this line you can toggle nerdtree with
\f given that
\ is your leader key.
or reload the whole folder structure:
a plain text wiki for vim including a diary function, kinda cool.
I need to learn and remember them!
<Leader>ww-- Open default wiki index file.
<Leader>wt-- Open default wiki index file in a new tab.
<Leader>ws-- Select and open wiki index file.
<Leader>wd-- Delete wiki file you are in.
<Leader>wr-- Rename wiki file you are in.
<Enter>-- Follow/Create wiki link
<Shift-Enter>-- Split and follow/create wiki link
<Ctrl-Enter>-- Vertical split and follow/create wiki link
<Backspace>-- Go back to parent(previous) wiki link
<Tab>-- Find next wiki link
<Shift-Tab>-- Find previous wiki link
diary key bindings:
<Leader>w<Leader>w- create new diary file with current date
<Leader>wi- go to diary index
<Leader>w<Leader>i- update diary index
- vim-markdown docs - until I've learned it by myself
- vimoutliner docs here - until i've learned it
- vimoutliner cheat sheet - they're really tricking you in reading the README to find the cheat sheet!