updated prompt

This commit is contained in:
L. Kraven
2024-06-15 00:28:02 -07:00
parent 1870c38888
commit dd2c280d4e
12 changed files with 100 additions and 1869 deletions

3
.nanorc Normal file
View File

@@ -0,0 +1,3 @@
set tabsize 2
set tabstospaces

1738
.p10k.zsh

File diff suppressed because it is too large Load Diff

182
.zshrc
View File

@@ -1,127 +1,86 @@
# Personal Zsh configuration file. It is strongly recommended to keep all # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# shell customization and configuration (including exported environment # Initialization code that may require console input (password prompts, [y/n]
# variables such as PATH) in this file or in files sourced from it. # confirmations, etc.) must go above this block; everything else may go below.
# if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
# Documentation: https://github.com/romkatv/zsh4humans/blob/v5/README.md. source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Periodic auto-update on Zsh startup: 'ask' or 'no'. # Set ZINIT Home
# You can manually run `z4h update` to update everything. ZINIT_HOME="${HOME}/.config/zinit/zinit.git"
zstyle ':z4h:' auto-update 'no' ZSH_TMUX_AUTOSTART=true
# Ask whether to auto-update this often; has no effect if auto-update is 'no'.
zstyle ':z4h:' auto-update-days '28'
# Keyboard type: 'mac' or 'pc'. # Download ZINIT
zstyle ':z4h:bindkey' keyboard 'pc' if [ ! -d "$ZINIT_HOME" ]; then
mkdir -p "$(dirname $ZINIT_HOME)"
git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
fi
# Start tmux if not already in tmux. #extend path
# zstyle ':z4h:' start-tmux command tmux -u new -A -D -t z4h
zstyle ':z4h:' start-tmux command byobu
# Whether to move prompt to the bottom when zsh starts and on Ctrl+L.
zstyle ':z4h:' prompt-at-bottom 'no'
# Mark up shell's output with semantic information.
zstyle ':z4h:' term-shell-integration 'yes'
# Right-arrow key accepts one character ('partial-accept') from
# command autosuggestions or the whole thing ('accept')?
zstyle ':z4h:autosuggestions' forward-char 'accept'
# Recursively traverse directories when TAB-completing files.
zstyle ':z4h:fzf-complete' recurse-dirs 'no'
# Enable direnv to automatically source .envrc files.
zstyle ':z4h:direnv' enable 'no'
# Show "loading" and "unloading" notifications from direnv.
zstyle ':z4h:direnv:success' notify 'yes'
# Enable ('yes') or disable ('no') automatic teleportation of z4h over
# SSH when connecting to these hosts.
zstyle ':z4h:ssh:example-hostname1' enable 'yes'
zstyle ':z4h:ssh:*.example-hostname2' enable 'no'
# The default value if none of the overrides above match the hostname.
zstyle ':z4h:ssh:*' enable 'no'
# Send these files over to the remote host when connecting over SSH to the
# enabled hosts.
zstyle ':z4h:ssh:*' send-extra-files '~/.nanorc' '~/.env.zsh'
# Clone additional Git repositories from GitHub.
#
# This doesn't do anything apart from cloning the repository and keeping it
# up-to-date. Cloned files can be used after `z4h init`. This is just an
# example. If you don't plan to use Oh My Zsh, delete this line.
z4h install ohmyzsh/ohmyzsh || return
# Install or update core components (fzf, zsh-autosuggestions, etc.) and
# initialize Zsh. After this point console I/O is unavailable until Zsh
# is fully initialized. Everything that requires user interaction or can
# perform network I/O must be done above. Everything else is best done below.
z4h init || return
# Extend PATH.
path=(~/bin $path) path=(~/bin $path)
path=(~/.local/bin $path)
# Export environment variables. # Load Zinit
export GPG_TTY=$TTY source "${ZINIT_HOME}/zinit.zsh"
# Source additional local files if they exist. # Powerlevel10k
z4h source ~/.env.zsh zinit ice depth=1; zinit light romkatv/powerlevel10k
# Use additional Git repositories pulled in with `z4h install`. # add zinit
# zinit light zsh-users/zsh-syntax-highlighting
# This is just an example that you should delete. It does nothing useful. zinit light zsh-users/zsh-completions
z4h source ohmyzsh/ohmyzsh/lib/diagnostics.zsh # source an individual file zinit light zsh-users/zsh-autosuggestions
z4h load ohmyzsh/ohmyzsh/plugins/emoji-clock # load a plugin zinit light Aloxaf/fzf-tab
# Define key bindings. zinit snippet OMZP::tmux
z4h bindkey z4h-backward-kill-word Ctrl+Backspace Ctrl+H
z4h bindkey z4h-backward-kill-zword Ctrl+Alt+Backspace
z4h bindkey undo Ctrl+/ Shift+Tab # undo the last command line change # Load completions
z4h bindkey redo Alt+/ # redo the last undone command line change autoload -U compinit && compinit
zinit cdreplay -q
z4h bindkey z4h-cd-back Alt+Left # cd into the previous directory # keybindings
z4h bindkey z4h-cd-forward Alt+Right # cd into the next directory bindkey -e
z4h bindkey z4h-cd-up Alt+Up # cd into the parent directory bindkey '^p' history-search-backward
z4h bindkey z4h-cd-down Alt+Down # cd into a child directory bindkey '^n' history-search-forward
# Autoload functions. # History
autoload -Uz zmv HISTSIZE=5000
HISTFILE=~/.zsh_history
SAVEHIST=$HISTSIZE
HISTDUP=erase
setopt appendhistory
setopt sharehistory
setopt hist_ignore_space
setopt hist_ignore_all_dups
setopt hist_save_no_dups
setopt hist_ignore_dups
setopt hist_find_no_dups
# Define functions and completions. # completion styling
function md() { [[ $# == 1 ]] && mkdir -p -- "$1" && cd -- "$1" } zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
compdef _directories md zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*' menu no
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
# Define named directories: ~w <=> Windows home directory on WSL. # aliases
[[ -z $z4h_win_home ]] || hash -d w=$z4h_win_home alias ls='eza'
alias cat='bat'
# Define aliases. alias tree='eza --tree'
alias tree='tree -a -I .git'
# Add flags to existing aliases.
alias ls="${aliases[ls]:-ls} -A"
# Set shell options: http://zsh.sourceforge.net/Doc/Release/Options.html.
setopt glob_dots # no special treatment for file names with a leading dot
setopt no_auto_menu # require an extra TAB press to open the completion menu
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
eval $(thefuck --alias)
eval $(thefuck --alias fk)
export FZF_DEFAULT_COMMAND="fd --hidden --strip-cwd-prefix --exclude .git" export FZF_DEFAULT_COMMAND="fd --hidden --strip-cwd-prefix --exclude .git"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="fd --type=d --hidden --strip-cwd-prefix --exclude .git" export FZF_ALT_C_COMMAND="fd --type=d --hidden --strip-cwd-prefix --exclude .git"
export FZF_DEFAULT_OPTS='--color=fg:#f8f8f2,bg:#282a36,hl:#bd93f9 --color=fg+:#f8f8f2,bg+:#44475a,hl+:#bd93f9 --color=info:#ffb86c,prompt:#50fa7b,pointer:#ff79c6 --color=marker:#ff79c6,spinner:#ffb86c,header:#6272a4'
_fzf_compgen_path() { _fzf_compgen_path() {
fd --hidden --exclude .git . "$1" fd --hidden --exclude .git . "$1"
} }
_fzf_compgen_dir() { _fzf_compgen_dir() {
fd --type=d --hidden --exclude .git . "$1" fd --type=d --hidden --exclude .git . "$1"
} }
source ~/fzf-git.sh/fzf-git.sh source ~/fzf-git.sh/fzf-git.sh
@@ -130,19 +89,18 @@ export FZF_CTRL_T_OPTS="--preview 'bat -n --color=always --line-range :500 {}'"
export FZF_ALT_C_OPTS="--preview 'eza --tree --color=always {} | head -200'" export FZF_ALT_C_OPTS="--preview 'eza --tree --color=always {} | head -200'"
_fzf_comprun() { _fzf_comprun() {
local command=$1 local command=$1
shift shift
case "$command" in
case "$command" in cd) fzf --preview 'eza --tree --color=always {} | head -200' "$@" ;;
cd) fzf --preview 'eza --tree --color=always {} | head -200' "$@" ;; export|unset) fzf --preview "eval 'echo \$' {}" "$@" ;;
export|unset) fzf --preview "eval 'echo \$' {}" "$@" ;; ssh) fzf --preview 'dig {}' "$@" ;;
ssh) fzf --preview 'dig {}' "$@" ;; *) fzf --preview 'bat -n --color=always --line-range :500 {}' "$@" ;;
*) fzf --preview 'bat -n --color=always --line-range :500 {}' "$@" ;; esac
esac
} }
export BAT_THEME=Dracula export BAT_THEME=Dracula
eval "$(zoxide init zsh)" eval "$(zoxide init zsh)"
alias cd='z'
alias cd="z" eval $(thefuck --alias)
eval $(thefuck --alias fk)

