Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • rspencer/awit-zsh-superawesome
1 result
Show changes
Commits on Source (47)
Showing
with 684 additions and 160 deletions
cache
zshrc.local
[submodule "oh-my-zsh"]
path = oh-my-zsh
url = https://github.com/robbyrussell/oh-my-zsh.git
[submodule "powerlevel9k"]
path = powerlevel9k
url = https://github.com/bhilburn/powerlevel9k.git
[submodule "awesome-terminal-fonts"]
path = awesome-terminal-fonts
url = https://github.com/gabrielelana/awesome-terminal-fonts.git
[submodule "zsh-syntax-highlighting"]
path = zsh-syntax-highlighting
url = https://github.com/zsh-users/zsh-syntax-highlighting.git
......@@ -2,7 +2,7 @@
AntiAliasFonts=true
BoldIntense=true
ColorScheme=AWIT-ZSH-SuperAwesome
Font=Hack Nerd Font,12,-1,0,50,0,0,0,0,0,Regular
Font=Hack,12,-1,0,50,0,0,0,0,0,Regular
UseFontLineChararacters=false
[Cursor Options]
......
This diff is collapsed.
# Requirements
* oh-my-zsh
* zsh-syntax-highlighting
* powerlevel9k
# Installing
# Checkout and initialize repository
cd ~
git clone ssh://git@gitlab.devlabs.linuxassist.net:608/allworldit/awit-zsh-superawesome.git .zsh
cd .zsh
git submodule update --recursive --init
cd ..
# Activate ZSH
# Activate the configuration
ln -s .zsh/zshrc .zshrc
# Install fonts
mkdir ~/.fonts
cp fonts/*.ttf ~/.fonts/
fc-cache -fv ~/.fonts
# For Konsole
cp AWIT-ZSH-SuperAwesome.profile ~/.local/share/konsole/
cp AWIT-ZSH-SuperAwesome.colorscheme ~/.local/share/konsole/
Select the "AWIT-ZSH-SuperAwesome" profile as default in Konsole's profile manager.
# Customizing
Customizing can be done by adding files to ~/.zsh/zshrc_local.d/ directory and editing the ~/.zsh/zshrc.local file.
If you have something awesome to contribute, please consider adding it to zshrc.d/.
# Oh My Zsh
This is updated by running
cd oh-my-zsh
git pull
cd ..
cd powerlevel9k
git pull
cd ..
cd zsh-syntax-highlighting
git pull
cd ..
The fonts/ is a download of the complete fonts in https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/Hack
# Ignore everything in this directory
*
# Except this file
!.gitignore
# compsys initialization
autoload -U compinit
compinit
# Get an array of known SSH host names after deleting:
# - Everything after the first column of host names or IPs
# - Square brackets and attached port numbers
# - IP addresses
# - Encrypted host names
hosts=( `sed -e 's/[, ].*//g' -e 's/\[\([^]]*\)\].*/\1/' -e '/^[0-9]\+/d' -e '/^|1|/d' $HOME/.ssh/known_hosts` )
zstyle ':completion:*:hosts' hosts $hosts
#!/bin/zsh
die() {
echo "$1"
exit 1
}
grep -q '^|1|' ~/.ssh/known_hosts && die "ERROR: ~/.ssh/known_hosts is hashed. Aborting!
Please see this contributions README.md for more information."
if [ ! -e ~/.zsh/completion/_awit-ssh ]; then
# Install
ln -s ~/.zsh/contrib/awit-ssh-completion/_awit-ssh ~/.zsh/completion/
echo "Installed ~/.zsh/completion/_awit-ssh"
else
# Uninstall
rm -f ~/.zsh/completion/_awit-ssh
echo "Uninstalled ~/.zsh/completion/_awit-ssh"
fi
if [ ! -e ~/.zsh/zshrc.d/51-completion-awit-ssh.zsh ]; then
# Install
ln -s ~/.zsh/contrib/awit-ssh-completion/51-completion-awit-ssh.zsh ~/.zsh/zshrc_local.d/
echo "Installed ~/.zsh/zshrc.d/51-completion-awit-ssh.zsh"
else
# Uninstall
rm -f ~/.zsh/zshrc.d/51-completion-awit-ssh.zsh ~/.zsh/zshrc_local.d/51-completion-awit-ssh.zsh
echo "Uninstalled ~/.zsh/zshrc.d/51-completion-awit-ssh.zsh and ~/.zsh/zshrc_local.d/51-completion-awit-ssh.zsh"
fi
# awit-ssh Completion
If you want to use awit-ssh completion with zsh you first need to clean up your ~/.ssh/known_hosts file if it is hashed.
Run the follow and if you see any number other than zero, your ~/.ssh/known_hosts file is hashed
grep -c '^|1|' ~/.ssh/known_hosts
Since you need the file unencrypted make a backup of ~/.ssh/known_hosts and then add the following lines to the top of ~/.ssh/config
Host *
HashKnownHosts no
Then delete the hashed lines
sed -i '/^|1|/d' ~/.ssh/known_hosts
Going forward host names will be added in plain text. You'll be prompted to re-add the deleted hosts names as you log in to each server again.
#compdef awit-ssh
local curcontext="$curcontext" state line expl ret=1
local -a _comp_priv_prefix
_arguments -C \
'(-?)--help[display help information]' \
'--version[display version information]' \
'--forward-agent[forward the ssh-agent socket]' \
'--knock[knock on HOST:PORT to gain access]' \
'--rsync[use rsync to rsync data from remote server to DEST]' \
'--libvirt-vnc[connect to remote VNC server HOST:PORT]' \
'1:remote host name:->userhost' \
'*:::args:_normal' && ret=0
case $state in
userhost)
if compset -P '*@'; then
_wanted hosts expl 'remote host name' _ssh_hosts && ret=0
elif compset -S '@*'; then
_wanted users expl 'login name' _combination -s '[:@]' my-accounts users-hosts users -S '' && ret=0
else
_alternative \
'hosts:remote host name:_ssh_hosts' \
'users:login name:_combination -s "[:@]" my-accounts users-hosts users -qS@' && ret=0
fi
;;
esac
return ret
# https://github.com/robbyrussell/oh-my-zsh/wiki/Customization#overriding-internals
*.zsh
# https://github.com/robbyrussell/oh-my-zsh/wiki/Customization#overriding-internals
*.zsh
# https://github.com/robbyrussell/oh-my-zsh/wiki/Customization#overriding-and-adding-plugins
#
# Ignore everything in this directory
*
# Except this file
!.gitignore
../../zsh-syntax-highlighting
\ No newline at end of file
/usr/share/zsh/plugins/zsh-syntax-highlighting
\ No newline at end of file
# https://github.com/robbyrussell/oh-my-zsh/wiki/Customization#overriding-and-adding-themes
#
# Ignore everything in this directory
*
# Except this file
!.gitignore
/usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
\ No newline at end of file
../../powerlevel9k/powerlevel9k.zsh-theme
\ No newline at end of file
File deleted
File deleted
File deleted