Java Forum / General / September 2006
eclipse and vim
Shawn - 19 Sep 2006 16:50 GMT Hi,
I start to use Eclipse to program Java now. I really love vim editor. Some vim features are so nice and time-saving. Like, "yy" copy the current line and "p" to paste below the current line.
I have googled and found viPlugin page: http://satokar.com/viplugin/index.php
I am surprised it has to be purchased and it is in euro.
Do you use vim in Eclipse? How to get it?
Thank you.
Manish Pandit - 19 Sep 2006 17:45 GMT Hi There,
I do not want to start some sort of a war here, but personally, ^c and ^v is just as easy as yy and p :-)
-cheers, Manish
David Orriss Jr - 19 Sep 2006 17:58 GMT >I do not want to start some sort of a war here, but personally, ^c and >^v is just as easy as yy and p :-) True, but that doesn't really answer his question, now does it? :-)
-- Traverse: To ski across a slope at an angle; one of two quick and simple methods of reducing speed. Tree: The other method. -- from "The Skier's Dictionary"
Shawn - 19 Sep 2006 18:38 GMT > Hi There, > [quoted text clipped - 3 lines] > -cheers, > Manish You are kidding?
For ctrl-c, you need to use the mouse to drag to highlight the whole line, then you can use ctrl-c to copy the line. In vim, your fingers don't need to move far away, just type pp (if you want to copy current line plus the 3 lines below, type p4p -- quick and easy), then move the cursor to where you want, press p -- that's it!
If you want to delete the current line and the 5 lines below, type d6d -- that's it!
(I mean all in command mode of course.)
Shawn - 19 Sep 2006 18:42 GMT > Hi There, > [quoted text clipped - 3 lines] > -cheers, > Manish You are kidding?
For ctrl-c, you need to use the mouse to drag to highlight the whole line, then you can use ctrl-c to copy the line. In vim, your fingers don't need to move far away, just type pp (if you want to copy current line plus the 3 lines below, type p4p -- quick and easy), then move the cursor to where you want, press p -- that's it!
If you want to delete the current line and the 5 lines below, type d6d -- that's it! If you want to paste it somewhere else, move the cursor to that place, press p -- done!
(I mean all in command mode of course.)
Vi/Vim is the most popular text editor in the world. I have to use Eclipse because Eclipse is very good for Java programming.
Anyway, I have installed a trial version to ViPlugin already. It is free but it bothers me with a reminding purchase message once in a while.
Robert Klemme - 19 Sep 2006 22:39 GMT >> Hi There, >> >> I do not want to start some sort of a war here, but personally, ^c and >> ^v is just as easy as yy and p :-)
> You are kidding? > > For ctrl-c, you need to use the mouse to drag to highlight the whole > line, then you can use ctrl-c to copy the line. No, that is not true. Pos1, Shift-ArrowDown, Ctrl-C - as you can see this can be done completely with the keyboard.
> In vim, your fingers > don't need to move far away, just type pp (if you want to copy current > line plus the 3 lines below, type p4p -- quick and easy), then move the > cursor to where you want, press p -- that's it! Move the cursor to the target line with arrows then Pos1, Ctrl-V - also doable with keyboard only.
Granted, it's not exactly the same.
> If you want to delete the current line and the 5 lines below, type d6d > -- that's it! If you want to paste it somewhere else, move the cursor to > that place, press p -- done! Pos1, Shift-ArrowDown * 5, Ctrl-X, move to target, Ctrl-V
> (I mean all in command mode of course.) > > Vi/Vim is the most popular text editor in the world. Do you have empirical proof to back that statement?
> I have to use > Eclipse because Eclipse is very good for Java programming. Then you might as well get used to it. If you let yourself get into it I am sure you will see that you can be highly productive with this tool. There are a *lot* keybord shortcuts which allow fast movement in source code and also very complex commands (refactorings, navigation along the call hierarchy...). It never occurred to me that it's a disadvantage that I have to use the mouse once in a while. Learning something new from time to time can be a very rewarding experience.
> Anyway, I have installed a trial version to ViPlugin already. It is free > but it bothers me with a reminding purchase message once in a while. Well, not everything is free on this planet. I am constantly amazed that even Eclipse is free. So you might look at the price for the VI plugin as the price for the complete package and I am pretty sure it then will be pretty reasonable compared what you get.
Kind regards
robert
kevin cline - 20 Sep 2006 06:02 GMT > >> Hi There, > >> [quoted text clipped - 33 lines] > > I have to use > > Eclipse because Eclipse is very good for Java programming. Compared to what? My experience is that it doesn't scale well compared to purely flat-file approaches to development, particularly when you couple it with a configuration management system. Eclipse does not do a good job of separating build configuration items from user preferences, so all the programmers on a project get stuck maintaining their own build configuration, "Run..." items, etc. Any tool that requires actions to be regularly performed by everyone on a project team is seriously flawed.
> Then you might as well get used to it. If you let yourself get into it > I am sure you will see that you can be highly productive with this tool. But not as productive as I have been with better and simpler tools.
> There are a *lot* keybord shortcuts which allow fast movement in > source code and also very complex commands (refactorings, navigation > along the call hierarchy...). It never occurred to me that it's a > disadvantage that I have to use the mouse once in a while. Because you've always done it that way? Frequent switching between the mouse and the keyboard is bad for several reasons. It's slows down code composition, causes breaks in concentration, and is a major cause of repetitive stress injuries. The rudimentary Eclipse editor sucks for writing code, so I write code in Emacs, then compile it and fix up errors in Eclipse. It takes me at least twice as many keystrokes to write code in Eclipse as it does in Emacs. So I do most of the typing in Emacs, and if I can't remember a function name I just make one up and fix it when I get a compile error. What I really want is the full Emacs editor working inside the Eclipse environment. Or maybe I just want JDEE.
> Learning something new from time to time can be a very rewarding experience. It can be. Eclipse is impressive, but it is not as productive for experts as purely text-based software development.
Robert Klemme - 20 Sep 2006 09:47 GMT On 20.09.2006 07:02, kevin cline wrote:
> Compared to what? My experience is that it doesn't scale well compared > to purely flat-file approaches to development, particularly when you [quoted text clipped - 4 lines] > requires actions to be regularly performed by everyone on a project > team is seriously flawed. But you know that you can share build configurations and use user defined variables in various places, do you?
>> Then you might as well get used to it. If you let yourself get into it >> I am sure you will see that you can be highly productive with this tool. > > But not as productive as I have been with better and simpler tools. Then don't use it.
>> Learning something new from time to time can be a very rewarding experience. > > It can be. Eclipse is impressive, but it is not as productive for > experts as purely text-based software development. I might not be for you, but there are plenty other people out there for whom it is. Of course, if enjoying to work with eclipse makes them non experts...
Regards
robert
kevin cline - 20 Sep 2006 20:00 GMT > On 20.09.2006 07:02, kevin cline wrote: > > Compared to what? My experience is that it doesn't scale well compared [quoted text clipped - 8 lines] > But you know that you can share build configurations and use user > defined variables in various places, do you? No, but maybe I better take this the Eclipse group. One major problem with IDE's is the notion that you don't need to look under the hood at all those magically created files. That's fine, until you want to change the class path for all of your 50 "Run..." tasks, and find out that the IDE only allows you to change one at a time.
blmblm@myrealbox.com - 21 Sep 2006 11:55 GMT [ snip ]
> No, but maybe I better take this the Eclipse group. One major problem > with IDE's is the notion that you don't need to look under the hood at > all those magically created files. That's fine, until you want to > change the class path for all of your 50 "Run..." tasks, and find out > that the IDE only allows you to change one at a time. Sing it, brother.
You can try finding the file(s) where this information is stored and editing them (some of them at least are plain text), but it's not clear this approach always works:
Recently I wanted to merge two Eclipse workspaces, and .... Actually I wasn't able to figure out a way to do it with the IDE either (supposedly one can import one project at a time from workspace A into workspace B, but I wasn't able to make that work). And what I really wanted to do was to script the process somehow, which as you say seems not to be possible with a point-and-click (or, okay, keyboard shortcuts through menus) interface. I thought maybe I could do the merging by tinkering with the appropriate files in Eclipse's .metadata directory (grep for files where the project name is stored, and then copy them to the target workspace, or change similar files, or something), but that wasn't a success.
I don't actually need a solution to the problem -- I pointed and clicked my way through many invocations of the "create a new project" wizard -- but am mildly curious about whether there was a better way.
"The Eclipse group" sounds like a place to ask -- newsgroup? Web-based forum?
 Signature B. L. Massingill ObDisclaimer: I don't speak for my employers; they return the favor.
