150 points · by todsacerdoti · 2y ago · 75 comments
My primary use case for Neovide (vs neovim running in Wezterm/kitty/Alacritty) is simply so I can Alt/Cmd-TAB to it quickly as I usually run with many terminal windows open and it's somewhat of a chore to locate the one with nvim in it, whereas with Neovide I have a separate app with an icon in the dock/sysmenu to switch to.
In Sway I have long (across three different terminal emulators) had a setup where I launch specially named terminals on session start, e.g. term-editor, term-local, term-remote, and then use the custom titles (I guess it's an appid actually) in my Sway config to make keybinds to focus those specific windows. I also focus my other always-used programs via their default appid (wayland) or class (xwayland), terminals just have the issue you mentioned of dealing with multiple, so had to use something more specific.
Relevant config lines:
```
exec --no-startup-id "sh -c 'sleep 10; exec foot --app-id=term-editor'"
bindsym ctrl+$mod+e [class="Emacs"] focus ; [app_id="term-editor"] focus
assign [app_id="term-editor"] 1
```
That last one makes the editor terminal always launch on workspace 1 which makes it a bit easier to get things where I'm used to having them after a restart.
The bind looks for emacs before my special term as I was using emacs (with evil) for a bit and had the bind set up to focus that. I left it in because this way if I just have one or the other open at some point, the bind works as expected without me having to change the config back and forth. Though with both open my focus ends up on the terminal.
Most terminal emulators should support a similar argument for launching with a custom id/title/whatever, and even if you're not using i3 or Sway, I think there are other programs such as wmctrl which can do something similar.
Question:
exec --no-startup-id "sh -c 'sleep 10; exec foot --app-id=term-editor'"
What's the sleep for?I use them every day :)
There is a discussion of Helix-style bindings on their github, and some proofs of concept, but nothing polished yet AFAIK.
Works great even though it's labeled as an alpha.
Regarding poor key binding support, I think that's not really a problem in modern applications. Quoting https://gpanders.com/blog/state-of-the-terminal/ :
> Sending key presses as escape sequences requires that terminal applications are able to recognize and parse those sequences, so it is not something that “just works” out of the box. However, the kitty keyboard protocol has been widely adopted by both modern terminal emulators and terminal applications. Terminals which support the kitty keyboard protocol (to some degree) include Wezterm, Alacritty, kitty, foot, Ghostty, and iTerm2. Applications which support the kitty keyboard protocol (to some degree) include Vim, Neovim, Helix, kakoune, and nushell. This means that when using one of these applications in one of these terminals, all of the key encoding problems discussed above (as well as some others which were not discussed…) are solved.
At least I indeed saw no such issue using helix in wezterm for example.
That’s lovely, I’m doing the same. I’m using glfw and C++14 to build a vim-ish IDE. I never learned to love vim/nvim plugins, and make only basic use of macros and substitutions so that’s pretty much the feature-set. It’s very fun to build your own UI library.
There's plenty of things that Emacs does right, but evil-mode is far from ideal. Many plugins don't support it OOB and need special workarounds. Many others expect native Emacs keybindings and you need to manually add ones for evil-mode specifically. Nowadays I don't experience many issues with it, but this is mostly because my setup is largely static, and it took me several years of tweaking the configuration to get it in a state that's usable and intuitive for me. It's unreasonable to expect everyone else to have the same patience, so an editor with a _native_ modal UI can certainly improve the user experience.
(Worth noting one of the maintainers said only a couple months ago: "this is really far away right now as helix needs large architectural changes before writing a GUI is even feasible/a good idea."[1])
[1]: https://github.com/helix-editor/helix/issues/39#issuecomment...
Both VS Code and Zed have pretty comprehensive (and in the case of VS Code, widely used) Vim modes, so it would really be quite a lot like that.
Having a visible menu bar helps with feature discoverability.
While it's true that terminal-based editors can have menu bars (e.g. nano), they're more limited overall than what you'll find with native OS menu bars.
But native menus can have buttons, dropdowns, and input boxes.
Also, native menus are more readily explorable by users which teaches them what's possible. It places related functions near each other so the user can be aware of a function that's more applicable to their task at hand rather than the function they would have picked otherwise.
The native menus also include keyboard shortcut indicators and command pallet features which speed up a user's transition into a power user. You can see both here, the user types something in the search box at the top right, and then the relevant menu opens to reveal itself, related features, and keyboard shortcuts: https://images.macrumors.com/t/1nSQeW8SNfCYItiL2GsvvDYL1w0=/...
But good terminal editors are rare to be used within SSH sessions. (Vs code can do but editing root owned files aren't easy)
I don't want to git push/pull on every minor edit that I might revert the next minute.
This also involves, directory listing that is only root accessible.
- Use configuration management systems to provision configuration changes: Ansible, SaltStack, Chef, etc. (And yeah, when testing on development or test set ups/VMs, you might first try stuff with vim directly. But if you are pretty sure you know what you want, you can also just do it in the configuration management system, test it, and provision it.) -- This may seem overkill for local configuration but it's pretty handy.
- If possible, make use of features of your tools to require less root access. For example, in Nix there are various ways to move the Nix configuration for the system out of /etc/nixos and into a user directory, or some hybrid of the two. Maybe some services can be made rootless: either running as "user" services, or even under a rootless container.
- Make use of permissions or ACLs to give write access to a non-root user or group. Then you don't need to be root to edit or provision the files.
I’m not questioning the usefulness or validity of tree explorers. I’m just trying to see things from a different perspective.
Fuzzy finders only work when you already know what files exist.
Without a tree-based finder, you have no way to know which files exist in an unfamiliar project. Imagine being asked to change something in a project (e.g. add some extra space between two things on screen) without knowing what files existed. If you only rely on searching for names/terms that come to mind, you're probably going to miss the best way to accomplish the task at hand.
Can build Zed from the main branch.
It's a different workflow, but kinda nice when you want that IDE-style experience in a simpler interface like a TUI.
Vim has
- normal mode which allows you to enter commands to manipulate text rather than just type characters in the file
- insert mode which allows you to enter text into a file
- replace mode which allows you to replace text
and a few others.
Most editors like vscode, sublime etc only have a single mode that they are always in IE insert mode. Modal editors have additional modes that allow for additional capabilities.
[0]https://www.freecodecamp.org/news/vim-editor-modes-explained...