Open Side Menu Go to the Top
Register
Vim reference guide Vim reference guide

12-02-2015 , 08:13 PM
Agreed. Also there are thousands of ways to skin a cat. I don't ever remember the command to go to the end of the file because I'm so use to mashing numbers and then pressing j.
Vim reference guide Quote
12-02-2015 , 09:11 PM
Quote:
Originally Posted by jjshabado
Agreed. Also there are thousands of ways to skin a cat. I don't ever remember the command to go to the end of the file because I'm so use to mashing numbers and then pressing j.
It's in the OP. It's G. And gg for top of the file.
Vim reference guide Quote
12-02-2015 , 09:42 PM
It never sticks for me. Probably because it's not a big deal for me.
Vim reference guide Quote
12-02-2015 , 10:26 PM
Quote:
Originally Posted by daveT
When I first saw some other (superior-to-vim) editor, I was shocked that anyone would want to program without a mouse or IDE. I think you have to give it an honest shot before you can judge it.

Yeah, it can be painful at first, but the payoff is worth it.
I do mobile work and the IDEs are so tightly integrated to the build process it doesn't make sense to use anything else (I think).

Does anyone here use vim to do serious ios or Android work?
Vim reference guide Quote
12-02-2015 , 10:36 PM
I hear for serious work, Vim is a lot about the plug-ins though too. Anyone care to confirm or deny?
Vim reference guide Quote
12-03-2015 , 12:01 AM
Quote:
Originally Posted by just_grindin
I hear for serious work, Vim is a lot about the plug-ins though too. Anyone care to confirm or deny?
I use to use snipMate and YouCompleteMe. YouCompleteMe isn't as good as VS or Eclipse Java's autocomplete (now that I mention Eclipse, does Eclipse support this for C++?). I also didn't use snipMate very much, so now I'm a just a bare bones vim guy.

NerdTree seems popular, but I usually just open more terminals and spread them out across workspaces, so I didn't bother trying this.

Interested in hearing what others use.
Vim reference guide Quote
12-03-2015 , 01:57 AM
Quote:
Originally Posted by maxtower
I do mobile work and the IDEs are so tightly integrated to the build process it doesn't make sense to use anything else (I think).

Does anyone here use vim to do serious ios or Android work?
I use a vim plugin for both android studio and xcode. You can't easily go keyboard only but the movement advantage is huge.
Vim reference guide Quote
12-03-2015 , 03:23 AM
Quote:
Originally Posted by maxtower
I do mobile work and the IDEs are so tightly integrated to the build process it doesn't make sense to use anything else (I think).

