Live data from Hacker News

Notes on switching to Helix from Vim

jvns.ca

231–240 of 242 posts

Re: Notes on switching to Helix from Vim

#231
post #111

Earlier quoted context omitted.

> presumably you would've been able to replicate it completely in the first X years of using vim, and then there is no hell anymore? I agree with this, but being able to ssh into a server and just grab Helix instead of copying over my Vim config and whatever else it depends on is really nice. Makes your dev env feel a lot more portable (although also more barebones than a crazy Vim config)

How is so? I have my dot files in GitHub. I just have to clone, run `PlugInstall` and it's all ready.

Glad it works for you! My dot files are in a private repo, I don't want to bother with adding new SSH keys to my GitHub account and then remembering to cleanup everything for what could be a one-time use. `apk add helix` is way easier for me.

Re: Notes on switching to Helix from Vim

#232
post #222
post #207

Earlier quoted context omitted.

Can you give at least a few examples? I have no understanding of ergonomics it seems

You can start with the original example 4 comments above and try to understand how unergonomic the default way of learning/remembering hundreds of key combinations in vim is. Then think about the basics: why some of the most frequently used commands w/b are located so inconveniently and far away from each other (and if you reconfigure them, how unergonomic the config language is where instead of reading a sensible na…

You don't need hundred of commands to use vim, have you at least finished vimtutor? Finish it in the way it proposes, then start it again and think on your own, what commands for more effective passing the problems from vimtutor might have been there as well.

Letters w and b may be located wherever they are located, if you can not touchtype vim is not for you for the same reason we do not learn how to run before we master how to walk.

Re: Notes on switching to Helix from Vim

#233
post #160

I feel like I am not asking THAT MUCH from my neovim setup, but it is so complicated. My collection of vim config is about 1000 lines, that's insane, but when I try to trim it, everything seems required. My requirements: - language support (syntax, formatting) - lsp (I want the goto definition) - file browser - quick jump (fzf...) - a little bit of eye candy, nice fonts and a few icons to make things clear - auto rel…

My configuration[0] doesn't quite meet all of your requirements, but you might be able to get some ideas from it. If you delete my hacky and very opinionated color theme configuration, it's 418 lines.

- I use Neovim in the terminal, so that's where I configure the font (Hack Nerd Font Mono) [1], which I install via homebrew on macOS[2].

- LSP: Can't recommend mason.nvim and mason-lspconfig enough. Install LSP servers with mason.nvim, and then mason-lspconfig handles automatically configuring and enabling whatever you've installed.

- I'm using mini.icons[3]

- For the file browser, I highly recommend Oil.nvim[4], which I discovered from this video by TJ DeVries[5].

- I was using fzf-lua, but switched back to Telescope because it was a better fit for me personally (I missed C-k to automatically append a file glob to live_grep. I missed being able to toggle the previewer. I missed being able to hit Esc and move around the picker input box with Vim motions)

Might be misunderstanding "splits I can manage with the keyboard", but (Neo)vim is pretty configurable here! I actually just use the default keybindings of e.g.

- `C-w` then HJKL to move

- `C-w C-v` to open a side-by-side (vertical) split

- `C-w C-q` to close the current split

- `C-w C-o` to close other splits (make current split the only one)

- `[NUMBER] C-w C-w` to jump to the [NUMBER]th split.

- `C-w o` to jump back to the last split you were at

[0] https://github.com/wilkystyle/nvim

[1] https://www.nerdfonts.com/

[2] https://gist.github.com/davidteren/898f2dcccd42d9f8680ec69a3...

[3] https://github.com/wilkystyle/nvim/blob/db16245731dea45f0c58...

[4] https://github.com/stevearc/oil.nvim

[5] https://www.youtube.com/watch?v=-r1mMg-yVZE

Re: Notes on switching to Helix from Vim

#234
post #183

Earlier quoted context omitted.

FWIW, in my (emacs, C++) experience, writing the editor config is a relatively minor part of the yak-shaving required to have jump-to-definition on an actual work codebase. I had to get my project to emit compile_commands.json, get clangd, figure out which things about our build process clangd was not understanding from compile_commands.json and add them in .clangd. All to achieve a level of functionality significant…

> I had to get my project to emit compile_commands.json, > get clangd, figure out which things about our build > process clangd was not understanding from > compile_commands.json and add them in .clangd That sounds rough. This is anecdotal, but in my Linux corner of the world, ccls has been an easier user experience as a C and C++ LSP since I've never had to resort to messing with flags in the generated file. I haven…

I did actually try CCLS first, but this was several years ago so it's possible that it may work better (something about our codebase was causing it to crash) - I should try it again.

Lacking LSP didn't stop me from using spacemacs, though. Oh, no. emacs has an auto-complete mode that just chooses from a pool of symbols already present in open files and that turns out to be Good Enough for me to prefer editing code there vs Visual Studio, IntelliSense be damned.

My employer furnished me with a beefy enough workstation that I can have Visual Studio open (to semantic search the whole codebase for stuff I don't already known where to find and to build/run/debug) alongside emacs (for editing and general code browsing when I know where definitions live).

Re: Notes on switching to Helix from Vim

#235
post #224

Earlier quoted context omitted.

> requires manual construction from a sequence of commands Right, I saw some people share some snippets here before. But none of them act like Sublime does. I can't double-click a token and Ctrl + D to select next instances of it in my file.

A-s = ["save_selection", "select_mode","search_selection","extend_search_next"] you select a token, then pess alt+s to select the next instance and so on

That limits to only 2 selections. If I keep pressing Alt + S, it does not select multiple instances of the first selection.

Also, I can't immediately start typing like in Sublime to replace the content. For example:

"test/filenameA.c"

"test/filenameB.c"

"test/filenameC.c"

"test/filenameD.c"

If I select test/ with the cursor, then A-s, it won't select 3 and 4. If I do this, however:

C-d = ["search_selection", "extend_search_next"]

It does select test/, in all 4 lines, but I can't immediately type "blah" to change test to blah.

Re: Notes on switching to Helix from Vim

#236
post #153

Earlier quoted context omitted.

To each their own. I quit using syntax highlighting about 10 years ago and won't ever go back (been programming for 25 years, vim/neovim user for 24 years). I just like it better, it works for me. It definitely does not make things "difficult for the sake of it" (for me ). There are dozens of us! :) (As to the rest: I use a pretty minimal set of plugins and I use the built in nvim C-o/C-p or C-x C-o/p "dumb" autocomp…

How is no syntax highlighting better, specifically?

(To address sibling comment: If I were colorblind, I would lead with that in any conversation about syntax highlighting; I am not colorblind.)

To answer the question: it's a feeling, like lots of things in software development. I tried "no syntax highlighting", found that I liked it, and I no longer use syntax highlighting. To say "specifically" how it's "better"... I'm not even saying it's better. "I like no-syntax-highlighting" is the statement I'm making (which, when it comes to syntax highlighting, is a statement a lot of people have issues with). So, from my personal experience, I take issue with the statement that no-syntax-highlighting is making things "difficult for the sake of it".

Try this out for analogy: I ate Red Baron pizzas every Friday night for 15 years, then I heard about homemade pizza 10 years ago. I tried making homemade pizza. It was good! ("I tried it and liked it") Now I only eat homemade pizza on Fridays. How is homemade pizza specifically better? It's better because I like it more. That's all there is to it. It's a preference.

(For the analogy to work, you have to like or at some point have liked Red Baron frozen pizzas. I happen to like them... the analogy is flawed though, I admit!)

(Let me preempt criticism that I'm comparing Red Baron frozen pizzas to syntax highlighting. I am not. It's only about the preference, not the object of the preference.)

Re: Notes on switching to Helix from Vim

#237

Earlier quoted context omitted.

It's not integrated at all right now. It's still sitting in a feature branch unfortunately.

Ah I thought the big branch finally got merged.

Not yet. PR is still open and waiting for someone from the team to review. I suspect this won't be an easy thing.

Re: Notes on switching to Helix from Vim

#238

used vim for ten years now. I have wanted to try this out but stuck in my ways with vim. To me one of the great selling points of vim (I use strictly in terminal, I didnt even know there was a gui) is that no matter what machine I am on, I basically always have my code editor available to me. my .vimrc is about 10 lines, growing at a pace of maybe 1 line a year, and it’s in my head. If I need to switch machines, no b…

Out of curiosity, what in a broad sense is configured in those 10 lines? (For context: I'm a Helix user trying out terminal-based vim at the moment and I'd like to know what the most important tweaks are.)

some basic ones like:

syntax on

set number

set expandtab

set tabstop=4

set modelines=0

set nowrap

and then a few related to ctags.

Re: Notes on switching to Helix from Vim

#239
post #207

Earlier quoted context omitted.

Can you give at least a few examples? I have no understanding of ergonomics it seems

There literally is a plugin [1] containing sensible defaults that everyone in the community agrees would be good as default but “backspace” and “incsearch” are the most obvious. “Backspace” allows you to delete with the backspace key beyond the point where you pressed “insert”. I don’t think I’ve ever met someone who thinks the vim default (not allowing this) is ergonomic. [1] https://github.com/tpope/vim-sensible

Have these already been adopted in neovim by default? It seems like I already have this behavior without needing any plugins.

Re: Notes on switching to Helix from Vim

#240
post #153

Earlier quoted context omitted.

How is no syntax highlighting better, specifically?

Not op, but in my case a lifetime of colourblindness has desensitised me to colour as an indicator. I have my editor configured with zero highlighting for keywords and syntactic elements. Admittedly, I have compilation/lint/syntax/type check errors set to invert the erroneous block, black background white text. Syntax and keyword highlighting is just noise given I’ve been trained by decades of colourblind unfriendly…

Syntax highlighting doesn't necessarily mean color, though. Using boldface to highlight keywords is another option that is traditional in some circles (e.g. Delphi has been doing that for 30 years now).
Post reply on HN