What are some of the neatest Vim features that few people know of?

What are some of the neatest Vim features that few people know of?

Attached: magazine-unlock-05-2.3.1152-_F3EA58808E223B4CA1AF55414505ED42.jpg (1440x2560, 481K)

Other urls found in this thread:

github.com/oblitum/caps2esc
github.com/christoomey/vim-tmux-runner
vimeo.com/126420226
twitter.com/NSFWRedditImage

:q!

inoremap jj

set listchars=tab:>-,trail:ยท,eol:$
nnoremap s :set nolist!

vnoremap < >gv

set clipboard=unnamed

since it's still relatively new in vim(8+)

function! OpenTerm() abort
10sp new
call termopen('/bin/bash')
setlocal nonumber norelativenumber
startinsert
endfunction
nnoremap :call OpenTerm()

>inoremap jj
Don't do this. remap your capslock key:
>github.com/oblitum/caps2esc
Use it as esc when pressed alone, and ctrl when pressed with another key
Just use tmux, it is way better.
Edit remote files over SSH:
>vim scp://host/folder/file.txt
save/restore your session:
>:mksession lol.session
>vim -S lol.session
Cool vimrc settings:
Live preview when doing find & replace:
>set inccommand=nosplit
Persistent undo history:
>set undodir=~/.vim/undo
Cool meme:
>:smile

>Just use tmux, it is way better.
no way, I've set up vim to do just fine without tmux so I can also use nvim-qt/gvim if I feel like it

my tab binds
nnoremap tn :tabnew
nnoremap tt :tabnew
nnoremap ts :vsplit
nnoremap :tabn
nnoremap :tabp

nnoremap :vertical resize -4
nnoremap :vertical resize +4

:earlier 5m
>revert to state 5 minutes ago.
:later 1m
>yeah make that 4 minutes ago.

sudo apt get uninstall vim

Try integrating vim with tmux. It is comfy AF. Try this plugin which lets you send commands from vim to a tmux pane:
github.com/christoomey/vim-tmux-runner
vimeo.com/126420226

vimdiff

Try learning to split vim into horizontal or vertical viewports, and learning diff mode and patch mode.

:make and the quickfix window. :term also exists now, but the workflow seems weird to me. If you want, you can change how netrw to treeview, and open it in its own split. You now have nerdtree, but built in. People like this for some reason.

About 80% of the people I talk to don't even know vim has built in autocomplete. They'd rather install slow buggy shit like youcompleteme

>you can change how netrw to treeview
interesting, sometimes I've wanted this when messing around with other people's projects but never felt like installing nerdtree

For most cli things, (vim, top, man pages, etc.), if you want you're terminal back for a bit, just ctrl-z to background it, then fg when you want to foreground it again.
In the case of vim, you also have the option of :suspend if ctrl z is mapped to something else.
Also;
:!command will get you back into term and run 'command'
:r /path/to/file will "read" contents of file into vim session.
:r!command will "read" the output of 'command' into your work/

How do I use vim's built-in autocomplete? I'm tired of slow YCM.

>vim features
Vi features.

Attached: ed2.png (680x1483, 180K)

no, vim features. vi is proprietary trash and nobody uses it. any vi today is a link to vim, nvi or other free software programs.

neovim

Why do you pick nerdtree over ranger? Honest question

>remap your capslock key
it's already remapped to control my dude

never mind, I can't read

:Capture
Basically vim's internal pager which handles the output of commands sucks even more than GNU's less. So the Capture plugin allows you to view the output in another vim window. Indispensable to debugging / filtering etc.

Because I can't stop sucking dick.