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...
> 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!
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).
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.
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
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.
I don't know why but it makes me happy that vim is getting so much attention from not-so-experienced developers.
Great job OP!
I like how you're not focusing on creating a complete list of commands but instead including only the ones you use and expanding it as you learn more.
Aside: I find it fascinating how you can often deduce how long someone has been using vim based on how they accomplish certain tasks.
It made me smile seeing OP use ggVG - I can think of two reasons why someone would do that: to delete everything ggVGd or to yank everything ggVGy. We (probably) all did that at one point.
And at some point you ask yourself what actually are ex commands? - and that's when you learn about :%d and :%y.
I am actually working on a project called vimgolf.ai, where I am looking at giving users the ability to practice these commands. Right now, only have a few levels, but looking at expanding to account for 80% of the commands used on a daily basis. If anybody's interested, please check out. Though please be aware at this time, the site does crash from time to time. Still working on scaling the nvim instances across nodes.
Hey! I saw your post on reddit a while ago! I think though that removing the sign in would definitely be nice for less bounce as others on reddit said. Otherwise i I think it's fun!
If you'd like to we can talk or mention eachother's project on our site to get a backlink and also to help noobs (like me, haha) go back and forth, because I think having a cheatsheet and somewhere to practice also could be fun and the audience might be interested in one-another! You can add me on Discord under "pici_csomi" if you want to talk :)
Love seeing vim and neovim being used in more open source projects. Despite the huge learning curve, once vim becomes second nature, it's hard to go back to using the mouse. At least, that's how it was for me. Thanks for creating this cheat sheet, I'm sure lots of beginners will find it useful!
Hey! I am sure it only takes time to become a master of it :) I think what makes people stick is exactly the fact that its configurable, as the sheer process of messing with your setup is fun in itself, not just the flow it can possibly give you! I really do hope that indeed others will find it useful <3
Absolutely! I'm very confident people will find it useful. Are you also perhaps going to include a light mode version of the website? It's currently hard to look at it when the sun is shining in my screen. I think other people would like it as well!
Sure! Actually it is already in there if your Chrome is in light mode, but I couldn't yet figure out how toggle the themes yet with the theme-changer npm. :D When I get back in the evening I'll write this down! Feel free to open an issue for it also!
Hey! Thank you, I know of this! I am actually thinking of displaying on the website how to access the command from the :help, for people (and myself, haha) to get used to using that.
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...
> 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.
I don't know why but it makes me happy that vim is getting so much attention from not-so-experienced developers.
Great job OP!
I like how you're not focusing on creating a complete list of commands but instead including only the ones you use and expanding it as you learn more.
Aside: I find it fascinating how you can often deduce how long someone has been using vim based on how they accomplish certain tasks. It made me smile seeing OP use ggVG - I can think of two reasons why someone would do that: to delete everything ggVGd or to yank everything ggVGy. We (probably) all did that at one point.
And at some point you ask yourself what actually are ex commands? - and that's when you learn about :%d and :%y.
Hilarious seeing this. About five minutes ago I ran
:q!
echo “” > file.txt
vi file.txt
I have a ways to go:)
Okay its so funny to see how many ways are there :D
Hey, yeah I figured that down the line I will add all the commands eventually anyway, for now I'll just put down what I need :)
So you say there is another way? Haha, I'll definitely check that out! Thank you for the heads up <3
TIL about :%d and :%y, thank you!
I am actually working on a project called vimgolf.ai, where I am looking at giving users the ability to practice these commands. Right now, only have a few levels, but looking at expanding to account for 80% of the commands used on a daily basis. If anybody's interested, please check out. Though please be aware at this time, the site does crash from time to time. Still working on scaling the nvim instances across nodes.
Hey! I saw your post on reddit a while ago! I think though that removing the sign in would definitely be nice for less bounce as others on reddit said. Otherwise i I think it's fun! If you'd like to we can talk or mention eachother's project on our site to get a backlink and also to help noobs (like me, haha) go back and forth, because I think having a cheatsheet and somewhere to practice also could be fun and the audience might be interested in one-another! You can add me on Discord under "pici_csomi" if you want to talk :)
Interesting, I don't recall posting on reddit. Perhaps, you are referring to vimgolf.com? - definitely, will do!
Had a play with this - good idea, well executed and I'll return when you've got more levels!
Thanks! Means a lot!
Love seeing vim and neovim being used in more open source projects. Despite the huge learning curve, once vim becomes second nature, it's hard to go back to using the mouse. At least, that's how it was for me. Thanks for creating this cheat sheet, I'm sure lots of beginners will find it useful!
Hey! I am sure it only takes time to become a master of it :) I think what makes people stick is exactly the fact that its configurable, as the sheer process of messing with your setup is fun in itself, not just the flow it can possibly give you! I really do hope that indeed others will find it useful <3
Absolutely! I'm very confident people will find it useful. Are you also perhaps going to include a light mode version of the website? It's currently hard to look at it when the sun is shining in my screen. I think other people would like it as well!
Sure! Actually it is already in there if your Chrome is in light mode, but I couldn't yet figure out how toggle the themes yet with the theme-changer npm. :D When I get back in the evening I'll write this down! Feel free to open an issue for it also!
There is a built in help pages for every default mapping, e.g :help v_CTRL-A
Web version: https://neovim.io/doc/user/change.html#change.txt
Hey! Thank you, I know of this! I am actually thinking of displaying on the website how to access the command from the :help, for people (and myself, haha) to get used to using that.