Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen Support - Servername in Title #2

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c516284
RED colour for root user
Apr 7, 2015
6caa2f3
Mac Support for ps and ls
argo1984 Apr 7, 2015
bd8d40e
Screen Tab Title to Hostname
May 24, 2015
3ad626c
Repo
argo1984 May 25, 2015
852dc33
Updated master branch of deployment repo to point to latest head of s…
May 25, 2015
afdf4e3
Easier installation
argo1984 May 30, 2015
bc8f627
fix typo
argo1984 May 30, 2015
5cb06a9
Complete Hostnames and read it from .ssh/known_hosts and .ssh/config
argo1984 Aug 3, 2015
04a5a4d
Updated master branch of deployment repo to point to latest head of s…
argo1984 Sep 4, 2016
b916775
Adding zsh-completions
Mar 8, 2017
0b04632
Adding completion for hostnames form /etc/hosts
Mar 8, 2017
37d0758
Fix backward and forward char on MacOS, Forward word Alt + Arrow
Mar 27, 2017
1bb643b
Delete zsh-completions submodule
argo1984 May 7, 2017
8e02011
Readd zsh-completions
argo1984 May 7, 2017
0223291
Updated master branch of deployment repo to point to latest head of s…
argo1984 May 7, 2017
73d5dbb
git cleanup
Sep 14, 2018
18dc227
Full FQDN
Nov 28, 2018
831bc61
Switch backward-delete-char more compatible
May 11, 2020
22a8c8b
Merge branch 'master' of github.com:argo1984/zshconfig
May 11, 2020
3da6d3f
Updated master branch of deployment repo to point to latest head of s…
argo1984 May 11, 2020
e346a97
Change Repo for git-prompt
argo1984 May 11, 2020
cf8c1dc
Updated master branch of deployment repo to point to latest head of s…
argo1984 May 11, 2020
0a88846
Updated master branch of deployment repo to point to latest head of s…
argo1984 May 11, 2020
85293d0
Remove submodule
argo1984 May 13, 2020
836a320
Add Submodule
argo1984 May 13, 2020
e4d5751
Change Path
argo1984 May 13, 2020
d7830b6
Updated master branch of deployment repo to point to latest head of s…
argo1984 May 13, 2020
2bee1b2
Updated master branch of deployment repo to point to latest head of s…
argo1984 Jan 5, 2021
e9d22a1
complete kubectl and terraform
Sep 10, 2021
9ab53bf
fix backspace issues
Sep 14, 2021
48b333f
kube-ps1
Sep 17, 2021
540f440
activate kube-ps1
Sep 17, 2021
08f3f48
Add Powerlevel10k
Sep 20, 2021
f916e24
fix stty erase
Sep 20, 2021
65e86b1
Instant Prompt Quiet
Sep 20, 2021
0815d4b
POWERLEVEL9K_TRANSIENT_PROMPT=always
Sep 21, 2021
4260ea9
check if terraform and kubectl are installed
Sep 28, 2021
c677657
remove kube-ps1 - it is done by powerlevel10k
Sep 28, 2021
23d88d4
Remove kube_ps1 from prompt
argo1984 Sep 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
[submodule "git-prompt"]
path = git-prompt
url = https://github.com/olivierverdier/zsh-git-prompt.git
[submodule "zsh-completions"]
path = plugins/zsh-completions
url = https://github.com/argo1984/zsh-completions.git
[submodule "zsh-git-prompt"]
path = plugins/zsh-git-prompt
url = https://github.com/argo1984/zsh-git-prompt.git
[submodule "plugins/kube-ps1"]
path = plugins/kube-ps1
url = https://github.com/jonmosco/kube-ps1.git
[submodule "themes/powerlevel10k"]
path = themes/powerlevel10k
url = https://github.com/romkatv/powerlevel10k.git
1,641 changes: 1,641 additions & 0 deletions .p10k.zsh

Large diffs are not rendered by default.

107 changes: 85 additions & 22 deletions .zshrc.core
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
############### backspace fix ########
stty erase 
stty erase ""

############### colors ###############
LS_COLORS=''
Expand Down Expand Up @@ -54,28 +54,27 @@ bindkey "\eOF" end-of-line
bindkey "\e[4~" end-of-line
bindkey "\e[F" end-of-line

bindkey "\eOc" forward-word
bindkey "\e[1;5C" forward-word
bindkey "\eOC" forward-word
bindkey "\eO5C" forward-word

bindkey "\eOd" backward-word
bindkey "\e[1;5D" backward-word
bindkey "\eOD" backward-word
bindkey "\eO5D" backward-word
bindkey "^[[1;3C" forward-word # [Alt-RightArrow] - move forward one word
bindkey '[C' forward-word # [Alt-RightArrow] - move forward one word MacOS
bindkey "^[[1;3D" backward-word # [Alt-LeftArrow] - move backward one word
bindkey '[D' backward-word # [Alt-LeftArrow] - move backward one word MacOS

bindkey "\e[3~" delete-char-or-list
bindkey "" delete-char-or-list

bindkey "OM" accept-line

bindkey "^A" beginning-of-line
bindkey "^B" backward-char
bindkey "^D" delete-char-or-list
bindkey "^E" end-of-line
bindkey "^F" forward-char
bindkey "^G" send-break
bindkey "^H" backward-delete-char

# [Backspace] - delete backward
bindkey -M emacs '^?' backward-delete-char
bindkey -M viins '^?' backward-delete-char
bindkey -M vicmd '^?' backward-delete-char
bindkey '^?' backward-delete-char

