-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_zshrc
More file actions
128 lines (106 loc) · 3.91 KB
/
dot_zshrc
File metadata and controls
128 lines (106 loc) · 3.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# Created by newuser for 5.9
. "$HOME/.local/bin/env"
# bindkey
bindkey -e
# Link to profile and brew environment
source ~/.profile
# Correct zsh-autosuggestions color
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=60'
# Aliases
alias l='eza -alF --icons'
alias ls='eza -alF --icons --total-size'
alias lt='eza -alF --icons -T -L3'
alias c='clear'
alias upd='sudo apt update -y && sudo apt full-upgrade -y && sudo apt autoremove -y && zinit self-update && zinit update --all && npm up && brew update && brew upgrade && brew autoremove && brew cleanup'
alias v='nvim'
alias p='pwd'
alias f='yazi'
alias tm='tmux'
alias lg='lazygit'
alias ld='lazydocker'
alias qw='qwen'
alias oc='opencode'
alias dl='git -c diff.external=difft log -p --ext-diff' # `git log` with patches shown with difftastic
alias ds='git -c diff.external=difft show --ext-diff' # Show the most recent commit with difftastic
alias df='git -c diff.external=difft diff' # Show an uncommitted changes with difftastic
alias ol-sw='ssh -p 4022 azureuser@20.91.218.96'
alias ol-kz='ssh -p 4022 dtukeev@62.113.59.27'
alias marzban='ssh -L 8000:localhost:8000 dtukeev@135.225.49.98'
alias devops-test='ssh -p 4022 dtukeev@20.91.202.5'
# Open buffer line in editor
autoload -Uz edit-command-line
zle -N edit-command-line
bindkey '^g^g' edit-command-line
# Qwen Code Headless Mode alias
# Load the Zsh hooks system (if not already loaded)
autoload -Uz add-zle-hook-widget
# The function that dynamically adjusts the cursor position
_qwq_cursor_fix() {
# Check if the flag was set by our command
if [[ $_QWQ_FLAG == 1 ]]; then
# ${BUFFER%%\"*} strips everything from the first quote to the end of the line.
# For 'qwen -p "" -y', this leaves just 'qwen -p '
local prefix=${BUFFER%%\"*}
# ${#prefix} gets the length of that remaining string (which is 8).
# We add 1 to step exactly one character past that first quote.
CURSOR=$(( ${#prefix} + 1 ))
# Reset the flag so it doesn't affect other commands
_QWQ_FLAG=0
fi
}
# Add the function to the line initialization hook
add-zle-hook-widget line-init _qwq_cursor_fix
# The command itself
qwq() {
print -z 'qwen -p "" -y'
_QWQ_FLAG=1
}
### Added by Zinit's installer
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
print -P "%F{33} %F{34}Installation successful.%f%b" || \
print -P "%F{160} The clone has failed.%f%b"
fi
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
# Load a few important annexes, without Turbo
# (this is currently required for annexes)
zinit light-mode for \
zdharma-continuum/zinit-annex-as-monitor \
zdharma-continuum/zinit-annex-bin-gem-node \
zdharma-continuum/zinit-annex-patch-dl \
zdharma-continuum/zinit-annex-rust
### End of Zinit's installer chunk
# Add plugins in zsh
zinit light zsh-users/zsh-completions
# Add snippets in zsh
zinit snippet OMZP::git
# Load completions
autoload -U compinit && compinit
zinit cdreplay -q
# Completion styling
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zinit light Aloxaf/fzf-tab
zinit light zsh-users/zsh-autosuggestions
zinit light zsh-users/zsh-syntax-highlighting
# 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
# Shetl integrations
source <(fzf --zsh)
eval "$(zoxide init zsh)"
eval "$(oh-my-posh init zsh --config /home/dtukeev/.omp_linux_conf.toml)"
export EDITOR="nvim"
export VISUAL="nvim"