Hacker News new | ask | show | jobs
by lil_csom 465 days ago
Hi Reddit,

As my school-funded GitHub education pack is about to expire, I have to let go of the InitelliJ IDEs and I decided to sell my soul and use NeoVim. I am already using Ubuntu after all, so why not continue the 10x cargo culting?

I soon realized that NeoVim is hard. I keep on forgetting how to do things. I figured the best course of action to take would be to start a project that I am writing entirely with using NeoVim... and I figured I'll build a cheat sheet for myself! I was not really satisfied with the existing cheat sheets as I couldn't really search in them and save my favorites to look them up later.

I decided to deploy it after all, so I can look on it on my phone as well. Then I figured, why do not I open source it, so the community can also help broaden this app?

I already feature a search by keyword, category and the favourites function. I plan to add popular remaps also and command breakdowns, to understand why and how eg. 'ggVP' highlights all the texts.

Perhaps I'll add guides later on too.

Enjoy! Now excuse me but I have to configure an LSP for JavaScript...

5 comments

> I soon realized that NeoVim is hard. I keep on forgetting how to do things.

Please don't take it in a bad way, but I suspect you don't really grok Vi[0].

Vi/ViM/NeoVim is a language for text manipulation. If you keep thinking in terms of "a bunch of shortcuts" you will have a pretty bad time with this editor.

For example, in your cheatsheet 'gg' and 'dd' are presented in the same way. Sure, both are commands in the normal mode but the similarities end there. 'gg' is a motion command whereas 'dd' is a shortcut for 'delete the current line' which can also be expressed as: 'Vd', '0d$', '0D', '$d_', ...

The important part to note about 'dd' is that it has 2 parts: 'delete' and 'current line'. 'delete' define what you want to do and 'current line' defines where the action should be applied. When you understand this things get way easier because you just need to learn a couple 'actions' and a couple 'motions' to do most of the things. And every time you learn something new you can also combine it with everything you already know.

But don't be discouraged by what I just wrote, you are in the right path. Have fun and keep hacking!

[0] - https://stackoverflow.com/questions/1218390/what-is-your-mos...

Hey! I think you are absolutely right, thank you for noting this! I already realized that having an understanding of the "subcommands" is what will lead me to success, as they are also easier to remember, because from a "combo" they will become understandble bits. I actually plan on writing "breakdown" for these compound entries so I (and others) can also grok vi 8) Well... eventually :D
Nice work! A useful one you’re missing is `set list` which shows whitespace characters. The main thing I use it for is checking whether indentation is tabs or spaces (or an unfortunate mix of both).
Thank you! Hah, cool! I'll defo use/add this later!
Nice work !

The nice thing with neovim is that people got together to make Neovim distributions. I'd recommend starting with one and you will learn by tuning it to your preferences because if you have to get some work done, this will take a lot of your time imho.

I still use vanilla vim + ALE linter + ctags + makefiles for simple C/C++ projects but once you start to get into webdev with ten different syntaxes and tools, it gets hard to keep up.

But if you have the time and curiosity to explore of course, it's worth it

Hey! Thank you! I actually wanted to start out with NvChad but then I became quickly overwhelmed with how many things are added that I do not know of. I also do not mind configuring nvim for hours, it's like tuning your car, the process is the hobby, not the result! I also found that I can incrementally then understand each added plugin and I am also more aware what is part of the config. But it's worth noting what you say about the webdev part... let's see if I can keep up :D
Nice reference. I think the layout could stand to be more compact and fit more keys on the screen.

Also don't forget to add in the excellent vim-surround for editing braces and parentheses, I was pleasantly surprised to find it installed by default in the VSCode vim plugin, not that I stuck with VSCode but it was worth trying out.

>> decided to sell my soul and use NeoVim

If you really wanted to make a deal with the devil, you'd try out Evil mode in Emacs with Spacemacs.

Thank you for the feedback! I'll definitely experience with the layout and also with the contrast on the page. Thank you for the suggestion, I was already looking for an extension like so!

I'll take a look on the Evil mode... Should I be scared? :D

Well it certainly puts you in an interesting place in the perennial emacs-vs-vim flamewar: Evil is a vim major mode in emacs. You get the programmability of Emacs with the efficient editing of vim, but you also get the memory usage, weight, and complexity of Emacs with the inscrutability and inability to quit of vim.
The free version of the IntelliJ IDEs are reasonably good, at least if you are using one of the languages that the free versions support.
Actually I have not even seen the free versions yet as I was always priviliged with the paid ones by my school. I do not think I'll check them out though, already invested time in configuring and you know... sunk cost fallacy :D
> sunk cost fallacy

Not as much as you think. Learning vim translates to a lot of things. I started learning vim by using vim emulator on vscode for a week, once I was comfortable with moving around in a file I moved to using neovim, learned lua to set it up the way I wanted. Eventually ended up just using lazyvim with some custom opts, custom keybindings and plugins I like.

But the point really is, what you learn in vim can be carried to most (if not all) code editors. Most will have a way to setup custom key bindings or a vim emulator.

I say that because there are times when you need to use a code editor that most devs use (mostly vscode) to work with other devs. And for those times, I really appreciate that I can keep using vim motion and key bindings.