Does anyone here use vim to do serious ios or Android work?
As I mentioned in Editor's thread, if your IDE adds significant value*, then you might be better of using an IDE. But there aren't any free C++ IDEs that add a lot of value imo. Plus, the superiority of g++, which is not available on Windows (cygwin doesn't count), in the world of free compilers rules out VS. And even VS for C++ isn't as nice as Eclipse is for Java.

So, I think C/C++ programming is best done in vim. Also, I have limited experience in python, but I believe the same may hold true there as well.



*Significant value is subjective and will be relative to vim experience in the context of this discussion. IMO - a debugging mode, some compiler errors checks and autocomplete are not sufficient. But if you had a couple of more features, e.g. refactoring support and package/build management (e.g. for Java - Eclipse), then the IDE will have more value to me.
Vim reference guide Quote
12-03-2015 , 06:19 AM
@:::grimReaper - Yes I agree about g++ and it is amazing to get something like that for free. Also for ARM development it is great as well, not many alternatives. VS 2015 has come a long way as far as C++ is concerned. The community edition is free and decent as far as a C++ compiler is concerned.
Vim reference guide Quote
12-03-2015 , 11:24 AM
Quote:
Originally Posted by greg nice
I like the positivity at the end, but it makes me cringe if he's still using arrow keys after seeing the light. Most of your entire right hand rests on jkl for a reason.

Quote:
Originally Posted by adios
@:::grimReaper - Yes I agree about g++ and it is amazing to get something like that for free. Also for ARM development it is great as well, not many alternatives. VS 2015 has come a long way as far as C++ is concerned. The community edition is free and decent as far as a C++ compiler is concerned.
Cool, I'll watch some youtube vids of it this weekend.
Vim reference guide Quote
12-03-2015 , 06:49 PM
I guess there could be a vim mode for Xcode or something.
Vim reference guide Quote
12-03-2015 , 06:51 PM
Quote:
Originally Posted by e i pi
I hit A,esc much more often than I hit $
do this

Code:
nnoremap L $
unless of course you actually use L
Vim reference guide Quote
12-03-2015 , 08:00 PM
Quote:
Originally Posted by maxtower
I guess there could be a vim mode for Xcode or something.
There is an xcode plugin for vim. I use and love it
Vim reference guide Quote
12-07-2015 , 06:00 PM
Quote:
Originally Posted by maxtower
This is a good example of why I hate vim. Just use the arrow keys like every other program. Makes the learning curve unnecessarily steep.
The arrow keys also work in vim. I love vim, but, were it not for the fact that I once worked on old UNIX systems where vi was the only viable text editing option and I was forced to learn it, I'm not sure that would be the case. The vi/vim user interface is about as far from intuitive as it gets and it will drive you crazy until you learn it. This is doubly so if you are used to the way text editing works in standard Windows apps, but once you do learn it it is extremely efficient. There are certainly many good editors out there that are easier to learn than Vim, and probably almost as efficient. But for us old fossils that learned on vi, vim is the best of both worlds. It gives you GUI file dialogs, etc. but still has the super-efficient vi interface that we love (after initially hating it).
Vim reference guide Quote
05-29-2016 , 02:37 PM
Quote:
Originally Posted by blackize5
Oh also a must for any vim user: bind caps lock to esc
I bind `jj`to ESC - seems like much faster to me
Vim reference guide Quote
05-29-2016 , 03:21 PM
I bind ctrl to caps lock system wide. All ctrl commands become 10x easier. Ctrl C for escape becomes easy, but I've also had jk mapped to escape for a long time
Vim reference guide Quote
06-01-2016 , 09:15 AM
Cool thread...

So I want to say upfront that I do believe you all when you say vim is faster once you get past the learning curve, and I'm getting "decent" with it, where it doesn't slow me down too much, and I find it to be very fun.

Now, with that said, I don't think most people compare apples to apples here. I've found that actually using the home, end, and control buttons properly already gives a huge speedup relative to my peers. For example, what grimReaper posted earlier:
Quote:
Originally Posted by :::grimReaper:::
e.g. if you have to copy and paste a line, instead of reaching for the mouse and dragging, pressing CTRL+c then CTRL+v, you just type yyp in vim. It's kinda addicting watching how much text manipulation can be performed with just a few keystrokes.
I would do home->shift+end->ctrl+c->ctrl+v. Yea might take me 2 seconds instead of 1. But in an extreme case where you have to do that 100 times a day you don't even lose 2 minutes. I'm still interested in vim because it just seems really fun, but I'm skeptical about the productivity boost. At least for normal coding, where 95% of the time you're just sitting there thinking, and the physical labor is a small % IMO. I do a lot more algorithm/data science stuff though so maybe that's different.

ETA: Or in the example, maybe just a wiser use of the mouse? By keeping it to right of the text allowing yourself to quickly select whole lines, etc. Then since mouse is 100% right hand and ctrl+c/v is left, they can act pretty much on top of one another.
Vim reference guide Quote
06-01-2016 , 12:43 PM
Well it's a pretty significant time savings on a relative basis, but you're right, it doesn't add up to a significant chunk at the end of the day.

For me my hands start to hurt if I'm constantly having to do ctrl-blah contortions, and moving back and forth to the mouse gives me elbow pain. With vim my hands almost never need to leave the keyboard and the commands I need to hit are much more accessible.

But it's much more common than you think where you need to delete a word or a line and hitting dw or dd is so much easier than opt-shift-arrow or ctrl-shift-end
Vim reference guide Quote
06-01-2016 , 03:29 PM
Yea very good point. Not having to move your hands around is probably really nice. I guess I just take issue with more strawman arguments that paint the picture of using a mouse/ctrl as such a terrible experience.

And again just to clarify I def believe vim is a nice experience and smoother all said and done (I'm am trying to learn it after all ).

My biggest hurdle for the near future I think will be getting it to work with the different developing environments. I mean programming isn't just editing text files, it's running and debugging as well.
Vim reference guide Quote
06-02-2016 , 02:13 AM
Quote:
Originally Posted by saw7988

ETA: Or in the example, maybe just a wiser use of the mouse? By keeping it to right of the text allowing yourself to quickly select whole lines, etc. Then since mouse is 100% right hand and ctrl+c/v is left, they can act pretty much on top of one another.
Depends. I have terrible coordination with mice, and it is worse depending on how whatever computer I'm using is set up.

Also, I'd rather write with my left toes than use a track pad, but I know others feel different.
Vim reference guide Quote
06-02-2016 , 10:43 PM
Quote:
Originally Posted by saw7988
I would do home->shift+end->ctrl+c->ctrl+v. Yea might take me 2 seconds instead of 1. But in an extreme case where you have to do that 100 times a day you don't even lose 2 minutes. I'm still interested in vim because it just seems really fun, but I'm skeptical about the productivity boost. At least for normal coding, where 95% of the time you're just sitting there thinking, and the physical labor is a small % IMO. I do a lot more algorithm/data science stuff though so maybe that's different.

ETA: Or in the example, maybe just a wiser use of the mouse? By keeping it to right of the text allowing yourself to quickly select whole lines, etc. Then since mouse is 100% right hand and ctrl+c/v is left, they can act pretty much on top of one another.
Clearly, "yyp" is easier than random buttons off the home row and holding down keys. Plus, I would take a 50% increase in speed any day lol. Last, I would have to look down at my keyboard if I wanted to click the Home/End button or comeback to the keyboard after using the mouse. vim keystrokes become muscle memory.

Also, didn't mean to strawman by mentioning mouse clicks. Even when I use Sublime or Notepad++ on Windows, I don't use the mouse, but the experience isn't as fluid as if I were on vim. Another benefit I mentioned about vim is that it's a terminal editor, so I can in/out files very fast or without opening additional windows.
Vim reference guide Quote
06-04-2016 , 09:16 AM
Quote:
Originally Posted by :::grimReaper:::
Another benefit I mentioned about vim is that it's a terminal editor, so I can in/out files very fast or without opening additional windows.
Combine that with a terminal multiplexer (tmux) and it's basically impossible to switch to another workflow if you use the terminal even semi frequently. Everything else will just frustrate you.
Vim reference guide Quote
06-11-2016 , 03:01 PM
you gotta use text objects:

(VERB)(i or a)(OBJECT SPECIFICATION)

di' Delete everything in single quotes, your cursor can be anywhere inside the single quotes when running
da' Delete everything in single quotes, including the single quotes themselves
di" Delete everything in double quotes
ci( Change inside parenthesis ( )
yiw Yank the entire word you're on
yis Yank the sentence you're on.
cit Change inside the html Tag you're in <div>this will be changed</div>
Vim reference guide Quote

      
m