Seems more like a weird para-work hobby than an actual productivity hack.
Seems more like a weird para-work hobby than an actual productivity hack.
You'll learn a few shortcuts, because it would be nice to delete an entire line, or just look at the end of the file. What do you know `dd`, and `G` respectively do that for you.
Eventually things will become easier in vim, and you'll just have another tool at your disposal.
It took me years to begin to appreciate vim. I don't have a .vimrc, I use all the base settings. However, now that I know how to use vim it's become invaluable.
The thing about vim is that it doesn't have to be complicated. It can be as easy or as hard as you want it to be.
Imho there are strictly better options than vim for this nowadays for people who are not already invested in vim. Sublime text is easier for people that prefer GUIs. For CLI, Kakoune has better discoverability, better thought/more consistent commands, and actually usable colorschemes and syntax highlighting out of the box.
The studies that "prove" CLIs are faster than GUIs are decades old now, and my experience says they're obsolete.
More than anything, it's about not switching devices. Typing feels like playing the keyboard. Switching to the mouse feels like having to pick up a trombone between keys. (I know that's a bit dramatic of an analogy, but...)
In vim, you just have your cursor inside the (...) and do `ci)`, which is (c)hange (i)nside `(, which instantly deletes all the test inside the (...) and you can type that stuff out easily
For a trackpad, don't you have to manually select all that text, hit delete, then start typing again? Or is there a better way I'm not thinking of
Delete to line's end: d$ Delete to next blank line: d] Replace current character: r Surround the next 3 words with quotes: ys3w" (non standard, but out-of-the-box on VSCode)
On and on
Regarding competitiveness, with a bit of get used to, you can muscle memory things like: "remove content inside this bracket (), or "", or block {} and place me into insert mode so I can start typing new content" in 3 keystrokes. I don't see how searching manually for start and end then select with mouse/trackpad can ever be competitive to that.
I was an avid user of vim for many many years, and I would not describe myself as a vim expert, rather I know a lot of the core commands. I have since switched do vscode (for many reasons) and still use the vim bindings.
I also don't believe it is just an issue about speed using the mouse. I believe it's also a movement issue.
This is the benefit I get, if it is vim/vscode/jetbrains etc as long as it has vim bindings I know `dd` is going to delete a line etc, the editing experience is fairly static. Block editing and yanking, F, T, ctrl-D, ctrl-U, cw, de, cs"`, vwS(, ci", and many others are all great vim methodologies, just like cmd-p (mac) for sublime and vscode.
Multicursor in vscode, feels broken do to me compared to block editing but even if I need to do mutlicursor across distributed lines (something missing from vim) I can use `gd`.
I would say vim is more of a methodology than just an editor.
And Sublime is vim with a user-friendly-ish GUI wrapped around it.
Ended up settling on MacVim.app which has nice window support.
I’ve had good experiences with the visual studio vim plug-in that’s written in F#
I hate that, I ssh in, then maybe I want to edit cron and I am hit with vim(someone changed the simple nano with it), in the past you had no choice then google how to quit vim but now it will tell you how to do it(I ssh and change config files 1 or 2 times a year). I never learned how to quit, just o use EDITOR=nano command to get a simple editor, I don't need a powerful editor for config files.
Would it be better if Nginx would have never been written and we'd all use Apache instead?
What about Docker never having been written and us having to ship VM images with no tool chain around them?
What about JetBrains never creating new IDEs and everyone being stuck with Eclipse or NetBeans?
What about no systemd and having to use sysvinit or OpenRC? Okay, perhaps that last one is debatable, due to some valid concerns.
If Vim is so powerful, then this power should be embraced and transformed into a software package that's easier to use, be it with nano style hints or simpler shortcuts - Vim isn't good because of its accidental complexity after all!
Of course, that might take a few generations, because no one who knows Vim wants to relearn it, whereas the newer people will oftentimes simply resist using it.
But my point is that the weaknesses of each software package should be addressed and eventually fixed, either in itself or another to replace it.
Could vim be easier? Probably. But it’s still useful and is an archetype. Remember I’m not saying new code should be written in Awk. It’s just useful to know how to use the tools that everyone knows, regardless of whether they should be replaced or improved.
The handsaw isn’t perfect or that beginner friendly, but if you refuse to learn to use one because there are other cutting instruments, you’ll probably have a bad time compared to if you didn’t.
This is a perfectly reasonable argument to make and probably reflects the reality of working in the industry pretty well.
That said, I'm still stoked to see what people come up with in the next 20 years.
Maybe gradual improvements like Neovim tried to do. Or perhaps Vim-like text interaction in VSC or JetBrains IDEs, with all of their plugins and ecosystem. Or maybe something even more grand!
Vim's power comes from it being 1) text-based, 2) very fast to load and manipulate files, and 3) very fast to use if you are familiar with the syntax. Like many power tools, it's the last part here that's hard, but it's also very hard to fix without affecting one of the other two qualities. For example, Emacs nails points 1 & 3, but is so much slower to load that few people use it as their default $EDITOR, and has a sizable learning curve as well.
It makes no sense to learn vim because I am hit with it once a year, I better learn tools like "tail" and "grep" this ones are useful for what I do.
But sure if you are a sysadmin or ssh daily and edit big complex config files the sure learn vim if you really want that.
Or you can keep resetting the default editor to nano. You do you, friend.
nano /etc/congig.cfg
my only issue was with crontab, since it was using nano but someone changed it to vim so I was surprised by it, I really had to google how to exit it. Since I edit cronjobs once a year and for config files I can use nano it would be a waste to learn vim, I would just forget all the shortcuts - not sure how other people memory works by me I forget stuff I do not use , like regexp I use them 2 times a year and each time I need to read again what symbol does what.
I am not sure who to blame for making vim the default (in EDITOR), I could swear it was nano and someone in our team had to switch it vim to fuck with the rest,
Delete an entire line: CTRL-Shift-K in VS Code.
Or just look at the end of the file: Ctrl-End in most editors.
Etc...
IntelliJ has programmable keys and they prompt you on first run which ones you'd like to use "Original?", "MacOS", "Linux".
VSCode has it's own key binds for various movements (like indenting a block), I know sublime does too.
It's all just too much hassle, and obviously that doesn't translate to being ssh'd into a server and needing to move some text around, which is harder than it ought to be in Nano. (but you only feel that after you've learned vim.. so.. that's weird, there has to be a universal law about that somewhere)
But consistency only exists within a "culture", such as Linux or Windows.
From the perspective of someone from Windows, VIM is hilariously inconsistent, to the point of absurdity.
Most editors on Windows share a relatively consistent set of navigation commands. Ctrl-Left-Arrow for previous word, Ctrl-End for end of file, etc...
VIM meanwhile is so far away from this it's basically from another planet.
So then from your perspective VIM is consistent and consistently available. From a Windows user's perspective it is the Windows standard editors that are consistent and consistently available.
That's why I've gone on rants previously about the bizarre hybrids like VS Code, where it does some things like VIM, but pretends to be a light version of Visual Studio. It's a garbled mess, but apparently I'm not allowed to criticise it because it is free and JavaScript people had nothing as good available to them before, so it must be the best thing since sliced bread...
Like tab or is something more elaborate?
In vim and vim emulators you select multiple lines with visual mode and press >
Or you do “10>>” and it will indent the next 10 lines.
This is how you do it in vscode:
https://code.visualstudio.com/docs/editor/codebasics#_multip...
This is how you do it in IntelliJ:
Granted, it's not easy to learn and perhaps not for everyone. I think it takes a certain kind of... disposition, maybe?, to appreciate it.
sed 's/vim/nano/g'
If you care about quick edits in a user friendly environment, you might as well use software that's simple to use and doesn't have a steep learning curve, instead providing user friendly shortcuts.In my eyes, Vim is better suited for more advanced text processing and more macro heavy edits, where you need to do lots of repeated actions. Of course, if you are used to Vim, might as well use it for everything, however if you don't that suggestion is possibly a suboptimal one.
Though there's definitely a space that's also occupied by regular text editors (like Notepad++ or the *nix equivalents) if you're in a graphical environment where you even have the possibility of opening an IDE.
I'm not sure that's still relevant, given the popularity of VSCode
> You'll learn a few shortcuts, because it would be nice to delete an entire line, or just look at the end of the file. What do you know `dd`, and `G` respectively do that for you.
That might be just me, but 99% of my navigation is a ctrl+f (a search) or a ctrl+click (go to definition). Most of my "complex" editing needs are served well by the multi cursor and ctrl+left/right arrow (go over a "whole" word). I know that vim is a generalisation of that, and instead of having a specific thing like this you have a whole language to compose things, but I just don't see the point.
I wonder if it's one of those thing that appear universal, but is in fact very personal, and "vim people" are different from "emacs people" and from "VSCode people" and from other people in a fundamental way that can't really change, and that is visible mostly through the editor choice.
It's not even good! This has to be the strangest cargo-cult following of all options you could have. If you're going to use a proprietary closed editor anyway, use something like a jetbrains IDE. At least then you will have a lot of very complete and well-integrated features.
I don't think that's true. It's lighter and faster than big IDEs while being way more accessible than them and vim/emacs. It handles most of what you throw at it, has lots of very good extensions, and you can easily use your shell. If you don't understand what's good about it, that's a failure on your part.
> If you're going to use a proprietary closed editor anyway
It's open source though.
> use something like a jetbrains IDE
My experience with jetbrains has been mostly terrible. That doesn't mean that their IDE isn't good, but it means that they are worse than VSCode for me.
> At least then you will have a lot of very complete and well-integrated features.
I already have that.
While it is true that it has advanced somewhat since it's electron days, this is still not the case. It is at best acceptable.
> open source
Not in any way that matters. Try packaging a not crippled version of the application and you will find out in short order.
It is faster than Jetbrains IDEs or Eclipse.
> Not in any way that matters. Try packaging a not crippled version of the application and you will find out in short order.
This was not my experience at all, but it's been a little while since I tested it so this could be the case.
This version is crippled. The plugin system works because of a workaround to a proprietary server, which will inevitably be broken on purpose when it gains any traction.
I don't think that's exactly true. The marketplace server is proprietary, but you can still install extension by hand https://github.com/VSCodium/vscodium/blob/master/DOCS.md#ext.... It's not ideal, but it's far from crippled.
Vim also has normal mode where every key has an effect on the editing. You can jump forward, backward, delete a word, a line, yank(copy), paste.
readline and MacOS Cocoa also have interesting ctrl/alt+key combinations.
It's useful.
You can use those vim skills in most IDEs. So, your editing will be faster in those IDEs.
I believe vscode is doing a better job at extensions UX than vim. These days, webkit is allowing a smoother experience than TUIs.
Under a reasonable assumption that 'brain space' is finite, not filling it up with editor commands that may be used at most once a month will leave room for something more valuable instead. This applies for many other aspects in the life of an engineer: indiscriminately memorizing the options of ps/ls, specific APIs, etc.
Do you customize your command line at all? What about your desktop? Keyboard? Chair? Office? Editor is just another part of the stack.
It's not portable!
I'd rather know/use the defaults, there's benefit to be had there. Most importantly for me, it will be on every server I ever have to log into/maintain.
GUI editors won't, and the hassle getting the output to where I need it doesn't fit well with workflows like mine.
Also... the config management stuff I write (YAML/Python+Jinja) is well enough supported as-is. Don't need much more than indentation preservation...
There's always a pane available to the side for ansible-doc/manual pages as a reference.
The only unusual thing I carry around with me is this:
alias vimtabs="vim -c ':tab all'"
It just makes it easier to open many files in the same editor with simple shell globbing.> Seems more like a weird para-work hobby than an actual productivity hack.
Because you will use the skills for forty years throughout your career?
It's that line in the Matrix where he goes "Eventually you don't see the numbers. You just see blonde, redhead, brunette"