View File

@@ -1,9 +0,0 @@
sudo apt update
sudo apt install -y gpg
sudo mkdir -p /etc/apt/keyrings
wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | sudo gpg --dearmor -o /etc/apt/keyrings/gierens.gpg
echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | sudo tee /etc/apt/sources.list.d/gierens.list
sudo chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list
sudo apt update
sudo apt install -y eza

View File

@@ -1 +0,0 @@
sh -c "$(wget -O- https://raw.githubusercontent.com/romkatv/zsh4humans/v5/install)"

1
lk-installers/install-apt-pkgs Executable file
View File

@@ -0,0 +1 @@
sudo apt install tmux neovim vim-nox btop htop neofetch curl wget tldr git zip unzip rar unrar --no-install-recommends

17
lk-installers/install-eza Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
# Check if Eza is installed
if dpkg-query -Wf'${db:Status-abbrev}' eza; then
sudo apt install -y eza
else
sudo apt update
sudo apt install gpg
sudo mkdir -p /etc/apt/keyrings
wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | sudo gpg --dearmor -o /etc/apt/keyrings/gierens.gpg
echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | sudo tee /etc/apt/sources.list.d/gierens.list
sudo chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list
sudo apt update
sudo apt install -y eza
fi

2
lk-installers/install-ohmyposh Executable file
View File

