Live data from Hacker News

Vim Creep (2011)

rudism.com

91–100 of 169 posts

Re: Vim Creep (2011)

#91
post #70
post #45

Probably the best second person POV story I've ever read. Very funny and I got a kick out of it. As a relatively new part time vim user (about a year), I felt portions of this. I still use VSCode for a handful of tasks, but Vim has taken over more and more. This past semester I had to SSH into our CS servers for my OS class, and the way my group would work was usually me sharing my screen and us peer programming. The…

Not to be too pedantic but shouldn't that be ddGp? Also, have you tried the Vim plugin for VSCode?

I've tried the Vim plugin for VSCode a few times personally, but I don't trust it. It's incomplete, and it has its own secondary understanding of history that can get you into trouble when it interacts poorly with VSCode's own history. Anyway, that was my experience for my short time using it.

I'm curious if there are any longtime vim users using VSCode with the Vim plugin, and if so, what are their experiences, and why do they use VSCode with a Vim plugin instead of just using vim itself?

Re: Vim Creep (2011)

#92
post #6

> You recorded macros, you moved entire blocks of code with the flick of a finger, you filled dozens of registers, and you rewrote and refactored entire components without even glancing at your mouse. You mean: spend untold hours scripting and recording interactions that give you about 10% of capabilities of a modern IDE. I've personally seen long-time vim users switch to Idea after looking over my shoulder.

Clearly there are many areas where vim is not the best tool for the job. Would you mind sharing a couple of examples of the context and the IDE features that made long-time vim users make the switch?

This was about three years ago, and the codebase was a huge Symfony project, in PHP.

- IDEA understands bindings to Symfony's sprawling YAML configuration files. So jumping between PHP code using a config value and the YAML file defining the value is one shortcut/click away. And more, and more: https://www.jetbrains.com/help/phpstorm/symfony-support.html

- Refactoring: even a small thing like renaming a variable, a method, a config value. Changes propagated through all affected files (with preview of changes). It's impressive even for dynamic languages like PHP: https://www.jetbrains.com/help/phpstorm/refactoring-source-c... For languages like Java? Oooh, boy, see submenues on the left https://www.jetbrains.com/help/idea/refactoring-source-code....

- Symbol search. You know a function name, you can't remember the file? Symbol search for the function name. It's fuzzy, too. https://www.jetbrains.com/help/idea/searching-everywhere.htm...

I think searching was the primary thing that drove people to try IDEA. And I've seen it again and again with emacs and vi users: they spend significantly more time searching for code than I do. Because most of the time the best you have grep/ag/ripgrep which just search through files as and leaves figuring out context to the user.

- Usages. Shortcut/Cmd+Click on anything, see where that anything is used/invoked. Without searching. https://www.jetbrains.com/help/idea/find-highlight-usages.ht... That was another big thing that fascinated people. Very useful in large legacy projects.

This is off the top of my head for that particular job.

But in general, there are significantly more things like identifying errors and suggesting fixes, large-scale refactorings, understading the plethora of test frameworks and letting you run the tests however you like, debugger integrations, stepping through automatically disassembled code for Java and .net during debugging etc. etc.

Re: Vim Creep (2011)

#93

I'm interested in using vim, but I'm not thrilled about trying to set up debuggers when an IDE has it for you. Maybe I'm over complicating it, anyone have a python based suggestion? As a note, I do not have local admin but Vim is installed already.

PyCharm + IdeaVim, the best Vimemulation i tried so far (VS, VSCode, Spacemacs). It supports Macros, you can use parts of your .vimrc and they ported several plugins, vim-surround and others.

Re: Vim Creep (2011)

#94
post #75

Earlier quoted context omitted.

I don't understand - how is using a debugger a waste of time? I don't often use a debugger, but they have proven to be useful in a lot of cases.

> I don't understand - how is using a debugger a waste of time? The debugger may help you understand, at some moment in time, what an unclear piece of code does. When you revisit this piece of code later, or another person finds it, your first experience with the debugger is not remembered, thus lost. This is what I meant. On the contrary, if you clarify the code and make it easier to instrumentate (by adding asserti…

I feel like your understanding of a debugger is very limited.

To me - A debugger is the instrumentation you're talking about, but created by the language/runtime developers instead of having to be remade by you, poorly, for each new project.

A good watch statement is a hell of a lot more useful than an assert - even though they both try to do the same thing.

Not even touching the places where a debugger solves a problem you simply can't touch with instrumentation after the fact (crash dumps immediately come to mind...).

And neither of them are (in any sense) a replacement for writing a test after you solve the problem, or adding comments so the next developer has context on the why of that piece of code.

Re: Vim Creep (2011)

#95
post #48

Earlier quoted context omitted.

I have .. as an alias for cd ..

Don’t stop there! ... for cd ../.. .... ..... They compose naturally too, ..../targetDir I use these so frequently and naturally that I forget that they aren’t built-in to my shell. Also, a shortcut to jump between the last 5 or working directories. Print them with `dirs` and cd to a directory by invoking its number.

