Skip to content

21.03 Cli Utilities

kitty, fish and starship are my default terminal, shell and prompt respectively. Gogh is really helpful for choosing a colorscheme.

My daily workflow is incomplete without fd, rg, 7z and ranger.

Monitoring tools like btop, dust, tokei and bandwhich comes in handy at just in time situations.

New rust projects like nushell and kalker boost productivity in general-purpose tasks.

Keybinds

Terminal

lua
Ctrl+l          clear
Alt+l           ls
Alt+s           toggles `sudo`
{Ctrl+w,Alt+d}  {backspace,delete} whole word
Ctrl+{u,y}      copy/paste currently written
Alt+e           edit currently written ($EDITOR)

Ctrl+Shift+h    make terminal open as less (only kitty)

(N)Vim

lua
Abbreviation: <C> === Ctrl  <A> === Alt  <S> === Shift
Notation: ^T === <C-t> === Ctrl-t

/<regex>                 Search the opened file/buffer with regex pattern
:%s/<regex>/<replace>/g  Global replace (use \1 \2 ... to backreference groups), removing g replaces first occurrence on each line only
:%v/<regex>/d            %v is inverted search, /d will delete lines not matching the regex
                         (these two can also be paired with visual selection, only difference is that it doesn\'t require % after :)
:5                Goto 5th line
5|                Goto 5th character on current line
<<|>>|==          Tab in normal mode (== is smart add/reducer)
gg=G              Reindent whole file (gg & =G), similarly ggyG to yank file
"                 Access any register (+ being system clipboard); "+p and "+y being paste and copy respectively
viw | diw | yiw   Visual/Delete/Yank inside (a) word
v|V|<C-v>         Visual / LineVisual / VisualBlock mode
%                 Jump to parenthesis opening/closing
<C-o>|<C-S-i>     Next/Prev location of jump, in find (/)
<C-d>|<C-u>       Next/Prev function (not that important)

I stopped using f/F/t/T now, after hop.nvim or hop.el.

Ranger

Majority of navigation, search, copy-paste keybinds are same as Vim's. Rest of are listed below.

lua
F7              New Folder
:e <file>       New file (open text editor)
a|A             Append to name|extension
r               Open with
S               Open shell here
C-n|TAB|S-TAB   Create / Navigate between tabs
S-v             Select file(s)

?               Help
R               Force reload
zh              Toggle hidden files