News for hackers. Stuff that matters.
Re:Learn Vim (2021) by Daunk on Friday February 24, 2023 @05:19PM (#34930948)
I love Vim, it's just a shame it takes 200 years to setup properly.
Re:Learn Vim (2021) by jzelinskie on Friday February 24, 2023 @05:42PM (#34931206)
I'd honestly point folks towards Helix[0] these days if they don't already have something keeping them on neovim/vim.

There's very little in the ways of needing to configure Helix; it has built-in most functionality that you'd find with batteries-included vim "distributions" and it works out of the box with the installed LSP servers on your system.

[0]: https://github.com/helix-editor/helix

Re:Learn Vim (2021) by extr on Friday February 24, 2023 @06:37PM (#34931819)
I've been using helix the last week or so. I can confirm everything "just works". My config file is not a turing-complete nightmare, it's literally 10 lines and took about 15 minutes to set up, most of that being personal preference on UI. Great program.

I've tried vim-as-IDE many times and personally I've found that I just don't have the patience/discipline to get it all set up and not have it become a huge time sink. I end up getting frustrated and start up VS code and what do you know, everything works absolutely perfectly with zero config. So why bother. New programming language? It literally pops up telling me what extension to install and < 5 seconds later it's working.

Re:Learn Vim (2021) by wruza on Friday February 24, 2023 @07:48PM (#34932453)
What’s the selling point of helix then?

Personally I have one hell of a config, but since you’re fine with vscode defaults, the only thing I’ve really done to vim that counts was cloning ale into a specific vimfiles directory. What was your package set?

Re:Learn Vim (2021) by extr on Friday February 24, 2023 @08:13PM (#34932675)
The selling point is that it's a solid editor with zero config I can use in the terminal for those "in between" tasks where it's not really worth pulling it up in an IDE but worth having some syntax highlighting and LSP support. Think like, I need to make a quick change to a python script in some far flung directory. In/out in less than a minute.

Just the fact that you're asking what my package set was is a turnoff for me. There shouldn't be a package set. It should just work. In VS Code when I need the editor to have additional features I just click the button, pick the extension with the highest number of installs, and 99% of the time it immediately does what I want. In vim you play this whole game where you google for it, gather opinions on the "best" plugin for that task, read the README, "just simply add these lines to your lua config", figure out why the keybind is conflicting with your existing keybind setup, etc etc. Goodbye afternoon!

I've tried lunarvim, astrovim, etc etc. Those work great! Until you actually do want to change something. Now you're back in config hell, and even worse, because you didn't even design this hell yourself, it's someone else's hell.

Re:Learn Vim (2021) by wruza on Saturday February 25, 2023 @04:40AM (#34935299)
I agree with you, it would be nice to have a cloud profile, a plugin store, few other “windowing” features.

But by package set I literally mean it, e.g. mine is ale, nerdtree, snipmate, and the rest is cosmetic: scss syntax, tab guides and a couple of other syntaxes. Not some lunar/astro nvim-based heap of packages.

What I really miss in vscode and others, be it zeroconf or not, is editor programming features. E.g. I like to have sections in code that I can easily navigate. Something nmap ; /\/\/<Space>sec_<CR>$ does that. I also can create a popup with all of them + function names grepped from an unsaved source and navigate. Or highlight few more tokens. That is impossible in vscode unless you take a deep dive into its or its modules not very well documented internals. You can’t even write a module in .vscoderc, it must be formed into a package and [re]installed or get run in a special vscode mode. If the store doesn’t have what I want, I’m out of luck.

Things that failed (various degrees) for me: correct linewise indentation, readable sections on outline or minimap, non-syntactic folds, custom command mappings. Also the defaults are horrible, my last attempt was something like three pages of settings.json. Way too many afternoons, deleted my whole account to never try again. Tbf, my vimrc is also two pages long in the part that is related to settings. But at least the rest does what I want.

Re:Learn Vim (2021) by phist_mcgee on Friday February 24, 2023 @08:34PM (#34932829)
I had the exact opposite experience just then.

Installed helix, and nothing 'worked'. LSP wouldn't start, syntax highlighting didn't work, and once I did get them working, editing JSX caused strange issues where the autopair functionality created a duplicate of my code several lines above where I was working..

Not particularly impressed tbh.

It was very fast to start and use the fuzzy search though.

Re:Learn Vim (2021) by loveparade on Friday February 24, 2023 @06:24PM (#34931663)
Helix itself looks amazing, but the keybindings make me stay away from it. Even if they are better than the original, I don't want to learn another set of "non-standard" keybindings that I need to switch between only to use an editor.
Re:Learn Vim (2021) by ckolkey on Saturday February 25, 2023 @01:52AM (#34934524)
Exactly. Vim keybinding are used in so many other places, it seems like a waste to learn a bespoke set of mapping just for a vim like editor.
Re:Learn Vim (2021) by sundarurfriend on Saturday February 25, 2023 @07:40AM (#34936214)
* * *
Re:Learn Vim (2021) by noloblo on Friday February 24, 2023 @05:44PM (#34931225)
AFAIK is not fully compatible with Vim keystrokes
Re:Learn Vim (2021) by jzelinskie on Friday February 24, 2023 @06:19PM (#34931617)
Correct. If you've got no background in vim, it might be a good thing Helix has broken "backwards compatibility" in order to have more cohesive key-bindings.
Re:Learn Vim (2021) by colordrops on Friday February 24, 2023 @06:23PM (#34931658)
But then you'd not be comfortable with the hundreds if not thousands of other packages out there that use vim bindings.
Re:Learn Vim (2021) by jzelinskie on Friday February 24, 2023 @06:35PM (#34931781)
I think folks might be over-estimating the difference between the Helix and vim. IME, adding "ge" to Vimium[0] was good enough to have any conflicting muscle-memory. I don't think it's much more than lots of folks are already configuring on their own in their vimrc (e.g. installing plugins like vim-unimpaired).

I'm not sure that I buy the purity argument -- almost all "vim modes" in other software are interpretations of the vim key-bindings and not an embeded vim/neovim engine. As a result, they all have their own caveats and folks using vim get used to functionality that exists exclusively in their vimrc.

[0]: https://chrome.google.com/webstore/detail/vimium/dbepggeogba...

Re:Learn Vim (2021) by noloblo on Friday February 24, 2023 @11:26PM (#34933897)
Yes my problem with helix is when the keystrokes that are muscle memory in Vim don't have any actions in helix this makes it problematic to move to helix

over moving to neovim for example neovim retains most if not all the vi keystrokes not just out of respect to the vi authors

Re:Learn Vim (2021) by crispinb on Friday February 24, 2023 @05:38PM (#34931161)
* * *
Re:Learn Vim (2021) by noloblo on Friday February 24, 2023 @05:43PM (#34931219)
Use neovim or astrovim or spacevim These are setup perfectly and come with just the right batteries installed
Re:Learn Vim (2021) by agrippanux on Friday February 24, 2023 @06:37PM (#34931817)
LunarVim is a good choice as well, just works out of the box
Re:Learn Vim (2021) by noloblo on Friday February 24, 2023 @11:23PM (#34933871)
What's lunarvim what are it's advantages over space or ASTRO Vim
Re:Learn Vim (2021) by I_complete_me on Friday February 24, 2023 @06:11PM (#34931526)
But a very enjoyable 200 years it must be said!
Re:Learn Vim (2021) by femto113 on Friday February 24, 2023 @06:23PM (#34931659)
Setup how? I've used vi/vim daily as my main editor for the past 35 years or so, over that time I doubt I've put more than 20 total hours into its setup. I've been using some evolution of the same .vimrc for decades and it's only accumulated a couple dozen lines. The longest setup task I can remember was a few years ago getting MacVim to launch with one window per folder (with files as tabs, in most cases that equates to one window per repo, handy when I'm working across a couple different ones), but that was all shell work, not within vim itself.
Re:Learn Vim (2021) by tridao on Friday February 24, 2023 @07:22PM (#34932245)
Personally for me the setup only gets annoying when you want IDE-like features: text completion, treesitter syntax highlighting, go to definitions, ...
Re:Learn Vim (2021) by Aperocky on Friday February 24, 2023 @07:39PM (#34932388)
no thanks, I'll go with tests.

jvm language goes to the IDE. Others can use vim.

Re:Learn Vim (2021) by fbarred on Saturday February 25, 2023 @04:46AM (#34935336)
20 hours???

Your comment makes it sound like you think it's a small amount? I get that it's over 35 years, but still!

Re:Learn Vim (2021) by femto113 on Saturday February 25, 2023 @08:26PM (#34942157)
It's a tiny amount--I'm guessing I've probably easily logged 20,000 hours of active use in vi by this point, I can't think of any other tool I use regularly that has a better time-of-use/time-of-setup ratio. Compared to the time I've spent, say, installing Ruby gems and fixing dependency conflicts it's a rounding error, and Ruby's only been a focus for a small fraction of my career. To clarify that wasn't ever one 20 hour chunk, that's a rough guess at the total time spent setting it up on dozens of different computers across many different operating systems and window managers. It's typically well under an hour of setup per computer, and much of that time goes towards remembering where to find installers, picking fonts, etc.
Re:Learn Vim (2021) by tastysandwich on Friday February 24, 2023 @06:42PM (#34931861)
And if you change jobs and start working with a totally different tech stack you get to set it up all over again!

(I still love it though)

Re:Learn Vim (2021) by shortlived on Friday February 24, 2023 @08:05PM (#34932588)
I used to have crazy IDE-like setups but have realized that Vim is great for straight text manipulation (writing bash scripts, log parsing, etc) and VS code or eclipse is great for heavy duty programming. Now my vimrc is less than 50 lines and no plugins.
Re:Learn Vim (2021) by anta40 on Friday February 24, 2023 @08:09PM (#34932646)
My impression is if you ask 10 vim users how they setup their vim, you'll get 11 different answers :p

I'm happy enough with config generated from: https://vim-bootstrap.com/

Re:Learn Vim (2021) by sikjoy on Friday February 24, 2023 @08:20PM (#34932732)
but you'll recover that time by not touching your mouse... ;o)