[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

What are some lesser-known Vim commands?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 24
Thread images: 5

File: vim.png (95KB, 605x552px) Image search: [Google]
vim.png
95KB, 605x552px
What are some lesser-known Vim commands?
>>
:q
>>
:%s/op/faggot/g
>>
:r! fortune | cowsay
>>
.
repeat the last edit where the cursor is now.
>>
>>61789087
:!emacs %<cr>
>>
:q!
>>
>>61789087
;

Repeat last ftF or T command

,

Same, but in reverse
>>
File: Screenshot_2017-03-30_22-30-20.png (19KB, 562x338px) Image search: [Google]
Screenshot_2017-03-30_22-30-20.png
19KB, 562x338px
>>61789087
The donate command.
>>
https://www.vi-improved.org/vim-tips/
>>
:help!
>>
>>61789330
i prefer the elisp port
M-x feed-niggers
>>
>>61789087
gv reselect last selected region
`] go to bottom of pasted text
pressing o while selecting will allow you to change the selection's start
= auto-indents a region
: while selecting will allow you to perform regex on selected block

protip: stop using tabs and learn the buffer system
>>
File: 1475269575120.gif (2MB, 200x200px) Image search: [Google]
1475269575120.gif
2MB, 200x200px
>>61789414
>pressing o while selecting will allow you to change the selection's start
>>
:qa!
-quit everything --help panels reg lists splits etc.
caw
-change a word
c4w
-change 4 words
ci)
-change inside parentheses
(ca)
-delete parentheses and whats inside them
ci}
ci]
>>
:earlier 3m
make my shit the way it was 3 minutes ago.
:later 1m
>>
learn to record macros.
not hard.
thank me later.
>>
:sort
Is pretty neat
:Buffdo "normal gg=G | :w"
Was super helpful at work the other day
>>
File: 1493085840776.png (3MB, 2048x1714px) Image search: [Google]
1493085840776.png
3MB, 2048x1714px
>>61789582
>tfw a and i as movement commands
>>
>>61789414
>: while selecting will allow you to perform regex on selected block
Not just regex but any ex command in general. You can even do something like
:'<,'> normal [some normal mode keystrokes]

Another one of my favorite is @:, which repeat the last ex command. Pretty useful for things like cycling through buffers/tabs/anything without having to set keymaps.
>>
>>61789123
thx man, I was trying to quit this shit for week now.. finally I can use my terminal again for other things
>>
33o<CR>Fizz<CR><Esc>qqABuzz<Esc>5kq19@q:%s/^$/\=line('.')<CR>
>>
File: 1495900040633.gif (2MB, 350x255px) Image search: [Google]
1495900040633.gif
2MB, 350x255px
>>61793394
fukken hired
>>
>>61793418
ty but im already employed and paid as a neet full time
Thread posts: 24
Thread images: 5


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.