lnk: sync configuration files
parent
d2230e1df2
commit
31b5e4e7ca
9
.lnk
9
.lnk
|
|
@ -7,12 +7,3 @@
|
||||||
.config/systemd/user
|
.config/systemd/user
|
||||||
.config/yazi/install-plugins
|
.config/yazi/install-plugins
|
||||||
.local/share/stew/Stewfile.lock.json
|
.local/share/stew/Stewfile.lock.json
|
||||||
.zsh_plugins.txt
|
|
||||||
.zsh_plugins.zsh
|
|
||||||
.zshenv
|
|
||||||
.zshrc
|
|
||||||
.zshrc.d/aliases.zsh
|
|
||||||
.zshrc.d/colors.zsh
|
|
||||||
.zshrc.d/environment.zsh
|
|
||||||
.zshrc.d/functions.zsh
|
|
||||||
.zshrc.d/options.zsh
|
|
||||||
|
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
# vim: set filetype=sh nospell :
|
|
||||||
|
|
||||||
mattmc3/zephyr path:plugins/color
|
|
||||||
mattmc3/zephyr path:plugins/completion
|
|
||||||
mattmc3/zephyr path:plugins/editor
|
|
||||||
mattmc3/zephyr path:plugins/zfunctions
|
|
||||||
|
|
||||||
zsh-users/zsh-autosuggestions
|
|
||||||
|
|
||||||
zsh-users/zsh-history-substring-search
|
|
||||||
|
|
||||||
3v1n0/zsh-bash-completions-fallback
|
|
||||||
|
|
||||||
Sam-programs/zsh-calc
|
|
||||||
|
|
||||||
MichaelAquilina/zsh-you-should-use
|
|
||||||
|
|
||||||
mattmc3/zman
|
|
||||||
|
|
||||||
# NOTE: syntax highlighting needs to be last
|
|
||||||
zdharma-continuum/fast-syntax-highlighting
|
|
||||||
# jeffreytse/zsh-vi-mode
|
|
||||||
jeffreytse/zsh-vi-mode
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
fpath+=( "$HOME/.cache/antidote/mattmc3/zephyr/plugins/color" )
|
|
||||||
source "$HOME/.cache/antidote/mattmc3/zephyr/plugins/color/color.plugin.zsh"
|
|
||||||
fpath+=( "$HOME/.cache/antidote/mattmc3/zephyr/plugins/completion" )
|
|
||||||
source "$HOME/.cache/antidote/mattmc3/zephyr/plugins/completion/completion.plugin.zsh"
|
|
||||||
fpath+=( "$HOME/.cache/antidote/mattmc3/zephyr/plugins/editor" )
|
|
||||||
source "$HOME/.cache/antidote/mattmc3/zephyr/plugins/editor/editor.plugin.zsh"
|
|
||||||
fpath+=( "$HOME/.cache/antidote/mattmc3/zephyr/plugins/zfunctions" )
|
|
||||||
source "$HOME/.cache/antidote/mattmc3/zephyr/plugins/zfunctions/zfunctions.plugin.zsh"
|
|
||||||
fpath+=( "$HOME/.cache/antidote/zsh-users/zsh-autosuggestions" )
|
|
||||||
source "$HOME/.cache/antidote/zsh-users/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh"
|
|
||||||
fpath+=( "$HOME/.cache/antidote/zsh-users/zsh-history-substring-search" )
|
|
||||||
source "$HOME/.cache/antidote/zsh-users/zsh-history-substring-search/zsh-history-substring-search.plugin.zsh"
|
|
||||||
fpath+=( "$HOME/.cache/antidote/3v1n0/zsh-bash-completions-fallback" )
|
|
||||||
source "$HOME/.cache/antidote/3v1n0/zsh-bash-completions-fallback/zsh-bash-completions-fallback.plugin.zsh"
|
|
||||||
fpath+=( "$HOME/.cache/antidote/Sam-programs/zsh-calc" )
|
|
||||||
source "$HOME/.cache/antidote/Sam-programs/zsh-calc/zsh-calc.zsh"
|
|
||||||
fpath+=( "$HOME/.cache/antidote/MichaelAquilina/zsh-you-should-use" )
|
|
||||||
source "$HOME/.cache/antidote/MichaelAquilina/zsh-you-should-use/zsh-you-should-use.plugin.zsh"
|
|
||||||
fpath+=( "$HOME/.cache/antidote/mattmc3/zman" )
|
|
||||||
source "$HOME/.cache/antidote/mattmc3/zman/zman.plugin.zsh"
|
|
||||||
fpath+=( "$HOME/.cache/antidote/zdharma-continuum/fast-syntax-highlighting" )
|
|
||||||
source "$HOME/.cache/antidote/zdharma-continuum/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh"
|
|
||||||
fpath+=( "$HOME/.cache/antidote/jeffreytse/zsh-vi-mode" )
|
|
||||||
source "$HOME/.cache/antidote/jeffreytse/zsh-vi-mode/zsh-vi-mode.plugin.zsh"
|
|
||||||
98
.zshenv
98
.zshenv
|
|
@ -1,98 +0,0 @@
|
||||||
# vim: set filetype=sh nospell:
|
|
||||||
|
|
||||||
export STOW_DIR="$HOME/.local/stow"
|
|
||||||
# export SKIM_DEFAULT_OPTIONS='--bind="ctrl-k:up" --bind="ctrl-j:down"'
|
|
||||||
|
|
||||||
## Set XDG directories
|
|
||||||
export XDG_CONFIG_HOME="$HOME/.config"
|
|
||||||
export XDG_DATA_HOME="$HOME/.local/share"
|
|
||||||
export XDG_STATE_HOME="$HOME/.local/state"
|
|
||||||
export XDG_CACHE_HOME="$HOME/.cache"
|
|
||||||
|
|
||||||
export XDG_DATA_DIRS="/usr/local/share:/usr/share"
|
|
||||||
export XDG_DATA_DIRS="$XDG_DATA_DIRS:$HOME/.local/share/applications"
|
|
||||||
|
|
||||||
# Desktop files (used by desktop environments within both X11 and Wayland) are
|
|
||||||
# # looked for in XDG_DATA_DIRS; make sure it includes the relevant directory for
|
|
||||||
# # snappy applications' desktop files.
|
|
||||||
snap_xdg_path="/var/lib/snapd/desktop"
|
|
||||||
if [ -n "${XDG_DATA_DIRS##*${snap_xdg_path}}" ] && [ -n "${XDG_DATA_DIRS##*${snap_xdg_path}:*}" ]; then
|
|
||||||
export XDG_DATA_DIRS="${XDG_DATA_DIRS}:${snap_xdg_path}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# set XDG_DATA_DIRS to include Flatpak installations
|
|
||||||
if command -v flatpak >/dev/null; then
|
|
||||||
|
|
||||||
new_dirs=$(
|
|
||||||
(
|
|
||||||
unset G_MESSAGES_DEBUG
|
|
||||||
echo "${XDG_DATA_HOME:-"$HOME/.local/share"}/flatpak"
|
|
||||||
GIO_USE_VFS=local flatpak --installations
|
|
||||||
) | (
|
|
||||||
new_dirs=
|
|
||||||
while read -r install_path; do
|
|
||||||
share_path=$install_path/exports/share
|
|
||||||
case ":$XDG_DATA_DIRS:" in
|
|
||||||
*":$share_path:"*) : ;;
|
|
||||||
*":$share_path/:"*) : ;;
|
|
||||||
*) new_dirs=${new_dirs:+${new_dirs}:}$share_path ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
echo "$new_dirs"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
export XDG_DATA_DIRS
|
|
||||||
XDG_DATA_DIRS="${new_dirs:+${new_dirs}:}${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# lua library paths
|
|
||||||
# eval "$(luarocks-5.4 path --bin)"
|
|
||||||
|
|
||||||
## Path for go(lang)
|
|
||||||
# Go compiler:
|
|
||||||
path+="/usr/local/go/bin"
|
|
||||||
# Local go programs
|
|
||||||
export GOPATH="$HOME/go"
|
|
||||||
path+=$GOPATH/bin
|
|
||||||
|
|
||||||
## Personal scripts
|
|
||||||
path+="$HOME/scripts"
|
|
||||||
|
|
||||||
if [ -d "$HOME/bin" ]; then
|
|
||||||
path+=$HOME/bin
|
|
||||||
fi
|
|
||||||
|
|
||||||
# set PATH so it includes user's private bin if it exists
|
|
||||||
if [ -d "$HOME/.local/bin" ]; then
|
|
||||||
path+=$HOME/.local/bin
|
|
||||||
fi
|
|
||||||
|
|
||||||
# git-fuzzy path
|
|
||||||
path+=$HOME/scripts/git-fuzzy/bin
|
|
||||||
|
|
||||||
# set PATH so it includes cargo if it exists
|
|
||||||
if [ -d "$HOME/.cargo/bin" ]; then
|
|
||||||
path+=/home/bryan/.cargo/bin
|
|
||||||
fi
|
|
||||||
|
|
||||||
. "$HOME/.cargo/env"
|
|
||||||
|
|
||||||
## lua
|
|
||||||
## luaenv
|
|
||||||
# see: https://github.com/cehoffman/luaenv
|
|
||||||
#
|
|
||||||
# Install luaenv:
|
|
||||||
# git clone https://github.com/cehoffman/luaenv.git ~/.luaenv
|
|
||||||
#
|
|
||||||
# Install lua-build plugin:
|
|
||||||
# git clone https://github.com/cehoffman/lua-build.git ~/.luaenv/plugins/lua-build
|
|
||||||
#
|
|
||||||
# Install luaenv-luarocks:
|
|
||||||
# git clone https://github.com/xpol/luaenv-luarocks.git ~/.luaenv/plugins/luaenv-luarocks
|
|
||||||
#
|
|
||||||
path+="$HOME/.luaenv/bin"
|
|
||||||
eval "$(luaenv init -)"
|
|
||||||
|
|
||||||
# Add all directories under ~/lua to path
|
|
||||||
path+=$(ls -Dd $HOME/lua/*)
|
|
||||||
76
.zshrc
76
.zshrc
|
|
@ -1,76 +0,0 @@
|
||||||
# vim: set filetype=sh nospell :
|
|
||||||
#
|
|
||||||
|
|
||||||
# Clone antidote ( https://antidote.sh )
|
|
||||||
[[ -d ${ZDOTDIR:-~}/.antidote ]] ||
|
|
||||||
git clone --depth=1 https://github.com/mattmc3/antidote.git ${ZDOTDIR:-~}/.antidote
|
|
||||||
# source antidote
|
|
||||||
source ${ZDOTDIR:-~}/.antidote/antidote.zsh
|
|
||||||
zstyle ':antidote:bundle' use-friendly-names 'yes'
|
|
||||||
antidote load
|
|
||||||
|
|
||||||
plugins+=(fzf)
|
|
||||||
|
|
||||||
## zoxide stuff - zoxide is a better cd utility
|
|
||||||
eval "$(zoxide init zsh)"
|
|
||||||
|
|
||||||
## starship
|
|
||||||
eval "$(starship init zsh)"
|
|
||||||
|
|
||||||
## FZF extras
|
|
||||||
[[ -e "$HOME/.fzf-extras/fzf-extras.sh" ]] &&
|
|
||||||
source "$HOME/.fzf-extras/fzf-extras.sh"
|
|
||||||
|
|
||||||
# This function is automatically called by zsh-vi-mode plugin
|
|
||||||
# Set keybindings here so that they aren't overridden by zsh-vi-mode
|
|
||||||
function zvm_after_init() {
|
|
||||||
# set vi mode
|
|
||||||
bindkey -v
|
|
||||||
# set ctrl-p and ctrl-n for vi insert mode
|
|
||||||
bindkey -v '^P' history-substring-search-up #up-history
|
|
||||||
bindkey -v '^N' history-substring-search-down #down-history
|
|
||||||
|
|
||||||
# mattmc3/zephyr path:plugins/editor
|
|
||||||
bindkey '^Z' symmetric-ctrl-z
|
|
||||||
bindkey '^S' prepend-sudo
|
|
||||||
|
|
||||||
# Alt+Enter
|
|
||||||
# To make shift+enter work in zsh we map Shift+Enter to Alt+Enter in kitty.
|
|
||||||
# There are autocommands in Neovim that set a user variable in kitty when we are in Neovim and unsets it when we exit.
|
|
||||||
# This allows us to unmap Shift+Enter in kitty when inside Neovim.
|
|
||||||
# By doing this we can use Shift+Enter for `forward-word`, which is autosuggest partial accept
|
|
||||||
# in the autosuggest plugin in zsh, without interfering with the mapping in nvim.
|
|
||||||
bindkey '^[^M' forward-word
|
|
||||||
# bindkey '^R' fzf-history-widget
|
|
||||||
|
|
||||||
# [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
|
||||||
# Source skim keybindings. Skim repo is cloned into stow directory
|
|
||||||
# so we can use stow to install the man page. The stow binary still has
|
|
||||||
# to be installed seperately.
|
|
||||||
source "$STOW_DIR/skim/shell/key-bindings.zsh"
|
|
||||||
|
|
||||||
# 'navi' interactive cheatsheet (https://github.com/denisidoro/navi)
|
|
||||||
# the plugin binds ^g to the widget so we need to source it here
|
|
||||||
eval "$(navi widget zsh)"
|
|
||||||
}
|
|
||||||
|
|
||||||
export NVM_DIR="$HOME/.config/nvm"
|
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
|
||||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
|
||||||
|
|
||||||
# 'try' utility (https://github.com/tobi/try)
|
|
||||||
# creates/manages directories for experiments
|
|
||||||
eval "$(~/.local/bin/try.rb init ~/projects/tries)"
|
|
||||||
|
|
||||||
# Tab completions for lnk
|
|
||||||
eval "$(lnk completion zsh)"
|
|
||||||
|
|
||||||
# Source anything in .zshrc.d.
|
|
||||||
for _rc in ${ZDOTDIR:-$HOME}/.zshrc.d/*.zsh; do
|
|
||||||
# Ignore tilde files.
|
|
||||||
|
|
||||||
if [[ $_rc:t != '~'* ]]; then
|
|
||||||
source "$_rc"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
unset _rc
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
# vim: set filetype=sh nospell:
|
|
||||||
|
|
||||||
## Use the kitty ssh kitten so that terminfo will be copied over to the remote
|
|
||||||
## otherwise the remote doesn't recognize kitty terminal
|
|
||||||
alias ssh="kitten ssh"
|
|
||||||
alias mosh='mosh --ssh="kitten ssh"'
|
|
||||||
|
|
||||||
# Show process names by default with pgrep
|
|
||||||
alias pgrep='pgrep -l'
|
|
||||||
|
|
||||||
# Use ov as less
|
|
||||||
alias less=ov
|
|
||||||
|
|
||||||
alias fd=fdfind
|
|
||||||
|
|
||||||
# Use eza as ls
|
|
||||||
alias la="eza -a --sort time --group-directories-first"
|
|
||||||
alias ls="eza --sort time --group-directories-first"
|
|
||||||
alias ll="eza -l --sort time --group-directories-first"
|
|
||||||
alias lsd="eza -D --sort time"
|
|
||||||
alias lsf="eza -f --sort time"
|
|
||||||
|
|
||||||
alias grep='grep --color=auto'
|
|
||||||
alias fgrep='fgrep --color=auto'
|
|
||||||
alias egrep='egrep --color=auto'
|
|
||||||
|
|
||||||
# Add an "alert" alias for long running commands. Use like so:
|
|
||||||
# sleep 10; alert
|
|
||||||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
|
||||||
|
|
||||||
## Use main clipbard by default with xclip
|
|
||||||
alias xclip="xclip -selection clipboard"
|
|
||||||
|
|
||||||
# Qalc
|
|
||||||
alias q=qalc
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
COLOR_1='\033[1;34m' # Primary color
|
|
||||||
COLOR_2='\033[0;96m' # Secondary color
|
|
||||||
COLOR_LIGHT='\033[2m'
|
|
||||||
|
|
||||||
COLOR_ERROR='\033[1;31m'
|
|
||||||
COLOR_WARN='\033[0;33m'
|
|
||||||
COLOR_SUCCESS='\033[0;32m'
|
|
||||||
|
|
||||||
TEXT_RESET='\033[0m'
|
|
||||||
TEXT_ITAL='\e[3m'
|
|
||||||
TEXT_ULINE='\e[4m'
|
|
||||||
|
|
||||||
CYAN_B='\033[1;96m'
|
|
||||||
YELLOW='\033[0;93m'
|
|
||||||
RED_B='\033[1;31m'
|
|
||||||
GREEN='\033[0;32m'
|
|
||||||
PURPLE='\033[0;35m'
|
|
||||||
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
# vim: set filetype=sh nospell:
|
|
||||||
|
|
||||||
export PAGER='ov'
|
|
||||||
export VISUAL='nvim'
|
|
||||||
export EDITOR='nvim'
|
|
||||||
|
|
||||||
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
|
|
||||||
export MANROFFOPT="-c"
|
|
||||||
|
|
||||||
export BAT_PAGER="ov -FX"
|
|
||||||
|
|
||||||
# Set language.
|
|
||||||
export LANG=${LANG:-en_US.UTF-8}
|
|
||||||
|
|
||||||
# Reduce key delay
|
|
||||||
export KEYTIMEOUT=${KEYTIMEOUT:-1}
|
|
||||||
|
|
||||||
# Ensure path arrays do not contain duplicates.
|
|
||||||
typeset -gU cdpath fpath mailpath path
|
|
||||||
|
|
||||||
### History settings ###
|
|
||||||
setopt BANG_HIST # Treat the '!' character specially during expansion.
|
|
||||||
setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format.
|
|
||||||
setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history.
|
|
||||||
setopt HIST_FIND_NO_DUPS # Do not display a previously found event.
|
|
||||||
setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate.
|
|
||||||
setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again.
|
|
||||||
setopt HIST_IGNORE_SPACE # Do not record an event starting with a space.
|
|
||||||
setopt HIST_REDUCE_BLANKS # Remove extra blanks from commands added to the history list.
|
|
||||||
setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file.
|
|
||||||
setopt HIST_VERIFY # Do not execute immediately upon history expansion.
|
|
||||||
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
|
|
||||||
setopt NO_HIST_BEEP # Don't beep when accessing non-existent history.
|
|
||||||
setopt NO_SHARE_HISTORY # Don't share history between all sessions.
|
|
||||||
setopt HIST_REDUCE_BLANKS # Remove superfluous blanks from each command line being added to the history.
|
|
||||||
|
|
||||||
export HIST_STAMPS="yyyy-mm-dd"
|
|
||||||
export HISTFILE=~/.zsh_history
|
|
||||||
export HISTORY_IGNORE="(ls|cd|pwd|exit|fg|hstr)*"
|
|
||||||
export SAVEHIST=1000 # increase history file size (default is 500)
|
|
||||||
export HISTSIZE=1000 # increase history size (default is 500)
|
|
||||||
|
|
||||||
export HSTR_CONFIG=prompt-bottom,hicolor,raw-history-view
|
|
||||||
export HSTR_PROMPT=">"
|
|
||||||
|
|
||||||
# for `zsh-users/zsh-history-substring-search` plugin
|
|
||||||
HISTORY_SUBSTRING_SEARCH_PREFIXED=1 # Match against the start of each history entry.
|
|
||||||
|
|
||||||
# for `Sam-programs/zsh-calc` plugin
|
|
||||||
CALC_CMD="qalc -t -c -f <(echo \$BUFFER)"
|
|
||||||
|
|
||||||
# zsh-vi-mode stuff
|
|
||||||
ZVM_VI_HIGHLIGHT_FOREGROUND=black
|
|
||||||
ZVM_VI_HIGHLIGHT_BACKGROUND=green
|
|
||||||
ZVM_NORMAL_MODE_CURSOR=$ZVM_CURSOR_BLINKING_BLOCK
|
|
||||||
ZVM_INSERT_MODE_CURSOR=$ZVM_CURSOR_BLINKING_BEAM
|
|
||||||
ZVM_VISUAL_MODE_CURSOR=$ZVM_CURSOR_BLOCK
|
|
||||||
ZVM_VISUAL_LINE_MODE_CURSOR=$ZVM_CURSOR_BLOCK
|
|
||||||
ZVM_OPPEND_MODE_CURSOR=$ZVM_CURSOR_BLINKING_UNDERLINE
|
|
||||||
|
|
@ -1,90 +0,0 @@
|
||||||
# vim: set filetype=sh nospell:
|
|
||||||
|
|
||||||
source ~/.zshrc.d/colors.zsh
|
|
||||||
|
|
||||||
## Use bat as cat, except use glow for Markdown files
|
|
||||||
function cat() {
|
|
||||||
if [[ $# -eq 1 ]]; then
|
|
||||||
extension=$([[ "$1" = *.* ]] && echo ".${1##*.}" || echo '')
|
|
||||||
if [[ "$extension" == ".md" ]]; then
|
|
||||||
glow --pager -w0 $1
|
|
||||||
elif [[ "$extension" == ".html" ]]; then
|
|
||||||
reader $1 | ov
|
|
||||||
elif [[ "$extension" == ".json" ]]; then
|
|
||||||
bat $1 | jq --color-output | bat
|
|
||||||
else
|
|
||||||
bat $1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
bat $@
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
## Use bat to colorize help text
|
|
||||||
## alias bathelp='bat --plain --language=help'
|
|
||||||
function help() {
|
|
||||||
"$@" --help 2>&1 | bat --plain --language=help
|
|
||||||
}
|
|
||||||
|
|
||||||
## If there is no man page for given command then use help
|
|
||||||
function man() {
|
|
||||||
$(whence -p man) $@
|
|
||||||
[[ $? -ne 0 ]] && help $1 || true
|
|
||||||
}
|
|
||||||
|
|
||||||
## Syntax highlighting for apropos
|
|
||||||
function apropos() {
|
|
||||||
$(whence -p apropos) "$@" | bat
|
|
||||||
}
|
|
||||||
|
|
||||||
## Make directory and cd into it
|
|
||||||
function mcd() {
|
|
||||||
mkdir $@
|
|
||||||
cd $_
|
|
||||||
}
|
|
||||||
|
|
||||||
## List dot files
|
|
||||||
function lsdot() {
|
|
||||||
eza -d $@ .??* 2>/dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
## Wrapper for yazi to provide ability to change current working directory when exiting yazi
|
|
||||||
function y() {
|
|
||||||
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
|
|
||||||
yazi "$@" --cwd-file="$tmp"
|
|
||||||
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
|
||||||
builtin cd -- "$cwd"
|
|
||||||
fi
|
|
||||||
rm -f -- "$tmp"
|
|
||||||
}
|
|
||||||
|
|
||||||
function hstr() {
|
|
||||||
local cmd_file="$(mktemp -t "hist-cmd.XXXXXX")"
|
|
||||||
1>&2 2>"$cmd_file" /usr/bin/hstr
|
|
||||||
|
|
||||||
local cmd="$(cat $cmd_file)"
|
|
||||||
echo "$cmd" >>"$HISTFILE"
|
|
||||||
echo "$cmd"
|
|
||||||
eval "$cmd"
|
|
||||||
rm "$cmd_file"
|
|
||||||
}
|
|
||||||
|
|
||||||
# set kitty user var `in_editor` when inside sk (skim fuzzy finder)
|
|
||||||
# need to use whence to find path of executible, functions can be recursive
|
|
||||||
# so if we don't do this it will just keep calling the sk() function
|
|
||||||
function sk() {
|
|
||||||
kitten @ set-user-var in_editor=1
|
|
||||||
$(whence -p sk) "$@"
|
|
||||||
kitten @ set-user-var in_editor
|
|
||||||
}
|
|
||||||
|
|
||||||
function fzf() {
|
|
||||||
echo "fzf not installed, using sk (skim)"
|
|
||||||
sk
|
|
||||||
}
|
|
||||||
|
|
||||||
function plz() {
|
|
||||||
last_command=$(fc -l -n -1)
|
|
||||||
echo "${COLOR_1}Okay, ${COLOR_SUCCESS}${TEXT_ITAL}sudo${TEXT_RESET} ${COLOR_SUCCESS}${last_command}. ${COLOR_1}You're welcome.${TEXT_RESET}"
|
|
||||||
echo "$last_command" | xargs sudo
|
|
||||||
}
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
# vim: set filetype=sh nospell:
|
|
||||||
|
|
||||||
setopt extended_glob # Use extended globbing syntax (#,~,^).
|
|
||||||
setopt glob_dots # Don't hide dotfiles from glob patterns.
|
|
||||||
setopt NO_rm_star_silent # Ask for confirmation for `rm *' or `rm path/*'
|
|
||||||
|
|
||||||
setopt combining_chars # Combine 0-len chars with the base character (eg: accents).
|
|
||||||
setopt interactive_comments # Enable comments in interactive shell.
|
|
||||||
setopt rc_quotes # Allow 'Hitchhikers''s Guide' instead of 'Hitchhikers'\''s Guide'.
|
|
||||||
setopt NO_mail_warning # Don't print a warning message if a mail file has been accessed.
|
|
||||||
setopt NO_beep # Don't beep on error in line editor.
|
|
||||||
|
|
||||||
# Set Zsh options related to job control.
|
|
||||||
setopt auto_resume # Attempt to resume existing job before creating a new process.
|
|
||||||
setopt long_list_jobs # List jobs in the long format by default.
|
|
||||||
setopt notify # Report status of background jobs immediately.
|
|
||||||
setopt NO_bg_nice # Don't run all background jobs at a lower priority.
|
|
||||||
setopt NO_check_jobs # Don't report on jobs when shell exit.
|
|
||||||
setopt NO_hup # Don't kill jobs on shell exit.
|
|
||||||
Loading…
Reference in New Issue