summaryrefslogtreecommitdiffstats
path: root/dot_config/zsh
diff options
context:
space:
mode:
Diffstat (limited to 'dot_config/zsh')
-rw-r--r--dot_config/zsh/aliasrc24
-rw-r--r--dot_config/zsh/dot_p10k.zsh22
-rw-r--r--dot_config/zsh/dot_zshenv33
-rw-r--r--dot_config/zsh/dot_zshrc7
4 files changed, 62 insertions, 24 deletions
diff --git a/dot_config/zsh/aliasrc b/dot_config/zsh/aliasrc
index 0b2b91d..5b933ed 100644
--- a/dot_config/zsh/aliasrc
+++ b/dot_config/zsh/aliasrc
@@ -3,19 +3,23 @@
# Use neovim for vim if present.
[ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d"
+# If code-insiders exists and code does not, use code-insiders.
+[ -x "$(command -v code-insiders)" ] && [ ! -x "$(command -v code)" ] && alias code="code-insiders"
+
# Use $XINITRC variable if file exists.
-[ -f "$XINITRC" ] && alias startx="startx $XINITRC"
+[ -f "$XINITRC" ] && alias startx='startx "$XINITRC"'
# sudo not required for some system commands
for x in mount umount sv emerge apt pacman updatedb su ; do
- alias $x="sudo $x"
+ # shellcheck disable=SC2139
+ alias $x='sudo $x'
done
-if command -v doas &>/dev/null
+if command -v doas >/dev/null 2>&1
then
alias sudo='doas'
else
- alias sudo='sudo '
+ alias sudo='sudo -E'
fi
# Verbosity and settings that you pretty much just always are going to want.
@@ -32,6 +36,7 @@ alias \
du="dust -r" \
free="free -m" \
gdb='gdb -q -nh -x "$XDG_CONFIG_HOME/gdb/init"' \
+ wget='wget --hsts-file="$XDG_DATA_HOME/wget-hsts"' \
# Colorize commands when possible.
alias \
@@ -39,7 +44,7 @@ alias \
ll="eza -alg --group-directories-first" \
lt='eza -aTF --group-directories-first' \
lr='eza -aRF' \
- grep="rg --color=auto" \
+ grep="rg --color=auto --hyperlink-format=file://{wslprefix}{path}" \
diff="delta" \
cat='bat --paging=never --style=plain' \
@@ -50,8 +55,8 @@ alias \
trem="transmission-remote" \
YT="youtube-viewer" \
sdn="sudo shutdown -h now" \
- e="$EDITOR" \
- v="$EDITOR" \
+ e="\$EDITOR" \
+ v="\$EDITOR" \
em="sudo emerge" \
p="sudo pacman" \
xi="sudo xbps-install" \
@@ -60,3 +65,8 @@ alias \
z="zathura"
alias adb='HOME="$XDG_DATA_HOME"/android adb'
+
+# Use the SSH kitten when possible. (but not already in SSH)
+if [ "$TERM" = "xterm-kitty" ] && [ -z "$SSH_TTY" ]; then
+ alias sshs='sshs -t "kitten ssh \"{{{name}}}\""'
+fi \ No newline at end of file
diff --git a/dot_config/zsh/dot_p10k.zsh b/dot_config/zsh/dot_p10k.zsh
index fc1b23c..eccf809 100644
--- a/dot_config/zsh/dot_p10k.zsh
+++ b/dot_config/zsh/dot_p10k.zsh
@@ -1,4 +1,4 @@
-# Generated by Powerlevel10k configuration wizard on 2023-11-09 at 16:04 CST.
+# Generated by Powerlevel10k configuration wizard on 1970-01-01 at 00:00 UTC.
# Based on romkatv/powerlevel10k/config/p10k-lean.zsh.
# Wizard options: nerdfont-complete + powerline, small icons, unicode, lean, 24h time,
# 2 lines, disconnected, no frame, sparse, few icons, concise, transient_prompt,
@@ -32,7 +32,7 @@
# The list of segments shown on the left. Fill it with the most important segments.
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
# =========================[ Line #1 ]=========================
- # os_icon # os identifier
+ os_icon # os identifier
dir # current directory
vcs # git status
# =========================[ Line #2 ]=========================
@@ -57,15 +57,15 @@
#goenv # go environment (https://github.com/syndbg/goenv)
#nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv)
#nvm # node.js version from nvm (https://github.com/nvm-sh/nvm)
- nodeenv # node.js environment (https://github.com/ekalinin/nodeenv)
- node_version # node.js version
- go_version # go version (https://golang.org)
- rust_version # rustc version (https://www.rust-lang.org)
- dotnet_version # .NET version (https://dotnet.microsoft.com)
- # php_version # php version (https://www.php.net/)
+ #nodeenv # node.js environment (https://github.com/ekalinin/nodeenv)
+ node_version # node.js version
+ go_version # go version (https://golang.org)
+ rust_version # rustc version (https://www.rust-lang.org)
+ dotnet_version # .NET version (https://dotnet.microsoft.com)
+ php_version # php version (https://www.php.net/)
# laravel_version # laravel php framework version (https://laravel.com/)
- # java_version # java version (https://www.java.com/)
- package # name@version from package.json (https://docs.npmjs.com/files/package.json)
+ java_version # java version (https://www.java.com/)
+ package # name@version from package.json (https://docs.npmjs.com/files/package.json)
rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv)
rvm # ruby version from rvm (https://rvm.io)
fvm # flutter version management (https://github.com/leoafarias/fvm)
@@ -104,7 +104,7 @@
timewarrior # timewarrior tracking status (https://timewarrior.net/)
taskwarrior # taskwarrior task count (https://taskwarrior.org/)
per_directory_history # Oh My Zsh per-directory-history local/global indicator
- # cpu_arch # CPU architecture
+ cpu_arch # CPU architecture
time # current time
# =========================[ Line #2 ]=========================
newline
diff --git a/dot_config/zsh/dot_zshenv b/dot_config/zsh/dot_zshenv
index dfa3718..47236cf 100644
--- a/dot_config/zsh/dot_zshenv
+++ b/dot_config/zsh/dot_zshenv
@@ -1,4 +1,4 @@
-#!/bin/zsh
+#!/usr/bin/env zsh
# profile file. Runs on login. Environmental variables are set here.
# If you don't plan on reverting to bash, you can remove the link in ~/.profile
@@ -8,9 +8,26 @@ export FPATH="$FPATH:${XDG_DATA_HOME:-$HOME/.local/share/zsh/site-functions}"
unsetopt PROMPT_SP
-# Default programs:
-export EDITOR="nvim +star"
-export BROWSER="chromium"
+if command -v nvim >/dev/null 2>&1
+then
+ DEFAULT_EDITOR="nvim +star"
+else
+ DEFAULT_EDITOR="nano"
+fi
+
+# Use TUI editor for git
+[ -z "$GIT_EDITOR" ] && export GIT_EDITOR="$EDITOR"
+# Default programs for SSH or not
+if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
+ export BROWSER="w3m"
+ export EDITOR="$DEFAULT_EDITOR"
+else
+ export BROWSER="chromium"
+ # shellcheck disable=SC2015
+ [ -n "$DISPLAY" ] && export EDITOR="code -nw" || export EDITOR="$DEFAULT_EDITOR"
+fi
+
+export VISUAL="$EDITOR"
# ~/ Clean-up (XDG):
[ -z "$XDG_CONFIG_HOME" ] && export XDG_CONFIG_HOME="$HOME/.config"
@@ -73,11 +90,15 @@ export DOCKER_CONFIG="$XDG_CONFIG_HOME"/docker
export AWS_SHARED_CREDENTIALS_FILE="$XDG_CONFIG_HOME"/aws/credentials
export AWS_CONFIG_FILE="$XDG_CONFIG_HOME"/aws/config
export AZURE_CONFIG_DIR="$XDG_DATA_HOME"/azure
+export RIPGREP_CONFIG_PATH="$XDG_CONFIG_HOME"/ripgrep/config
+export GRADLE_USER_HOME="$XDG_DATA_HOME"/gradle
+export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc
+export BUNDLE_USER_CONFIG="$XDG_CONFIG_HOME"/bundle
+export BUNDLE_USER_CACHE="$XDG_CACHE_HOME"/bundle
+export BUNDLE_USER_PLUGIN="$XDG_DATA_HOME"/bundle
# Other program settings:
export DOTNET_CLI_TELEMETRY_OPTOUT=1
-export DICS="/usr/share/stardict/dic/"
-export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"
export FZF_DEFAULT_OPTS="--layout=reverse --height 40%"
export LESS=-R
export LESS_TERMCAP_mb="$(printf '%b' '')"
diff --git a/dot_config/zsh/dot_zshrc b/dot_config/zsh/dot_zshrc
index 829b5a7..a592706 100644
--- a/dot_config/zsh/dot_zshrc
+++ b/dot_config/zsh/dot_zshrc
@@ -1,3 +1,4 @@
+#!/usr/bin/env zsh
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.config/zsh/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
@@ -25,6 +26,10 @@ case "$ID" in
;;
esac
+if [ -x "$(command -v gem)" ]; then
+ export GEM_HOME="$(gem env user_gemhome)"
+ export PATH="$PATH:$GEM_HOME/bin"
+fi
# Enable colors and change prompt:
autoload -U colors && colors # Load colors
@@ -104,3 +109,5 @@ case "$ID" in
;;
esac
+# Windows Terminal stuff
+PS1="\[\033]133;D;\007\]\[\033]133;A;\007\]$PS1\[\033]133;B;\007\]" \ No newline at end of file