dwyl / technology-stack

🚀 Detailed description + diagram of the Open Source Technology Stack we use for dwyl projects.
288 stars 26 forks source link

`Helix` [Vim-compatible Editor] #105

Open nelsonic opened 2 years ago

nelsonic commented 2 years ago

https://helix-editor.com is a non-graphical text/code editor written in Rust, it shares many key-bindings with Vim. image

https://github.com/helix-editor/helix image

Via: Helix 🧬 the Rust Powered Development Environment: https://youtu.be/xHebvTGOdH8

image

nelsonic commented 2 years ago

Diving in: 🏊

brew install helix

Configuring ... https://docs.helix-editor.com/configuration.html

All keyboard shortcuts in a single page: https://cheatography.com/hiddenmonkey/cheat-sheets/helix/

nelsonic commented 2 years ago

Elixir language server: https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers#elixir-ls

nelsonic commented 1 year ago
brew install helix
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
buf                          dotnet@6                     grammarly-languageserver     licensed                     nemu                         sapling                      stylelint
busted                       erigon                       hermit                       luacheck                     oauth2c                      souffle                      zf
clusterawsadm                evtx                         kubefirst                    metals                       php@8.1                      spectral-cli
code-cli                     go-task                      libisofs                     naga-cli                     portablegl                   standard
==> New Casks
ankerwork                         cursr                             elephas                           overt                             tsh                               vincelwt-chatgpt
nelsonic commented 1 year ago

Tried to open Helix:

helix .

Got:

zsh: command not found: helix

That's because the command to open it is:

hx

Cause writing "helix" is way too many keystrokes! 😜

nelsonic commented 1 year ago

https://matduggan.com/battle-of-the-text-editors/

nelsonic commented 1 year ago

https://docs.helix-editor.com/keymap.html

nelsonic commented 1 year ago

Helix Text Editor: Better than Neovim? https://youtu.be/9Zj-wiQ9_Xw

image
nelsonic commented 1 year ago

Helix: an editor hopping story (NeovimConf 2022 Talk): https://youtu.be/tGYvUXYN-c0

nelsonic commented 1 year ago

Built-in Tutor: https://github.com/helix-editor/helix/blob/master/runtime/tutor List of commands: https://docs.helix-editor.com/commands.html

nelsonic commented 1 year ago

PDF cheat sheet: https://cheatography.com/hiddenmonkey/cheat-sheets/helix/pdf/

nelsonic commented 1 year ago

Themes: https://docs.helix-editor.com/themes.html

mkdir -p ~/.config/helix/themes
hx ~/.config/helix/themes/sonokai

paste the contents of: https://raw.githubusercontent.com/CptPotato/helix-themes/main/schemes/sonokai

then:

wq!

And then in the editor you're in:

:theme sonokai

Before:

image

After:

image

Pretty straightforward to add a different theme. ✅

nelsonic commented 1 year ago

Almost any VIM theme works.

nelsonic commented 1 year ago

There are already quite a few themes built-in. Select a new one by typing :theme

image

To test-drive all the themes in: https://github.com/CptPotato/helix-themes

cd /tmp
git clone git@github.com:CptPotato/helix-themes.git
cp -r ./helix-themes/schemes/* ~/.config/helix/themes/
nelsonic commented 1 year ago

e.g: :theme everforest_dark

image
nelsonic commented 1 year ago

I can see this becoming my default/goto editor; it has everything I need and is very fast. A couple of annoyances but nothing major. The biggest barrier to entry is memorising the commands / shortcuts. Think I'm going to have to make a video about this.

nelsonic commented 1 year ago

Just lost some work when accidentally quit Helix 😢 Went looking for auto-save and found: https://docs.helix-editor.com/master/configuration.html Created the ~/.config/helix/config.toml file with the following contents:

theme = "onedark"

[editor]
line-number = "relative"
mouse = false

[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"

[editor.file-picker]
hidden = false

auto-save = true

Got the following error:

Bad config: unknown field `auto-save`, expected one of `hidden`, `follow-symlinks`, `parents`, `ignore`, `git-ignore`, `git-global`, `git-exclude`, `max-depth` for key `editor.file-picker` at line 12 column 1
Press <ENTER> to continue with default config

That's because my auto-save = true was in the "wrong" part of the file ... 🙄 It needed to be in the [editor] section to be parsed correctly. (lame...)

This worked:

theme = "onedark"

[editor]
line-number = "relative"
mouse = false
auto-save = true

[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"

[editor.file-picker]
hidden = false

Back to work. 🧑‍💻