Vim and Emacs users, how to debug as effectively as Eclipse/Netbeans? - vim

After reading books like The Pragmatic Programmer, one thing it strongly suggested was to pick a text editor and master it. I chose to use Emacs and stuck with it for about half a year. However, the one thing that kept pulling me back to a full-fledged IDE was debugging.
After attempting to use xdebug via command-line for a couple of weeks, it was no surprise that the debugging tools that Netbeans/Eclipse provide are far superior to CLI.
So fellas, are there any Linux tools that allow you to place breakpoints and help visualize your application at run-time, or is there a reason why I should stick to suffering through CLI debugging?
Any feedback appreciated!

I'm using Vim all day for coding. But when it comes to debugging, I always take the debugger of my IDE (Visual Studio) because while debugging, I take the mouse and hoover over some variables, edit their values and so on. That's not a task that I'd need a powerful editor for.
That's my advice to you: for coding and editing, take an editor; for debugging take a (graphical) debugger (DDD, Eclipse, whatever). It's not a sacrilege to switch tools, only to take the wrong tools for the task to be done.

Like this: http://www.gnu.org/software/libtool/manual/emacs/GDB-Graphical-Interface.html#GDB-Graphical-Interface ?
Tutorial : http://www.youtube.com/watch?v=vHOzMOzzxDA

Same. I use IDEs for the heavy stuff and Emacs for quick stuff.
The reason to be proficient with a light-weight editor is to be nimble when you know what you want to do. Open this file, find-tag, edit, magit-status, commit, push. Bam. You don't want startup-time & instability to be cock-blocking your effort when you've got at goal. Vim is installed on most servers, and if you're editing on production, you'd better have a goal.
IDEs on the other hand (Aptana for me, PHP) I find are useful for "studying". Debugging, stepping through code, analyzing code, searching (Eclipse's tree-results search over Emac's rgrep ANY day when there are multiple results).
I consider myself quite proficient with using Emacs as a full-fledged IDE via ECB, geben, rgrep, ctags, magit, etc. I used it as such exclusively for over a year -- but in all honesty, it hindered my productivity -- the heavy tasks take too many steps. Now I use Aptana & Emacs really about 50/50 throughout the day.
Light editors for light stuff, Heavy editors for the heavy stuff

there are definitely debugging solutions in vim see http://jaredforsyth.com/projects/vim-debug/, there are more but I haven't tried them, I tend to switch back and forth from an ide to vim.

Related

Modal fully fledged IDE

I am trying to find a good IDE. I always found Vim's modal behaviour interesting but, Vim is more of a text editor than an IDE. Even though I have made a few changes to my .vimrc file Vim isn't IDE enough. Any suggestions?
FYI: By IDE I mean it's got to have a debugger, autocomplete and easy compilation
Edit: I do web development, backend node.js, python and Ruby on Rails
I'd start by listing features you need from your IDE in order of importance.
Think about (random order):
Language support (native support/need to import specific plugin)
project tools support (eg. cmake, maven, gradle, so you can easily switch between different environments)
editor power (make your changes fast, refactor easily, repeat changes, shortcuts and tricks etc.)
version control support
easy to use
completion, snippets, etc.
speed (how long it takes to launch, how much memory/cpu it consumes)
compilation speed/support
Of course you can consider many more features and find them much more important than the ones I listed here. It's totally individual preference, since that's you who has to be comfortable.
If you want to use the power of VIM you have basically three options:
1. use VIM, customize it and make it your unique IDE, totally adopted to your needs
Start with vanilla VIM and incrementally add settings and plugins you need. Check out existing configs and adapt them. To make it fully fledged IDE I'd recommend some plugins:
CtrlP - fuzzy seach, really powerful, must-have
NerdTree - classic file browser
vim-dispatch - for deployment, fast and easy
vim-git, vim-gitgutter, vim-fugitive - for awesome version control
xptemplate, supertab, syntastic - for autocompletion and snippets
vimgdb - for debugging
2. Use existing VIM config
I recommend one of these:
Example VIM configs
or this:
janus
3. Use IDE with VIM plugin/mode
Many of today's top IDEs have vim-mode or vim plugin easily available. For C++ I recommend QtCreator, because it's really fast and easy-to-use, and it's FakeVIM mode works really well. For JVM-based languages I recommend IntelliJ IDEA, because it's really powerful and stable. It's VIM plugin also works really well, and you can easily mix IDE's shortcuts with VIM commands, adapting it to your needs.
Both can be customized with many useful settings placed in your home directory (for IntelliJ it has to be .ideavimrc).
To be good at vim you need time, but it will eventually pay off
The mindset 'hunt for cool plugins to assemble your IDE' often leads to suboptimal solutions
Start with a small .vimrc and maybe a small amount of plugins (if you tell what is your programming environment people could help you here)
Use what you have for a while and observe where are you spending most of your time struggling
Search for a way to alleviate that problem and repeat
Get use to read vim help (:h). It may sound boring but is one of the best sources to really grok vim and that will bring you closer to the 'vim mindset'
Vim is an investment, not a tool you can decide to start using by tomorrow and be good at it.
If you want to spend most of your time coding (text editing) and are willing to put the time and effort it will pay eventually off and you would be very efficient. If you don't accept this it can be frustrating and make you quit.
Take a look at this: What is your most productive shortcut with Vim?
It also depends what your programming environment is. Having autocomplete and compiling from in the vim editor is no problem. Debugging depends, but you can also do debugging with other tools and be perfectly fine. Just because other IDEs do it doesn't mean it's the best way.
Don't try to get it perfect just from the beginning and don't try to copy every feature your known IDE has. Accept the initial pain and enjoy all those little improvements that you can make every single day. All those improvements will sum up and after a while you will be very proficient. Even years after you still will find ways to improve your workflow.
There has been recent development in (at least) those three projects, based on nvim extensibility, and addressing your very concern:
oni
veonim
gonvim
[update] lunarvim
I seems that they are all in early alpha though, let's hope the best for them :)

