5 ms·
Vim's (well... "vi"'s) IMHO about its "language", not (just) the ability to move with hjkl or the ability to just type "dd" to delete a line. The ability to jo
by mfontani 6y ago
Vim's (well... "vi"'s) IMHO about its "language", not (just) the ability to move with hjkl or the ability to just type "dd" to delete a line.
The ability to join together optional "contexts" (this visual selection, this line range, the whole file, ...) with "verbs" (delete, change, append, ...) and "adjectives" (up to, including, ...) and "nouns"/"things" (word, WORD, next search term, letter, line number, ...) is what makes the language both worth to learn, and powerful.
This is enlightening: https://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim#1220118 https://stackoverflow.com/questions/1218390/what-is-your-mos...
My point being: aside from the few IDEs which "really include" a copy of "full" vi/vim (i.e. including a remote neovim they communicate with), a well-seasoned Vi user is probably far better off using the real editor, than they are using a crippled "vi-like mode".
- jack_pp 6y agoI'm a basic/intermediate vim user for about 8 years now and I implore you to stop talking about vim like this. You overcomplicate basic vim and make it sound all esoteric when it isn't but people who haven't gotten through vimtutor will probably read your comment and just reinforce the belief that vim has a steep learning curve and is probably not worth learning. Also, try vim mode in VSCode before stating that it's not really mature enough and you're better off with vanilla vim. I am certain you haven't and are operating on the mistaken assumption that vim modes are not mature enough
- methodin 6y agoI disagree. Without getting to know the language you end up just memorizing commands which is akin to doing the same thing in school to pass a course but getting nothing out of it in the long run.
- jack_pp 6y agoGetting nothing out of it? Any navigation whatsoever using a basic editor is a pain in the ass compared to vim, learning that alone is trivial and would probably make people switch to vim. Add to navigation a few bells and whistles like replacing text inside brackets, dot macros and probably 10 others things that I can't name off the top of my head but are very convenient and "in the long run" you would've saved a whole lot of time and made coding more enjoyable because your edit speed is noticeably improved.
- 411111111111111 6y agoPersonally I went from cli vim on servers (sys admin) to vim mode in atom. I loved atoms vim mode - especially the way it handled multiline input. Then I switched to vscode and struggled a little. Copy paste didn't just work, i.e. getting things from the register (yank) into another application and multiline input was not pleasant (esc deselecting instead of exiting input mode etc) Then I switched to intellij (developer now) and installed vim mode. When I noticed how often I had to use the menu because I wanted to use an ide feature I realized that it got more in the way then in helped, so I removed it and went back to just navigating with ^-f and arrow keys. I definitely miss atoms vim mode. But it's not that big of a difference, because the actual input time is usually less then the time thinking about what to implement and how to do it.
- qayxc 6y ago> the actual input time is usually less then the time thinking about what to implement and how to do it. 1000x that! I never understood what people mean by being "more productive" with vim. As a developer I don't edit text - I reason about architectures, algorithms, and data flow. Actual typing is the smallest part of the job and I don't get paid by lines of code anyway...
- aoloe 6y agoMy personal answer: I'm touch typing. I can do so without looking at the screen. While I'm typing, I can think of what I want to say next. At least to some degree. Vim helps me to stay focused, to stick to my thoughts instead of having to work with the IDE/editor. I don't have to select a word, by detecting its boundaries (or point to it and double click), delete it and type an new word. ciwnew word^ what looks like random chars is almost a reflex, when you get the Vim "grammar". (of course, you can do it with any editor: ctrl-left, ctrl-shift-right, delete, "new word".) So, yes, you're 100% right: programming is no about typing. And Vim helps me to care even less about typing the code.
- alpaca128 6y ago> I never understood what people mean by being "more productive" with vim. But you understand why people plug a mouse into their laptop instead of using the touchpad, why they use Ctrl-C instead of copying with the mouse, why they autocomplete code in the IDE using keyboard shortcuts instead of clicking through menus and why they sometimes prefer a physical keyboard on their iPad instead of typing with two fingers on a non-tactile screen? Sometimes it's not about being more productive but about turning the stuff you do every day from a chore riddled with tiny annoyances into a more enjoyable, coherent experience. With Vim I don't have to worry about annoying "smart" features, popups with suggestions I never asked for, no need to switch between mouse and keyboard all the time for little things like selecting some text or opening a file, and at the same time it has the most flexible system for custom keyboard shortcuts I have seen to date.
- lqet 6y agoWould you say that in the long run, you get nothing out of learning basic algebra in elementary school by memorizing the techniques of addition, subtraction, division and multiplication, because you do not learn anything about group theory? It's a bit pompous to call the vim commands a "language". Basically all you have to know to use vim very powerfully is the difference between insert and navigation mode, how to switch between them, how to move around with hjkl, how to move around in "blocks", that \ opens the search and that y = yank means basically copying. You can learn that in under an hour. Combine that with stuff like "yiw" (yank in word) or "dib" (delete in bracket) and you will get a lot farer than with most other editors. I guarantee you that I do not think about how "dib" means "delete in bracket" when I use it, I have it just memorized.
- alpaca128 6y agoVim modes are kind of mature, but that's simply not enough imho. Even the best of them (like Evil mode) have enough deviations in behaviour to throw me off regularly. IntelliJ constantly auto-indents and reformats the code I'm currently writing, breaking my focus on it all the time. You might think those are unimportant details, but when someone relies on muscle memory and keyboard-heavy controls it just doesn't always lead to an expected result. Especially once you add configuration files and plugins into the mix. IDEs should just support NeoVim integration for text editing. It removes the need to replicate anything because it's literally just Vim with the unchanged user configuration. I think it would be a win for both users and developers.
- JeremyNT 6y ago> Also, try vim mode in VSCode before stating that it's not really mature enough and you're better off with vanilla vim. I am certain you haven't and are operating on the mistaken assumption that vim modes are not mature enough I gave this a shot actually, and it was 1) slow and 2) missing features I used a lot. The tab/window/buffer behavior was close enough to feel similar but not close enough to be a direct replacement, and that just left me frustrated. For anybody who has really deeply ingrained muscle memory on using vim (beyond the basics of navigating around a file), trying to switch to an IDE with a vim emulation mode is still a pretty big haul. (This isn't to say that the vim-like modes of other editors aren't good/useful for people, it's just to say that for a lifelong vim user they may be lacking in too many ways to justify)
- noknownsender 6y agoI agree with this. I was scared of vim for... years. Then I used it for like a day, and I was already better off than using nano.
- yomly 6y agoI agree that the navigation is top notch in Vim. But after getting comfortable with navigation and general operation of vim, it opened up macros as a means of using it. Then recently I've come to appreciate how well Vim composes with "it's just text" Unix tools and how being able to filter things to tabularise or sort your code is almost magic. All while keeping your edit history and not requiring any plugins. It goes deep, but in a good way. I guess what's also good is you can get a lot of value without having to go that deep
- 0xfaded 6y agoWhen you record a macro you record the key presses to the specified register (e.g. "qa" records the macro to register "a"). A long time ago (early university years) I needed to do some codegen, which I implemented with a vim macro. But the macro was waaaaaaay to long and complicated to record once without making mistakes. So as you've alluded to, I wrote a "program" in a separate file which was all the key presses to generate a c++ class (including pretty print!) from a protocol definition. I could then yank the program into a register, switched tabs, and ran the macro :) Totally maintainable /s
- fit2rule 6y agoYou reminded me of the time I solved a thorny PROGRESS/4GL programming problem in the 80's using PC-Write (what an editor that was!) by writing a macro file containing a code-gen/-mod script, and then feeding the macro file into PC-Write and processing 2,000 source files in a few minutes, ready for re-compilation. I haven't done that too much with vim in the ~35 years since then, but that's only because I haven't quite grok'ed how to write vim macro's by hand, yet. I should probably figure that out by now, but as a vim guy all I've ever needed is maybe 1% of all of vim's feature set to be productive ..
- deleted 6y ago[deleted]
- fit2rule 6y agoI completely agree with you. Every time I get an IDE's "vi mode" unpacked and set up in any way that I can try to use it, I end up running from the IDE with my hair on fire, back to plain ol' text-mode vim at the command line. These features only ever serve to remind me that the IDE is the problem, not vim. Disclaimer: vi/vim user for 30+ years.
- atrettel 6y agoI agree with this basic idea, though I understand why some people have a difficult time seeing it. VI and Vim are advertised as "modal" editors, but in fact they are just editors that accept a rather terse command language. I originally never wanted to use Vim but had to use it often at work (especially in the server room), so I got used to mechanically entering and exiting insert mode as many people do. That was the extent of my knowledge, but then during a slow period at work I took the time to learn Vim thoroughly by reading "Learning the vi and Vim Editors" from O'Reilly. It changed my view of VI and Vim to the point that (as I had said) I now think of them as command-based editors rather than modal editors. Once you realize that each key press is a command in a very terse language, you can see the power and expressiveness of the language, but it takes some practice and time to build up your intuition. For example, I often find myself typing something like "79a-ESC" or "79i-ESC" to put in a horizontal rule in text or Markdown documents. To somebody thinking modally this command makes little sense, since I leave insert mode immediately after typing a single character! But from a command language perspective it makes total sense, since I merely instruct Vim to append 79 dashes to the current line. Once you see that it's a language, you stay in command "mode" much more, since that is where the power is.