From 6b222adedf6228ea5d1a12d7d9c81786bece6c88 Mon Sep 17 00:00:00 2001 From: haunt98 Date: Thu, 23 Jul 2020 12:39:33 +0700 Subject: [PATCH] big update --- src/Applications/Essential/Bash.md | 39 +++++++++++++++----- src/Applications/Essential/bat.md | 19 ---------- src/Applications/Essential/diff-so-fancy.md | 6 --- src/Applications/Essential/exa.md | 19 ---------- src/Applications/Essential/fd.md | 9 ++--- src/Applications/Essential/fzf.md | 18 --------- src/Applications/Essential/git.md | 6 --- src/Applications/{Essential => Misc}/ncdu.md | 0 src/SUMMARY.md | 5 +-- 9 files changed, 35 insertions(+), 86 deletions(-) delete mode 100644 src/Applications/Essential/bat.md delete mode 100644 src/Applications/Essential/diff-so-fancy.md delete mode 100644 src/Applications/Essential/exa.md rename src/Applications/{Essential => Misc}/ncdu.md (100%) diff --git a/src/Applications/Essential/Bash.md b/src/Applications/Essential/Bash.md index 331bb12..bc59489 100644 --- a/src/Applications/Essential/Bash.md +++ b/src/Applications/Essential/Bash.md @@ -1,14 +1,5 @@ # Bash -Read [Default Keyboard Shortcuts for Bash](https://catonmat.net/ftp/readline-emacs-editing-mode-cheat-sheet.pdf). - -In macOS, Bash read `~/.bash_profile` not `~/.bashrc`, so edit `~/.bash_profile`: - -```bash -[[ -f ~/.bashrc ]] && \ - source ~/.bashrc -``` - Add to `~/.bashrc`: ```bash @@ -26,6 +17,14 @@ Shebang: #!/usr/bin/env bash ``` +| Shorcut | Explain | +| ------------ | ------------------------ | +| `CTRL-A` | move to begining of line | +| `CTRL-E` | move to end of line | +| `CTRL-Right` | move forward a word | +| `CTRL-Left` | move backward a word | +| `CTRL-W` | clear the word behind | + ## Bash completion | Distribution | Package | @@ -45,3 +44,25 @@ Add to `~/.bashrc`: [[ -f /usr/local/etc/bash_completion ]] && \ source /usr/local/etc/bash_completion ``` + +## macOS + +In macOS, Bash read `~/.bash_profile` not `~/.bashrc`, so edit `~/.bash_profile`: + +```bash +[[ -f ~/.bashrc ]] && \ + source ~/.bashrc +``` + +To use latest Bash, install `bash` from Homebrew. +Then append to `/etc/shells`: + +```txt +/usr/local/bin/bash +``` + +Set default shell + +``` +chsh -s /usr/local/bin/bash +``` diff --git a/src/Applications/Essential/bat.md b/src/Applications/Essential/bat.md deleted file mode 100644 index 99c377c..0000000 --- a/src/Applications/Essential/bat.md +++ /dev/null @@ -1,19 +0,0 @@ -# [bat](https://github.com/sharkdp/bat) - -| Distribution | Package | -| ------------ | ------- | -| Arch Linux | `bat` | -| Ubuntu | `bat` | -| Homebrew | `bat` | - -Add to `~/.bashrc`: - -```bash -# Arch Linux, Ubuntu -[[ -f /usr/bin/bat ]] && \ - alias cat="bat" - -# Homebrew -[[ -f /usr/local/bin/bat ]] && \ - alias cat="bat" -``` diff --git a/src/Applications/Essential/diff-so-fancy.md b/src/Applications/Essential/diff-so-fancy.md deleted file mode 100644 index e32e53d..0000000 --- a/src/Applications/Essential/diff-so-fancy.md +++ /dev/null @@ -1,6 +0,0 @@ -# [diff-so-fancy](https://github.com/so-fancy/diff-so-fancy) - -| Distribution | Package | -| ------------ | --------------- | -| Arch Linux | `diff-so-fancy` | -| Homebrew | `diff-so-fancy` | diff --git a/src/Applications/Essential/exa.md b/src/Applications/Essential/exa.md deleted file mode 100644 index e0febb1..0000000 --- a/src/Applications/Essential/exa.md +++ /dev/null @@ -1,19 +0,0 @@ -# [exa](https://github.com/ogham/exa) - -| Distribution | Package | -| ------------ | ------- | -| Arch Linux | `exa` | -| Ubuntu | `exa` | -| Homebrew | `exa` | - -Add to `~/.bashrc`: - -```bash -# Arch Linux, Ubuntu -[[ -f /usr/bin/exa ]] && \ - alias ls="exa" - -# Homebrew -[[ -f /usr/local/bin/exa ]] && \ - alias ls="exa" -``` diff --git a/src/Applications/Essential/fd.md b/src/Applications/Essential/fd.md index 04ff781..9d098f5 100644 --- a/src/Applications/Essential/fd.md +++ b/src/Applications/Essential/fd.md @@ -1,7 +1,6 @@ # [fd](https://github.com/sharkdp/fd) -| Distribution | Package | -| ------------ | --------- | -| Arch Linux | `fd` | -| Ubuntu | `fd-find` | -| Homebrew | `fd` | +| Distribution | Package | +| ------------ | ------- | +| Arch Linux | `fd` | +| Homebrew | `fd` | diff --git a/src/Applications/Essential/fzf.md b/src/Applications/Essential/fzf.md index d20e83e..4f60ed2 100644 --- a/src/Applications/Essential/fzf.md +++ b/src/Applications/Essential/fzf.md @@ -1,26 +1,8 @@ # [fzf](https://wiki.archlinux.org/index.php/Fzf) -| Distribution | Package | -| ------------ | ------- | -| Arch Linux | `fzf` | -| Ubuntu | `fzf` | -| Homebrew | `fzf` | - Add to `~/.bashrc`: ```bash -# Arch Linux, Ubuntu -[[ -f /usr/share/fzf/completion.bash ]] && \ - source /usr/share/fzf/completion.bash -[[ -f /usr/share/fzf/key-bindings.bash ]] && \ - source /usr/share/fzf/key-bindings.bash - -# Homebrew -[[ -f /usr/local/opt/fzf/shell/completion.bash ]] && \ - source /usr/local/opt/fzf/shell/completion.bash -[[ -f /usr/local/opt/fzf/shell/key-bindings.bash ]] && \ - source /usr/local/opt/fzf/shell/key-bindings.bash - # Use fd instead of find export FZF_DEFAULT_COMMAND='fd --hidden --exclude .git' export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" diff --git a/src/Applications/Essential/git.md b/src/Applications/Essential/git.md index a22a47f..490e25b 100644 --- a/src/Applications/Essential/git.md +++ b/src/Applications/Essential/git.md @@ -1,11 +1,5 @@ # Git -| Distribution | Package | -| ------------ | ------- | -| Arch Linux | `git` | -| Ubuntu | `git` | -| Homebrew | `git` | - ## Config Aliases: diff --git a/src/Applications/Essential/ncdu.md b/src/Applications/Misc/ncdu.md similarity index 100% rename from src/Applications/Essential/ncdu.md rename to src/Applications/Misc/ncdu.md diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 5775f2f..40f0425 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -5,18 +5,15 @@ - [Essential](Applications/Essential/README.md) - [Bash](Applications/Essential/Bash.md) - [Neovim](Applications/Essential/Neovim.md) - - [bat](Applications/Essential/bat.md) - - [diff-so-fancy](Applications/Essential/diff-so-fancy.md) - - [exa](Applications/Essential/exa.md) - [fd](Applications/Essential/fd.md) - [fzf](Applications/Essential/fzf.md) - [git](Applications/Essential/git.md) - - [ncdu](Applications/Essential/ncdu.md) - [ripgrep](Applications/Essential/ripgrep.md) - [rsync](Applications/Essential/rsync.md) - [tldr](Applications/Essential/tldr.md) - [tmux](Applications/Essential/tmux.md) - [Misc](Applications/Misc/README.md) + - [ncdu](Applications/Misc/ncdu.md) - [Cheat](Applications/Misc/Cheat.md) - [Instaloader](Applications/Misc/Instaloader.md) - [Prettier](Applications/Misc/Prettier.md)