6 ms·
Vim reminds me of an example from Bret Victor's excellent talk Inventing on Principle [1] (which you should watch from beginning to end if you've somehow been h
by cletus 14y ago
Vim reminds me of an example from Bret Victor's excellent talk Inventing on Principle [1] (which you should watch from beginning to end if you've somehow been hiding under a rock and have missed it).
Bret mentions Larry Tesla (starting at about 38:10) who made it his personal mission to eliminate modes from software.
This is the problem I've always had with Vim and I suspect I'm not alone in this. I find the concepts of modes jarring, even antiquated. Everyone who has used vi(m) has copied and pasted text in while in command mode and done who knows what.
Emacs is better in this regard but I find Emacs's need to consecutive key presses (or a key press followed by a command) to be longwinded.
The advantage of either is they're easy to use over ssh+screen (or tmux) for resuming sessions.
That all being said, give me a functional IDE any day. IDEs understand the language syntax. Vim can do a reasonable job of this. Emacs (with elisp) seems to do a better job (or so it appears; I'm no expert) but IDEs (my personal favourite being IntelliJ) just make everything easier. Things as simple as left-clicking on a method and going to its definition.
For statically typed languages (eg Java/C#), IDEs (quite rightly) rule supreme. Static code analysis, auto-completion, etc are just so much better than text-based editors.
Dynamic languages are more of a mixed bag and its certainly the norm for, say, Python and Ruby programmers to use one of these.
Still, give me an IDE any day.
One objection seems to be that people don't like using the mouse. I tend to think the speed differences over not using the mouse are largely illusory.
Anyway, I can use vim but I've never felt comfortable in it and I don't think I ever will and modes are the primary reason.
EDIT: I realize there are plugins and workarounds for many of these things but that's kinda the point: I don't want to spend hours/days/weeks/years messing with my config to get it "just right".
Also, instead of archaic commands to, say, find matching opening/closing braces (which tend to involve an imperfect understanding of the language), IntelliJ just highlights matching braces/parentheses, where a variable is used and so on.
[1[: http://www.youtube.com/watch?v=PUv66718DII http://www.youtube.com/watch?v=PUv66718DII
- jes5199 14y agoThe way that most Vim users use modes is like using "StickyKeys" on your Shift/Control/Option keys. You smack "i" or "a" to go into insert mode just for the duration that you need it, and then you smack Escape the moment that you stop typing, even if it's just pausing to think. Also, if you use a GUI version of Vim, then it knows about "paste" and doesn't make the mistake of interpreting your paste buffer as keystrokes.
- dave1010uk 14y agoI think this is the key to vim. It's a revelation or a turning point in how you use it. You change to insert mode to insert text; you don't change to normal mode (to do text operations) as you're already in normal model.
- irahul 14y ago> Everyone who has used vi(m) has copied and pasted text in while in command mode and done who knows what. If you are using vim, you should play per vim rules. When you are entering text, you enter insert mode. When you are done, back to command mode. Once you have that mental model, you don't try to c-v(or c-shift-v or whatever) in command mode. Also, if you are willing to try vim, grab a vim build with clipboard support and copy-paste from within vim(=+p paste clipboard, =p paste x selection, =+y{motion} copy to clipboard ... in command mode; or ctrl-r+ paste from clipboard, ctrl-r paste from x selection in insert mode) > I find the concepts of modes jarring, even antiquated. The thing I like about vim is translating intent to vim commands - delete 10 lines and then move to the top of the file 10ddG, delete everything inside these parens and put me in insert mode cib etc. Without modes, these won't be as short and sweet. You will be left with long key combinations - the way emacs does it. > Emacs is better in this regard but I find Emacs's need to consecutive key presses (or a key press followed by a command) to be longwinded. Isn't that obvious? If you always want to be in insert mode, how else will the special instructions be entered? > The advantage of either is they're easy to use over ssh+screen (or tmux) for resuming sessions. And they are very good at editing text, and majority of programming languages, though might require some configuration. > For statically typed languages (eg Java/C#), IDEs (quite rightly) rule supreme. Static code analysis, auto-completion, etc are just so much better than text-based editors. I generally am able to find something for Vim which makes language specific stuff easy. Clojure - http://www.vim.org/scripts/script.php?script_id=2501 http://www.vim.org/scripts/script.php?script_id=2501 Java - http://eclim.org/ http://eclim.org/ Go - https://github.com/nsf/gocode https://github.com/nsf/gocode C - http://www.vim.org/scripts/script.php?script_id=3302 http://www.vim.org/scripts/script.php?script_id=3302 Python - http://rope.sourceforge.net/ropevim.html http://rope.sourceforge.net/ropevim.html And a lot more... > I tend to think the speed differences over not using the mouse are largely illusory. Doesn't that depend on the task? What will be faster - ctrl-f on this page or clicking edit(or some menu)->find? Also, for me, it is more about having my fingers on home row is the sweet spot and moving my fingers from my sweet spot is irritating.
- flyinRyan 14y ago>If you are using vim, you should play per vim rules. This issue is that studies show us vim's rules are wrong: modal editing is a source of confusion and error. I used vi[m] exclusively for 8 years or so and until the very last day I could still make major modal based errors.
- Ralith 14y agoGiven that emacs (and I expect vim) can do all of that and then some, for languages both static and dynamic while taking a fraction of the resources of a monolithic IDE and permitting to use the same editor across all your projects, it seems that your only actual problem is that the default configs are not to your taste.
- cageface 14y agoMy laptop can run a full-featured IDE (IntelliJ) without breaking a sweat and it supports all the languages I need and then some. I guess I could go back to trying to hack together an IDE in emacs or vim with a bunch of buggy, half-supported third party plugins that interoperate poorly if at all, but why?
- Ralith 14y ago> My laptop can run a full-featured IDE (IntelliJ) without breaking a sweat and it supports all the languages I need and then some. I've had a quad-core desktop chug under Eclipse (employer required I use it) and still had to fall back to a real editor regularly. > I guess I could go back to trying to hack together an IDE in emacs or vim with a bunch of buggy, half-supported third party plugins that interoperate poorly if at all, but why? Well, mostly people use the well-maintained, integrated, and first-party ones instead. Each to his own, I suppose!
- aerique 14y agoEmacs is better in this regard but I find Emacs's need to consecutive key presses (or a key press followed by a command) to be longwinded. These consecutive key presses ("chords") are just there to provide default bindings and are one of Emacs' weakest points since they're universally horrid. However, there's no single best way to use Emacs[1]: everyone should configure it how they want it to. After years of using my own key bindings I've streamlined them with the rest of my OS[2] and couldn't be happier. [1] Opposite IMHO to Vi(m) where one should use the default key bindings. [2] CTRL/CMD-o to open a file, C-s to save, C-f for incremental search, etc.
- martininmelb 14y agoI used to use IntelliJ when I programmed in Java and loved it. I was still learning Java and its ability to show help, check syntax and refactor was excellent. But then I did less Java and more Python and returned to vim. One issue was that I was not only editing code, I was writing documents in LaTex, I was editing large 'data' files (ascii text), I was editing blogs and other notes in Markdown etc. Unfortunately, IntelliJ seems to regard everything as a project and does not make it easy (at least back then) to simply create or edit a file that is not part of a particular project. Another advantage of vim is that most of the time at work I am working on a PC but editing files on Linux boxes. At home I am on a mac. I know I could run X, but I prefer running Putty, and I enjoy the lightweight nature of just bringing up vim. So, currently, vim is my editor of choice. Also, I must admit that after 20+ years of using vi/vim, I still make the occasional mode mistake and type 'i' when in insert mode, or ':wq', but vim is still my favourite editor.
- ibotty 14y ago> Everyone who has used vi(m) has copied and pasted text in while in command mode and done who knows what. try to set mousemode (vim) if vim is compiled with x11-support.