@@ -0,0 +1,2 @@
curl -s https://ohmyposh.dev/install.sh | bash -s

View File

@@ -0,0 +1 @@
git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm

View File

@@ -1,9 +1,8 @@
rm -rf ~/.cache/zsh4humans/v5/fzf git clone --depth 1 https://github.com/junegunn/fzf.git ~/.cache/lk-tools/fzf
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.cache/zsh4humans/v5/fzf ~/.cache/lk-tools/fzf/install
~/.cache/zsh4humans/v5/fzf/install git clone https://github.com/junegunn/fzf-git.sh.git ~/fzf-git.sh
curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh
wget -O /tmp/bat.deb https://github.com/sharkdp/bat/releases/download/v0.24.0/bat_0.24.0_amd64.deb wget -O /tmp/bat.deb https://github.com/sharkdp/bat/releases/download/v0.24.0/bat_0.24.0_amd64.deb
sudo apt install /tmp/bat.deb sudo apt install /tmp/bat.deb
sudo apt install fd-find wget -O /tmp/fdfind.deb https://github.com/sharkdp/fd/releases/download/v10.1.0/fd_10.1.0_amd64.deb
ln -s $(which fdfind) ~/.local/bin/fd sudo apt install /tmp/fdfind.deb
git clone https://github.com/junegunn/fzf-git.sh.git ~/fzf-git.sh

View File

@@ -1,2 +0,0 @@
cp ~/.zshrc .
cp ~/.p10k.zsh .