Hendrik Maryns - 21 Sep 2006 12:37 GMT blmblm@myrealbox.com schreef:
> "The Eclipse group" sounds like a place to ask -- newsgroup? > Web-based forum? news.eclipse.org:eclipse.newcomer, see www.eclipse.org/newsgroups.
H.
 Signature Hendrik Maryns http://tcl.sfs.uni-tuebingen.de/~hendrik/ ================== http://aouw.org Ask smart questions, get good answers: http://www.catb.org/~esr/faqs/smart-questions.html
Lew - 22 Sep 2006 04:47 GMT > (partisan ranting snipped) Editor wars! Editor wars!
(The newsgroup equivalent of "Food fight!")
http://www.imdb.com/title/tt0077975/
blmblm@myrealbox.com - 23 Sep 2006 17:55 GMT > > (partisan ranting snipped) Snipping in another sense, so to speak -- or maybe I should just say "quibbling":
As the author of the post to which yours is a reply, I'd prefer to claim that *I* snipped out a fair amount of partisan ranting, and added a longish but fairly calm anecdote about something I found annoying about Eclipse. Maybe I should have added that it has some features I really like, and that's quite a concession coming from someone who much prefers the old-style tools (non-GUI text editor and command-line compiler)? but I don't mean to get the debate started again here.
Because I won't argue with a claim that there has been a bit of partisan ranting in the thread.
> Editor wars! Editor wars! Yeah. I sometimes wonder what it says about computer people that you can start a heated debate by asking "vi or emacs?" But maybe it's the same with experts (?) in any field -- there are topics they'll happily debate at any length, with the rest of the world saying "huh? whatever!"
> (The newsgroup equivalent of "Food fight!") > > http://www.imdb.com/title/tt0077975/
 Signature B. L. Massingill ObDisclaimer: I don't speak for my employers; they return the favor.
