Live data from Hacker News

Neovim 0.9

github.com

101–106 of 106 posts

Re: Neovim 0.9

#101
post #98

Earlier quoted context omitted.

If that's your motivation it could still be useful. Almost every live coding interview I've had so far has a part where I'm explaining the magic tricks I'm performing in vim. I have to remember to slow down and explain my thoughts as I zip through the code or they will just see code moving around the screen. For me it's mastery of my toolbox. Understanding vim pushed me further down the rabbit hole and now my compute…

That's something I can do with vim emularion too right? Part of motivation of the switch was getting a lean environment that doesn't hog resources.

No not really. Granted I've never used any of the emulators (outside of firefox) but vim is so much more than handy keybindings for editing text. It's difficult to explain and has to be experienced. And even if the integration is 1:1 it won't help with resources so I don't see the point.

Resources was my only motivation when I made the switch, had to because everything was electron and my laptop couldn't handle it. Now I'm a few years in and whenever I get tired of doing something repetitive I create a keybinding to perform that action.

A recent example is take the current filename (%) remove the extension (:r) and run it with valgrind to monitor memory usage. Bind it to vg and it looks like this:

  nnoremap vg :!valgrind ./%:r
When I hit it in the file 'my-program.c' it runs 'valgrind ./my-program' and I get the output in the built-in terminal. Very simple example but shows how easy it is to add any command-line tool you want without reaching for plugins, and integrate into your workflow instead of inheriting someone else's. Any command and combination of keypresses can be turned into a keybinding.

I understand it's not for everyone, but comparing it to vscode and judging from that perspective is missing the point entirely. I don't type letters when I edit code, I execute and compose commands, it's a different mindset.

Re: Neovim 0.9

#102
post #99

One feature I'm personally excited about is the "undeprecation" of the 'exrc' option, which allows project-specific configuration. Vim (and thus Neovim) has had the 'exrc' option for a long time, which loads any .exrc or .vimrc (or in Neovim's case, .nvimrc) files in the current directory. However, it does this unconditionally, which is obviously a bit of a security concern as a random .vimrc file could contain arbit…

> In this release, Neovim adds the concept of a "trust database", which is used for the 'exrc' option. This is basically how direnv and shadowenv work. So if anyone has used those, this is the same idea but it lets you layer on project-specific nvim config without shipping a whole, preconfigured nvim with your projects. Pretty cool!

Indeed. The combination of direnv and exrc is very potent.

Re: Neovim 0.9

#103
post #25

After hacking around with various Neovim "frameworks" I decided I want my text editor to but just that and no more so switched back to Vim and MacVim. The improvements to Vim's scripting language were icing on the cake.

I decided not to give in to any configuration frameworks and I see them as unnecessary complexity.

Initially, I just symlinked my old .vimrc to ~/.config/nvim/init.vim and started adding if sections to configure neovim features while keeping the config backwards-compatible.

Eventually I started rewriting small chunks of it in Lua, and now I'm 100% migrated to init.lua. I think it's a little cleaner this way, but not a life changer. The real power of Lua is for plugin authors.

Re: Neovim 0.9

#104
post #25

After hacking around with various Neovim "frameworks" I decided I want my text editor to but just that and no more so switched back to Vim and MacVim. The improvements to Vim's scripting language were icing on the cake.

I decided not to give in to any configuration frameworks and I see them as unnecessary complexity. Initially, I just symlinked my old .vimrc to ~/.config/nvim/init.vim and started adding if sections to configure neovim features while keeping the config backwards-compatible. Eventually I started rewriting small chunks of it in Lua, and now I'm 100% migrated to init.lua. I think it's a little cleaner this way, but not…

Perhaps by "frameworks" you meant plugin managers.

On vim, I was using vim-plug, which works fine with neovim too.

At some point I switched to Packer, which is written in Lua and is definitely more powerful. Now I would recommend Lazy instead: https://github.com/folke/lazy.nvim

Yes, it's silly that neovim still doesn't come with built-in plugin management. Installing a plugin should require 0 lines of config.

Re: Neovim 0.9

#105
post #74
post #48

Earlier quoted context omitted.

I don't disagree, but then you shouldn't update Neovim if you are not ready for that. I'll go even farther: don't use Neovim if you are not going to write the config yourself.

Then they'll never use neovim? That's poor advice.

Don't learn neovim (or vim) as an IDE. Learn it as an editor. Then add tricks when you are ready.

Re: Neovim 0.9

#106

One feature I'm personally excited about is the "undeprecation" of the 'exrc' option, which allows project-specific configuration. Vim (and thus Neovim) has had the 'exrc' option for a long time, which loads any .exrc or .vimrc (or in Neovim's case, .nvimrc) files in the current directory. However, it does this unconditionally, which is obviously a bit of a security concern as a random .vimrc file could contain arbit…

I just use a Neovim distro like https://nvchad.com/ and I am reasonably happy. Can customize anything specific on top of that.
Post reply on HN