cliday

  • About

2022-03-25

March 25, 2022

  1. delta: A syntax-highlighting pager for git, diff, and grep output
  2. btop: A monitor of resources
  3. zoxide: A smarter cd command

Tip of the week: Remove duplicate lines without sorting

If you have data with duplicate lines but don’t want to change the order, try awk '!a[$0]++'! For example:

% cat << EOF > file1
Apple
Orange
Orange
Banana
Apple
Pineapple
EOF

% awk '!a[$0]++' file1
Apple
Orange
Banana
Pineapple

How does this work? You can read a wonderful walkthrough at opensource.com.

Continue reading

2022-03-18

March 18, 2022

  1. zsh-syntax-highlighting: syntax highlighting for Zsh
  2. zsh-autosuggestions: autosuggestions for zsh
  3. forgit: A utility tool powered by fzf for using git interactively
  4. yq: jq wrapper for YAML/XML/TOML documents

Tip of the week: Make Zsh help more helpful

Zsh does not enable a builtin help command, instead it provides run-help. By default run-help is an alias to man and will only work on external commands. To use it for Zsh builtins and features, load and unalias the command in your .zshrc.

autoload -Uz run-help
unalias run-help
alias help=run-help # for convenience

For example, you can now run help whence, help history, etc.

Continue reading
Prev

Powered by Jekyll with Type Theme