diff options
| author | 2026-07-16 12:30:55 -0700 | |
|---|---|---|
| committer | 2026-08-26 23:04:25 -0700 | |
| commit | f782e6f16bcd31061dc143bbb8df9d4edc4e5a4c (patch) | |
| tree | 180100e56f433837a04cea0a357d6e99eb48907d | |
| parent | 3c861bfe9e848b6c2249c3430bef9fde80cc615c (diff) | |
| download | new-dotfiles-f782e6f16bcd31061dc143bbb8df9d4edc4e5a4c.tar.gz new-dotfiles-f782e6f16bcd31061dc143bbb8df9d4edc4e5a4c.zip | |
zshrc: Fix indentation
I use org-indent now.
| -rw-r--r-- | zsh/zshrc.org | 297 |
1 files changed, 141 insertions, 156 deletions
diff --git a/zsh/zshrc.org b/zsh/zshrc.org index 57d9228..5d54e59 100644 --- a/zsh/zshrc.org +++ b/zsh/zshrc.org @@ -10,230 +10,215 @@ Autoload any ZSH function from =$HOME/.zsh/functions=. * Aliases - Use rlwrap on some less-than-pleasant REPLs that don't have GNU - Readline-like features themselves. +Use rlwrap on some less-than-pleasant REPLs that don't have GNU Readline-like features themselves. - #+BEGIN_SRC sh - alias csi="rlwrap csi" - alias scsh="rlwrap scsh" - alias sbcl="rlwrap sbcl" - #+END_SRC +#+BEGIN_SRC sh + alias csi="rlwrap csi" + alias scsh="rlwrap scsh" + alias sbcl="rlwrap sbcl" +#+END_SRC - This alias is useful for when I'm trying something new with - herbstluftwm. +This alias is useful for when I'm trying something new with herbstluftwm. - #+BEGIN_SRC sh - alias hc=herbstclient - #+END_SRC +#+BEGIN_SRC sh + alias hc=herbstclient +#+END_SRC - Systemd supports user-level services, it's easy to manage them with this - simple alias. +Systemd supports user-level services, it's easy to manage them with this simple alias. - #+begin_src sh - alias myctl="systemctl --user" - #+end_src +#+begin_src sh + alias myctl="systemctl --user" +#+end_src - By default scrot will take a screenshot in whatever the current working - directory is, but I prefer having it all in the same location. +By default scrot will take a screenshot in whatever the current working directory is, but I prefer having it all in the same location. - #+begin_src sh - alias scrot="/usr/bin/scrot -e 'mv \$f ~/pictures/screenshots/'" - #+end_src +#+begin_src sh + alias scrot="/usr/bin/scrot -e 'mv \$f ~/pictures/screenshots/'" +#+end_src - Show colors and an indicator of what type each file is when using ~ls~, like - directory, pipe, link, etc. +Show colors and an indicator of what type each file is when using ~ls~, like directory, pipe, link, etc. - #+begin_src sh - alias ls="ls --classify --color=always" - #+end_src +#+begin_src sh + alias ls="ls --color=always" +#+end_src - Always show color in pacman output. +Always show color in pacman output. - #+begin_src sh - alias pacman="pacman --color=always" - #+end_src +#+begin_src sh + alias pacman="pacman --color=always" +#+end_src * History - Store ZSH history in a non-intrusive place. +Store ZSH history in a non-intrusive place. - #+BEGIN_SRC sh - HISTFILE=$HOME/.zsh/histfile - #+END_SRC +#+BEGIN_SRC sh + HISTFILE=$HOME/.zsh/histfile +#+END_SRC - Keep at most 1000 previous commands in memory. +Keep at most 1000 previous commands in memory. - #+BEGIN_SRC sh - HISTSIZE=1000 - #+END_SRC +#+BEGIN_SRC sh + HISTSIZE=1000 +#+END_SRC - Save at most 1000 previous commands to disk. +Save at most 1000 previous commands to disk. - #+BEGIN_SRC sh - SAVEHIST=1000 - #+END_SRC +#+BEGIN_SRC sh + SAVEHIST=1000 +#+END_SRC - Allow multiple shell instances to share the same history. +Allow multiple shell instances to share the same history. - #+BEGIN_SRC sh - setopt SHARE_HISTORY - #+END_SRC +#+BEGIN_SRC sh + setopt SHARE_HISTORY +#+END_SRC - Don't remember duplicated commands. +Don't remember duplicated commands. - #+BEGIN_SRC sh - setopt HIST_IGNORE_ALL_DUPS - #+END_SRC +#+BEGIN_SRC sh + setopt HIST_IGNORE_ALL_DUPS +#+END_SRC -* Plug-ins +* COMMENT Plug-ins - Load zplug, a next generation zsh plugin manager. +Load zplug, a next generation zsh plugin manager. - #+BEGIN_SRC sh - source /usr/share/zsh/scripts/zplug/init.zsh - #+END_SRC +#+BEGIN_SRC sh + source /usr/share/zsh/scripts/zplug/init.zsh +#+END_SRC - Add zsh-syntax-highlighting. +Add zsh-syntax-highlighting. - #+BEGIN_SRC sh - zplug "zsh-users/zsh-syntax-highlighting", defer:3 - #+END_SRC +#+BEGIN_SRC sh + zplug "zsh-users/zsh-syntax-highlighting", defer:3 +#+END_SRC - Add zsh-autosuggestions. +Add zsh-autosuggestions. - #+BEGIN_SRC sh - zplug "zsh-users/zsh-autosuggestions" - #+END_SRC +#+BEGIN_SRC sh + zplug "zsh-users/zsh-autosuggestions" +#+END_SRC - Add bgnotify from oh-my-zsh to show when long-running commands finish. +Add bgnotify from oh-my-zsh to show when long-running commands finish. - #+BEGIN_SRC sh - zplug "plugins/bgnotify", from:oh-my-zsh - #+END_SRC +#+BEGIN_SRC sh + zplug "plugins/bgnotify", from:oh-my-zsh +#+END_SRC - Make sure all plugins are installed. +Make sure all plugins are installed. - #+BEGIN_SRC sh - if ! zplug check --verbose; then - printf "Install? [y/N]: " - if read -q; then - echo; zplug install - fi - fi - #+END_SRC +#+BEGIN_SRC sh + if ! zplug check --verbose; then + printf "Install? [y/N]: " + if read -q; then + echo; zplug install + fi + fi +#+END_SRC - Load all plugins. +Load all plugins. - #+BEGIN_SRC sh - zplug load - #+END_SRC +#+BEGIN_SRC sh + zplug load +#+END_SRC * X Interaction - Make some widgets for interacting with the clipboard. +Make some widgets for interacting with the clipboard. - #+BEGIN_SRC sh - zle -N x-copy-region-as-kill - zle -N x-kill-region - zle -N x-yank - #+END_SRC +#+BEGIN_SRC sh + zle -N x-copy-region-as-kill + zle -N x-kill-region + zle -N x-yank +#+END_SRC - Bind them to keyboard shortcuts. +Bind them to keyboard shortcuts. - #+BEGIN_SRC sh - bindkey -e '^[w' x-copy-region-as-kill - bindkey -e '^W' x-kill-region - bindkey -e '^Y' x-yank - #+END_SRC +#+BEGIN_SRC sh + bindkey -e '^[w' x-copy-region-as-kill + bindkey -e '^W' x-kill-region + bindkey -e '^Y' x-yank +#+END_SRC * Completion - Initialize completion. This triggers loading of - zsh-syntax-highlighting as well. +Initialize completion. This triggers loading of zsh-syntax-highlighting as well. - #+BEGIN_SRC sh - autoload -Uz compinit - compinit - #+END_SRC +#+BEGIN_SRC sh + autoload -Uz compinit + compinit +#+END_SRC * Less - I use a terminal that's always 80 columns wide. This means that a - lot of output doesn't fit on a single line. I use the less command a - lot to look at output that's too big and wide to view in my - terminal. The default doesn't make this any better though, so I use - these switches. Most of these I originally got from what git uses. +I use a terminal that's always 80 columns wide. This means that a lot of output doesn't fit on a single line. I use the less command a lot to look at output that's too big and wide to view in my terminal. The default doesn't make this any better though, so I use these switches. Most of these I originally got from what git uses. - #+BEGIN_SRC sh - export LESS="FXRSi" - #+END_SRC +#+BEGIN_SRC sh + export LESS="FXRSi" +#+END_SRC - This causes less to immediately quit if there is no need to use a - pager (everything fits in a single screen) (=-F=). Doesn't clear the - screen when less is closed (=-X=). Handles ANSI colors (=-R=). Stops - long lines from wraping (=-S=). And makes searches case-insensitive - (=-i=). +This causes less to immediately quit if there is no need to use a pager (everything fits in a single screen) (=-F=). Doesn't clear the screen when less is closed (=-X=). Handles ANSI colors (=-R=). Stops long lines from wraping (=-S=). And makes searches case-insensitive (=-i=). * Prompt - First off, do some setup. Allow the use of functions inside the prompt, - initialize colors and load the ~add-zsh-hook~ function. +First off, do some setup. Allow the use of functions inside the prompt, initialize colors and load the ~add-zsh-hook~ function. - #+begin_src sh - setopt PROMPT_SUBST +#+begin_src sh + setopt PROMPT_SUBST - autoload -U colors - autoload -Uz add-zsh-hook - autoload -Uz vcs_info + autoload -U colors + autoload -Uz add-zsh-hook + autoload -Uz vcs_info - colors - #+end_src + colors +#+end_src - Setup VCS info. The =formats= option supports two arguments, they are the format strings for the =vcs_info_message_0_= and =vcs_info_message_1_=. The latter is used to set the title for the current wezterm (or other terminal) tab. +Setup VCS info. The =formats= option supports two arguments, they are the format strings for the =vcs_info_message_0_= and =vcs_info_message_1_=. The latter is used to set the title for the current wezterm (or other terminal) tab. - #+begin_src sh - add-zsh-hook precmd vcs_info +#+begin_src sh + add-zsh-hook precmd vcs_info - zstyle ':vcs_info:*' actionformats '%u%c%B%F{1}%a%f%%b %F{3}%s%f:%F{5}%r%f:%F{4}%b%f' - zstyle ':vcs_info:*' enable bzr git hg svn - zstyle ':vcs_info:*' formats '%u%c%F{3}%s%f:%F{5}%r%f:%F{4}%b%f' '%r' - zstyle ':vcs_info:*' nvcsformats '' - zstyle ':vcs_info:bzr:*' branchformat '%b' - zstyle ':vcs_info:git:*' check-for-changes 1 - zstyle ':vcs_info:*' stagedstr '%F{2}*%f' - zstyle ':vcs_info:*' unstagedstr '%F{1}*%f' - #+end_src + zstyle ':vcs_info:*' actionformats '%u%c%B%F{1}%a%f%%b %F{3}%s%f:%F{5}%r%f:%F{4}%b%f' + zstyle ':vcs_info:*' enable bzr git hg svn + zstyle ':vcs_info:*' formats '%u%c%F{3}%s%f:%F{5}%r%f:%F{4}%b%f' '%r' + zstyle ':vcs_info:*' nvcsformats '' + zstyle ':vcs_info:bzr:*' branchformat '%b' + zstyle ':vcs_info:git:*' check-for-changes 1 + zstyle ':vcs_info:*' stagedstr '%F{2}*%f' + zstyle ':vcs_info:*' unstagedstr '%F{1}*%f' +#+end_src - Set the actual prompts. +Set the actual prompts. - #+begin_src sh - PROMPT='%T $(spwd) %B%(?.%F{2}.%F{1}[%?])>%b%f ' - PROMPT='%{\e]133;P;k=i\a%}%T $(spwd) %B%(?.%F{2}.%F{1}[%?])>%b%f %{\e]133;B\a%}' - PROMPT=$'%{\e]133;P;k=i\a%}%T $(spwd) %B%(?.%F{2}.%F{1}[%?])>%b%f %{\e]133;B\a%}' - RPROMPT=$'%{\e]133;P;k=r\a%}${vcs_info_msg_0_}%{\e]133;B\a%}' - #+end_src +#+begin_src sh + PROMPT='%T $(spwd) %B%(?.%F{2}.%F{1}[%?])>%b%f ' + PROMPT='%{\e]133;P;k=i\a%}%T $(spwd) %B%(?.%F{2}.%F{1}[%?])>%b%f %{\e]133;B\a%}' + PROMPT=$'%{\e]133;P;k=i\a%}%T $(spwd) %B%(?.%F{2}.%F{1}[%?])>%b%f %{\e]133;B\a%}' + RPROMPT=$'%{\e]133;P;k=r\a%}${vcs_info_msg_0_}%{\e]133;B\a%}' +#+end_src - Execute this preexec function to mark the output field. +Execute this preexec function to mark the output field. - #+begin_src sh - function mark_output() - { - printf "\\e]133;C\a" - } +#+begin_src sh + function mark_output() + { + printf "\\e]133;C\a" + } - add-zsh-hook preexec mark_output - #+end_src + add-zsh-hook preexec mark_output +#+end_src - Set the current tab's title (for wezterm at least), to the current project directory. This is set above with the =%r= specifier. +Set the current tab's title (for wezterm at least), to the current project directory. This is set above with the =%r= specifier. - #+begin_src sh - function set_vcs_title() - { - printf "\\e]0;${vcs_info_msg_1_}\\a" - } +#+begin_src sh + function set_vcs_title() + { + printf "\\e]0;${vcs_info_msg_1_}\\a" + } - add-zsh-hook precmd set_vcs_title - #+end_src + add-zsh-hook precmd set_vcs_title +#+end_src * Other configurations |