Chris Uppal - 20 Sep 2006 09:52 GMT kevin cline wrote:
> [do most of the typing in Emacs] if I can't remember a function > name I just make one up and fix it when I get a compile error. That, I call /practical/.
-- chris
Olle - 20 Sep 2006 13:37 GMT > > >> Hi There, > > >> [quoted text clipped - 42 lines] > requires actions to be regularly performed by everyone on a project > team is seriously flawed. I agree that some a flawed, the only thing is that most modern IDEs use your (flat?) file structure below they don't change it or require you to change it, so there is no real difference except that you get a lot help with boring stuff like syntax checking, typing for loops and hard stuff like refactoring interfaces etc.
> > Then you might as well get used to it. If you let yourself get into it > > I am sure you will see that you can be highly productive with this tool. [quoted text clipped - 17 lines] > Emacs editor working inside the Eclipse environment. Or maybe I just > want JDEE. Exactly what I though prior to trying a fully fledged IDE, namely IDEA. Some say Eclipse is almost as good and if anywhere near I would really recommend you to try it for a while: you might be surprised. I was a hardcore Emacs/JDEE user (I even extended it a bit for personal taste) until I tried IDEA for a week and even after that first week I could see that I was more productive than before after a month I never looked back to JDEE again (I still use Emcas and use a very Emacs like key mapping).
Now I get 2-3 compile errors per week instead of per hour and when your project is large that really matters more than how fast I type/copy/paste. Also the refactoring tools make my code a lot better than before because I can change the code easily when I see bad design, variable names, etc.
> > Learning something new from time to time can be a very rewarding experience. > > It can be. Eclipse is impressive, but it is not as productive for > experts as purely text-based software development. Maybe I am no expert (only been a programmer for 24 years, professionally for 18:-) and I don't use Eclipse since last when I tried it was really bad (version 2.2 or something) but to say that text tools are more productive than any decent IDE (which I think Eclipse might qualify as) is just not true.
Of course if you compare a decent Eclipse programmer with a pro Text programmer the pro will win every time, but an Eclipse pro vs a Text pro I would put my money on the Eclipse user every time. The modern Java IDEs are not just VisualStudio copies that mess up your code they actually help.
/Olle PS By the way for those that only use graphical IDEs, it might be good to learn some text tools since you never know when you have to fix something using only a text terminal (vi/vim/Emacs still have their uses).
blmblm@myrealbox.com - 21 Sep 2006 11:31 GMT > >> Hi There, > >> [quoted text clipped - 12 lines] > > Granted, it's not exactly the same. Which might be the point.
With enough practice, I think any text-editing UI becomes second nature, to the point where you don't consciously think about the key sequences (or mouse actions) needed to do operations such as cut and paste. Developing that level of fluency with a different UI -- well, it takes time.
So "just as easy, but not exactly the same" is in a sense not "just as easy". I think I said that right ....
[ snip ]
 Signature B. L. Massingill ObDisclaimer: I don't speak for my employers; they return the favor.