How do you make that history? Something like an alias for cd that pushes them onto a queue?

Re: Vim Creep (2011)

#96
post #62

Earlier quoted context omitted.

Yeah I always wonder who these people are for which the editor is a bottleneck and how they work or what they work on. 90% of my time is spent debugging, understanding legacy code and drawing trees or writing pseudo code on my notepad. The actual time I type stuff into an editor is like 10minutes per day.

Just a single data point, but as a matter of principle I never use a debugger. Any time spend inside the debugger is 100% lost and useless to other people. To study a code, it is best to copy it, run it, and keep adding assertions, comments, and logging infrastructure. Besides helping you to understand what the code does, all these changes are useful for other people who may need to understand the code in the future.

Styles differ, but for me using actual runtime behaviour to guide my reading of a code base is often a LOT faster, and your approach ends up boiling the ocean. The way for this activity to benefit others is to use your improved understanding to refactor/simplify the code you are working with to make it clearer for someone else to understand at first reading. Personally for me many systems only clicked after seeimg the, from the inside.

Re: Vim Creep (2011)

#97
post #63
post #16

Earlier quoted context omitted.

I highly recommend trying out VSCodeVim. Use it for Go, JS, C, Rust and more - it's really enjoyable, and even stuff like C - W works just fine.

Unfortunately that plug-in is a horrible performance hit to an editor that already is on the slow side of typing responsiveness.

The plugin called "Neo Vim" is much faster, although it requires a nightly neovim to be installed.

Re: Vim Creep (2011)

#98
post #6

> You recorded macros, you moved entire blocks of code with the flick of a finger, you filled dozens of registers, and you rewrote and refactored entire components without even glancing at your mouse. You mean: spend untold hours scripting and recording interactions that give you about 10% of capabilities of a modern IDE. I've personally seen long-time vim users switch to Idea after looking over my shoulder.

For me Vim’s value is as a great programmer’s editor, not so much as an IDE. There are a few things I have made or installed that I just could not live without: * CamelCaseMotion, allowing select/delete/change of just one or a number of segments of a camel case or snake case name * surround.vim, allowing single commands to (for example) change the () surrounding a text to [] or “ to ‘ * a simple one-liner to change a…

> You don’t even have to think to type ysiw” to put “ around the current word

I just select the word (Option/Alt + ArrowUp) and press “. Same for parentheses, brackets, curly brackets and single quotes. ;)

> or vt)~ to change the case of everything up to the next )

Since selection in IDEA is context-aware, pressing Option/Alt + ArrowUp will select the word, then the group (e.g., an expression in parentheses, or a key-value pair in HTML/JSX), then the outlying group (e.g., the scope block, or the tag) and so on up until the full file is selected. For any context/group.

It doesn't have a built-in camelCase transform, but there is a plugin :)

So, in general, an IDE usually provides a much more generic set of commands that are applicable in a wide variety of situations, and that are usually context-aware. Not some very specific situations like "if I'm in this particular place, and I do this particular thing, then do that particular thing".

Re: Vim Creep (2011)

#99
post #23
post #6

> You recorded macros, you moved entire blocks of code with the flick of a finger, you filled dozens of registers, and you rewrote and refactored entire components without even glancing at your mouse. You mean: spend untold hours scripting and recording interactions that give you about 10% of capabilities of a modern IDE. I've personally seen long-time vim users switch to Idea after looking over my shoulder.

> You mean: spend untold hours scripting and recording interactions that give you about 10% of capabilities of a modern IDE. For information, not all vim users are trying to reimplement the capabilities of a modern IDE in vim. Some of us are just fine with vanilla vim/vi (and derivatives) because we are comfortable enough with the *nix environment [1] and don't need IDEs' fancy GUIs and integrations with stuff such a…

> In my opinion if one needs the full capabilities of a modern IDE right in their editor one should go with a modern IDE.

> Trying to turn vim into a modern IDE with a zillion of plugins and glue scripts is a leisure activity and a time sink.

Haha. That's true :) It's possible there's this conscious/unconscious bias against IDEs and "all the cool kids use vim/emacs". So people use those editors, but consciously/unconsciously crave the quality-of-life improvements that many IDEs (or just many other editors) provide. Even the simplest ones like file lists. Or symbol look ups. And then, yeah, it's down the rabbit hole of chasing the plugins, and configurations, and scripts.

I experienced all this myself with emacs (I never grokked vim beyond some basic commands).

Re: Vim Creep (2011)

#100

Earlier quoted context omitted.

But are those functionality available natively without plugins? All these are in the default emacs distribution possibly since more than 20 years, and are in a very usable, stable state of functionality.

Aren't these technically plugins for emacs that are shipped with the editor? Org-mode is a plugin for emacs too right?

Sure but what’s the difference? That’s the beauty (and occasional curse) of Emacs. There’s no hard line between “native” code and plugins, outside of the Emacs Lisp interpreter.
Post reply on HN