General changes + vim changes
This commit is contained in:
@@ -16,3 +16,6 @@ alias ll='ls -l'
|
||||
# WG
|
||||
alias wgon='wg-quick up ~/Downloads/wg0.conf'
|
||||
alias wgoff='wg-quick down ~/Downloads/wg0.conf'
|
||||
|
||||
# nvim
|
||||
nv() { neovide $1 & }
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
setopt interactivecomments # VERY IMPORTANT LINE! Completions will be very bad without it
|
||||
|
||||
zinit ice as"completion"
|
||||
zstyle ':autocomplete:*' min-delay 0.5 # float
|
||||
zstyle ':autocomplete:*' min-input 2 # int
|
||||
zstyle ':autocomplete:*' insert-unambiguous no
|
||||
|
||||
zinit ice as "autocomplete"
|
||||
zinit light zsh-users/zsh-completions
|
||||
|
||||
zinit light marlonrichert/zsh-autocomplete
|
||||
|
||||
|
||||
@@ -31,3 +31,22 @@ split() {
|
||||
(kitty . &)
|
||||
}
|
||||
|
||||
APPLETS=("svelte" "react" "vite")
|
||||
|
||||
declare -A KNOWN_APPLETS=(
|
||||
["svelte"]="npm create svelte@latest"
|
||||
["react"]="npx create-next-app@latest"
|
||||
["vite"]="npm create vite@latest"
|
||||
)
|
||||
|
||||
create() {
|
||||
if [[ -n "$KNOWN_APPLETS[$1]" ]]; then
|
||||
eval "$KNOWN_APPLETS[$1]"
|
||||
else
|
||||
echo "$fg[red]FATAL:$fg[white] I don't know that applet"
|
||||
echo "USAGE: create <applet>"
|
||||
echo "APPLETS:"
|
||||
echo " $APPLETS"
|
||||
return 64
|
||||
fi
|
||||
}
|
||||
|
||||
27
zsh/git.sh
27
zsh/git.sh
@@ -1,27 +0,0 @@
|
||||
function git_prompt_info() {
|
||||
# If we are on a folder not tracked by git, get out.
|
||||
# Otherwise, check for hide-info at global and local repository level
|
||||
if ! __git_prompt_git rev-parse --git-dir &> /dev/null \
|
||||
|| [[ "$(__git_prompt_git config --get oh-my-zsh.hide-info 2>/dev/null)" == 1 ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Get either:
|
||||
# - the current branch name
|
||||
# - the tag name if we are on a tag
|
||||
# - the short SHA of the current commit
|
||||
local ref
|
||||
ref=$(__git_prompt_git symbolic-ref --short HEAD 2> /dev/null) \
|
||||
|| ref=$(__git_prompt_git describe --tags --exact-match HEAD 2> /dev/null) \
|
||||
|| ref=$(__git_prompt_git rev-parse --short HEAD 2> /dev/null) \
|
||||
|| return 0
|
||||
|
||||
# Use global ZSH_THEME_GIT_SHOW_UPSTREAM=1 for including upstream remote info
|
||||
local upstream
|
||||
if (( ${+ZSH_THEME_GIT_SHOW_UPSTREAM} )); then
|
||||
upstream=$(__git_prompt_git rev-parse --abbrev-ref --symbolic-full-name "@{upstream}" 2>/dev/null) \
|
||||
&& upstream=" -> ${upstream}"
|
||||
fi
|
||||
|
||||
echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${ref:gs/%/%%}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}"
|
||||
}
|
||||
@@ -13,5 +13,4 @@ zinit light zsh-users/zsh-syntax-highlighting
|
||||
zinit snippet OMZP::colored-man-pages
|
||||
zinit snippet OMZP::sudo
|
||||
zinit snippet OMZP::git
|
||||
zinit snippet OMZ::lib/git.zsh
|
||||
|
||||
|
||||
@@ -8,7 +8,12 @@ update_prompt() {
|
||||
# PROMPT+="%{$fg[yellow]%}$(git remote show | head -n 1)"
|
||||
# PROMPT+="%{$fg_bold[magenta] $(git_repo_name)"
|
||||
# PROMPT+="%{$fg_bold[blue]($(git_current_branch))%{$fg[white]%}:"
|
||||
PROMPT+="%{$fg[yellow]%}$(git remote show | head -n 1) %{$fg_bold[magenta]%}$(git_repo_name)%{$fg_bold[blue]%}($(git_current_branch))%{$fg[white]%}:"
|
||||
if [[ -n "$(git remote show)" ]]; then
|
||||
PROMPT+="%{$fg[yellow]%}$(git remote show | head -n 1)"
|
||||
else
|
||||
PROMPT+="%{$fg_bold[red]%}NO-REMOTE"
|
||||
fi
|
||||
PROMPT+=" %{$fg_bold[magenta]%}$(git_repo_name)%{$fg_bold[blue]%}($(git_current_branch))%{$fg[white]%}:"
|
||||
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user