[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]

how many shortcuts do you have to know to be effective with vim?

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: 83
Thread images: 9

File: Vimlogo.png (10KB, 140x140px) Image search: [Google]
Vimlogo.png
10KB, 140x140px
how many shortcuts do you have to know to be effective with vim?
>>
20?
>>
>>57282232
understand different modes, buffers, and the general structure of most commands (i.e. action + movement) and you are good to go.
>>
File: vim_drill_small.jpg (80KB, 518x376px) Image search: [Google]
vim_drill_small.jpg
80KB, 518x376px
>>57282232
The real question is, how many Ugandan children did you support this month?
>>
>not using office
fucking unnormies man
>>
File: sheit.jpg (485KB, 2097x1467px) Image search: [Google]
sheit.jpg
485KB, 2097x1467px
>>57282901
Kony helped more children find a job than you.
>>
For basic use, not many. Mostly just i for insert and :wq. If you want to do fancy shit I suggest that you rtfm and practice over the weekend.
>>
>>57282232
All of the ones covered in vimtutor. Then you can use Vim in an effective way.

To use it like a basic text editor (Notepad level), all you need to know is the following:
- vim starts up in "normal mode" where every key has its own function
- i puts you in insert mode, to type raw text
- escape brings you back to normal mode
- : will put you in command mode, to run commands
- :w will save your document (write it)
- :q will quit vim
- :wq will save and quit at once

It isn't very difficult to understand, and especially not if you just go through the vimtutor.
>>
>>57283247
ZZ iz your friendz too.
>>
>>57282232
How many shortcuts do you need to know to be faster in vim than sublime text?
>>
>>57282232
u=undo
>go nuts
>>
>>57283626
this is the real question.
>>
>>57283626
Not many. Basic motions with counts, find and search forward and back, and copying and pasting should be enough. Macros too since they are a nice way to really boost speed even if you don't know many commands.
>>
Serious question how can I override the :s command? I don't want to learn another damn regex language. I can write python just can't find a good reference for overriding commands with addons.
>>
>>57282232
o and O:
Like `i` you start to insert text but you do it after or before the current line.

p and P:
Paste after or before the current cursor position or line.

=:
Fix indentation

v and V:
Highlight shit, so you can do stuff like fix indentation

vip or vap:
Highlight inside or around the current paragraph.

dip or dap/yip or yap:
Cut or yank in or around the current paragraph. Good for moving functions around. You can also combine with numbers like d2ap to delete the next two paragraphs in one go.
>>
>>57282232

w, ci, _, $, :vs, C, dd, p, :vs, :tabe, :tabnext (bind it)
>>
File: teco_EP.gif (4KB, 394x288px) Image search: [Google]
teco_EP.gif
4KB, 394x288px
Define "Effective"
Vim is an obstruction to productivity for text authoring. Simple edits are made needlessly complex and require many more keystrokes than they would in emacs. It's better for macro-edits, but horrible at all other times.

Vim is more like TECO now than emacs was when it was literally TECO. Macro package for vim becoming its own non-modal editor when?
>>
>>57284076

I liked how you just threw out an inflammatory statement with not a single argument to back it up. Good post
>>
>>57284147
He's waiting for someone to call him out on it first so he can be all "I'm glad you asked" and we get his real post afterward as DLC.
>>
>>57283247
you forgot :wq!

I use it daily, save & quit
>>
>>57282232
i. w. q. 3 letters.
just works.
>>
File: worrycornman.jpg (10KB, 193x245px) Image search: [Google]
worrycornman.jpg
10KB, 193x245px
>>57284076
>obstruction

To who exactly? A fucking normie who isn't used to text authoring inside of the terminal? Well why the fuck does it matter at that point given IT IS A FUCKING NORMIE
>>
>>57284076
no need to start a flame war
>>
File: vulcan pepe.png (272KB, 1280x731px) Image search: [Google]
vulcan pepe.png
272KB, 1280x731px
>>57284076


