Update docs and add an option for graphical login
This commit is contained in:
parent
a17ad2dc3c
commit
0351cace86
52
README.md
52
README.md
@ -6,6 +6,7 @@ This is my personal zsh configuraton.
|
|||||||
* [direnv](https://github.com/direnv/direnv)* - runs on cd, safely set enviroment
|
* [direnv](https://github.com/direnv/direnv)* - runs on cd, safely set enviroment
|
||||||
* [eza](https://github.com/eza-community/eza)* - better ls
|
* [eza](https://github.com/eza-community/eza)* - better ls
|
||||||
* [bat](https://github.com/sharkdp/bat)* - better cat, less, man, etc.
|
* [bat](https://github.com/sharkdp/bat)* - better cat, less, man, etc.
|
||||||
|
* [trash-cli](https://github.com/andreafrancia/trash-cli)* - safer deletion
|
||||||
|
|
||||||
(* = optional)
|
(* = optional)
|
||||||
|
|
||||||
@ -24,13 +25,48 @@ source "${ZSH_CONFIG_DIR}/init.zsh"
|
|||||||
* ZSH_BOOKMARK_DIR: Bookmark directory (default: ~/.cache/zsh/bookmarks)
|
* ZSH_BOOKMARK_DIR: Bookmark directory (default: ~/.cache/zsh/bookmarks)
|
||||||
* ZSH_BOOKMARK_LS: If true, run `ls` after jumping to a bookmark (default:
|
* ZSH_BOOKMARK_LS: If true, run `ls` after jumping to a bookmark (default:
|
||||||
true)
|
true)
|
||||||
* ZSH_USER_DIR: Directory containing configuration files (see below, default:
|
* ZSH_GRAPHICAL_LOGIN: Weather or not to enable starting a graphical session
|
||||||
~/.zsh.d)
|
when a login shell is started. (default: true)
|
||||||
|
|
||||||
|
### 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)*
|
||||||
|
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
To configure, create `~/.zsh.d` (or set ZSH_USER_DIR as described above). The
|
Previous versions of this configuration supported files that were not under
|
||||||
create either of the option files `init.zsh` and `early-init.zsh`. The former is
|
version control to be run during initialization of the shell. However the
|
||||||
run in the middle of startup, after most plugins have been initialized, but
|
current version does not support this. Configuring the shell requires editing
|
||||||
before ones related to command history, auto-complete, etc. The latter is run as
|
either `init.zsh` or `early-init.zsh`.
|
||||||
the first thing in the configuration file (after `autoload -U compinit &&
|
|
||||||
compinit`).
|
|
||||||
|
@ -24,7 +24,7 @@ function bm {
|
|||||||
[ -L "${ZSH_BOOKMARK_DIR}/${1}" ] || { echo "No such bookmark: '${1}'!"; return 1 }
|
[ -L "${ZSH_BOOKMARK_DIR}/${1}" ] || { echo "No such bookmark: '${1}'!"; return 1 }
|
||||||
[ -e "${ZSH_BOOKMARK_DIR}/${1}" ] || { echo "The bookmark '${1}' refers to a non-existant file!"; return 1 }
|
[ -e "${ZSH_BOOKMARK_DIR}/${1}" ] || { echo "The bookmark '${1}' refers to a non-existant file!"; return 1 }
|
||||||
cd -P "${ZSH_BOOKMARK_DIR}/${1}"
|
cd -P "${ZSH_BOOKMARK_DIR}/${1}"
|
||||||
[[ -v ZSH_BOOKMARK_LS ]] && "${ZSH_BOOKMARK_LS}" && ls
|
[[ -v ZSH_BOOKMARK_LS ]] && [[ "${ZSH_BOOKMARK_LS}" = 'true' ]] && ls
|
||||||
}
|
}
|
||||||
function _bm {
|
function _bm {
|
||||||
_arguments '::bookmark:_bookmarks'
|
_arguments '::bookmark:_bookmarks'
|
||||||
|
@ -10,7 +10,8 @@ add_ssh_keys() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Because I use zsh to start graphical sessions
|
# Because I use zsh to start graphical sessions
|
||||||
if [[ -o login ]]; then
|
[[ -v ZSH_GRAPHICAL_LOGIN ]] || ZSH_GRAPHICAL_LOGIN=true
|
||||||
|
if [[ -o login ]] && [[ "${ZSH_GRAPHICAL_LOGIN}" = 'true' ]] ; then
|
||||||
export LC_ALL=en_US.UTF-8
|
export LC_ALL=en_US.UTF-8
|
||||||
eval "$(gnome-keyring-daemon --start 2>/dev/null)"
|
eval "$(gnome-keyring-daemon --start 2>/dev/null)"
|
||||||
export SSH_AUTH_SOCK
|
export SSH_AUTH_SOCK
|
||||||
|
2
init.zsh
2
init.zsh
@ -14,8 +14,6 @@ function cmd_exists {
|
|||||||
hash "${1}" >/dev/null 2>&1
|
hash "${1}" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
# User configuration file
|
|
||||||
[[ -v ZSH_USER_DIR ]] || ZSH_USER_DIR="${HOME}/.zsh.d"
|
|
||||||
# source_user_file <name>
|
# source_user_file <name>
|
||||||
function source_user_file {
|
function source_user_file {
|
||||||
local machine_specific="${ZSH_CONFIG_DIR}/${1}.${HOST}.zsh"
|
local machine_specific="${ZSH_CONFIG_DIR}/${1}.${HOST}.zsh"
|
||||||
|
Loading…
Reference in New Issue
Block a user