bindkey "^I" expand-or-complete
bindkey "^J" accept-line
bindkey "^K" kill-line
Expand All @@ -100,21 +99,30 @@ alias rm='rm -i'
alias mv='mv -i'
alias cp='cp -i'

alias ls='ls --color=yes -F'
UNAMESTR=`uname`

if [ $UNAMESTR = 'Darwin' ]
then
alias ls='ls -F'
alias ps='ps auxw'
else
alias ls='ls --color=yes -F'
alias ps='ps aufwx'
fi
alias l='ls -alh'
alias ll='ls -lh'
alias ..='cd ..'
alias ...='cd ..; cd ..'
alias ...='cd ../..'
alias ....='cd ../../../
alias cdd='cd -' # goto last dir cd'ed from
alias ps='ps aufxw'
alias z='vim ~/.zsh/.zshrc.core && source ~/.zshrc'
alias vim='vim -o'

# screen
alias sls='screen -ls'
alias sr='screen -dRR'
alias ss='screen -S'
alias sx='screen -x'
# alias sls='screen -ls'
# alias sr='screen -dRR'
# alias ss='screen -S'
# alias sx='screen -x'

# git
alias g='git status'
Expand All @@ -128,6 +136,7 @@ alias ga='git add'
alias gaa='git add -A'
alias gcm='git commit'
alias gcma='git commit --amend'
alias gclb="git remote prune origin && git branch -vv | grep 'origin/.*: gone]' | awk '{print \$1}' | xargs git branch -d"
alias gd='git diff --color'
alias gdc='git diff --color --cached'
alias gdw='git diff -w'
Expand All @@ -143,6 +152,12 @@ alias grs='git rebase --skip'
alias grom='git rebase origin/master'
alias gsu='git submodule update'

alias devopsrepo='cd ~/xempusgit/plat/devops'
alias managerrepo='cd ~/xempusgit/xbm/manager'

# alias ^H='stty erase ^H'
# alias ^?='stty errase ^?'

############### functions #############

# git
Expand All @@ -154,6 +169,9 @@ function gri() {
fi
}

#zsh-completions
fpath=(plugins/zsh-completions/src $fpath)

############### modules ###############
autoload colors zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
Expand Down Expand Up @@ -294,13 +312,58 @@ compctl -g "*(-/) .*(-/)" cd rmdir


############### git prompt ###########
source ~/.zsh/git-prompt/zshrc.sh
source ~/.zsh/plugins/zsh-git-prompt/zshrc.sh

if command -v kubectl > /dev/null; then
############ kubectl completion ######
source <(kubectl completion zsh)
fi

########### powerlevel 10k ###########
source ~/.zsh/themes/powerlevel10k/powerlevel10k.zsh-theme
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.zsh/.p10k.zsh ]] || source ~/.zsh/.p10k.zsh

######## terraform completion #######
if command -v terraform > /dev/null; then
complete -o nospace -C $(which terraform) terraform
fi

ZSH_THEME_GIT_PROMPT_CONFLICTS="%{$fg_bold[red]%}✖"
ZSH_THEME_GIT_PROMPT_CHANGED="%{$fg_bold[blue]%}✚"

setopt promptsubst
setopt promptpercent
if [ "$EUID" -ne 0 ]
then
PROMPT='
%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%M%{$reset_color%}: %{$fg_bold[green]%}%~%{$reset_color%} $(git_super_status)
> '
else
PROMPT='
%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[green]%}%~%{$reset_color%} $(git_super_status)
%{$fg[red]%}%n%{$reset_color%}@%{$fg[yellow]%}%M%{$reset_color%}: %{$fg_bold[green]%}%~%{$reset_color%} $(git_super_status)
> '
fi

if [[ ${TERM} == "screen-bce" || ${TERM} == "screen" ]]; then
precmd () { print -Pn "\033k\033\134\033k%m[%1d]\033\134" }
preexec () { print -Pn "\033k\033\134\033k%m[$1]\033\134" }
else
precmd () { print -Pn "\e]0;%n@%m: %~\a" }
preexec () { print -Pn "\e]0;%n@%m: $1\a" }
fi

h=()
if [[ -r ~/.ssh/config ]]; then
h=($h ${${${(@M)${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*})
fi
if [[ -r ~/.ssh/known_hosts ]]; then
h=($h ${${${(f)"$(cat ~/.ssh/known_hosts{,2} || true)"}%%\ *}%%,*}) 2>/dev/null
fi
if [[ -r /etc/hosts ]]; then
h=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}}
fi
if [[ $#h -gt 0 ]]; then
zstyle ':completion:*:ssh:*' hosts $h
zstyle ':completion:*:slogin:*' hosts $h
fi
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Zsh 4.3+ Config directory
1. Backup your ~/.zsh/ directory in case u have such
2. Clone the repository under your `~/` directory:

cd ~ && git clone git://github.com/naglik/zshconfig .zsh --recursive
cd ~ && git clone git://github.com/argo1984/zshconfig .zsh --recursive

3. Source the config files in your `.zshrc`

source ~/.zsh/.zshrc.core
cd ~ && echo "source ~/.zsh/.zshrc.core" > .zshrc
1 change: 0 additions & 1 deletion git-prompt
Submodule git-prompt deleted from cb628e
1 change: 1 addition & 0 deletions plugins/kube-ps1
Submodule kube-ps1 added at 54271c
1 change: 1 addition & 0 deletions plugins/zsh-completions
Submodule zsh-completions added at fa1c72
1 change: 1 addition & 0 deletions plugins/zsh-git-prompt
Submodule zsh-git-prompt added at d01091
1 change: 1 addition & 0 deletions themes/powerlevel10k
Submodule powerlevel10k added at 7a72ac