Łukasz Wieczorek's blog A slice of programmer's life

Helix

Helix is my newest favourite editor.

Before opening:

which -a hx
brew install helix
hx --version
hx Notes.md
hx --tutor

To exit:

:q
:q!
:x
:wq

To navigate:

h j k l # train this with muscles
gh # home
gl # end
gg # document beginning
e # document end

In visual mode:

d # delete
x # visual line select
i # insert
a # append
A # apend at line end
y # yank
space + Y # yank to system clipboard
p # paste
space + p # paste system clipboard
u # undo
ctrl + U # redo

In insert mode:

esc # escape to visual mode

Note

Will be adding shortcuts as used.

Tool driving

What is the common in scripts.

  • Version printer.
  • Help printer.
  • Arguments count must be proper.
  • Arguments are taken into tuples (what, what value).
  • Arguments have well known types in libraries for CLIs.
  • Script contains main method.
  • Scripts contain echo step by step explanation.
  • Scripts contain colouring statements.
  • Scripts call blobs.
  • Scripts source files.
  • Scripts use flags (set -eu).
  • Scripts have a starting untold directory.
  • Scripts have a way to know where they are placed at (dirname (status –current-filename)).
  • Scripts have a $status, $? mechanism.
  • Scripts do not scale.

VIM

VIM is my favourite terminal editor. I am writing this post for me to easier to switch to Helix which I will follow up with another post.

Before opening:

which -a vim
brew install vim
vim --version
vim Notes.md
vimtutor

To exit:

:q
:q!
:x
:wq

To navigate:

h j k l # train this with muscles
^ # home
$ # end
gg # document beginning
shift + G # document end

In visual mode:

i # insert
a # append
shift + i # append to the beginning of line
shift + a # append to the end of line
dd # delete line
dw # delete word
y # yank
p # paste
u # undo
ctrl + r # redo
shift + v # visual line

In insert mode:

esc # escape to visual mode