update shell complition, functions and aliases
This commit is contained in:
@@ -6,6 +6,16 @@ env_shell_expand = true
|
||||
_.file = ".secrets.yaml"
|
||||
SOPS_AGE_KEY_FILE = "$HOME/.config/sops/.age"
|
||||
TFENV_REMOTE = "https://hashicorp-releases.yandexcloud.net"
|
||||
K9S_FEATURE_GATE_NODE_SHELL = true
|
||||
|
||||
[shell_alias]
|
||||
nvimc = "nvim ~/.config"
|
||||
nvimm = "nvim ~/.config/mise/config.toml"
|
||||
nvimn = "nvim ~/.config/nvim"
|
||||
nvimz = "nvim ~/.config/zsh/.zshrc"
|
||||
|
||||
gh = "cd ~ && clear"
|
||||
gw = "cd ~/work && clear"
|
||||
gp = "cd ~/personal && clear"
|
||||
|
||||
ytr = "fabric-ai -p rate_content -g ru -s -y"
|
||||
|
||||
64
zsh/.zshrc
64
zsh/.zshrc
@@ -69,30 +69,44 @@ source $ZSH/oh-my-zsh.sh
|
||||
export EDITOR='nvim'
|
||||
fi
|
||||
|
||||
# Set personal aliases, overriding those provided by oh-my-zsh libs,
|
||||
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
|
||||
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
|
||||
# For a full list of active aliases, run `alias`.
|
||||
# YandexCloud CLI completion
|
||||
# NOTE: Versions checked from utility version output
|
||||
source "$HOMEBREW_PREFIX/Caskroom/yandex-cloud-cli/$(yc --version | egrep -o "([0-9]{1,}\.)+[0-9]{1,}")/yandex-cloud-cli/completion.zsh.inc"
|
||||
|
||||
#compdef opencode
|
||||
###-begin-opencode-completions-###
|
||||
#
|
||||
# Example aliases
|
||||
# alias zshconfig="mate ~/.zshrc"
|
||||
# alias ohmyzsh="mate ~/.oh-my-zsh"
|
||||
alias vi="nvim"
|
||||
alias vim="nvim"
|
||||
alias vimdiff="nvim -d"
|
||||
alias ovim="/usr/bin/vim"
|
||||
# yargs command completion script
|
||||
#
|
||||
# Installation: opencode completion >> ~/.zshrc
|
||||
# or opencode completion >> ~/.zprofile on OSX.
|
||||
#
|
||||
_opencode_yargs_completions()
|
||||
{
|
||||
local reply
|
||||
local si=$IFS
|
||||
IFS=$'
|
||||
' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" opencode --get-yargs-completions "${words[@]}"))
|
||||
IFS=$si
|
||||
if [[ ${#reply} -gt 0 ]]; then
|
||||
_describe 'values' reply
|
||||
else
|
||||
_default
|
||||
fi
|
||||
}
|
||||
if [[ "'${zsh_eval_context[-1]}" == "loadautofunc" ]]; then
|
||||
_opencode_yargs_completions "$@"
|
||||
else
|
||||
compdef _opencode_yargs_completions opencode
|
||||
fi
|
||||
###-end-opencode-completions-###
|
||||
|
||||
alias vimz="nvim ~/.config/zsh/.zshrc"
|
||||
alias vimn="nvim ~/.config/nvim"
|
||||
|
||||
alias gh="cd ~ && clear"
|
||||
alias gw="cd ~/work && clear"
|
||||
alias gp="cd ~/personal && clear"
|
||||
|
||||
# Functions
|
||||
# Add Docker Desktop for Mac (docker)
|
||||
export PATH="$PATH:/Applications/Docker.app/Contents/Resources/bin/"
|
||||
|
||||
## Functions
|
||||
#Generate strong password
|
||||
pwg() {
|
||||
function pwg() {
|
||||
pwgen -cny -r \[\]\{\}\(\)\"\'\-\|\:\;\`\,\<\>\$\= 32 1
|
||||
}
|
||||
|
||||
@@ -106,9 +120,7 @@ function y() {
|
||||
rm -f -- "$tmp"
|
||||
}
|
||||
|
||||
# YandexCloud CLI completion
|
||||
# NOTE: Versions checked from utility version output
|
||||
source "$HOMEBREW_PREFIX/Caskroom/yandex-cloud-cli/$(yc --version | egrep -o "([0-9]{1,}\.)+[0-9]{1,}")/yandex-cloud-cli/completion.zsh.inc"
|
||||
|
||||
# Add Docker Desktop for Mac (docker)
|
||||
export PATH="$PATH:/Applications/Docker.app/Contents/Resources/bin/"
|
||||
#DuckDuckGo Search with w3m
|
||||
function ddgs(){
|
||||
w3m https://lite.duckduckgo.com/html/\?q\="$@"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user