What are the typical use cases for vi?

I recently started picking up vi, going through some tutorials and trying to get used to it. But I still have some questions about it.
It seems to be nice for small one file changes, but as soon as I start to try doing bigger things it seems to be lacking. For example I'm used to have code formatting, import organizing, simple overview over all packages and other things that an IDE gives me. I saw some tutorials on how to use vi as an IDE, but it felt awkward at best.
Now I'm just wondering, what are the typical use cases for vi? Is it typically used to edit small files, or can it be used for larger projects? And if you use it in larger projects, how do you make it work? Or would it be a lot easier to use an IDE with vi keybindings?
People use non-IDE editors like Vi(m) for coding due to the following reasons,
They are non-distractive, allows you to concentrate on the job.
They do not clutter you screen area, offers you more code space
They are faster
They have better/faster/cooler text manipulation at the stroke of the finger
You happen to move your hands out of the keyboard less to hold the mouse, drag it here and there and click.
They also have the flexibility to support other tools like debugger, document viewer, etc.
They also have ways to get things like code folding, etc.
For a normal programmer whose ideal work cycle is sit, write code, test, debug, more code, test debug.. Vi offers a simplistic yet powerful environment to get the work done faster and more efficiently.
For someone who had years of using some IDE, it might be like using some prehistoric tool, but once they have been through the initial days, then there is no looking back. They'd feel like there is no better thing.
Why, oh WHY, do those #?#! nutheads use vi?
I've haven't done anything that you'd call a big project in python (only little test scripts), but I use Vim exclusively for writing large embedded C applications and I have never really felt the need for an IDE.
Vim is fast to start up, extremely fast to use and (with a bit of customisation) can do most things that an IDE can do. It'll do code completion, code auto-indentation and reformatting and it is very good at refactoring. The project plugin http://www.vim.org/scripts/script.php?script_id=69 makes it very easy to manage projects with lots of files and the taglist plugin http://www.vim.org/scripts/script.php?script_id=273 is great for browsing source code. It also allows you to have the C code open side-by-side with python code, assembly code and latex documentation without having to use a different tool for each.
Overall though, I think there is one really valuable thing that Vim gives you that very few other editors do and I would find it very hard to lose that: I can have a window split into three parts like this:
Each of the subwindows can either show a separate file or (as in the screenshot) a separate part of the file. I imagine emacs can do this (although I could be wrong), but I doubt many IDEs can. This can be invaluable for refactoring and for referring to other parts of the file.
I've used VI(M) and Emacs as my primary editors for years... I've tried switching to IDEs but find they can't get out of my way enough. I always end up back in VI(M) or Emacs after a while. One major reason is that I find my hands need to leave the keyboard too much in IDEs as they require the mouse too often... And I'm too lazy to setup my own shortcuts for everything.
Here's why I use it.
it's fast to start up
it's available across multiple platforms and is on all Unix machines
it's fast to use (keystrokes for common operations, operations based around words/paragraphs etc.)
However, I use IDEs for large scale development work, since I can't believe they can be beaten for productivity, given their code-awareness and refactoring capability. I use Eclipse, but I plug a VI editor emulator into it. See this answer for more details.
I saw some tutorials on how to use VI as an IDE, but it felt awkward at best.
There's one thing to do at the very beginning: throw your sense of aesthetics overboard. You will never get the same kind of graphical experience in VIM as you do in a decent IDE.
That said, VIM actually does offer many of the features of a full-blown IDE and has a lot of advantages besides. I use VIM for almost all of my developing work and all of my text documents (using Vim-LaTeX) – even though I've actually paid money for Apple’s office suite, iWorks.
There's one point that's still nagging me, though: I can't get IntelliSense to work. For me, that's a huge problem, especially when using languages such as VB, C# or Java, for which excellent IDE support exists.
So, the learning curve for VIM is steep but once you've passed a certain point it's everything but awkward. In fact, compared to VIM's editing experience, you will find that it's the IDEs that suddenly feel awkward because while they're good at bookkeeping stuff, they suck at editing.
I frequently work on a remote system, programming for a cluster, or editing config files on a headless box. All of these could be done with a file transfer, a regular IDE, and another file transfer, but it is so much faster to just use VIM through SSH.
You can find it (or easily install it) almost anywhere - Runs on all systems that can implement the standard C library, including UNIX, Linux, DOS, Windows, Mac, BeOS, and POSIX-compliant systems.
The ability to log into a remote server and confidently edit a config file is priceless.
Vim is not very good at code awareness. What it is good at is text manipulation. It provides you with the tools for you to edit text, not to edit for you. If you just do "small" edits and don't read up on the occasional "vim commands you wish you knew" you'll never understand the power provided.
code formatting
Formatting is done with =. You can also point equalprg to an external program to do the formatting for you.
import organizing
Vim won't be able to remove unused imports but if you select the import lines
:'<,'>sort
simple overview over all packages
:vs .
This will open a vertical window containing the current working directory :)
In conclusion, vim can't replace your IDE but it will let you edit your text.
As usuall: Choose your tool depending on the work you have to do! ;-) I'm using Vim and Visual Studio. You don't have to choose only one.
If you need an IDE, use an IDE. Vim is made for text manipulation.
It supports any languages. Try to edit a Ruby script with Visual Studio.
Performance on large files is much better than for most IDEs. Try to analyze a logfile having 100k lines and more using your IDE.
It runs on many plattforms and you can use it via a remote console, if you have to edit files on a server.
...
IDEs are specialized tools, which are good for problems they are made for. Vim is an incredible flexible and powerfull generall purpose tool.
This is obviously a hot topic so I'm going to give a list of reasons why I prefer IDE editor for coding.
1) I prefer to be able to fold sections of my code (I don't know whether Vi(m) can) without having to remember the command to do so or type it.
2) I prefer one click compile button/command as opposed to having to remember my compile command and it's library of options
3) I prefer the easier highlight copy paste operations without having to........ aah sod it!!
Well by now you get the picture. I'm not knocking Vi(m) I just think having your the elements and functionality of your coding environment visually represented makes for a clearer head and encourages exploration of options you may not know exists.
I much prefer vim over vi and prefer not to lump them together. Vim provides some features that are really handy and not always immediately obvious. Already mentioned was screen splitting. Also you may want to checkout ctags or exctags. These allow you to jump around the code base from within vim. I can place the cursor over a called method, jump to the definition, jump to a definition within that method, etc. Very powerful for tracing down bugs. Cscope is another similar program.
Vim will also allow you to run arbitrary shell commands within the environment and has powerful search and replacement features.
So an IDE will provide most of those, what will vim provide over a traditional GUI based IDE? That's easy, it runs on the CLI.
This allows me to login to my dev box, run screen (definitely something to checkout for the unfamiliar: http://www.gnu.org/software/screen/) and run multiple vim sessions within my screen session on my dev box. Now when I leave work for the day, I can leave my work session just as I left it, even while running builds. When I come into work the next day I can connect from my environment as if I never left.
Another reason to like vim or vi in particular, is that it can be found on virtually any Unix environment.

Would you recommend vim/emacs for beginner programmers? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
For someone just starting to program, would you recommend using vim/emacs, or should you use some IDE? Like are vim/emacs better suited for more advanced users than for beginners? I'm just wondering because I'm trying to get some of my friends to program.
If they're just starting programming, I'd not recommend VIM to begin with.
they'll have enough on their plate to begin with learning the ins and outs of programming
depending on the language/platform, I think they'd appreciate an IDE with code completion , general language support etc. (I know you can do this in VIM, but it's a lot more seamless in an IDE).
Note. I'm a VIM fan, and I run my IDEs with VIM plugins, so I have nothing against VIM as such.
I note in your comments you're looking at teaching them Java. BlueJ is a Java IDE geared towards learning Java, and may be a useful introductory tool.
When I used to teach C & C++ commercially, back in the late 80s/early 90s, we did all our teaching on UNIX boxes, with vi as the editor. A lot of our clients were MSDOS (and later Windows) users. These guys used to have, on day #1 of a 5 day course, to learn the basics of UNIX and the basics of vi, at the same time as they were learning C and C++. They all bitched like mad (and I couldn't blame them) but they all managed it.
Perhaps we expected a lot more of each other back then. Still, we haven't changed genetically in that short period, so if they could learn vi easily then, programmers today can also learn it, without too much trouble.
Avoiding the subjective question of editor choice, it's not so much about advanced/beginner as learning too much at once. It's probably a good idea to separate the coding learning curve from the editor learning curve. If you're busy learning to code, use an editor you're already comfortable with (doesn't have to be an IDE, could be gedit, etc.). Once you're comfortable coding, you can move on to an editor of your choice if you're not happy with what you already knew. An advanced coder might still prefer a simple editor, and one who hasn't learned too much might still want to work faster and switch to Vim.
Since you say you'd suggest Java to them, Eclipse is probably the way to go. If you were suggesting Common Lisp, I'd say Emacs without hesitation. For Python and the like, I'd say to use whatever text editor they know now; vi, vim, Emacs, Geany, whatever. But for Java Eclipse is a pretty good standard choice.
Whatever editor you choose, have the cheatsheet sticked next to your screen.
People either like vi (or emacs) or hate it regardless of their skill level as programmers.
I am by no means an emacs whiz, but in terms of learning the basics of a new language I think it is handy.An IDE can be a distraction from what you are trying to learn (So you end up spending time learning an IDE rather than a language) and emacs provides both good indenting and syntax highlighting, as well as easy access for compiling, debugging, and accessing the shell.
I know I'm going to get voted way down by the legion of emacs/vi people here, but in terms of learning a language, an IDE with intellisense (or whatever the generic version is called) is absolutely indispensable. For instance, if you use visual studio, you will spend almost no time playing with the IDE. The automatic completion clearly shows the relationships of member variables, and makes it so that you don't have to remember minutia. Scope and type resolution is also invaluable for the beginner. Most important however, is that whatever you are using contains an industrial strength debugger. Logging with strings to a text file is no way to go through life. Even the legion of emacs lovers will probably admit that someone is far more productive with a professional IDE and a beginner is far less likely to get frustrated. Now, if you are going with something opensource/free, your experience may vary.
If you're just starting and you're learning Java, I would go for one of the graphical IDEs. Yeah, something like Eclipse or Netbeans is fairly bloated, but it doesn't change the fact that they make the barrier of entry way lower with suggested error fixes and the like.
vi or emacs in combination with gcc are great, but I would go with something more beginner-friendly to begin with.
If they are beginning to learn programming, it is better to start with a simplae text editor like gedit or geany. But learning to use emacs or vi down the road will be a hugely enlightening experience. It might be be a good idea to learn emacs by using for plain text files (notes, todo lists), so there is not the distraction of learning language specifics.
Run the vimtutor command. It's an interactive way of learning a lot of useful basics in Vim. Vim is very powerful and efficient. You won't learn everything there is to know about it at once. You'll continuously learn more handy features of it as you continue to use it. If you get the basics down, you'll start spending more time in command mode. Do not use the arrow keys. It may feel awkward at first using hjkl keys to move around, but it will soon feel natural and become faster because your hands do not leave homerow on the keyboard. One of the great things about Vim is the user almost never if ever needs to take his or her hands off of homerow.
As for Java, Netbeans kicks ass IMO. Why shouldn't it? It's made by the same people who developed the Java language. So when I am using Netbeans, I use it with jVi plugin that allows me to work with it just like I were using Vim.
vi and gcc, nothing else
Editors seem to be a touchy subject. It really seems to be personal preference. The only reason I ever learned vim was because of the workplace required me to. The only reason I ever used emacs was because of school. Having said that, I think just using the available development tools (VS for .net framework, Eclipse/NetBeans for Java, etc) would be best in my opinion, but again, its definitely personal preference.
It depends on what platform and language you plan to start and then boils down to individual preference. If it happens to be windows and you plan to do C#/VC++/VB then Visual Studio IDE is the best.
I used emacs when I started on Scheme and python and I found it handy.
cheers
I learned Java using a combination of DrJava, BlueJ and Eclipse. I started with DrJava since it had an interactive Java shell. Then I played with BlueJ and finally Eclipse once I thought I knew enough.
Now that I "know" a couple languages I just use Vim.
I'd recommend Vim for anyone working with a text editor, but not at the same time as learning programming.
I don't know about emacs, but I would recommend learning Vim for a beginner in a heartbeat. The vimtutor program is a great way to pick up the basics. It is a bit of effort, but you soon get used to it.
I started using Vim when I was learning HTML, and it was a massive improvement over something like Notepad. It soon replaced nano as my command-line text editor of choice in Ubuntu as it's easy to navigate around fast with Vim. Then, I decided to learn Python and I found it was easy to get started with it because I was already familiar with Vim. Now I'm learning C and it's great to have an editor I'm already familiar with as it means I don't have to worry about getting used to a new IDE or text editor. This means there's less work for me to do.
I've found knowing how to use Vim gives me a significant productivity boost over any other editor I've used. The only downside is the key bindings get burned into your brain, to the extent that I keep reaching for Escape when I want to move around in a Word document!

I am looking for tips for learning Vim or Emacs the smart way

I am a quite happy user of Eclipse (I mostly develop in PHP and Python), however I found the answers to "What specific productivity gains does Vim/Emacs provide over GUI text editors?" interesting enough to make me wish to try out Vim or Emacs as well and see if they would turn out to be a better solution for me.
I have the general feeling that Vim and Emacs are not the kind of editor you learn by "playing with it" though. I have the impression you must dedicate some time and effort to "study" them a bit, before you can benefit from their power.
So, I have two questions for the community:
In the linked thread responders have essentially answered by commenting on Vim (often mentioning: "I'm sure Emacs has the same"). Google trends seems to indicate Vim is the mostly adopted between the two, however my first question is: knowing that I have no prior experience whatsoever on any of the two, and that I use and develop (mostly PHP and Python) on GNU/Linux systems (Ubuntu, Arch Linux), is there any of the two which would represent a better option to start with? (To be clear: my question is not about the quality of the editors but it is about what it is strategically better to learn in my situation).
What advice would you give me on how to learn using it/them? I know this is a broad question, but it is deliberately so. Have a look at this answer (unrelated topic) for an idea of the kind of information / style of answer I am looking for [but do not feel obliged to answer that way... any contribution will be welcome, in any form!]
EDIT (on picking the "accepted answer")
I picked one answer as the accepted one just now, but I would like to say "thank you" to all those who shared their experience and advice: almost all of it has being useful to me in some way. The thread has definitively exceeded my expectations! Thank you! :)
I would advise that checking out both is worth the time because of various reasons already covered by other answers or "Emacs vs vim vs XY" threads.
Still if you would have to pick one of them I'd go with vim because of one thing:
Availability
Vi(m) has the advantage that it is installed (not only available) by default on almost any *nix system. So no matter whether it is your system or someone else's or whether you are allowed to make changes to it or not, your favorite text editor and friend is there waiting for you.
Once you know vi(m) it feels awesome in those situations where you ssh into a machine and need to do something with text (navigating through a file, editing, whatever). You are going to feel like a King. I remember several times when I almost freaked out because nano or pico were not installed and I had to use "this ugly beast vi" which made unpredictable things when I started typing (because I wasn't in insert mode and didn't even know what that was) and when I was happy to have googled that ":wq!" gets me back out of hell. Now I can look back and smile about it.
I have the general feeling that vim
and emacs are not the kind of editor
you learn by "playing with it" though
Vim and Emacs are certainly editors that you "learn by doing".
Of course the question cries for including these highly scientific text editor learning curve graphs =)
Vim might be a bit harder in the beginning because its modal editing can feel quite unfamiliar at first. I think motivation is the key here. The article "Why, oh WHY, do those #?#! nutheads use vi?" explains the advantages quite well I think. In my opinion it really is worth to give it a try even while the learning curve might be steeper than with other editors and it sounds like you bring the necessary motivation.
Back to learning by doing.
Something I wish I would have done the first time:
Check out Vimtutor. It is an interactive tutorial which demonstrates the power of vim by showcasing it's basic commands and how they can be composed. Just type vimtutor in your terminal.
This helped me to really "get it" after trying to learn editing with vim several times in the past. The tutorial eases the learning curve dramatically as it explains the commands and makes you actually perform them so they become a habit. It really makes a difference compared to being frustrated because of feeling handicapped. Using vimtutor you also will see what the benefits of modal editing are and instead of fighting or ignoring it you are going to embrace it because you have experienced the advantages at first hand. I guess it would be pretty difficult to learn that all by oneself. So these 30 minutes are quite worth it.
I have the general feeling that vim and emacs are not the kind of editor you learn by "playing with it" though.
My experience with emacs is actually quite the opposite. I tried going through the tutorial, but it didn't seem to help much. The way I ultimately ended up learning is with a reference card and just forced myself to use emacs on my code until I got it correct*. Then again, I do also have a screw loose. Your milage may vary. Offer void where prohibited. You get the idea.
One other piece of advice I recall reading somewhere is to try writing down a list of about 10 commands you want to learn and keep it by you while coding. Once you've mastered those commands, make another list of 10 more. Keep doing this until you've got a big enough chunk of the editor committed to memory.
*Note that the linked reference card is out-of-date. If you google, you can get a more up-to-date reference card.
knowing that I have no prior
experience whatsoever on any of the
two, and that I use and develop
(mostly PHP and Python) on GNU/linux
systems (ubuntu, archlinux), is there
any of the two which would represent a
better option to start with?
I'm an emacs guy, so my opinion should be obvious. That said, you're likely best trying out the one that more people you know seem to use. Having someone who's experienced with emacs (and I'd assume vim) is a great help.
If you don't know anyone who uses either one, choose whichever one you feel is the prettiest or has the coolest name. You won't know enough to know which one you'll like, so you might as well choose arbitrarily.
For vim try vimtutor
I came to Vim when I started using Linux after years of Windows development, and had to do a lot of work on remote systems via ssh. For the first couple of weeks hated it. After that I could not live without it.
Probably the best way to start is to use Vim in easy mode ([g]vim -y), most installations have a shortcut called evim. This runs vim in a mode that is in insert mode by default and remaps keys to the usual Windows ones (ctrl-S to save, ctrl-X to cut etc). You can then use it like a regular Windowsy editor but still access the power of Vim.
There is also Cream which is Vim + a bunch of scripts to make it behave even more like a Windows editor.
I started out using evim and Cream, but found I gradually transitioned to using 100% vim.
Also if you use gvim then most of the functionality is also available through the menus and you can see the keystrokes for the same functionality.
Also read the docs - there are extensive help files available on every aspect. I still browse them from time to time and find something new.
Using VIM, I find the following quick reference card very helpful, especially for the stuff I don't do everyday:
VIM QuickReference
For emacs, you should read the GNU Emacs Manual. Don't try to do everything all at once.
Start with the basic stuff, and then move on to the more powerful features once you're comfortable with the easier stuff.
Some time ago I decided to learn vim beside Eclipse as well because of its powerful textual editing, search and navigation features. But - at the same time - I liked the project handling, code completion, refactoring and debugging features of Eclipse and I did not want to lose them.
Nowadays I use an Eclipse plugin called vrapper which provides me nearly all basic features of vim inside Eclipse without losing any Eclipse functionality. Of course it is not a full-featured vim but it gave me the productivity gain I 'expected' (motions, the dot operator, registers and marks). Also, this plugin can be considered the 'trial' version of vim where you can learn all basic and some advanced stuff within your 'best-known' environment.
There is another interesting approach called eclim. Eclim integrates Eclipse with vim from the vim side so you can use many features from Eclipse within vim.
For learning the basics of vim, this graphical cheatsheet helped me a lot.
I would go for Emacs.
Explicit command name will makes your task easier.
I switched to emacs after I had years of experience with vi and never looked back.
Go with tutorial first.
Hang out at #emacs in irc and people are happy to help you in real time, for whatever more you need.
My advice for learning emacs is to understand that everything is done by a command (written in elisp) that is connected (bound) to the key strokes that you make. The power of emacs comes from being able to write new commands and use commands that are not bound to keys (there are too many commands to bind each one to a command.) as well, of course, read and modify commands that are already in emacs.
Next learn how to use the Help key and how to make a key binding list, then how to search for relevant commands (apropos) and see if they are bound already.
Be ready to take learning diversions into the emacs manual (Help, Read manual, Emacs manual).
One argument in favor of Vim if you know Python is that you can write Vim scripts in Python. See :h python. Emacs requires you to learn elisp.
I find myself gravitating toward Vim for scripting languages like Ruby/Perl/Python/PHP, and for Emacs for languages that are more interactive (Lisp, essentially). If you develop your Python code using an interactive Python shell a lot, Emacs might be good, because you can embed a Python shell right into Emacs. If you write code and run it from commandline a lot, Vim can handle that easily enough via :make or :!.
I really recommend you learn both and pick whichever you like better. They are both worth knowing.
Wow, vi/vim vs emacs, what a temptation...
From a vi-user's perspective...
Always Therevi is on about every unix system ever released, in the default install, and available for Win
May save you from RSIvi uses home-row keys for just about everything, modifiers like control and meta are used only for rarely invoked functions and even shift-key use is moderate. This was probably all just a lucky accident, but don't laugh at RSI. It can happen to anyone, it's seriously painful, it's potentially career-ending, and it's hard to treat.
Starts up instantly.In the past, this was a huge advantage over emacs. Emacs users had to start up just once, and navigate everywhere within emacs. Today it starts faster, but in vi, it's perfectly reasonable to quit out of it entirely on every compile or test cycle.
Has an awesome line-mode The line mode in vi is backwards compatible to the original Unix ed(1) program, an editor that had only a line mode. That is, vi's regular-expression-substitution-engine-/-line-editor was once an editor all by itself.
Easily scriptableGot something you want to do to every .whatever file in your project? It's easy to write a declarative script that will edit a sequence of files. No need for imperative or procedural programming.
Easily extensibleVim, at least, can be extended in Python.
First of all, be humble.
As long as you remain aware that they are very powerful tools you'll be ok. If you are finding a task very difficult, and you are thinking 'it's just me that sucks not the editor', you're in the right mind to learn and improve.
Bram's 7 habits are a good tenets to go by
http://www.moolenaar.net/habits.html
Also I highly recommend having a go at writing a plugin. It doesn't matter what it does. It gives you the impetus to dive deep into the manuals.
Maybe, a good way is to learn vim/emacs while using eclipse. Try vimplugin or emacsplus plugins for eclipse.
This should really just be a comment, but against which answer ...
With Vim I'd suggest using the GUI version for a start, just dive in, the built-in help is excellent (:h and the screen splits adding a panel with comprehensive "hyperlinked" help pages). With vim the only potentially dangerous operation is a write, everything else you do is recoverable per command or edit (undo & redo).
The power acquired easily incentivises the learning.
Here's the way you learn: Start typing. When you hit a point where you want to do something other than typing, look up how you do that. Repeat. It helps to start with a few basics, say 7 fundamental commands. Other than that, when you run into wanting to do some operation, look it up and use it.
This great Tutorial was a big help for me for my first steps in Vim. It is a gently introduction and explain at the same time the philosophy of vim in a pleasant way:
aByteOfVim
The way I learned emacs was mostly by doing both of the following:
All the GUI menus show you the key-bindings you can use to execute the same command as that menu item. Pay attention to the bindings for the menu items you select a lot, and try them out manually next time you get a chance.
ctrl-h ctrl-h (think "Help! Help!") brings up a buffer that shows the various types of help available. If you then hit the "b" key (the buffer calls it "describe-bindings"), you will get a list of all the key bindings that are available in the buffer you are working on. Just peruse that every now and then with an eye for commands that look useful. Try them out when you get a chance.
As for vi, I learned it in the days before vim, so I pretty much had to use man vi to figure it out. Most of us emacs users will tell you that all the vi you need to know is :q! ("quit, and I really mean it"). :-)
But in truth if you are a Unix user you need to learn at least enough vi to do simple edits to config files and save them. You never know exactly what (if anything) you will get when you try to start emacs on a strange system Unix system, but vi is always there.
Nearly everything you see or interact with in Emacs can tell you about itself -- you just need to know how to ask it.
To learn Emacs, learn about the current Emacs context: what the values of things are, what the relations between them are, how they are denoted, how you can change them or otherwise interact with them.
The most important thing to learn is that Emacs is Emacs Lisp -- it is a Lisp ecosystem. Learning Emacs means also learning Emacs Lisp -- the more you know, the better. Lisp is the most flexible and most powerful way in which Emacs realizes itself as "the self-documenting, extensible editor".
Icicles can help you learn Emacs and Emacs Lisp. It helps you ask Emacs about itself. This page gives an overview of the ways it does that: Emacs Newbie with Icicles.
Don't get caught up in the vi(m) versus emacs religious war. They are both great editors. I originally started with VI (real VI not VIM) and later started using Emacs. These days, I tend to use both, but emacs more because emacs has some features I need which are not in vim.
The real challenge and what you should be aiming for is how to be as efficient, quick and accurate as possible with your editor of choice. Both VI and Emacs have a lot to offer in this respect. However, much of it boils down to two main habits you need to develop
Don't use the mouse. Both editors were created when mice were not the plague they are now. When it comes to editing, cutting, pasting, highlighting etc, both editors offer keyboard equivalents. Use them and keep your fingers on the keyboard. You will be surprised how much faster you will become
Avoid the arrow keys. This is for a similar reason. The arrow keys tend to make you move your hands off the main keyboard. In the end, this also slows you down and makes you less efficient. Both editors provide far more convenient functions which are faster.
These are the two main things to focus on when learning either of these editors. There is lots more, but to start with, just start with focusing on using the main keyboard.
After you have got that down pat, then begin to think about how you can tweak your environment to suit your needs. By this time, you will be familiar with the power of the editor you have chosen and will probably have some ideas. Both of these editors are very configurable. I find emacs is the most configurable, but you can easily get lost iin writing elisp to configure things and before you know it, your an elisp programmer who does a bit of PHP and Python. To some extent, the same can happen with VIM, but to a lesser degree. However, note that the defaults have usually been set by people with lots of experience and who probably know something you don't. Avoid making the mistake of trying to modify either editor to be what your use to. Learn how it works with minimal config first and then change once you have an idea of why it was done some way - know the rules before breaking them.
If your serious about programming, your editor will be your most important tool. Other important tools are your screen, your chair and your keyboard. The rest is incidental.

