148 points · by frankjr · 2y ago · 139 comments
vim.g.neovide_cursor_animation_length = 0
vim.g.neovide_scroll_animation_length = 0I bit the bullet and evaluated some of the "distributions" (AstroNvim and kickstarter) and played around with all the new lua plugins that I had never thought I needed (why use telescope when FZF-vim worked so well?).
Anyways, after a month of tweaking and absorbing, I found myself running Neovide only, and doing something I never thought I'd see, running tmux from within neovim/neovide. I think this only works (for me) because of session management (there are half a dozen plugins for handling quickly changing 'workspaces') and because the built-in terminal (with a very useful plugin called toggleterm: https://github.com/akinsho/toggleterm.nvim) works so well.
I have not stopped using tmux and layouts, and it sits in another fullscreen iterm2 workspace, but I find that I now spend 90% of my time using a fullscreen neovide and summoning/toggling tmux momentarily for running commands.
Of course, the caveat here is that my preferred mode of operation is being fullscreen as often as possible. I think if your preferred mode of operation is to always see splits then running neovim from the terminal within tmux is still the way to go.
As for why I like neovide? I find the animations, when tweaked to be less 'cool' are extremely useful to see where the cursor jumps to. I am also a huge fan of the fact that I can finally use 'linespace' to put some space between my lines of code -- it is an aesthetic I didn't realize I wanted.
Oh interesting, it sounds like it can't do permanent splits? Very odd to me.
If your workflow is already entirely terminal-oriented with something like Tmux, then yeah, this won't really fit into your workflow.
If I didn't use that I could definitely see just using my tiling window manager to manage splits.
But as it stands I want all my terminals to appear and reappear with one key combo.
I'm sure they will help a lot also when learning Vim for the first time.
But the be fair, the default animations are bit much but they can be toned down.
Input latency is very notably worse than in the terminal, at least on Linux + sway. (alacritty or kitty)
One of the main reasons I use neovim is because everything feels so instant.
"editor.cursorSmoothCaretAnimation": "on",Why would I go over the trouble of debugging my editor for simple stuff like having LSP completions and semantic highlighting? It's insanely difficult for me to wrap my mind around vim packages, configs, etc., when VSCode/GoLand/et al. do a pretty darn job being decent editors that you don't need to hack on and just work out of the box.
Don't get me wrong, I'm not throwing shade on vim/emacs, I'm just wondering what am I missing since everyone's been super happy and productive with vim for ages, and if I'm approaching these tools the wrong way...
I had the same problem with configuring (neo)vim, it's simply too much work to get a reasonable IDE experience. Using an already well tested and documented configuration helped me to make the switch.
Keep nvim as minimal as possible IMO.
I am also firmly in the vanilla config camp.
Neovim is very usable out of the box. Once you are invested in the interface (modal editing) then look to get 'fancy'.
I think the big config approach just tries to make the editor an IDE. You don't most of that to try it out.
Start simple.
But yeah, webdev had me switch to Lunarvim (my favorite among all those nvim distros)
I suggest to take someone's lua config and start from there. Kickstart.nvim is a good one: https://github.com/nvim-lua/kickstart.nvim
Being familiar with vi keybindings can be useful if you ever find yourself on a minimal system with no other editors available, but the subset of knowledge you need in that situation would be much smaller than if you wanted to use Neovim as your primary development environment. I think Emacs/Vim/Neovim and the like are better suited to users who actually enjoy the process of configuring stuff like LSPs and code completions in a way that's fine-tuned to their personal preferences and works the same across all programming languages.
Despite what others may say to convince you otherwise, this is the only correct answer ;)
I feel naked without those commands at my fingertips. It's not even about speed, without it it's like... it's like woodworking with a table knife
If I were to take up modal editing now, I'd go for Helix. It's a better editing paradigm (Kakoune inspired) and it aims at just working out of the box.
I finally opted for Lunarvim but I believe all those Neovim distributions are great
[1]: https://github.com/neovim/nvim-lspconfig/
[2]: https://github.com/neovim/nvim-lspconfig/blob/master/doc/ser...
It's a single file and you can pretty easily use it as a starting point for your own config.
And it comes with the which-key.nvim [2] plugin that helps you learn vim motions.
You won't get the deep magic of emacs, or the benefit of learning vi key bindings (sadly there's not yet a helix mode for gnu readline) - but you get a great modal editing experience, good defaults and great discoverability.
I moved from vim/neovim a while back - and now I find vi/vim verb-object (d[delete]w[ord]) yanky compared hx visual select/object-verb (wd).
I've been using vim for some 15-20 years prior.
https://github.com/helix-editor/helix/issues/1596
What does g; do?
Helix has (experimental?) macro record/playback q/Q?
I often use `viwd` instead of `dw` to create a selection before deleting.
I've heard that a lot of vim folks get similar behavior via tmux and leverage other shell tools.
I'm not going to argue you should switch, because it is an investment. It is like owning a house, you have autonomy but you're also on the hook to fix the air conditioner. You also can't just drop it and move to the next editor. Your hands and workflows become tied to your editor. Keybindings may be similar, but it is not the full story. Either way, it is a journey getting good with your tools, so enjoy it!
Along the way there are innumberable little choices that you make that shape it into something completely your own. Plus you know it's never going away or getting enshittified because it's open source and has been for decades.
Now, does it actually make you more productive? Or is any productivity you gain swallowed up by tinkering with configuration? That's an open question, and a valid one. People who enjoy an out-of-the-box IDE experience are fine by me - different strokes and all. I just enjoy working in an environment that is always gradually evolving according to my needs, even if it means putting in the work.
There's another faction, of users who have come to vim/emacs in the era of decent IDEs. I think a lot of these people have come in due to the keyboard focus of these vs. IDEs, or because they are very quick and responsive (though recent IDEs themselves are finally really fast, too), or due to aesthetics or because it's percieved as being "hardcore" or "cool".
IMO if you're productive with what you're using now, stick with it. But try other things and see if they click. This goes both for the Unix graybeards and the IDE kids.
I then left it backgrounded in my brain for a couple decades, only using it here and there when I didn't have a GUI available, while I used JetBrains IDEs. I couldn't be bothered to do all the customization.
But the past few weeks, I got pissed at JetBrains for the way they're handling the CLion->RustRover transition, and my CLion license ran out and I said f'it, and spent a weekend really tuning emacs for my workflow. And, honestly, it's kind of awesome.
The key point being I can make it do whatever I want really. So the learning curve really comes down to what I put on it. LSP + Company Mode + Rustic Mode + Treemacs + Projectile is a pretty good approximation of an IDE. And then I just went through and tuned it up with the bindings I wanted, adjusting things as I went.
I had never in 30 years invested this much time into emacs before, and it was entirely worth it.
Anyways, the TLDR is: it's not just the "I want to be hardcore" and "I am ancient", there's real practical value to the depth of these tools that's actually hard to get out of other "editors", even VS Code. I can't speak for Vim, I have never liked that way of editing, but with Emacs it's really about building your own lightsabre.
Beyond that?, I just run LazyVim unmodified. It supports Copilot out of the box, which was my killer feature for it. Last year I even wrote a set of shell scripts I can curl into any new Ubuntu machine to fully automate all the setup for me, which might be of use to you as well, if you want to skip all the configuration. It also installs fzf, fd, rg, and a whole bunch of other useful tools all at once.
But it does take time, and doesn't come "out of the box" with the creature comforts you're probably used to, and has "weird" ways of doing things that are very old but there's usually good reasons for them.
What I like about neovim is that it's as fast as greased lightning. If I could say the same thing about Emacs there would be no competition.
My simple config does include vim-commentary, vim-surround (both supported by jetbrains too) and fzf.vim.
Also, I started using vim basically at the same time I started using Linux and really learning to program. There were plenty of other editors and IDEs around at the time. Even for the languages I was learning. I still use vim, but not those editors.
I will break vim into two parts: its philosophy(s) and its technical implementation. I think both are valuable, but for separate reasons.
First the technical implementation
Because I've been using vim for so long and from such a foundational stage for me, vim is largely just how I think about editing text now. Not just insert vs normal mode, either. Vim includes a whole host of features for editing text. I've been using it pretty regularly for many years now and still learn about new features. The rabbit hole is huge.
To the point that I find a lot of plugins either re-implement built-in features or outright go against the philosophies in vim (more on this later). Personally, I spend as much time (or more) trying to remove plugins as I do trying to find new ones to solve a need.
Plugins have better SEO, but worse integration with the editor, on average. Because of this, I might use a plugin for a bit just to solve a need, but then upon reading up on vim documentation (some of the best around), I might find a way to do something better than my current plugin-based way.
A frequent example is when I need to open a file that doesn't have built-in highlighting support. Instead of adding another plugin that might include more than just syntax support, I might really just need to alias it as another language. e.g. Jenkinsfiles are mostly just Groovy, so the following line is all I personally needed to make editing Jenkinsfiles in vim acceptable [0]:
au BufNewFile,BufRead Jenkinsfile setf groovy
None of that is to say "don't use plugins". Some people use hundreds of plugins, others use zero or very few. Both are correct. Personally, I still think that it's really easy to get carried away with plugins in attempts to try and turn vim into vscode or an IDE. If that's your goal, save yourself a ton of headache and just use vscode or an IDE. Truly ask yourself what it is you are trying to achieve with vim and work towards that, not feature parity with a completely different piece of software. [1]
Probably the biggest watershed moment for me was learning to use vim's buffers to manage multiple open files instead of always using vim's tabs. It has tabs, but they are a different metaphor from "tabs" in most editors. That still resulted in me adding a plugin to display open buffers at the top of the view, but that is an incredibly simple plugin that augments built-in vim functionality rather than try to shoehorn vim's tabs to work like tabs in other editors.
Getting a bit more philosophical
If you'll pardon a somewhat-forced metaphor, vim is a box full of handtools, not an all-in-one power tool. Each one can accomplish the vast majority of what the other can do and neither is inherently better than the other, but their ways of doing so differs greatly.
In particular, vim (like handtools) expects you to learn how to use it. It expects you to not only read the manual, but to keep referencing it and gradually learning new techniques for doing things. It expects you to sharpen it. It expects you to oil it. It will cut you if you abuse it [2]. This is also true for the power tools and other editors, but the whole point of using those is that your expected learning and maintenance is greatly reduced.
The payoff for those years (yes, years) of dedicated learning, at least in my experience, is that you will have a closer understanding of how the tool works. You will gradually develop a sense as though the tool itself has wants and needs. To be entirely too romantic, it is a symbiosis. Again, the way I think about editing text is in vim's commands and metaphors [3].
The other reward for that time spent is that vim doesn't really change. Sure, it's still updated (thankfully) and gets new features, but it is glacially slow to really change anything fundamental. This is often cited as a bad thing, but I personally love it as it means I can depend on it. I don't have to worry about my tool changing out from under me. That is rare in software, especially these days.
Sometimes even a master woodworker might still need a 3D printer, but having mastery over a hammer and chisel can pay dividends.
[0]: That line creates an autocommand for whenever a file called Jenkinsfile is opened or read, set its filetype to groovy instead.
[1]: There is an old article called Linux Is Not Windows. It's been a while since I've read it, so I might not agree with everything in it, but it presents a really great point: the only way Linux can be better than Windows is by being different. That means you will have to change your mindset before you understand it and/or like it.
[2]: Pretty big stretch here. It's not buggy and won't really do damage. I really just mean "cut" as more of "will be slower/harder than it might be otherwise".
[3]: I should point out that, while tools like vscode have plugins and settings to emulate vim's commands and a couple of modes, I have always found those lacking for my needs. I hope it's clear by now that vim is far more (to me, at least) than just using hjkl to move, dd to delete a line, etc.
> Transform your Neovim into a full-fledged IDE
The amount of time you need setup *vim in order to make it a useful editor is not justified, i have seen people waste weeks on it and the only reason is if you have a condition that vim helps to masquerade.
Personally m waiting to get enough money to justify a kinesis keyboard, that will the only reason to improve my neovim knowledge... as for the moment the vim keybindings for vscode are as good as neovim.
Neovim is bizarrely confusing and difficult to configure. The UIs are all weird terminal windows with no buttons, it isn't clear which of the dozens of folders are actually being used for configuration files, it isn't clear how the actual attributes are being declared, it's a disaster.
A terminal could do this, but there would need to be direct integration into Bash, ZSH, etc.
The synchronized output extension could be used to do this, though. https://github.com/contour-terminal/contour/blob/master/docs...
It looks like Wezterm even has preferences for how cursors are displayed.
https://wezfurlong.org/wezterm/config/lua/config/cursor_blin...
However i'm extremely jealous of Neovide. As much as i love Terminal Editors, i feel like Terminals themselves have been an annoyance for a long time for me. Despite having solely worked in them for ~15 years, i don't like them at all for my primary editor. I just miss too much.
Looks like a Neovide author wants to abstract Neovide to support other editors! Imagine that's a big lift, though.
Moving across a code block with "{" and "}" could highlight the parentheses and the link between them, for a fraction of a second.
Highlighting or landing on a variable could send a tiny zip of pixels towards the nearest uses of that variable.
I've wondered sometimes if making the current function or block pop a little brighter than its surroundings could also give your subconscious mind a bit more information.
All these would have to be incredibly fast animations, just a few ms would be great for me. I loathe the slow-to-me animations in Android, and always use the dev tools to speed them up.
- https://neovim.io/doc/user/pi_paren.html - https://neovim.io/doc/user/lsp.html#lsp-highlight
Books (made from paper) invariably have a region with no printing on the left and right sides of every page -- margins. But users of most text editors are tougher than that: they don't need margins apparently. I want the leftmost and rightmost parts of the editor window to be able to be blank margins.
I'm on Emacs currently because it is easy to configure margins (at least in graphical Emacs) but it would be nice to have another option.
Didn't see the answer in the FAQ
https://neovide.dev/configuration.html#hello-is-this-neovide
If those are barely worth mentioning (and still not to say what) .. what is the point over 'the terminal UI'?
Features page is better: https://neovide.dev/features.html
- Ligatures: ok, nice, possible in terms too (hopefully Alacritty one day)
- Animated cursor: I would disable that for sure
- Smooth scrolling: I would disable that too (surprised anyone would want it in neovim actually - do people scroll? I navigate line-by-line (or many lines) so it seems natural that the rendering should be the same, otherwise it's just a permanently clipped top and bottom line)
- Animated windows: ..that maybe looks a bit smoother, hard to tell without side-by-side, it's not horrible anyway
- Blurred floating windows: that's nice
- Emoji support: if you want it you probably have font configured anyway
Seems like it's for people who are reluctantly in a terminal, to position it more like a VSCode/Sublime alternative in an appy sense, there's not really much of an up-sell here for anyone familiar and happy with vim/neovim in the terminal IMO.
I use a graphical frontend precisely because I was unhappy with the terminal, and not because I am stupid, inept, or lazy.
For one thing, a graphical interface liberates you from constraints on key binding, fonts, and colors. Whether any particular graphical interface implements such improvements is up to the developer. But that's the beauty of the whole system: unlike with Gvim, none of that has to be upstreamed into the main application.
Neovim-Qt also offers a couple of interesting features like native scroll bars, a tab/buffer line made of native "tabs" instead of drawing it with plain text, and a native right-click menu. It also has some kind of adaptive color thing, for people who really like to "rice" their system and get a uniform look and feel across applications.
Something to keep in mind is that all of these projects are relatively new and developed by hobbyists. It will take years and years for any of them to reach feature parity with Gvim.
I wouldn't hold my breath. Seems like its getting the iPad calculator treatment[0]. Which is to say rather than ship something working that can be improved, they're leaving a UX void.
Edit: and in fact, I'd forgotten all about it, but you can tell I'd seen that issue because it was locked on my suggestion ;)
It took me the better part of a weekend to get Doom Emacs (which defaults to evil-mode) working on par with VSCode.
https://neovide.dev/configuration.html#background-color-depr...
Cute, sometimes very cute, but ultimately distracting and only adds a delay to the intended action, so after a week the novelty wears off and I usually revert back to the old UI.
Typically "no-nonsense" UX (the kind used to get stuff done) has minimal animation, if any. The whole point is to focus, not to get distracted by railgun animations.
The feature list seems to be mostly eyecandy and emojis.
So it adds no delay, has a very focused practical purpose, in what way is this "nonsense" UX preventing your from getting stuff done?
https://github.com/equalsraf/neovim-qt
There are quite a few GUI front-ends options available:
Neovim-Qt and Neovide both work the same way, one is not more privileged or official or well-integrated with Neovim than the other.
You don't need anything fancy to do what you're asking, except for holding a key, which AFAIK isn't possible. Some bind j+k to esc in insert mode. I don't like messing with the characters in insert mode because it creates latency and fucks with my typing but I swap esc and caps since esc is my most used key, and caps my least.
JK is not the solution as your mentioned yourself since it's within the same simplistic/terminal-limited key input handling (also, it fails if you speak more than one language where JK is common in regular words, and also fails if you speak just one language since you can have variable names or other abbreviations/terms with JK in them).
There are ways to avoid any latency/typing sideffects, but as far as I know that is only possible by eschewing the "but functionally it should act like the terminal UI" maxim, hence the original question whether any GUI app is ready to break off the rusted chains
I'll clarify that for you, my most used individual key. Most of my typing is on the home row.
> and that's what's wrong with the native keybindings - they are simply awful ergonomically
You asked for a way to bind the keys, you got one. Now all of a sudden your problem is that the default keybindings not being ergonomical. I use vim keys EVERYWHERE to help my RSI, but to each their own.
> There are ways to avoid any latency/typing sideffects, but as far as I know that is only possible by eschewing the "but functionally it should act like the terminal UI" maxim, hence the original question whether any GUI app is ready to break off the rusted chains
This makes zero sense. My point is that there is no native way to bind hold. The latency comes from vim waiting for either a second keypress to run the binding, or typing the character. You can natively set the delay lower and I do in :termdebug, but when typing it's very noticeable at my typing speeds. You could write a plugin and one probably even exists if you want that functionality.
But please, explain how a GUI would solve that in a way a TUI can't. Very curious to hear what you come up with.