Steve W. Jackson - 19 Sep 2006 19:52 GMT > Hi There, > [quoted text clipped - 3 lines] > -cheers, > Manish That's only a tiny fraction of what vim brings to the table, though. And if a GVim equivalent could be used at no cost in Eclipse, I might even be willing to use it more myself.
 Signature Steve W. Jackson Montgomery, Alabama
Jeffrey Schwab - 19 Sep 2006 21:16 GMT > I do not want to start some sort of a war here, but personally, ^c and > ^v is just as easy as yy and p :-) Most of the Vim motion and editing commands do not have reasonable equivalents in Eclipse. It's not like Vim just does the same stuff as Notepad with slightly different key bindings. Aside from powerful ideas like block selections, registers, and a sophisticated approach to windows and buffers, Vim saves you a tremendous amount of time by assigning the same key a different meaning for each of several modes. Eclipse, by contrast, requires you to move your whole arm for even simple tasks like navigating the cursor up one line. If you're still working that way, bite the bullet, take the Vim tutorial, and prepare for a better life.
It sounds like you have at least tried vi already, but didn't invest enough time in it to get the real benefit. A beginner's setup like Cream might help you get up to speed more gradually. FWIW, you can assign the yank/copy and paste actions to ^c and ^v in Vim if you want, though I wouldn't recommend it.
Brandon McCombs - 19 Sep 2006 23:39 GMT > Hi There, > [quoted text clipped - 3 lines] > -cheers, > Manish Not quite considering ^c won't work until you actually highlight the line while yy in vim will automatically take the whole line w/o having to highlight so before you can use ^c you have to press (keyboard only) Home key if not already at the beginning of the line, Shift, then End to get the line highlighted or a click of the mouse while dragging will also highlight the text. Bottom line: yy is faster and simpler.
Jim Cheng - 19 Sep 2006 18:06 GMT > Hi, > [quoted text clipped - 10 lines] > > Thank you. You may want to ask this questions in a Eclipse group (e.g., www.eclipse.org) to get more answers.
Regards, Jim
IchBin - 19 Sep 2006 18:30 GMT > Hi, > [quoted text clipped - 10 lines] > > Thank you. There are only three good sites that you can search for an Eclipse plugin. If they do not have it then you will not find it.
EclipsePlugins http://eclipse-plugins.info/eclipse/index.jsp
Eclipse Plugin Central http://www.eclipseplugincentral.com/index.php
Eclipse Magazin (German) http://www.eclipse-magazin.de/plugins
 Signature Thanks in Advance... IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us __________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"' -William E. Taylor, Regular Guy (1952-)
opalpa@gmail.com opalinski from opalpaweb - 20 Sep 2006 05:32 GMT Sweet.
A new reason to try Eclipse again.
I'll try ":r!ls" first
> Hi, > [quoted text clipped - 10 lines] > > Thank you.
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|