As a grapical IDE user, should I be interested in traditional editors? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I use full blown graphical IDEs such as Eclipse CDT (Linux) and Visual Studio (Windows) which have features like auto completion, built in debugging, etc. These are features that I feel I can't live without.
I keep hearing about how many people use emacs/vim on a daily basis. How come people still use console based editors when graphical IDEs appear to be easier to use? I know how to use vim and emacs, but for day-to-day programming I just use an IDE as I find myself being more productive.
This is not a vim vs emacs question so please don't argue one against the other, please instead argue graphical IDE against console IDE.
As I'm already familiar with graphical IDEs, am I likely to gain any productive advantage by using emacs/vim instead?
I expect the answer is "maybe not", simply because of the learning curve, and I'd miss the usual graphical IDE features such as auto complete and the built in debugger; but apparently emacs supports auto complete and debugging. However, to someone who uses a standard GUI text editor, I'd probably say that they should use emacs/vim. What do you think?
Related questions:
SciTE user wants to know if they should use emacs.
vi user wants to know if they should learn emacs.
There is an advantage to learning to master a command line editor for those situations where a full IDE is not available. I know people who swear by VIM and people who swear by Emacs. I think the latter is more configurable, but you might not even need that. Since you already know VI, it might be enough for your needs.
I humbly admit that in the few situations where I do need to edit not through an IDE, I just use pico... :(
All that being said, I do have the impression that for some people in certain programmer subcultures and companies, using emacs rather than an IDE is an issue of honor, like using leaves rather than TP on camping trips.
I would always suggest knowing at least one command-line only editor, be it Vi, emacs, pico, ed, etc., even if you do most of your developing in an IDE. If you're more productive in an IDE than in another editor, then by all means use the IDE.
That said, my reasoning is this: say you're installing a graphics driver on Linux, and the driver is not being co-operative. Your version of X doesn't start correctly using the new configuration, and you need to edit your X configuration. You could copy the backup of the working configuration over the edited configuration, start X, use a GUI editor to edit the X configuration, and then restart X, or you could do the edit very quickly using an editor that doesn't depend on X (typically, command line).
Eclipse has built-in support for Emacs key-bindings. The only support I've seen for Vim is a commercial plugin.
You certainly don't need to learn one or the other, and you don't need arguments extolling the virtues of one editor vs. the other, but if you do learn Emacs, you can customize your Eclipse environment to use the Emacs key-bindings (it's under Windows->Preferences->General->Keys). This (in my mind) can greatly increase your productivity in Eclipse as your hands rarely need to leave the 'home' line of your keyboard.
This feature is one (of many) reasons I use Eclipse for my 90% of my development.
I have been an emacs user for nearly 10 years. Emacs is an IDE with X support it is not console based. It does have auto completion it does have integrated debugger. The advantages i consider emacs over other IDE's are you said that you use eclipse in linux and visual studio on windows well i use emacs on both OS's. Don't need to change tools when switching OS's. Also on my daily work i work with multiple languages ruby,c/c++,java emacs supports much more languages than any other tool out there. And once you master using your keyboard you are 100 times faster than using an IDE. You can move around a file in blazing speed. i got my terminal , connection to my database server right in the editor no need to change windows and loose my train of thought. Another nice feature is i can edit files on machines half way across the world just like they are sitting on my local file system.
Disadvantages are both emacs and vi have steep learning curves in order to use them properly you need to invest some time on them but the way i see it why not master one tool that works on all languages and works on all OS's. then to learn how to use multiple tools and learn a new one when you wanna learn a new language.
Using emacs after knowing vim will make that task somewhat annoying. The editor war has been long and there have been many casualties.
In short, you should simply evaluate whether you think the editor(s) you are using currently are not up to your expectations. If you feel hindered, try something new. If you are working just fine, keep working!

Resources