updated prompt
This commit is contained in:
162
.zshrc
162
.zshrc
@@ -1,120 +1,79 @@
|
||||
# Personal Zsh configuration file. It is strongly recommended to keep all
|
||||
# shell customization and configuration (including exported environment
|
||||
# variables such as PATH) in this file or in files sourced from it.
|
||||
#
|
||||
# Documentation: https://github.com/romkatv/zsh4humans/blob/v5/README.md.
|
||||
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
||||
# Initialization code that may require console input (password prompts, [y/n]
|
||||
# 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
|
||||
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
||||
fi
|
||||
|
||||
# Periodic auto-update on Zsh startup: 'ask' or 'no'.
|
||||
# You can manually run `z4h update` to update everything.
|
||||
zstyle ':z4h:' auto-update 'no'
|
||||
# Ask whether to auto-update this often; has no effect if auto-update is 'no'.
|
||||
zstyle ':z4h:' auto-update-days '28'
|
||||
# Set ZINIT Home
|
||||
ZINIT_HOME="${HOME}/.config/zinit/zinit.git"
|
||||
ZSH_TMUX_AUTOSTART=true
|
||||
|
||||
# Keyboard type: 'mac' or 'pc'.
|
||||
zstyle ':z4h:bindkey' keyboard 'pc'
|
||||
# Download ZINIT
|
||||
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.
|
||||
# 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.
|
||||
#extend path
|
||||
path=(~/bin $path)
|
||||
path=(~/.local/bin $path)
|
||||
|
||||
# Export environment variables.
|
||||
export GPG_TTY=$TTY
|
||||
# Load Zinit
|
||||
source "${ZINIT_HOME}/zinit.zsh"
|
||||
|
||||
# Source additional local files if they exist.
|
||||
z4h source ~/.env.zsh
|
||||
# Powerlevel10k
|
||||
zinit ice depth=1; zinit light romkatv/powerlevel10k
|
||||
|
||||
# Use additional Git repositories pulled in with `z4h install`.
|
||||
#
|
||||
# This is just an example that you should delete. It does nothing useful.
|
||||
z4h source ohmyzsh/ohmyzsh/lib/diagnostics.zsh # source an individual file
|
||||
z4h load ohmyzsh/ohmyzsh/plugins/emoji-clock # load a plugin
|
||||
# add zinit
|
||||
zinit light zsh-users/zsh-syntax-highlighting
|
||||
zinit light zsh-users/zsh-completions
|
||||
zinit light zsh-users/zsh-autosuggestions
|
||||
zinit light Aloxaf/fzf-tab
|
||||
|
||||
# Define key bindings.
|
||||
z4h bindkey z4h-backward-kill-word Ctrl+Backspace Ctrl+H
|
||||
z4h bindkey z4h-backward-kill-zword Ctrl+Alt+Backspace
|
||||
zinit snippet OMZP::tmux
|
||||
|
||||
z4h bindkey undo Ctrl+/ Shift+Tab # undo the last command line change
|
||||
z4h bindkey redo Alt+/ # redo the last undone command line change
|
||||
# Load completions
|
||||
autoload -U compinit && compinit
|
||||
zinit cdreplay -q
|
||||
|
||||
z4h bindkey z4h-cd-back Alt+Left # cd into the previous directory
|
||||
z4h bindkey z4h-cd-forward Alt+Right # cd into the next directory
|
||||
z4h bindkey z4h-cd-up Alt+Up # cd into the parent directory
|
||||
z4h bindkey z4h-cd-down Alt+Down # cd into a child directory
|
||||
# keybindings
|
||||
bindkey -e
|
||||
bindkey '^p' history-search-backward
|
||||
bindkey '^n' history-search-forward
|
||||
|
||||
# Autoload functions.
|
||||
autoload -Uz zmv
|
||||
# History
|
||||
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.
|
||||
function md() { [[ $# == 1 ]] && mkdir -p -- "$1" && cd -- "$1" }
|
||||
compdef _directories md
|
||||
# completion styling
|
||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
||||
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.
|
||||
[[ -z $z4h_win_home ]] || hash -d w=$z4h_win_home
|
||||
|
||||
# Define aliases.
|
||||
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
|
||||
# aliases
|
||||
alias ls='eza'
|
||||
alias cat='bat'
|
||||
alias tree='eza --tree'
|
||||
|
||||
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
||||
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.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_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
|
||||
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() {
|
||||
fd --hidden --exclude .git . "$1"
|
||||
@@ -132,7 +91,6 @@ export FZF_ALT_C_OPTS="--preview 'eza --tree --color=always {} | head -200'"
|
||||
_fzf_comprun() {
|
||||
local command=$1
|
||||
shift
|
||||
|
||||
case "$command" in
|
||||
cd) fzf --preview 'eza --tree --color=always {} | head -200' "$@" ;;
|
||||
export|unset) fzf --preview "eval 'echo \$' {}" "$@" ;;
|
||||
@@ -140,9 +98,9 @@ _fzf_comprun() {
|
||||
*) fzf --preview 'bat -n --color=always --line-range :500 {}' "$@" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
export BAT_THEME=Dracula
|
||||
|
||||
eval "$(zoxide init zsh)"
|
||||
alias cd='z'
|
||||
|
||||
alias cd="z"
|
||||
eval $(thefuck --alias)
|
||||
eval $(thefuck --alias fk)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
sh -c "$(wget -O- https://raw.githubusercontent.com/romkatv/zsh4humans/v5/install)"
|
||||
1
lk-installers/install-apt-pkgs
Executable file
1
lk-installers/install-apt-pkgs
Executable 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
17
lk-installers/install-eza
Executable 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
2
lk-installers/install-ohmyposh
Executable file
@@ -0,0 +1,2 @@
|
||||
curl -s https://ohmyposh.dev/install.sh | bash -s
|
||||
|
||||
1
lk-installers/install-tmux-plugins
Executable file
1
lk-installers/install-tmux-plugins
Executable file
@@ -0,0 +1 @@
|
||||
git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm
|
||||
@@ -1,9 +1,8 @@
|
||||
rm -rf ~/.cache/zsh4humans/v5/fzf
|
||||
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.cache/zsh4humans/v5/fzf
|
||||
~/.cache/zsh4humans/v5/fzf/install
|
||||
curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh
|
||||
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.cache/lk-tools/fzf
|
||||
~/.cache/lk-tools/fzf/install
|
||||
git clone https://github.com/junegunn/fzf-git.sh.git ~/fzf-git.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
|
||||
sudo apt install /tmp/bat.deb
|
||||
sudo apt install fd-find
|
||||
ln -s $(which fdfind) ~/.local/bin/fd
|
||||
git clone https://github.com/junegunn/fzf-git.sh.git ~/fzf-git.sh
|
||||
wget -O /tmp/fdfind.deb https://github.com/sharkdp/fd/releases/download/v10.1.0/fd_10.1.0_amd64.deb
|
||||
sudo apt install /tmp/fdfind.deb
|
||||
@@ -1,2 +0,0 @@
|
||||
cp ~/.zshrc .
|
||||
cp ~/.p10k.zsh .
|
||||
Reference in New Issue
Block a user