2022-08-28 02:52:37 -07:00
|
|
|
# zsh-config
|
|
|
|
This is my personal zsh configuraton.
|
|
|
|
|
|
|
|
### Requirements
|
2022-11-30 23:28:40 -08:00
|
|
|
* [starship](https://github.com/starship/starship) - a pretty and fast prompt
|
|
|
|
* [direnv](https://github.com/direnv/direnv)* - runs on cd, safely set enviroment
|
2023-09-10 03:40:05 -07:00
|
|
|
* [eza](https://github.com/eza-community/eza)* - better ls
|
2022-11-30 23:28:40 -08:00
|
|
|
* [bat](https://github.com/sharkdp/bat)* - better cat, less, man, etc.
|
2024-01-12 15:05:09 -08:00
|
|
|
* [trash-cli](https://github.com/andreafrancia/trash-cli)* - safer deletion
|
2024-01-12 15:09:49 -08:00
|
|
|
* [fzf](https://github.com/junegunn/fzf)* - better auto-complete
|
2022-11-30 23:28:40 -08:00
|
|
|
|
|
|
|
(* = optional)
|
2022-08-28 02:52:37 -07:00
|
|
|
|
|
|
|
### Installation
|
2022-08-30 02:04:54 -07:00
|
|
|
1. Clone this repo and init the submodules
|
2022-11-30 23:28:40 -08:00
|
|
|
```sh
|
|
|
|
git clone 'https://git.zander.im/Zander671/zsh-config.git'
|
|
|
|
git submodule init && git submodule update
|
|
|
|
```
|
2022-08-28 02:52:37 -07:00
|
|
|
2. Create a `.zshrc` and fill it with something like this:
|
2022-11-30 23:28:40 -08:00
|
|
|
```zsh
|
|
|
|
ZSH_CONFIG_DIR="path/to/this/repo" # This variable *MUST* be set
|
2022-11-30 23:35:15 -08:00
|
|
|
source "${ZSH_CONFIG_DIR}/init.zsh"
|
2022-11-30 23:28:40 -08:00
|
|
|
```
|
2022-08-28 02:52:37 -07:00
|
|
|
3. Optionally, set some other variables (before the `source` line):
|
2023-05-03 16:29:35 -07:00
|
|
|
* ZSH_BOOKMARK_DIR: Bookmark directory (default: ~/.cache/zsh/bookmarks)
|
|
|
|
* ZSH_BOOKMARK_LS: If true, run `ls` after jumping to a bookmark (default:
|
|
|
|
true)
|
2024-01-12 15:08:07 -08:00
|
|
|
* ZSH_GRAPHICAL_LOGIN: Whether or not to enable starting a graphical session
|
|
|
|
when a login shell is started (default: true)
|
2024-01-12 15:05:09 -08:00
|
|
|
|
|
|
|
### Aliases
|
|
|
|
I use a lot of aliases. Because a lot of the aliases are only enabled if the
|
|
|
|
corresponding piece of software is installed (see above), it is hard to give a
|
|
|
|
full list. Therefore you should think of the following list as a guide and read
|
|
|
|
`init.zsh` if you want a full list.
|
|
|
|
* `ls`: eza --git -F
|
|
|
|
* `la`: eza --git -Fa
|
|
|
|
* `l`: eza --git -Fl
|
|
|
|
* `ll`: eza --git -Fla
|
|
|
|
* `cat`: bat --paging=never
|
|
|
|
* `pcat`: bat -pp
|
|
|
|
* `ncat`: bat -pp --color=never
|
|
|
|
* `e`: emacsclient -a nvim -nw
|
|
|
|
* `n`: emacsclient -a nvim -nw
|
|
|
|
* `emacs`: emacsclient -a nvim -nw
|
|
|
|
* `d`: *start dired in either the current or provided directory*
|
|
|
|
* `dired`: *start dired in either the current or provided directory*
|
|
|
|
* `se`: sudoedit
|
|
|
|
* `mv`: mv -i
|
|
|
|
* `cp`: cp -i
|
|
|
|
* `rm`: *disabled if trash-cli is installed*
|
|
|
|
* `tp`: trash-put
|
|
|
|
* `trr`: trash-restore
|
|
|
|
* `trl`: trash-list
|
|
|
|
* `tre`: trash-empty
|
|
|
|
* `trm`: trash-rm
|
|
|
|
* `gt`: git status
|
|
|
|
* `ga`: git add
|
|
|
|
* `gaa`: git add -A
|
|
|
|
* `gc`: git commit
|
|
|
|
* `gf`: git fetch
|
|
|
|
* `gu`: git pull
|
|
|
|
* `gp`: git push
|
|
|
|
* `gcm`: *git commit -m, but treat all following args as the message (like echo)*
|
|
|
|
* `gacm`: *git commit -am, but treat all following args as the message (like echo)*
|
|
|
|
|
2023-05-03 16:29:35 -07:00
|
|
|
|
|
|
|
### Configuration
|
2024-01-12 15:05:09 -08:00
|
|
|
Previous versions of this configuration supported files that were not under
|
|
|
|
version control to be run during initialization of the shell. However the
|
|
|
|
current version does not support this. Configuring the shell requires editing
|
|
|
|
either `init.zsh` or `early-init.zsh`.
|