Commanding your text editor(blog.peepcode.com) |
Commanding your text editor(blog.peepcode.com) |
Also, 'Fuzzy file' searching in vim: https://github.com/kien/ctrlp.vim
As others have mentioned for fuzzy finding, use CtrlP. I also use FuzzyFinder for quickly switching between many open files (buffers).
Yet to meet anyone using vim or emacs who is actually more productive than me... the more productive people use Visual Studio, Xcode, Eclipse or whatever else is infront of them.
Maybe I am wrong, but I think typing is probably 30% or less of the time I spend coding... and thinking to make sure I write less code is probably more valuable than typing faster, not just in saving me time, but in improving stability and ease of reading code...
FYI GNU Readline shortcuts - basically Emacs shortcuts - are defaults on OSX...
Just always keep an eye out how you can improve yourself and your tools. There are many hidden joys to be found in all those programs, methodologies and workflows. Don't fall into the trap that just because you committed to one thing, you can't try another. There is nothing worse than being limited by your tools and not even noticing it.
Even if you don't stick with the new stuff in the long run, you will probably still learn something valuable. Learning a new tool or language or methodology is like visiting a foreign country. It is not so much about seeing new stuff, but more about gaining new insight in your own ways and getting a new appreciation and context for what you take for granted.
Be happy and keep an open mind is all I'm saying.
You are confusing non-expressive languages like C# and Java which needs lots of "refactoring" and lots of boilerplate code (hence the need for code generators which understand "patterns" and refactoring tools etc.) with "productive languages", for a start.
Then your point is moot anyway: since quite some time there are vim programmers using an Eclipse bridge and getting the Eclipse features right from inside vim (it's called "eclim") and there's, of course, a port to Emacs ("emacs-eclim") which, despite only being used by a few people, works quite well (I'm using it and getting the best of both world and for when I do really need to something inside that piece of underperforming bloat that Eclipse is, I can just switch to it in a heartbeat).
But anyway, even without these Eclipse bridges, if you do really think that someone using, say, Visual Studio to develop C# code is more productive than a programmer using Emacs to develop Clojure code I'd like to have some of the stuff you're smoking because it looks good ; )
To me the biggest issue with Eclipse / Visual Studio / IntelliJ is that their "text editor" part is really terrible.
In addition to that, programmers do craft tools to make their life easier : to me it's only logical that a programmer would want to be able to program his editor.
I suggest to take a look at the "Emacs rocks!" series on YouTube to get a feel of what's possible using Emacs.
To me a good example of a productive programmer using Emacs would be Rich Hickey. He created the Lisp dialect Clojure and then he went on to create an amazing DB (Datomic) using Clojure. He knows about productivity...
Now of course if you're stuck in the C#/NHibernate/SQL hell working on apps full of mutability and where it's close to impossible to reproduce state, I do understand why you feel Visual Studio would be better. But I do really your ability to "move fast" compared to people using more advanced technologies and who are not stuck in the "design pattern" / ORM mindset...
C# is a quite expressive language in my opinion. And i'm quite versed in Clojure, which seems to be your language of predilection. It does have limited type inference and lambdas, which makes it a lot less painful than Java.
It really depends on the problem you have at hand anyway. But even if you have a problem where you need a more functional approach, with immutable data structures, you can use F#, which is an amazing language.
> But anyway, even without these Eclipse bridges, if you do really think that someone using, say, Visual Studio to develop C# code is more productive than a programmer using Emacs to develop Clojure code I'd like to have some of the stuff you're smoking because it looks good ; )
I use Visual Studio to develop C# code. I use Eclipse if i have to code Scala. I use emacs if i have to clojure, i actually used it to develop Clojurescript's Lua backend. Most of them have good vim bindings anyway, but in emacs i prefer to use emacs.
C# with Visual Studio can be the most productive of languages, provided the good use case. And you sound like you know nothing about what you're talking about.
> Editor war!
Please don't.So fucking what if someone has the audacity to eschew vim/emacs/ed/acme/pen and paper in favour of a nice IDE they're familiar and productive with? You don't get any geek-cred for using any editor over the alternatives.
1. Why doesn't it already index on the function names (the ones you get to by pressing @), so that I could find a file not by it's name or path, but by it's function definition (and with less priority, by it's function use)?
2. Why doesn't find in files work with the same usability, even if the match would not be as instant? Having an overhead box and the file auto open in the buffer as it matched would be a great improvement over what seems like a set in stone standard of opening a new dialog/file to display the find in files results.
If anyone knows of settings, plugins or even other editors I can get for these features, I'd be in heaven.
There's project-wide fuzzy opening in Xcode too: bind "Open Quickly" to whatever you like (I use cmd+O). It has the same fuzzy searching as Sublime Text (for example, gvcm will take you straight to your GridViewController) but builds on it can take you straight to symbols if you want.
Ctrl/Cmd + P is even better than fuzzy search in Sublime; it searches in all the files that are contained in opened folders.
Automatic indentation is also available without plugin, though you have to add a key binding:
{ "keys": ["ctrl+shift+r"], "command": "reindent" , "args": {"single_line": false} }
or look for it in Edit > Line > Reindent.Completion works with Tab too on Sublime.
vim is great and I use it all the time but not for Java and PHP where the IDE support is so good that it really makes a difference.
Also, not listed there, but TextMate's autocomplete word can also be used with [Shift - Esc] for the reverse direction.
https://github.com/garybernhardt/dotfiles/blob/master/.vimrc...
You use tab for completion in so many other contexts, it's nice not to have to break that habit in your editor.
Ctrl+Del even works in Notepad, if that's your thing.
Maybe that's just me but I would be incapable of choosing an editor/IDE/smartphone/perfume/car/whatever because someone I admire uses it. That sounds incredibly childish to me.
That is not what i was trying to say. I mean that when reading HN with all its Vim/Emacs hype one could get the impressions that you cant be an awesome software developer without using vim/emacs. But some examples like mine might help to check with reality.
Lots of what you read on HN is hype, be it vim/emacs, textmate, NoSQL, or some form of super cool javascript framework that is currently fashionable. Its good to know that there are still lots of devs in the real world, using proven tools and being as productive/awesome as the people using the latest buzz.
Not really. I'm over a month into using Vim full time because it's the standard at my workplace. It sucks. I can't believe that the people around me insist on using this piece of junk. It has so many problems that I never had to deal with in Textmate. Huge step backward.
Okay, indentation and auto-completion are rather trivial things to do in an IDE, but most IDEs come with powerful search tools and for most IDEs I don't know how to use them.
Vim also contains excellent autocompletion (several kinds, actually, most powerful of which is the omni complete) but it's not restricted to one language. It may, however require you to install your language specific plugins. Vim ships with C and C++ mode, which requires you to build a ctags database of your source code. In addition you might want to add cscope for source code navigation.
Eclipse has autocomplete perhaps for a handful of languages but Vim has support for autocompletion in tons of languages.
In addition to omni-complete, vim can have an user defined completion (C-x C-u), which is handy to set to do syntax completion (set completefunc=syntaxcomplete#Complete). Vim ships with tons of syntax files, which are used for completion and syntax highlighting. This is not super useful for programming, but is excellent for different kinds of configuration files, so you don't have to memorize (or look in the manual) for the configuration options you use.
And I'd rather use Vim without autocomplete than have to deal with Eclipse. Thankfully I don't have to.
Emacs has great autocomplete too.
To me the IDE features make up for the minor annoyances of using vi/vim emulation.
EDIT: Reading some other comments, there is Emacs-eclim that gives you Java IDE features inside Emacs. So forget what I said about Java: Emacs can now handle even Java well!
For dynamically typed languages, Emacs can essentially be as good as possible fairly easily. I've been using it for JavaScript and Racket lately, and it's been really great for both. For statically typed languages, there are often type-aware tools that make it as good as any IDE--for example, I've used TypeRex[1] for OCaml; there is also ENSIME[2] for Scala and similar tools for a bunch of other languages.
[1]: http://www.typerex.org/ [2]: https://github.com/aemoncannon/ensime
Just because Emacs is a great text editor does not mean it isn't a good IDE. It has some very good support for a whole bunch of languages. I'm under the impression that Java is an exception to this rule, but I really don't know--I haven't used Java in a couple of years and really hope I will never have to use it again.
So, all told, I think this oft-repeated advice to use an IDE instead of a text editor like Emacs is misguided: Emacs is much more an IDE than just a text editor. Perhaps it's accurate for Vim, which I've never used (and I wouldn't be surprised if Vim support IDE features well too), but it isn't anywhere near true for Emacs.
That said, Emacs and Vim also have intelligent autocompletion depending on the language and support for it has only been getting better.
disclaimer: numbers have been made up
1. The vast majority of things that I did were repetitive and were already solved in other environments
2. Knowing the minutiae of the stuff that I know now does not improve my skills at all - production matters for shipping, minutiae matters for interviews. Best way to get a job is to produce so much - you don't have to interview :D
Now I just use whatever is the most widely deployed, best supported environment for each language (e.g. Visual Studio for C++ and Eclipse for Java).
The one thing I have kept is my vim foo by using IDE specific plugins :D. Pick your tools carefully - and don't fall into the "true final solution trap" that people try to sell you.
Choose the right tool for the right job.
It actually works so well that the "emacs eclim", based on eclim, "Just Works! [TM]" and gives you, right inside Emacs, the Eclipse auto-completion.
Even when stuck in the Java/ORM/Hibernate/SQL/XML hell (at which point I want to kill myself and really question the company's "productivity"), I'd still rather use Emacs + emacs-eclim then Eclipse (or IntelliJ IDEA -- which gives both NetBeans and Eclipse a run for its money btw).
Thing is: adding Eclipse / IntelliJ support to vim / emacs is not that hard. But turning the "text editor" part of Eclipse into Emacs just looks like mission impossible.
IIRC using eclim you can replace the (very lame) text editor of Eclipse with vim. So you get vim running right in the middle of your Eclipse.
What's not to love there?
While we are at it…
I never really used TagList or equivalent widgets in other IDEs/editors as an outline of my code but rather as a navigation tool. :CtrlPBufferTag is great for moving around in a large file. Same thing with :CtrlPTag for navigating a project. I love CtrlP.
If the "you" is me you don't need to convince me at all: I'm a diehard Vimmer.
Usually, I tend to ignore it more often than I actually find it useful. Even some simplistic look-for-common-words-in-open-buffers in regular text editors works better in my experience.
That said, add Visual Assist X and it's a different ball game.
I agree with you on everything. These days, the number of new Vim users who switched because of some misinformed and/or shiny blog post is staggering. People now seem to just jump from one ORM or VCS or editor or framework or DB or design pattern or language to another twice a week. I wonder what would happen if nobody was there to tell them what to do?
Being a good dev is totally independent on the tools: everything that matters is in the head.
I like Vim because it shortens the path from brain to code quite dramatically. But it's definetely not a pre-requisite for being a good dev (which I don't pretend to be, BTW).
It's hard to measure this, of course. But I have a hard time believing that there's this population of developers out there that are constantly switching tools/frameworks/platforms/etc. and getting any work done at the same time.
There's probably a silent majority, everywhere around us, who act as adults but that vocal minority… boy how loud is it!
It just keeps me sane. It just saves me from "arrow, arrow, arrow, arrow, arrow, backspace, backspace, backspace, backspace, backspace."
Editing python it's fine. If I was going to write c++, I'm sure I'd pick up an ide. With a plugin for vim keybindings.
Ctrl+<L/R arrow> moves one word to the left/right Ctrl+Backspace deletes the previous word Home takes you to the beginning of the line End takes you to the end of the line Adding Shift to any of the selection operators will select the word/line in question.
Now you don't have to press arrow,arrow,arrow,backspace,backspace,backspace anymore.