WHAT THE FUCK
>>
File: .png (5KB, 208x72px) Image search: [Google]
.png
5KB, 208x72px
>>57284076
t.b.h. i`d rather edit via a series of lesses and echoes than vi
>>
>>57284039
gt and gT
>>
>>57284426

heh, never knew there was a default tabnext tabprev bind, I used the leader key. The more you know!
>>
>>57284147
If you're a vim user you should already know the folly of typing esc-colon-w-enter-i to save a file and then go back to writing text when everyone else just types ctrl-s

To make vim truly efficient and effective you would have to bind so many single-shot shortcuts and macros within insert mode that you would eventually have a normal editor with normal mode tacked on for "serious" editing.
>>
>>57284580

uhh, I just bound ww to save current buffer in normal and insert mode. One of the very first things I did when I got vim...
>>
>>57284580
To most vim users, normal mode is the default state. You enter insert mode to make small changes and then go back to normal mode. That's automatic. Insert mode is for writing text. Normal mode is for moving around and manipulating text. So :w<cr> takes just about as much effort (ignoring the ugly chord) as C-s in other editors.
>>
>>57284302
:x
>>
>>57282901
That's a real King Kong looking motherfucker
>>
>>57284302
>2016
>using :wq! instead of :x
:q means quit, and :q! means quit dammit, just like with :help and :help!
>>
>>57283247
this really. Just use it like a basic text editor and when you want to do something(like delete a line, replace a pattern with another, etc) check on the wiki how to do it, eventually you'll organically get all the shortcuts you need.
>>
>>57283974
:s is nearly the same shit as with history substitutions so you may as well know it.
>>
which editor should I be using for effectively writing code? as in, adding new code, not maintaining existing one. sublime is really handy and it allows customization via JSON. I really don't like vim for programming because simple things like deleting the whole word (ctrl+backspace in sublime) require me to exit and re-enter insertion mode. so what should I be using if I don't want to rely on proprietary software anymore?
>>
>>57284373
why you don't?
also, there's editor for such purpose, it's called ed.
>>
I pretty much get by with only
diw
dw
yiw
g and G
cc
yy
"+y
p
o
ctrl shift v + direction
u and ctrl r
$
^
:vs
:!<systemcommand>
:%s/word/newword/g

>default vim with only nerdtree extension
>>
vimtutor will suffice for your basic shitposting needs, faggo.
>>
>to be effective
know how to get into and out of edit mode

that's it. when you first start using vim, you should be using it like you would use a straightup editor like notepad. add new hotkeys and techniques to your repertoire as necessary.
>>
>>57284701
move your keybinds around so that colon doesn't need a chord
>>
>>57282232
None, you have to understand they are not shortcuts but a language with verbs, nouns and adverbs to edit text.
>>
>>57282241
fuck off with your reddit memes
>>
>>57282232
PLEASE SOMEONE GIVE ME A NON-SHIT ALTERNATIVE TO VIM, EMACS, THE VARIATIONS OF THE PREVIOUS TWO, SUBLIME TEXT, ATOM, ETC.

FOR LINUX.
REQUIREMENT IT MUST LOOK GOOD
>>
>>57286108
scite
>>
>>57282232
just use vim tutor
>>
If you know "i" and "ESC" you're already as effective with vim as you are with gedit or nano or notepad, and any shortcut you get on top of that is making you more effective than those other text editors. If you use it like notepad for a while and learn shortcuts as you learn shortcuts, you'll eventually be unable to go back.
>>
>>57286108
STOP BEING A FAGGOT AND INSTALL WINDOWS WITH VISUAL STUDIO!
>>
>>57283139
kony for president
>>
>>57286108
gedit
>>
>>57286108
if command line -> micro (basically nano, but good and complete)
if browser based -> VS code (well, who would really want browser based editors)
if JVM based -> jEdit (see #2)
if a real, actually usable GUI -> UltraEdit
>>
AYY LMAO NIGGA WTF LIKE JUST USE A MOUSE LIKE WHAT LIKE ARE YOU FROM THE 70'S LOL
>>
>>57286016
This t.b.h.
>>
I know like I duuno 5? And I do all my scripting in vim. Lets see:

y
p
i
a
dd
x
r R
o
/pattern

:q, :w, :wq!

And know how to navigate (I mean I guess you can use arrow keys) and that's about it. Anything else use help or man vim
>>
>>57286108
vi is pretty good
>>
>>57282232
You have to have the second edition of Practical Vim memorized. Only then will you be a true editing god.
>>
>tfw you learn vim but then you're to intelligent to learn emacs
>>
>>57282946
AAHAHHAHHAHAHAH SO FUNNY

fuck off reddit
>>
>>57286016
>:!<systemcommand>
:r!<systemcommand>
:r <file>
>>
>>57284701
So you admit vim is garbage for actually writing text?

It's the dream editor for second-tier code monkeys and newbie programmers who spend most of their time tweaking text, but for experienced professionals whose edits are in themselves lengthy writing sessions instead of brace shuffling and re-indentation parties, having "edit" mode be the default state is heinous.

In that sense, vi/vim really is an editor for UNIX users. After all, all they do is fuck with config files.
>>
File: emacs disease.jpg (93KB, 800x600px) Image search: [Google]
emacs disease.jpg
93KB, 800x600px
>>57286445
>>
>>57286660
Rekt.
>>
i, a, o, x, /, dd, esc
:wq
>>
>>57286660
I liked how you just threw out an inflammatory statement with not a single argument to back it up. Good post
>>
i (insert mode), a (append to line), 0 (go to beginning of line), $ (go to end of line), d (delete here), dd (delete line), dw/dW (delete word), gg (top of file), G (end of file), :w, :wq, :e. I probably messed one of these up, I don't really think about these anymore. I use them all day... I could probably get better and learn more commands but this serves my needs fine. Only time I really fuck up is copying/pasting and indentation commands.
>>
>>57286660
Huh? Vim is just as good as anything else for writing text. Pick your favorite of iIoOaAR and type away. I believe there were some benchmarks done and vim is just as fast if not faster at putting characters on the screen as you type. If you want word wrap and spell checking you've got that.

But it's an editor. Where it shines though is editing text. Which is most of what you do when writing prose or programming. Merely being able to quickly jump between sentences, paragraphs, sections, words, and WORDS with a few keystrokes or jump to some search pattern so you can perform edits without having to touch your mouse puts vim above anything else for casual users who care to learn it.
>>
>>57286808
*as fast as or faster than other major editors
>>
>>57286779
>>57286808
He baited you guys so hard.
>>
>>57286824
I don't care if he's just pretending to be retarded. I just want the random other person reading this to not get the wrong impression.
>>
>>57286842
name one single proffesional or big company that use vim on daily basic senpai
>>
>>57286808
>Huh? Vim is just as good as anything else for writing text

So why would I use it?

>Where it shines though is editing text

I am not a code monkey/Sys Admin/QA engineer that spends all his time reshuffling code.
>>
>>57287285
Vim is the most popular editor at Google followed closely by Emacs. Intellij IDEA is next but it's much less popular than both Vim and Emacs.
>>
>>57287285
>name one big company
>that use [any given text editor]
this is like asking what car big companies drive. that's how retarded your demand is.
>>
try to learn the vim language, thoughtbot has a good series of videos on it

things like 'ciw' or 'caw'
i don't even remember stuff, it just comes natural
wanna delete a word? 'diw' ==> 'delete inner word', for example
wanna delete and go into insert mode? 'ciw' ==> 'change inner word'

also, i see a lot of :wq over here, you dumbasses can thank me for saving you from arthritis but please use :x
it does the same thing but saves you a whole keystroke
>>
>>57285696
Ctrl+w in vim fuccboi
>>
>>57286108
>REQUIREMENT IT MUST LOOK GOOD
Your mother.
>>
>>57287585
I find the ones who use Emacs to generally be more intelligent.
>>
>>57288867
Most of the Go team is really dragging the vim users down.
>>
>>57288883
How?
>>
>>57286108
vi
>>
>>57286108
Textadept or howl
>>
File: Xlk9rNfl.jpg (18KB, 300x300px) Image search: [Google]
Xlk9rNfl.jpg
18KB, 300x300px
>>57284076
At the level /g/ has devolved to, I'm just happy I've gotten this far in the thread without seeing any fucking sublime faggots. Good post, friend.
>>
The only way to be really effective with vim is to use it a lot. You're never going to learn all of the shortcuts. Just use it a lot and you'll find the shortcuts that tailor to you. I've even got a vim plugin on chrome, wasavi, that allows me to use vim controls on text fields.

Basically don't worry about the commands and just start using it.
Thread posts: 83
Thread images: 9


[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.