start antidote vs zsh config
This commit is contained in:
parent
efdebbc17b
commit
aeac63b7e8
42 changed files with 638 additions and 0 deletions
4
home/private_dot_config/zsh/completions/_fnhelp
Normal file
4
home/private_dot_config/zsh/completions/_fnhelp
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#compdef fnhelp
|
||||||
|
|
||||||
|
# show files in the functions dir (exclude dirs)
|
||||||
|
_path_files -W "$ZDOTDIR/functions" -g "**/*(.)"
|
1
home/private_dot_config/zsh/completions/_g
Normal file
1
home/private_dot_config/zsh/completions/_g
Normal file
|
@ -0,0 +1 @@
|
||||||
|
#compdef g=git
|
8
home/private_dot_config/zsh/completions/readme.md
Normal file
8
home/private_dot_config/zsh/completions/readme.md
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# Completions
|
||||||
|
|
||||||
|
Add user contributed completions to this directory.
|
||||||
|
|
||||||
|
Read more about how Zsh completions work in this [how-to][1] article.
|
||||||
|
|
||||||
|
|
||||||
|
[1]: https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org
|
37
home/private_dot_config/zsh/conf.d/aliases.zsh
Normal file
37
home/private_dot_config/zsh/conf.d/aliases.zsh
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
#
|
||||||
|
# aliases - Set whatever Zsh aliases you want.
|
||||||
|
#
|
||||||
|
|
||||||
|
# single character aliases - be sparing!
|
||||||
|
alias g=git
|
||||||
|
|
||||||
|
# mask built-ins with better defaults
|
||||||
|
alias vi=vim
|
||||||
|
|
||||||
|
# this one is kinda dangerous
|
||||||
|
alias rr="rm -rf"
|
||||||
|
|
||||||
|
# more ways to ls
|
||||||
|
alias ls="ls --group-directories-first --color=always"
|
||||||
|
alias l='ls -lh'
|
||||||
|
alias la='ls -lAh'
|
||||||
|
alias ldot='ls -ld .*'
|
||||||
|
alias lr='ls -R'
|
||||||
|
alias lsl="ls -lhFA --color=always | less"
|
||||||
|
alias left='ls -t -1'
|
||||||
|
|
||||||
|
# GNU make
|
||||||
|
alias mkrt='make -C $(git rev-parse --show-toplevel)'
|
||||||
|
alias mk="make"
|
||||||
|
alias mkc="make -C"
|
||||||
|
|
||||||
|
# url encode/decode
|
||||||
|
alias urldecode='python3 -c "import sys, urllib.parse as ul; \
|
||||||
|
print(ul.unquote_plus(sys.argv[1]))"'
|
||||||
|
alias urlencode='python3 -c "import sys, urllib.parse as ul; \
|
||||||
|
print (ul.quote_plus(sys.argv[1]))"'
|
||||||
|
|
||||||
|
# misc
|
||||||
|
alias zshrc='${EDITOR:-vim} "${ZDOTDIR:-$HOME}"/.zshrc'
|
||||||
|
# alias zbench='for i in {1..10}; do /usr/bin/time zsh -lic exit; done'
|
||||||
|
alias zdot='cd ${ZDOTDIR:-~}'
|
28
home/private_dot_config/zsh/conf.d/misc.zsh
Normal file
28
home/private_dot_config/zsh/conf.d/misc.zsh
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#
|
||||||
|
# misc - Set general Zsh config options here, or change plugin settings.
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Options
|
||||||
|
#
|
||||||
|
|
||||||
|
# Undo options from plugins
|
||||||
|
setopt NO_BEEP # Be quiet!
|
||||||
|
setopt NO_HIST_BEEP # Be quiet!
|
||||||
|
|
||||||
|
#
|
||||||
|
# OMZ
|
||||||
|
#
|
||||||
|
MAGIC_ENTER_GIT_COMMAND="$MAGIC_ENTER_OTHER_COMMAND && git status -sb"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Zsh-Utils
|
||||||
|
#
|
||||||
|
# The belek/zsh-utils completion plugin also introduces compstyles. Let's use that!
|
||||||
|
(( ! $+functions[compstyle_zshzoo_setup] )) || compstyle_zshzoo_setup
|
||||||
|
|
||||||
|
# let make handle it's own shell completion
|
||||||
|
zstyle ':completion::complete:make:*:targets' call-command true
|
||||||
|
|
||||||
|
|
||||||
|
|
33
home/private_dot_config/zsh/dot_editorconfig
Normal file
33
home/private_dot_config/zsh/dot_editorconfig
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
#
|
||||||
|
# .editorconfig
|
||||||
|
#
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
indent_style = space
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
[*.zsh]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[.{zsh*,zlog*,zprofile}]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[**/functions/*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[**/completions/_*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
56
home/private_dot_config/zsh/dot_zprofile
Normal file
56
home/private_dot_config/zsh/dot_zprofile
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
#
|
||||||
|
# .zprofile - Zsh file loaded on login.
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# XDG
|
||||||
|
#
|
||||||
|
|
||||||
|
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||||
|
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
|
||||||
|
export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
|
||||||
|
export XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
|
||||||
|
export XDG_STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state}
|
||||||
|
export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-$HOME/.xdg}
|
||||||
|
|
||||||
|
for xdgdir in XDG_{CONFIG,CACHE,DATA,STATE}_HOME XDG_RUNTIME_DIR; do
|
||||||
|
[[ -e ${(P)xdgdir} ]] || mkdir -p ${(P)xdgdir}
|
||||||
|
done
|
||||||
|
|
||||||
|
#
|
||||||
|
# Paths
|
||||||
|
#
|
||||||
|
|
||||||
|
# Ensure path arrays do not contain duplicates.
|
||||||
|
typeset -gU path fpath cdpath mailpath
|
||||||
|
|
||||||
|
# Set the list of directories that zsh searches for commands.
|
||||||
|
path=(
|
||||||
|
$HOME/{go,.cargo}/bin(N)
|
||||||
|
$HOME/.extra/bin(N)
|
||||||
|
$HOME/{,.local/}{,s}bin(N)
|
||||||
|
/opt/{homebrew,local}/{,s}bin(N)
|
||||||
|
/usr/{,local/}{,s}bin(N)
|
||||||
|
$path
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Less
|
||||||
|
#
|
||||||
|
|
||||||
|
# Set default less options.
|
||||||
|
export LESS="${LESS:--g -i -M -R -S -w -z-4}"
|
||||||
|
|
||||||
|
# Set the less input preprocessor.
|
||||||
|
if [[ -z "$LESSOPEN" ]] && (( $#commands[(i)lesspipe(|.sh)] )); then
|
||||||
|
export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Misc
|
||||||
|
#
|
||||||
|
|
||||||
|
# Use `< file` to quickly view the contents of any file.
|
||||||
|
[[ -z "$READNULLCMD" ]] || READNULLCMD=$PAGER
|
||||||
|
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
113
home/private_dot_config/zsh/dot_zsh_plugins.txt
Normal file
113
home/private_dot_config/zsh/dot_zsh_plugins.txt
Normal file
|
@ -0,0 +1,113 @@
|
||||||
|
#
|
||||||
|
# .zsh_plugins.txt - antidote plugins file
|
||||||
|
#
|
||||||
|
|
||||||
|
### Overview
|
||||||
|
#
|
||||||
|
# The `.zsh_plugins.txt` file is used by antidote to configure Zsh bundles. Bundles are
|
||||||
|
# just a fancy way of referring to Zsh utilities, frameworks, prompts, or plugins.
|
||||||
|
# `.zsh_plugins.txt` is used by antidote to generate a static `.zsh_plugins.zsh` file,
|
||||||
|
# which can then be sourced in your `.zshrc`. You can use this file as a starting point
|
||||||
|
# for your own config. Strip out instructional comments (ie: lines beginning with a '#')
|
||||||
|
# and any plugins you don't need, then add what you like and make it yours!
|
||||||
|
#
|
||||||
|
# NOTE: Order matters in this file! Some bundles need to be last, and others are
|
||||||
|
# prerequisites. Read the documentation for the plugins you use to ensure proper
|
||||||
|
# configuration.
|
||||||
|
#
|
||||||
|
###
|
||||||
|
|
||||||
|
|
||||||
|
### Utilities
|
||||||
|
#
|
||||||
|
# Utilities aren't traditional Zsh plugins - they aren't sourced Zsh scripts. Instead
|
||||||
|
# they provide commands that can be executed from your terminal session. One good
|
||||||
|
# example is zsh-bench, which is a utility that benchmarks your Zsh config. Utility
|
||||||
|
# bundles can often be made available simply with the `kind:path` annotation.
|
||||||
|
#
|
||||||
|
###
|
||||||
|
romkatv/zsh-bench kind:path
|
||||||
|
|
||||||
|
### Framework: Oh-My-Zsh
|
||||||
|
|
||||||
|
ohmyzsh/ohmyzsh path:lib/clipboard.zsh
|
||||||
|
ohmyzsh/ohmyzsh path:plugins/copybuffer
|
||||||
|
ohmyzsh/ohmyzsh path:plugins/copyfile
|
||||||
|
ohmyzsh/ohmyzsh path:plugins/copypath
|
||||||
|
ohmyzsh/ohmyzsh path:plugins/extract
|
||||||
|
ohmyzsh/ohmyzsh path:plugins/magic-enter
|
||||||
|
ohmyzsh/ohmyzsh path:plugins/fancy-ctrl-z
|
||||||
|
|
||||||
|
### Framework: zsh-utils
|
||||||
|
#
|
||||||
|
# zsh-utils is a micro-framework that is also well suited to pair with antidote. It
|
||||||
|
# provides much of the same core functionality from other bigger frameworks without the
|
||||||
|
# bloat or performance hit. Using zsh-utils, you may find you don't need much else.
|
||||||
|
# If you want a really thin framework, this is great.
|
||||||
|
#
|
||||||
|
###
|
||||||
|
belak/zsh-utils path:history
|
||||||
|
belak/zsh-utils path:utility
|
||||||
|
#belak/zsh-utils path:editor
|
||||||
|
#belak/zsh-utils path:prompt
|
||||||
|
#belak/zsh-utils path:completion
|
||||||
|
|
||||||
|
|
||||||
|
### Deferred Plugins
|
||||||
|
#
|
||||||
|
# Antidote allows you to defer loading plugins. This is similar to concepts like "turbo
|
||||||
|
# mode" in other plugin managers. Antidote handles deferring plugins by leveraging
|
||||||
|
# romkatv/zsh-defer, which "defers execution of a zsh command until zsh has nothing else
|
||||||
|
# to do and is waiting for user input". In general, you should not defer plugins unless
|
||||||
|
# you know for sure they properly support deferred loading, and there are no adverse
|
||||||
|
# side-effects (see: https://github.com/romkatv/zsh-defer#Caveats). However, for
|
||||||
|
# certain plugins, this can greatly increase your zsh startup speed.
|
||||||
|
#
|
||||||
|
###
|
||||||
|
# Syntax highlighting
|
||||||
|
#zsh-users/zsh-syntax-highlighting kind:defer
|
||||||
|
zdharma-continuum/fast-syntax-highlighting kind:defer
|
||||||
|
Aloxaf/fzf-tab kind:defer
|
||||||
|
|
||||||
|
### Completions
|
||||||
|
#
|
||||||
|
# You may want to add some additional completions to Zsh. Completions look in your fpath
|
||||||
|
# for completion functions, which are functions named with a leading underscore
|
||||||
|
# (eg: _git). You need to add all supplemental completions to your fpath prior to
|
||||||
|
# running `compinit` to use completions functionality properly. You will want to find
|
||||||
|
# a completion plugin that runs `compinit` for you, or you can run it yourself in
|
||||||
|
# your .zshrc after antidote loads like this:
|
||||||
|
#
|
||||||
|
# autoload -Uz compinit && compinit
|
||||||
|
#
|
||||||
|
###
|
||||||
|
|
||||||
|
# zsh-users/zsh-completions is a popular plugin for adding supplemental completions.
|
||||||
|
# We combine the `path:` and `kind:fpath` annotations here:
|
||||||
|
zsh-users/zsh-completions path:src kind:fpath
|
||||||
|
|
||||||
|
# Compinit plugins should be near the end of .zsh_plugins.txt so that $fpath has been
|
||||||
|
# fully populated. Use zsh-utils for its completion plugin.
|
||||||
|
belak/zsh-utils path:completion
|
||||||
|
|
||||||
|
|
||||||
|
### Final Plugins
|
||||||
|
#
|
||||||
|
# Remember plugin order matters! Put plugins that need run last at the bottom of your
|
||||||
|
# .zsh_plugins.txt file.
|
||||||
|
#
|
||||||
|
###
|
||||||
|
|
||||||
|
# Add fzf completions scripts
|
||||||
|
junegunn/fzf path:shell/completion.zsh
|
||||||
|
junegunn/fzf path:shell/key-bindings.zsh
|
||||||
|
|
||||||
|
# Source everything in $ZDOTDIR/rc.d prior to wrapping up.
|
||||||
|
mattmc3/zshrc.d
|
||||||
|
~/.config/zsh/plugins/zexists
|
||||||
|
|
||||||
|
# These popular core plugins should be loaded at the end
|
||||||
|
zsh-users/zsh-autosuggestions kind:defer
|
||||||
|
zsh-users/zsh-history-substring-search
|
||||||
|
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
24
home/private_dot_config/zsh/dot_zshenv
Normal file
24
home/private_dot_config/zsh/dot_zshenv
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
#
|
||||||
|
# .zshenv - Zsh environment file, loaded always.
|
||||||
|
#
|
||||||
|
# NOTE: .zshenv has to live at ~/.zshenv, not in $ZDOTDIR! You can get around this by
|
||||||
|
# symlinking .zshenv from your $ZDOTDIR: `ln -sf $ZDOTDIR/.zshenv ~/.zshenv`
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# ZDOTDIR
|
||||||
|
#
|
||||||
|
|
||||||
|
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-${HOME}/.config}
|
||||||
|
export ZDOTDIR=${ZDOTDIR:-${XDG_CONFIG_HOME}/zsh}
|
||||||
|
|
||||||
|
#
|
||||||
|
# .zprofile
|
||||||
|
#
|
||||||
|
|
||||||
|
# We use .zprofile for everything else (load for non-login, non-interactive shells).
|
||||||
|
if [[ ( "$SHLVL" -eq 1 && ! -o LOGIN ) && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then
|
||||||
|
source "${ZDOTDIR:-$HOME}/.zprofile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
63
home/private_dot_config/zsh/dot_zshrc
Normal file
63
home/private_dot_config/zsh/dot_zshrc
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
#
|
||||||
|
# .zshrc - Zsh file loaded on interactive shell sessions.
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Profiling
|
||||||
|
#
|
||||||
|
|
||||||
|
# Load zprof first if we need to profile.
|
||||||
|
[[ ${ZPROFRC:-0} -eq 0 ]] || zmodload zsh/zprof
|
||||||
|
alias zprofrc="ZPROFRC=1 zsh"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Options
|
||||||
|
#
|
||||||
|
|
||||||
|
# Set general Zsh options needed for config.
|
||||||
|
setopt extended_glob
|
||||||
|
|
||||||
|
#
|
||||||
|
# Lazy-load functions
|
||||||
|
#
|
||||||
|
|
||||||
|
# Autoload functions directory and its subdirs.
|
||||||
|
for funcdir in $ZDOTDIR/functions $ZDOTDIR/functions/*(N/); do
|
||||||
|
fpath=($funcdir $fpath)
|
||||||
|
autoload -Uz $fpath[1]/*(.:t)
|
||||||
|
done
|
||||||
|
unset funcdir
|
||||||
|
|
||||||
|
#
|
||||||
|
# Pre-antidote
|
||||||
|
#
|
||||||
|
|
||||||
|
# Be sure to set any supplemental completions directories before compinit is run.
|
||||||
|
fpath=(${ZDOTDIR}/completions(-/FN) $fpath)
|
||||||
|
|
||||||
|
#
|
||||||
|
# antidote
|
||||||
|
#
|
||||||
|
|
||||||
|
[[ -d ${ZDOTDIR:-~}/.antidote ]] ||
|
||||||
|
git clone https://github.com/mattmc3/antidote ${ZDOTDIR:-~}/.antidote
|
||||||
|
|
||||||
|
# Set the name of the static .zsh plugins file antidote will generate.
|
||||||
|
zsh_plugins=${ZDOTDIR:-~}/.zsh_plugins.zsh
|
||||||
|
|
||||||
|
# Ensure you have a .zsh_plugins.txt file where you can add plugins.
|
||||||
|
[[ -f ${zsh_plugins:r}.txt ]] || touch ${zsh_plugins:r}.txt
|
||||||
|
|
||||||
|
# Lazy-load antidote.
|
||||||
|
fpath+=(${ZDOTDIR:-~}/.antidote/functions)
|
||||||
|
autoload -Uz $fpath[-1]/antidote
|
||||||
|
|
||||||
|
# Generate static file in a subshell when .zsh_plugins.txt is updated.
|
||||||
|
if [[ ! $zsh_plugins -nt ${zsh_plugins:r}.txt ]]; then
|
||||||
|
(antidote bundle <${zsh_plugins:r}.txt >|$zsh_plugins)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Source your static plugins file.
|
||||||
|
source $zsh_plugins
|
||||||
|
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
|
@ -0,0 +1,15 @@
|
||||||
|
##? Post load function for zsh-autosuggestions
|
||||||
|
|
||||||
|
# function autosuggestions-keybinds {
|
||||||
|
|
||||||
|
# https://github.com/zsh-users/zsh-autosuggestions
|
||||||
|
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8'
|
||||||
|
if [[ -n "$key_info" ]]; then
|
||||||
|
# vi
|
||||||
|
bindkey -M viins "$key_info[Control]F" vi-forward-word
|
||||||
|
bindkey -M viins "$key_info[Control]E" vi-add-eol
|
||||||
|
fi
|
||||||
|
|
||||||
|
# }
|
||||||
|
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
15
home/private_dot_config/zsh/functions/envsubst
Normal file
15
home/private_dot_config/zsh/functions/envsubst
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
##? envsubst - fall-back wrapper in the event the envsubst command does not exist.
|
||||||
|
|
||||||
|
# function envsubst {
|
||||||
|
if (( ! $+commands[envsubst] )); then
|
||||||
|
function envsubst {
|
||||||
|
command envsubst "$@"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
function envsubst {
|
||||||
|
python -c 'import os,sys;[sys.stdout.write(os.path.expandvars(l)) for l in sys.stdin]'
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
# }
|
||||||
|
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
13
home/private_dot_config/zsh/functions/fnhelp
Normal file
13
home/private_dot_config/zsh/functions/fnhelp
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
##? fnhelp - use '##?' comments in function files as help docs.
|
||||||
|
##?
|
||||||
|
##? usage: fnhelp <func>
|
||||||
|
|
||||||
|
# function fnhelp {
|
||||||
|
local ZFUNCDIR="${ZFUNCDIR:-${ZDOTDIR:-~/.config/zsh}/functions}"
|
||||||
|
if [[ ! -f "$ZFUNCDIR/$1" ]]; then
|
||||||
|
echo >&2 "fnhelp: function not found '$1'." && return 1
|
||||||
|
fi
|
||||||
|
command grep "^##?" "$ZFUNCDIR/$1" | cut -c 5-
|
||||||
|
# }
|
||||||
|
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
5
home/private_dot_config/zsh/functions/format-qmd
Normal file
5
home/private_dot_config/zsh/functions/format-qmd
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# TODO: add support for outputs
|
||||||
|
|
||||||
|
jupytext --from qmd $1 --pipe black --opt 'notebook_metadata_filter=-all'
|
||||||
|
|
||||||
|
# vim ft=zsh
|
3
home/private_dot_config/zsh/functions/gi
Normal file
3
home/private_dot_config/zsh/functions/gi
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
curl -sL "https://www.toptal.com/developers/gitignore/api/$@"
|
||||||
|
|
||||||
|
# vim ft=zsh
|
|
@ -0,0 +1,25 @@
|
||||||
|
##? Post load function for zsh-history-substring-search plugin
|
||||||
|
|
||||||
|
# function history-substring-search-keybinds {
|
||||||
|
|
||||||
|
# https://github.com/zsh-users/zsh-history-substring-search
|
||||||
|
if [[ -n "$key_info" ]]; then
|
||||||
|
# Emacs
|
||||||
|
bindkey -M emacs "$key_info[Control]P" history-substring-search-up
|
||||||
|
bindkey -M emacs "$key_info[Control]N" history-substring-search-down
|
||||||
|
|
||||||
|
# Vi
|
||||||
|
bindkey -M vicmd "k" history-substring-search-up
|
||||||
|
bindkey -M vicmd "j" history-substring-search-down
|
||||||
|
|
||||||
|
# Emacs and Vi
|
||||||
|
for keymap in 'emacs' 'viins'; do
|
||||||
|
bindkey -M "$keymap" "$key_info[Up]" history-substring-search-up
|
||||||
|
bindkey -M "$keymap" "$key_info[Down]" history-substring-search-down
|
||||||
|
done
|
||||||
|
|
||||||
|
unset keymap
|
||||||
|
fi
|
||||||
|
# }
|
||||||
|
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
7
home/private_dot_config/zsh/functions/is-exe
Normal file
7
home/private_dot_config/zsh/functions/is-exe
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#? check if executable exists
|
||||||
|
|
||||||
|
if [ -x "$(command -v $1)" ]; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
11
home/private_dot_config/zsh/functions/is-tty
Normal file
11
home/private_dot_config/zsh/functions/is-tty
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
##? check if running in a tty
|
||||||
|
|
||||||
|
case $(tty) in /dev/tty[0-9]*)
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
5
home/private_dot_config/zsh/functions/pmodload
Normal file
5
home/private_dot_config/zsh/functions/pmodload
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# function pmodload {
|
||||||
|
# if you are using Prezto, you'll need an empty pmodload function
|
||||||
|
# }
|
||||||
|
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
6
home/private_dot_config/zsh/functions/reload
Normal file
6
home/private_dot_config/zsh/functions/reload
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
##? reload zshell configs
|
||||||
|
|
||||||
|
source $ZDOTDIR/.zshenv
|
||||||
|
source $ZDOTDIR/.zshrc
|
||||||
|
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
18
home/private_dot_config/zsh/functions/web
Normal file
18
home/private_dot_config/zsh/functions/web
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
##? open file in $BROWSER
|
||||||
|
|
||||||
|
if [[ -z "$BROWSER" ]]; then
|
||||||
|
echo 'set $BROWSER'
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
for i
|
||||||
|
do
|
||||||
|
if [[ ! -r $i ]]
|
||||||
|
then
|
||||||
|
echo "$0: file doesn't exist: \`$i'" >&2
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
$BROWSER "$i" > /dev/null 2>&1 &
|
||||||
|
disown
|
||||||
|
done
|
||||||
|
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
1
home/private_dot_config/zsh/zexists.d/cmd/anit-lsd.zsh
Normal file
1
home/private_dot_config/zsh/zexists.d/cmd/anit-lsd.zsh
Normal file
|
@ -0,0 +1 @@
|
||||||
|
alias lt="tree -L 3"
|
2
home/private_dot_config/zsh/zexists.d/cmd/anti-nvim.zsh
Normal file
2
home/private_dot_config/zsh/zexists.d/cmd/anti-nvim.zsh
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
EDITOR=vim
|
||||||
|
VISUAL=vim
|
11
home/private_dot_config/zsh/zexists.d/cmd/anti-starship.zsh
Normal file
11
home/private_dot_config/zsh/zexists.d/cmd/anti-starship.zsh
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
echo "no starship = dumber prompt"
|
||||||
|
|
||||||
|
autoload -Uz vcs_info
|
||||||
|
precmd() {
|
||||||
|
vcs_info
|
||||||
|
}
|
||||||
|
|
||||||
|
zstyle ':vcs_info:git:*' formats '%b '
|
||||||
|
|
||||||
|
setopt PROMPT_SUBST
|
||||||
|
PROMPT='%F{green}%*%f %F{blue}%~%f %F{red}${vcs_info_msg_0_}%f$ '
|
3
home/private_dot_config/zsh/zexists.d/cmd/bat.zsh
Normal file
3
home/private_dot_config/zsh/zexists.d/cmd/bat.zsh
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export BAT_THEME=Catppuccin
|
||||||
|
export BAT_STYLE=header,numbers,grid
|
||||||
|
|
1
home/private_dot_config/zsh/zexists.d/cmd/eget.zsh
Normal file
1
home/private_dot_config/zsh/zexists.d/cmd/eget.zsh
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export EGET_BIN=$HOME/bin
|
1
home/private_dot_config/zsh/zexists.d/cmd/fnm.zsh
Normal file
1
home/private_dot_config/zsh/zexists.d/cmd/fnm.zsh
Normal file
|
@ -0,0 +1 @@
|
||||||
|
eval "$(fnm env --shell zsh)"
|
11
home/private_dot_config/zsh/zexists.d/cmd/fzf.zsh
Normal file
11
home/private_dot_config/zsh/zexists.d/cmd/fzf.zsh
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
# catppuccin
|
||||||
|
FZF_COLORS="
|
||||||
|
--color=bg+:#302D41,bg:#1E1E2E,spinner:#F8BD96,hl:#F28FAD
|
||||||
|
--color=fg:#D9E0EE,header:#F28FAD,info:#DDB6F2,pointer:#F8BD96
|
||||||
|
--color=marker:#F8BD96,fg+:#F2CDCD,prompt:#DDB6F2,hl+:#F28FAD
|
||||||
|
"
|
||||||
|
|
||||||
|
export FZF_DEFAULT_OPTS=${FZF_COLORS}${FZF_LAYOUT}
|
||||||
|
|
1
home/private_dot_config/zsh/zexists.d/cmd/lazygit.zsh
Normal file
1
home/private_dot_config/zsh/zexists.d/cmd/lazygit.zsh
Normal file
|
@ -0,0 +1 @@
|
||||||
|
alias lg=lazygit
|
3
home/private_dot_config/zsh/zexists.d/cmd/lsd.zsh
Normal file
3
home/private_dot_config/zsh/zexists.d/cmd/lsd.zsh
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
is-tty && alias lsd="lsd --icon never"
|
||||||
|
alias ls="lsd --group-directories-first --color=always"
|
||||||
|
alias lt='lsd --tree --depth=3'
|
19
home/private_dot_config/zsh/zexists.d/cmd/micromamba.zsh
Normal file
19
home/private_dot_config/zsh/zexists.d/cmd/micromamba.zsh
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
|
||||||
|
alias umamba=micromamba
|
||||||
|
|
||||||
|
# >>> mamba initialize >>>
|
||||||
|
# !! Contents within this block are managed by 'mamba init' !!
|
||||||
|
export MAMBA_EXE="$HOME/bin/micromamba";
|
||||||
|
export MAMBA_ROOT_PREFIX="$HOME/.micromamba";
|
||||||
|
__mamba_setup="$("$MAMBA_EXE" shell hook --shell zsh --prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
eval "$__mamba_setup"
|
||||||
|
else
|
||||||
|
if [ -f "$HOME/.micromamba/etc/profile.d/micromamba.sh" ]; then
|
||||||
|
. "$HOME/.micromamba/etc/profile.d/micromamba.sh"
|
||||||
|
else
|
||||||
|
export PATH="$HOME/.micromamba/bin:$PATH" # extra space after export prevents interference from conda init
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
unset __mamba_setup
|
||||||
|
# <<< mamba initialize <<<
|
3
home/private_dot_config/zsh/zexists.d/cmd/nvim.zsh
Normal file
3
home/private_dot_config/zsh/zexists.d/cmd/nvim.zsh
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export EDITOR=nvim
|
||||||
|
export VISUAL=nvim
|
||||||
|
alias vim=nvim
|
3
home/private_dot_config/zsh/zexists.d/cmd/pnpm.zsh
Normal file
3
home/private_dot_config/zsh/zexists.d/cmd/pnpm.zsh
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export PNPM_HOME="$HOME/.local/share/pnpm"
|
||||||
|
path=( "$PNPM_HOME" $path)
|
||||||
|
|
7
home/private_dot_config/zsh/zexists.d/cmd/starship.zsh
Normal file
7
home/private_dot_config/zsh/zexists.d/cmd/starship.zsh
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
if is-tty; then
|
||||||
|
export STARSHIP_CONFIG=~/.config/starship/plain.toml
|
||||||
|
else
|
||||||
|
export STARSHIP_CONFIG=~/.config/starship/config.toml
|
||||||
|
fi
|
||||||
|
|
||||||
|
eval "$(starship init zsh)"
|
7
home/private_dot_config/zsh/zexists.d/cmd/tmux.zsh
Normal file
7
home/private_dot_config/zsh/zexists.d/cmd/tmux.zsh
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
alias t-labbook="$DOTFILES_DIR/tmux/labbook.sh"
|
||||||
|
# source custom tmux.conf with older tmux
|
||||||
|
alias tmux="tmux -f ~/.config/tmux/tmux.conf"
|
||||||
|
alias t='tmux'
|
||||||
|
alias tn='tmux new-session'
|
||||||
|
alias tl='tmux list-sessions'
|
||||||
|
|
3
home/private_dot_config/zsh/zexists.d/cmd/zellij.zsh
Normal file
3
home/private_dot_config/zsh/zexists.d/cmd/zellij.zsh
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
alias zs="zellij -s"
|
||||||
|
alias zl="zellij ls"
|
||||||
|
alias za="zellij a"
|
5
home/private_dot_config/zsh/zexists.d/cmd/zoxide.zsh
Normal file
5
home/private_dot_config/zsh/zexists.d/cmd/zoxide.zsh
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
eval "$(zoxide init zsh --cmd cd)"
|
||||||
|
|
||||||
|
if is-exe lsd; then
|
||||||
|
export _ZO_FZF_OPTS="--preview 'command lsd --tree --color always --icon always {2..}'"
|
||||||
|
fi
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
export DENO_INSTALL="$HOME/.deno"; \
|
||||||
|
path=("$DENO_INSTALL/bin" $path)
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
path=("$HOME/.nimble/bin" $path)
|
|
@ -0,0 +1,2 @@
|
||||||
|
source "$HOME/.pkgs/google-cloud-sdk/completion.zsh.inc"
|
||||||
|
path=("$HOME/.pkgs/google-cloud-sdk/bin" $path)
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# bun completions
|
||||||
|
[[ -s "$HOME/.bun/_bun" ]] && source "$HOME/.bun/_bun"
|
||||||
|
# bun
|
||||||
|
export BUN_INSTALL="$HOME/.bun"
|
||||||
|
path=("$BUN_INSTALL/bin" $path)
|
|
@ -0,0 +1,52 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# Updated to use $HOME
|
||||||
|
|
||||||
|
# >>> conda initialize >>>
|
||||||
|
# !! Contents within this block are managed by 'conda init' !!
|
||||||
|
__conda_setup="$("$HOME/mambaforge/bin/conda" 'shell.zsh' 'hook' 2>/dev/null)"
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
eval "$__conda_setup"
|
||||||
|
else
|
||||||
|
if [ -f "$HOME/mambaforge/etc/profile.d/conda.sh" ]; then
|
||||||
|
. "$HOME/mambaforge/etc/profile.d/conda.sh"
|
||||||
|
else
|
||||||
|
export PATH="$HOME/mambaforge/bin:$PATH"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
unset __conda_setup
|
||||||
|
|
||||||
|
if [ -f "$HOME/mambaforge/etc/profile.d/mamba.sh" ]; then
|
||||||
|
. "$HOME/mambaforge/etc/profile.d/mamba.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# <<< conda initialize <<<
|
||||||
|
|
||||||
|
# <<< mamba initialize <<<
|
||||||
|
|
||||||
|
snake() {
|
||||||
|
if [[ $1 == "no" ]]; then
|
||||||
|
if [[ $VIRTUAL_ENV != "" ]]; then
|
||||||
|
echo "deactivate python virtualenv: $VIRTUAL_ENV"
|
||||||
|
deactivate
|
||||||
|
elif [[ $CONDA_DEFAULT_ENV != "" ]]; then
|
||||||
|
echo "deactivating conda env: $CONDA_DEFAULT_ENV"
|
||||||
|
conda deactivate
|
||||||
|
else
|
||||||
|
echo 'no environment to leave'
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [[ -d $(pwd)/env ]]; then
|
||||||
|
printf 'activating project-specific env: %s\n' "${PWD##*/}/env"
|
||||||
|
conda activate ./env
|
||||||
|
elif [[ -d $(pwd)/venv ]]; then
|
||||||
|
echo "activating python virtualenv"
|
||||||
|
source ./venv/bin/activate
|
||||||
|
elif [[ -d $(pwd)/.venv ]]; then
|
||||||
|
echo "activating python virtualenv"
|
||||||
|
source ./.venv/bin/activate
|
||||||
|
else
|
||||||
|
echo "is there an environment to activate?"
|
||||||
|
echo "I was expecting either a conda(env) or virtualenv(venv,.venv)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
Loading…
Reference in a new issue