Cleanup: Remove old duplicate dotfiles (2026-01-18)
REMOVED FILES (can revert to commit 14554cb if needed):
- .bash_aliases (duplicate of dot_bash_aliases)
- .zshrc (duplicate of dot_zshrc)
- .zshenv (duplicate of dot_zshenv)
- .tmux.conf.local (duplicate of dot_tmux.conf.local)
- .vimrc (old format, not chezmoi-managed)
- .virtualenvwrapper.sh (old 41KB script)
- .gitconfig (old format)
- setup.sh (replaced by chezmoi)
KEPT:
- All dot_* files (current configs)
- wombat256mod.vim (vim theme)
- vim-plugins/ (vim plugins)
- fusuma.yml (Linux gestures)
- iterm2.json (macOS iTerm2)
- konsole.profile (KDE terminal)
This commit is contained in:
parent
14554cba1c
commit
4b6031a484
8 changed files with 0 additions and 3006 deletions
555
.bash_aliases
555
.bash_aliases
|
|
@ -1,555 +0,0 @@
|
|||
alias ls='ls --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
alias py='python3'
|
||||
alias ipy='ipython3'
|
||||
alias whatisopen='sudo netstat -pnlt'
|
||||
alias calc='gcalccmd'
|
||||
alias pmr='python manage.py runserver'
|
||||
alias nopmr="ps auxw | grep runserver | awk '{print \$2}' | xargs kill"
|
||||
alias pmm='python manage.py migrate'
|
||||
alias pmmm='python manage.py makemigrations'
|
||||
|
||||
# Start vim with system clipboard
|
||||
alias vim="vimx" # don't alias this - make symlink instead
|
||||
alias vi="vim"
|
||||
alias vimdiff="vim -d"
|
||||
|
||||
# git aliases
|
||||
alias g='git'
|
||||
alias gs='git status'
|
||||
alias ga='git add'
|
||||
alias gc='git commit -S'
|
||||
alias gp='git push origin master'
|
||||
# alias gp='for r in $(git remote); do echo "Pushing to $r" && git push $r master; done'
|
||||
alias gpull='git pull --rebase origin master'
|
||||
alias gl="git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"
|
||||
alias gd="git diff"
|
||||
alias gds="git diff --staged"
|
||||
alias gb="git branch"
|
||||
alias gpp='git push production master' # push to production for personal website
|
||||
# pull all remote branches
|
||||
alias git-pull-branches='git branch -r | grep -v "\->" | while read remote; do git branch --track "${remote#origin/}" "$remote"; done'
|
||||
# useful for daily stand-up
|
||||
git-standup() {
|
||||
AUTHOR=${AUTHOR:="`git config user.name`"}
|
||||
|
||||
since=yesterday
|
||||
if [[ $(date +%u) == 1 ]] ; then
|
||||
since="2 days ago"
|
||||
fi
|
||||
|
||||
git log --all --since "$since" --oneline --author="$AUTHOR"
|
||||
}
|
||||
|
||||
# MSR registers is responsible for lag after suspend
|
||||
alias checkcpu='modprobe msr; rdmsr -a 0x19a'
|
||||
alias fixcpu='wrmsr -a 0x19a 0x0'
|
||||
|
||||
alias muzika='xdg-open ~/Documents/Music/njoy.m3u'
|
||||
alias randomstr="tr -dc a-z1-4 </dev/urandom | tr 1-2 ' \n' | awk 'length==0 || length>50' | tr 3-4 ' ' | sed 's/^ *//' | cat -s | sed 's/ / /g' |fmt"
|
||||
alias battery="upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E 'time to empty|state|to\ full|percentage'"
|
||||
alias svali_papka=download_github_folder
|
||||
alias omg="sudo systemctl restart NetworkManager"
|
||||
alias omg1.1="sudo rmmod iwlmvm && sudo rmmod iwlwifi; sudo modprobe iwlwifi"
|
||||
alias zsh_fix="mv ~/.zsh_history ~/.zsh_history_bad; strings ~/.zsh_history_bad > ~/.zsh_history;fc -R ~/.zsh_history; rm ~/.zsh_history_bad"
|
||||
alias myip="curl https://icanhazip.com"
|
||||
alias rmswp="find ~/.vim/tmp/ -iname \"*swp\" -delete"
|
||||
alias root="sudo su -"
|
||||
|
||||
download_github_folder() {
|
||||
svn checkout $(echo $1 | sed "s/\/tree\/[a-zA-Z]\+/\/trunk/")
|
||||
}
|
||||
|
||||
bye() {
|
||||
if ps -p $(pidof rsync) 2> /dev/null
|
||||
then
|
||||
echo 'Rsync is running, not going to sleep.'
|
||||
else
|
||||
# (/bin/lock &) && sudo systemctl suspend
|
||||
sudo systemctl suspend
|
||||
fi
|
||||
}
|
||||
|
||||
alias sizeof='du -sh'
|
||||
alias mkdir="mkdir -pv"
|
||||
|
||||
# ls(){
|
||||
# if [[ $2 == "-l" ]]; then
|
||||
# if [[ $3 != "" ]]; then
|
||||
# exa -bghHliS $3
|
||||
# else
|
||||
# exa -bghHliS
|
||||
# fi
|
||||
# else
|
||||
# if [[ $2 != "" ]]; then
|
||||
# /bin/ls --color=auto $2
|
||||
# else
|
||||
# /bin/ls --color=auto
|
||||
# fi
|
||||
# fi
|
||||
# }
|
||||
|
||||
# Get packet manager
|
||||
declare -A osInfo;
|
||||
osInfo[/etc/redhat-release]=dnf
|
||||
osInfo[/etc/arch-release]=pacman
|
||||
osInfo[/etc/gentoo-release]=emerge
|
||||
osInfo[/etc/SuSE-release]=zypp
|
||||
osInfo[/etc/debian_version]=apt-get
|
||||
|
||||
# for f in "${!osInfo[@]}" # bash version
|
||||
for f in "${(@k)osInfo}" # zsh version
|
||||
do
|
||||
if [[ -f $f ]];then
|
||||
pm=${osInfo[$f]}
|
||||
fi
|
||||
done
|
||||
alias update="sudo $pm update"
|
||||
alias u="update"
|
||||
alias upgrade="sudo $pm upgrade"
|
||||
alias install="sudo $pm install"
|
||||
alias remove="sudo $pm remove"
|
||||
alias reinstall="sudo $pm reinstall"
|
||||
|
||||
# secureme(){
|
||||
# workon ansible;
|
||||
# cd /home/viktor/ansible-play/
|
||||
# ansible-playbook -i ./hosts --extra-vars "ansible_sudo_pass=$ROOTPASS" --tags "vpn_startup" main.yml >> /dev/null
|
||||
# cd /home/viktor/;
|
||||
# sudo openvpn --config viktor.ovpn &
|
||||
# }
|
||||
|
||||
# function in(){
|
||||
# if [ $# -lt 2 ];
|
||||
# then
|
||||
# echo "Usage:"
|
||||
# echo "To start existing container:"
|
||||
# echo "in <os you want>"
|
||||
# echo
|
||||
# echo "To start new container:"
|
||||
# echo "in new <os you want>"
|
||||
# return
|
||||
# fi
|
||||
|
||||
# if [ $# -eq 1 ]
|
||||
# then
|
||||
# container_name="${1/:/_}"
|
||||
# else
|
||||
# container_name="${2/:/_}"
|
||||
# fi
|
||||
|
||||
# # Check if recreating a container or reuse existing
|
||||
# if [ "$1" = "new" ]
|
||||
# then
|
||||
# image_name=$2
|
||||
# if [[ $(docker container ls -a | grep "$container_name") ]]
|
||||
# then
|
||||
# if [[ $(docker ps | grep $container_name) ]]
|
||||
# then
|
||||
# docker stop $container_name >> /dev/null
|
||||
# fi
|
||||
# docker rm $container_name >> /dev/null
|
||||
# fi
|
||||
|
||||
# if [ -z "$3" ]
|
||||
# then
|
||||
# cmd="/bin/bash"
|
||||
# else
|
||||
# cmd="$3"
|
||||
# fi
|
||||
# echo "Running $cmd in $container_name"
|
||||
# # docker run -it --name $container_name --publish-all=true $image_name "$cmd" && docker attach $container_name
|
||||
|
||||
# xhost +local:root # allow gui apps
|
||||
# docker run -it --name $container_name -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix $image_name "$cmd"
|
||||
# xhost -local:root
|
||||
# else
|
||||
# xhost +local:root
|
||||
# docker start $container_name >> /dev/null && docker attach $container_name
|
||||
# xhost -local:root
|
||||
# fi
|
||||
# }
|
||||
|
||||
# stest(){
|
||||
# snapshot_name="rootsnap"
|
||||
# mount_point="$2"
|
||||
|
||||
# if [ $# -ne 2 ];then
|
||||
# echo "Usage:"
|
||||
# echo "$0 <snapshot size> <mount point> "
|
||||
# echo
|
||||
# return
|
||||
# fi
|
||||
|
||||
# if [ ${mount_point:0:1} != '/' ]; then
|
||||
# echo "Mount point must be absolute path"
|
||||
# return
|
||||
# fi
|
||||
|
||||
# if [[ $(sudo lvs | grep $snapshot_name) ]]; then
|
||||
# echo "$snapshot_name already exists!"
|
||||
# # read -e -p "Do you want to discard it and create a new one?(y/N)" -i n should_discard
|
||||
# echo "Do you want to discard it and create a new one?(y/N)"
|
||||
# read should_discard
|
||||
# should_discard=${should_discard:-"n"}
|
||||
# # if [ ${(L)should_discard} = 'y' ]; then
|
||||
# if [ $(echo $should_discard | awk '{print tolower($0)}') = 'y' ]; then
|
||||
# sudo umount $mount_point
|
||||
# sudo lvremove /dev/kubuntu-vg/$snapshot_name -y
|
||||
# else
|
||||
# echo "Leaving old snapshot intact"
|
||||
# return
|
||||
# fi
|
||||
|
||||
# fi
|
||||
|
||||
# sudo lvcreate -s -n $snapshot_name /dev/kubuntu-vg/root -L $1
|
||||
# sudo mount /dev/kubuntu-vg/$snapshot_name $mount_point
|
||||
# sudo chroot $mount_point /bin/zsh
|
||||
# }
|
||||
wifi_int_name="$(cat /proc/net/wireless | perl -ne '/(\w+):/ && print $1')"
|
||||
|
||||
alias ifl="ifconfig|less"
|
||||
# Docker aliases
|
||||
alias dsl="docker swarm leave --force"
|
||||
alias dsi="docker swarm init --advertise-addr=$wifi_int_name"
|
||||
alias dsjtm="docker swarm join-token manager"
|
||||
alias dsjtw="docker swarm join-token worker"
|
||||
|
||||
alias noip6="sudo sh -c 'echo 1 > /proc/sys/net/ipv6/conf/$wifi_int_name/disable_ipv6'"
|
||||
alias yesip6="sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/$wifi_int_name/disable_ipv6'"
|
||||
|
||||
# alias omg2="killall plasmashell; plasmashell > /dev/null 2>&1 & disown"
|
||||
alias omg2="kwin --replace &"
|
||||
alias omg2.1="kquitapp5 plasmashell && kstart5 plasmashell"
|
||||
alias aliases="vim ~/.bash_aliases && source ~/.bash_aliases"
|
||||
|
||||
# alias ghcirun="ghci --make $1; ./$1"
|
||||
alias lip="ifconfig $(route -n | head -n 3 | tail -n 1 | awk '{print $8}') | grep inet | awk '{print \$2}'"
|
||||
|
||||
netok(){
|
||||
# ping google.com
|
||||
echo 'Testing DNS settings.'
|
||||
timeout 1 ping google.com -W 1 -c 1 &>> /dev/null
|
||||
if (( $? == 0 )); then
|
||||
echo 'Internet is up.'
|
||||
return 0
|
||||
fi
|
||||
# ping 8.8.8.8
|
||||
echo 'Pinging 8.8.8.8'
|
||||
ping 8.8.8.8 -W 1 -c 1 &>> /dev/null
|
||||
if (( $? == 0 )); then
|
||||
echo 'Issue spoted in DNS settings'
|
||||
return 0
|
||||
fi
|
||||
# ping gateway
|
||||
gateway=$(echo $(route -n | sed -n '3p' | awk '{print $2}'))
|
||||
echo 'Pinging ' $gateway
|
||||
ping $gateway -W 1 -c 2 &>> /dev/null
|
||||
if (($? == 0 )); then
|
||||
echo 'Gateway connectivity issues or being firewalled.'
|
||||
return 0
|
||||
else
|
||||
echo 'Cant reach default gateway.'
|
||||
return 0
|
||||
fi
|
||||
# deteemine issue
|
||||
}
|
||||
|
||||
#alias tldr="rm -r /home/viktor/.tldr_cache/ &> /dev/null; tldr"
|
||||
alias sl=ls
|
||||
alias vimrc="vim ~/.vimrc"
|
||||
alias zshrc="vim ~/.zshrc"
|
||||
alias f="free -h"
|
||||
alias h="sudo htop"
|
||||
alias a="sudo atop"
|
||||
alias e="exa -bghHliS"
|
||||
alias n="sudo nethogs"
|
||||
alias hosts="sudo vim /etc/hosts"
|
||||
|
||||
# Source:
|
||||
# https://wiki.archlinux.org/index.php/Streaming_to_twitch.tv
|
||||
streaming() {
|
||||
youtube_key="k1ms-wpmc-v652-7rjr" # Ancient, not used anymore
|
||||
twitch_key="live_56376159_CCAGv99vT0rr3QwiBiMuDAdoPcYB5N" # Ancient, not user anymore
|
||||
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Choose yt/tw"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ "$1" = "yt" ]; then
|
||||
STREAM_KEY=$youtube_key
|
||||
STREAM_URI="rtmp://a.rtmp.youtube.com/live2/$STREAM_KEY"
|
||||
elif [ "$1" = "tw" ]; then
|
||||
STREAM_KEY=$twitch_key
|
||||
SERVER="live-fra" # twitch server in frankfurt, see http://bashtech.net/twitch/ingest.php for list
|
||||
STREAM_URI="rtmp://$SERVER.twitch.tv/app/$STREAM_KEY"
|
||||
else
|
||||
echo "Invalid media\nChoose yt/tw"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# INRES="1920x1080" # input resolution
|
||||
# OUTRES="1920x1080" # output resolution
|
||||
INRES="$(xdpyinfo | awk '/dimensions/{print $2}')"
|
||||
# OUTRES="$(xdpyinfo | awk '/dimensions/{print $2}')"
|
||||
# OUTRES="1280x720"
|
||||
OUTRES="2560x1440"
|
||||
# OUTRES="3840x2160"
|
||||
FPS="15" # target FPS
|
||||
GOP="29" # i-frame interval, should be double of FPS,
|
||||
GOPMIN="15" # min i-frame interval, should be equal to fps,
|
||||
THREADS="0" # max 6
|
||||
CBR="4000k" # constant bitrate (yuvj444p)
|
||||
QUALITY="ultrafast" # one of the many FFMPEG preset
|
||||
AUDIO_RATE="44100"
|
||||
# STREAM_KEY="$1" # use the terminal command Streaming streamkeyhere to stream your video to twitch or justin
|
||||
|
||||
ffmpeg -thread_queue_size 512 -f x11grab -s "$INRES" -r "$FPS" -i :0.0 -f alsa -i pulse -f flv -ac 2 -ar $AUDIO_RATE \
|
||||
-vcodec libx264 -g $GOP -keyint_min $GOPMIN -b:v $CBR -minrate $CBR -maxrate $CBR -pix_fmt yuv444p\
|
||||
-s $OUTRES -preset $QUALITY -tune zerolatency -acodec libmp3lame -threads $THREADS -strict normal \
|
||||
-bufsize $CBR $STREAM_URI
|
||||
}
|
||||
alias gg="xset dpms force off"
|
||||
|
||||
alias hib="sudo systemctl hibernate"
|
||||
# where systemctl doesn't work
|
||||
# hib(){
|
||||
# # sudo swapon /dev/kubuntu-vg/swap_1 2&>/dev/null
|
||||
# # sudo systemctl hibernate
|
||||
# # sudo swapoff /dev/kubuntu-vg/swap_1 2&>/dev/null
|
||||
# sudo swapon -a
|
||||
# /bin/lock
|
||||
# sleep 2
|
||||
# sudo s2disk 2>1 > /dev/null
|
||||
# }
|
||||
|
||||
alias tricks="vi ~/tricks/tricks.txt"
|
||||
alias ftricks="vi ~/tricks/fedora.txt"
|
||||
alias xo="xdg-open"
|
||||
alias time='"time"' # Disable bash builit
|
||||
alias vix="vim -X" # Fast vim startup wihtout x (no ystem clipboard)
|
||||
alias reso="xrandr --output HDMI-1 --scale-from 1920x1080"
|
||||
alias zoomit="gromit-mpx"
|
||||
alias dk="docker"
|
||||
|
||||
alias lk="sudo logkeys -u --start --output /home/viktor/tt --device /dev/input/event4" # integrated keyboard
|
||||
alias lk1="sudo logkeys --start --output /home/viktor/tt --device /dev/input/event17" # usb keyboard
|
||||
|
||||
psave() {
|
||||
sudo service bluetooth stop
|
||||
sudo service vmware-workstation-server stop
|
||||
sudo service vmware stop
|
||||
sudo service ModemManager stop
|
||||
}
|
||||
|
||||
camelcase() {
|
||||
perl -pe 's#(_|^)(.)#\u$2#g'
|
||||
}
|
||||
|
||||
rem_known() {
|
||||
"ssh-keygen -f '/home/viktor/.ssh/known_hosts' -R $1"
|
||||
}
|
||||
|
||||
alias s="ssh"
|
||||
ytplaylist(){
|
||||
# if error try updating youtube-dl with: sudo youtube-dl -U
|
||||
# youtube-dl -o - $1 -f best | /snap/bin/vlc -
|
||||
youtube-dl -o - -f best $@ | vlc -
|
||||
# youtube-dl --get-id "$1" | awk '{print "https://www.youtube.com/watch?v=" $0;}' | /snap/bin/vlc -
|
||||
}
|
||||
|
||||
function certinfo {
|
||||
# curl --insecure -v "$1" 2>&1;
|
||||
curl --insecure -v https://"$1" 2>&1 | awk 'BEGIN { cert=0 } /^\* SSL connection/ { cert=1 } /^\*/ { if (cert) print }';
|
||||
}
|
||||
|
||||
alias speedtest="curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py |python -"
|
||||
alias backupnas="rsync -az --progress --delete /home nas:/volume1/Backup/Viki/laptop/yuhu-fedora; rsync -az --progress --delete /opt nas:/volume1/Backup/Viki/laptop/yuhu-fedora"
|
||||
|
||||
function c(){
|
||||
# pass any arguments to gcc and afterwards run executable
|
||||
gcc "$@" && ./a.out
|
||||
}
|
||||
|
||||
function dang_gcc(){
|
||||
gcc "$@" -fno-stack-protector -z execstack
|
||||
}
|
||||
|
||||
function encrypt() {
|
||||
tar -czvf $1.tar.gz $1 && \
|
||||
gpg --symmetric --armor $1.tar.gz && \
|
||||
echo "Deleting $1 and $1.tar.gz" && \
|
||||
rm -rf $1 $1.tar.gz
|
||||
}
|
||||
|
||||
function decrypt() {
|
||||
gpg --decrypt $1 | tar xzvf -
|
||||
}
|
||||
|
||||
# use avr-gcc for latfortuna, but gcc works as well
|
||||
function make_tags() {
|
||||
avr-gcc -M $* | sed -e 's/[\\ ]/\n/g' | \
|
||||
sed -e '/^$/d' -e '/\.o:[ \t]*$/d' | ctags -L - --c++-kinds=+p --fields=+iaS --extra=+q
|
||||
}
|
||||
#alias server="python3 -m http.server --bind 0.0.0.0 8000"
|
||||
alias server="/opt/miniserve-linux"
|
||||
alias gr="go run ."
|
||||
alias hg="hugo -D server --bind 0.0.0.0"
|
||||
alias logout="qdbus org.kde.ksmserver /KSMServer logout 0 0 0"
|
||||
alias sucss="cd ~/pentesting/sucss-19 && workon sucss-playground-webapp"
|
||||
alias i="sudo iotop"
|
||||
alias ssucss="ssh sucss.ecs.soton.ac.uk"
|
||||
alias gpc="globalprotect connect; sudo sed -i '1 i\\nameserver 152.78.110.110' /etc/resolv.conf"
|
||||
alias gpd="globalprotect disconnect; sudo sed -i '1d' /etc/resolv.conf"
|
||||
|
||||
function whoishome() {
|
||||
# echo "Finding connected devices..."
|
||||
ips=$(nmap -sn 192.168.0.1/24 | grep for | awk '{print $5}')
|
||||
|
||||
# echo "Getting entries from ARP table..."
|
||||
# Get entries in arp table
|
||||
python3 -c '
|
||||
import sys
|
||||
users={
|
||||
"C8:21:58:98:29:25": "lubo-laptop",
|
||||
"18:F0:E4:2A:CB:B0": "lubo-phone",
|
||||
"2C:0E:3D:A7:C1:19": "viktor-phone",
|
||||
"48:89:E7:18:0E:66": "viktor-laptop",
|
||||
"A0:32:99:C4:0E:38": "nasko-phone",
|
||||
"44:03:2C:6B:04:5E": "nasko-laptop",
|
||||
"48:01:C5:39:A6:3D": "ioana-phone",
|
||||
"F4:0F:24:2B:FE:14": "ioana-laptop",
|
||||
"50:EB:71:23:BC:11": "gabi-laptop",
|
||||
"FE:43:0A:04:03:BA": "gabi-phone",
|
||||
}
|
||||
# print("Connected device: ")
|
||||
for line in sys.argv[1].split("\n"):
|
||||
ip = line.split()[1].replace("(", "").replace(")", "")
|
||||
mac = line.split()[3].upper()
|
||||
if mac in users:
|
||||
print(f"{users[mac]}:{ip}")
|
||||
' "$(arp -a | grep -v incomplete)"
|
||||
}
|
||||
|
||||
alias wa="watch sensors"
|
||||
alias gtop="sudo intel_gpu_top"
|
||||
|
||||
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
|
||||
bindkey '^[0' autosuggest-accept;
|
||||
# bindkey '^[9' forward-word;
|
||||
bindkey '^[9' autosuggest-fetch;
|
||||
# bindkey '^[9' autosuggest-clear;
|
||||
#bindkey '^ ' autosuggest-fetch
|
||||
alias sp="snapper -c home"
|
||||
|
||||
function snp(){
|
||||
# Runs a command wrapped in btrfs snapper pre-post snapshots.
|
||||
# Usage: $ snp <commands>
|
||||
# e.g.: $ snp dnf install htop
|
||||
|
||||
cmd="$@"
|
||||
|
||||
snapshot_nbr=$(snapper -c home create --type=pre --cleanup-algorithm=number --print-number --description="${cmd}")
|
||||
# snapshot_nbr=$(sudo snapper create --type=pre --cleanup-algorithm=number --print-number --description="${cmd}")
|
||||
|
||||
eval "$cmd"
|
||||
|
||||
snapshot_nbr=$(snapper -c home create --type=post --cleanup-algorithm=number --print-number --pre-number="$snapshot_nbr")
|
||||
# snapshot_nbr=$(sudo snapper create --type=post --cleanup-algorithm=number --print-number --pre-number="$snapshot_nbr")
|
||||
}
|
||||
|
||||
function waitfor() {
|
||||
while pidof $1 > /dev/null; do sleep 2; done;
|
||||
}
|
||||
alias toclip="xclip -selection clipboard"
|
||||
alias clearsessions="rm -rf ~/.vim/tmp/sessions/*"
|
||||
#alias restore_virtualenv_post_scripts="find /home/.snapshots/337/snapshot/viktor/.virtualenvs -name 'postactivate' | sed 's/\/home\/.snapshots\/337\/snapshot\/viktor\///' | xargs -I % rsync -va /home/.snapshots/337/snapshot/viktor/% ~/"
|
||||
|
||||
# `clear` can be seen and flicker is annoying
|
||||
# function watch() {
|
||||
# while sleep 1; do
|
||||
# clear;
|
||||
# ${SHELL-/bin/sh} -c "$*"
|
||||
# done;
|
||||
# }
|
||||
alias vmon="sudo systemctl start vmware"
|
||||
alias vmoff="sudo systemctl stop vmware"
|
||||
alias dkon="sudo systemctl start docker"
|
||||
alias dkoff="sudo systemctl stop docker"
|
||||
alias tf="terraform"
|
||||
alias tfa="tf apply"
|
||||
function b64() {
|
||||
echo $1 | base64 -d
|
||||
}
|
||||
# alias fuck='sudo $(history -p !!)'
|
||||
alias fuck='sudo $(fc -ln -1)'
|
||||
alias curlb='curl -s -o /dev/null -w "%{time_starttransfer}\n" "$@"'
|
||||
alias nomicautoadjust='while sleep 0.5; do pacmd set-source-volume alsa_input.pci-0000_00_1f.3.analog-stereo 20000; done'
|
||||
|
||||
# Needs to send dbus msg not sure how
|
||||
# function toggleLidClose() {
|
||||
# # If action is none, make it suspend and vice-versa
|
||||
# if grep 'lidAction=0' ~/.config/powermanagementprofilesrc > /dev/null; then
|
||||
# sed -i 's/lidAction=0/lidAction=1/' ~/.config/powermanagementprofilesrc
|
||||
# else
|
||||
# sed -i 's/lidAction=1/lidAction=0/' ~/.config/powermanagementprofilesrc
|
||||
# fi
|
||||
# }
|
||||
|
||||
# Games
|
||||
alias medieval="sh -c 'cd ~/.wine/drive_c/Program\ Files\ \(x86\)/SEGA/Medieval\ II\ Total\ War/ && wine medieval2.exe'"
|
||||
|
||||
alias kb="kubectl"
|
||||
alias kbp="kubectl get pods"
|
||||
alias kbpo="kubectl get pods -o wide"
|
||||
alias kbs="kubectl get svc"
|
||||
alias kbn="kubectl get nodes -o wide"
|
||||
alias kbd="kubectl describe pods"
|
||||
alias kbf="kubectl logs --all-containers --max-log-requests 50 -f"
|
||||
alias kn="kubens"
|
||||
function cephpw() {
|
||||
kubectl -n rook-ceph get secret rook-ceph-dashboard-password -o yaml | grep "password:" | grep -v '{}'| awk '{print $2}' | base64 --decode
|
||||
}
|
||||
function kbop() {
|
||||
kb -n rook-ceph delete pods $(kbp |grep opera | awk '{print $1}')
|
||||
kb -n rook-ceph logs -f $(kbp |grep operator | awk '{print $1}')
|
||||
}
|
||||
|
||||
alias k8srole="ansible-playbook -i hosts.yaml linux.yml -e host='10.0.20.100' -t "
|
||||
function wgon(){
|
||||
wg-quick up ~/vpn-certs/viktor.conf
|
||||
# Add ipv4 precedence because vpn is v4 onyl for now
|
||||
bash -c "grep -qxF 'precedence ::ffff:0:0/96 100' /etc/gai.conf || echo 'precedence ::ffff:0:0/96 100' | sudo tee -a /etc/gai.conf"
|
||||
# Add dns if missing
|
||||
ns_str="nameserver 10.0.20.1 # Added by wgon function"
|
||||
search_str="search viktorbarzin.lan # Added by wgon function"
|
||||
resolv_conf="/etc/resolv.conf"
|
||||
bash -c "grep -qxF '$search_str' $resolv_conf || echo '$search_str' | sudo tee -a $resolv_conf"
|
||||
bash -c "grep -qxF '$ns_str' $resolv_conf || echo '$ns_str' | sudo sed -i -e '1i $ns_str' $resolv_conf"
|
||||
}
|
||||
function wgoff(){
|
||||
wg-quick down ~/vpn-certs/viktor.conf
|
||||
|
||||
ns_str="nameserver 10.0.20.1 # Added by wgon function"
|
||||
search_str="search viktorbarzin.lan # Added by wgon function"
|
||||
resolv_conf="/etc/resolv.conf"
|
||||
|
||||
# Remove ipv4 precedence because vpn is v4 onyl for now
|
||||
sudo sed -i '/precedence ::ffff:0:0\/96 100/d' /etc/gai.conf
|
||||
|
||||
sudo sed -i "/$search_str/d" $resolv_conf
|
||||
sudo sed -i "/$ns_str/d" $resolv_conf
|
||||
}
|
||||
function wgs() {
|
||||
kubectl scale -n wireguard deployment wireguard --replicas=$1
|
||||
}
|
||||
alias wg="sudo wg"
|
||||
alias svm="et -c 'tmux new -A -s main' 10.0.10.104:2022"
|
||||
alias calicoctl="kubectl exec -i -n kube-system calicoctl -- /calicoctl"
|
||||
alias ipcalc="ipcalc --no-decorate"
|
||||
alias ss-tunnel="snap run shadowsocks-libev.ss-tunnel"
|
||||
alias ss-local="snap run shadowsocks-libev.ss-local"
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
[user]
|
||||
emal = vbarzin@gmail.com
|
||||
name = viktorbarzin
|
||||
email = vbarzin@gmail.com
|
||||
signingkey = 6AF253F1C94B5F00750FBBD40EB088298288D958
|
||||
[push]
|
||||
default = tracking
|
||||
[branch]
|
||||
autosetuprebase = always
|
||||
360
.tmux.conf.local
360
.tmux.conf.local
|
|
@ -1,360 +0,0 @@
|
|||
# https://github.com/gpakosz/.tmux
|
||||
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
|
||||
# without any warranty.
|
||||
# Copyright 2012— Gregory Pakosz (@gpakosz).
|
||||
|
||||
|
||||
# -- navigation ----------------------------------------------------------------
|
||||
|
||||
# if you're running tmux within iTerm2
|
||||
# - and tmux is 1.9 or 1.9a
|
||||
# - and iTerm2 is configured to let option key act as +Esc
|
||||
# - and iTerm2 is configured to send [1;9A -> [1;9D for option + arrow keys
|
||||
# then uncomment the following line to make Meta + arrow keys mapping work
|
||||
#set -ga terminal-overrides "*:kUP3=\e[1;9A,*:kDN3=\e[1;9B,*:kRIT3=\e[1;9C,*:kLFT3=\e[1;9D"
|
||||
|
||||
|
||||
# -- windows & pane creation ---------------------------------------------------
|
||||
|
||||
# new window retains current path, possible values are:
|
||||
# - true
|
||||
# - false (default)
|
||||
tmux_conf_new_window_retain_current_path=false
|
||||
|
||||
# new pane retains current path, possible values are:
|
||||
# - true (default)
|
||||
# - false
|
||||
tmux_conf_new_pane_retain_current_path=true
|
||||
|
||||
# new pane tries to reconnect ssh sessions (experimental), possible values are:
|
||||
# - true
|
||||
# - false (default)
|
||||
tmux_conf_new_pane_reconnect_ssh=false
|
||||
|
||||
# prompt for session name when creating a new session, possible values are:
|
||||
# - true
|
||||
# - false (default)
|
||||
tmux_conf_new_session_prompt=false
|
||||
|
||||
|
||||
# -- display -------------------------------------------------------------------
|
||||
|
||||
# RGB 24-bit colour support (tmux >= 2.2), possible values are:
|
||||
# - true
|
||||
# - false (default)
|
||||
tmux_conf_theme_24b_colour=false
|
||||
|
||||
# window style
|
||||
tmux_conf_theme_window_fg='default'
|
||||
tmux_conf_theme_window_bg='default'
|
||||
|
||||
# highlight focused pane (tmux >= 2.1), possible values are:
|
||||
# - true
|
||||
# - false (default)
|
||||
tmux_conf_theme_highlight_focused_pane=false
|
||||
|
||||
# focused pane colours:
|
||||
tmux_conf_theme_focused_pane_fg='default'
|
||||
tmux_conf_theme_focused_pane_bg='#0087d7' # light blue
|
||||
|
||||
# pane border style, possible values are:
|
||||
# - thin (default)
|
||||
# - fat
|
||||
tmux_conf_theme_pane_border_style=thin
|
||||
|
||||
# pane borders colours:
|
||||
tmux_conf_theme_pane_border='#444444' # gray
|
||||
tmux_conf_theme_pane_active_border='#00afff' # light blue
|
||||
|
||||
# pane indicator colours
|
||||
tmux_conf_theme_pane_indicator='#00afff' # light blue
|
||||
tmux_conf_theme_pane_active_indicator='#00afff' # light blue
|
||||
|
||||
# status line style
|
||||
tmux_conf_theme_message_fg='#000000' # black
|
||||
tmux_conf_theme_message_bg='#ffff00' # yellow
|
||||
tmux_conf_theme_message_attr='bold'
|
||||
|
||||
# status line command style (<prefix> : Escape)
|
||||
tmux_conf_theme_message_command_fg='#ffff00' # yellow
|
||||
tmux_conf_theme_message_command_bg='#000000' # black
|
||||
tmux_conf_theme_message_command_attr='bold'
|
||||
|
||||
# window modes style
|
||||
tmux_conf_theme_mode_fg='#000000' # black
|
||||
tmux_conf_theme_mode_bg='#ffff00' # yellow
|
||||
tmux_conf_theme_mode_attr='bold'
|
||||
|
||||
# status line style
|
||||
tmux_conf_theme_status_fg='#8a8a8a' # light gray
|
||||
tmux_conf_theme_status_bg='#080808' # dark gray
|
||||
tmux_conf_theme_status_attr='none'
|
||||
|
||||
# terminal title
|
||||
# - built-in variables are:
|
||||
# - #{circled_window_index}
|
||||
# - #{circled_session_name}
|
||||
# - #{hostname}
|
||||
# - #{hostname_ssh}
|
||||
# - #{username}
|
||||
# - #{username_ssh}
|
||||
tmux_conf_theme_terminal_title='#h ❐ #S ● #I #W'
|
||||
|
||||
# window status style
|
||||
# - built-in variables are:
|
||||
# - #{circled_window_index}
|
||||
# - #{circled_session_name}
|
||||
# - #{hostname}
|
||||
# - #{hostname_ssh}
|
||||
# - #{username}
|
||||
# - #{username_ssh}
|
||||
tmux_conf_theme_window_status_fg='#8a8a8a' # light gray
|
||||
tmux_conf_theme_window_status_bg='#080808' # dark gray
|
||||
tmux_conf_theme_window_status_attr='none'
|
||||
tmux_conf_theme_window_status_format='#I #W'
|
||||
#tmux_conf_theme_window_status_format='#{circled_window_index} #W'
|
||||
#tmux_conf_theme_window_status_format='#I #W#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}'
|
||||
|
||||
# window current status style
|
||||
# - built-in variables are:
|
||||
# - #{circled_window_index}
|
||||
# - #{circled_session_name}
|
||||
# - #{hostname}
|
||||
# - #{hostname_ssh}
|
||||
# - #{username}
|
||||
# - #{username_ssh}
|
||||
tmux_conf_theme_window_status_current_fg='#000000' # black
|
||||
tmux_conf_theme_window_status_current_bg='#00afff' # light blue
|
||||
tmux_conf_theme_window_status_current_attr='bold'
|
||||
tmux_conf_theme_window_status_current_format='#I #W'
|
||||
#tmux_conf_theme_window_status_current_format='#{circled_window_index} #W'
|
||||
#tmux_conf_theme_window_status_current_format='#I #W#{?window_zoomed_flag,🔍,}'
|
||||
|
||||
# window activity status style
|
||||
tmux_conf_theme_window_status_activity_fg='default'
|
||||
tmux_conf_theme_window_status_activity_bg='default'
|
||||
tmux_conf_theme_window_status_activity_attr='underscore'
|
||||
|
||||
# window bell status style
|
||||
tmux_conf_theme_window_status_bell_fg='#ffff00' # yellow
|
||||
tmux_conf_theme_window_status_bell_bg='default'
|
||||
tmux_conf_theme_window_status_bell_attr='blink,bold'
|
||||
|
||||
# window last status style
|
||||
tmux_conf_theme_window_status_last_fg='#00afff' # light blue
|
||||
tmux_conf_theme_window_status_last_bg='default'
|
||||
tmux_conf_theme_window_status_last_attr='none'
|
||||
|
||||
# status left/right sections separators
|
||||
# tmux_conf_theme_left_separator_main=''
|
||||
# tmux_conf_theme_left_separator_sub='|'
|
||||
# tmux_conf_theme_right_separator_main=''
|
||||
# tmux_conf_theme_right_separator_sub='|'
|
||||
tmux_conf_theme_left_separator_main='\uE0B0' # /!\ you don't need to install Powerline
|
||||
tmux_conf_theme_left_separator_sub='\uE0B1' # you only need fonts patched with
|
||||
tmux_conf_theme_right_separator_main='\uE0B2' # Powerline symbols or the standalone
|
||||
tmux_conf_theme_right_separator_sub='\uE0B3' # PowerlineSymbols.otf font, see README.md
|
||||
|
||||
# status left/right content:
|
||||
# - separate main sections with '|'
|
||||
# - separate subsections with ','
|
||||
# - built-in variables are:
|
||||
# - #{battery_bar}
|
||||
# - #{battery_hbar}
|
||||
# - #{battery_percentage}
|
||||
# - #{battery_status}
|
||||
# - #{battery_vbar}
|
||||
# - #{circled_session_name}
|
||||
# - #{hostname_ssh}
|
||||
# - #{hostname}
|
||||
# - #{loadavg}
|
||||
# - #{pairing}
|
||||
# - #{prefix}
|
||||
# - #{root}
|
||||
# - #{synchronized}
|
||||
# - #{uptime_y}
|
||||
# - #{uptime_d} (modulo 365 when #{uptime_y} is used)
|
||||
# - #{uptime_h}
|
||||
# - #{uptime_m}
|
||||
# - #{uptime_s}
|
||||
# - #{username}
|
||||
# - #{username_ssh}
|
||||
|
||||
# CPU info
|
||||
# CPU: #{cpu_icon} #{cpu_percentage} RAM: #{ram_icon} #{ram_percentage} ,
|
||||
|
||||
# #(curl wttr.in/Southampton?format=3) , # - for weather
|
||||
cpu_percentage_format="%3.1f%%" # printf format to use to display percentage
|
||||
tmux_conf_theme_status_left=' ❐ #S | ↑#{?uptime_y, #{uptime_y}y,}#{?uptime_d, #{uptime_d}d,}#{?uptime_h, #{uptime_h}h,}#{?uptime_m, #{uptime_m}m,} '
|
||||
#tmux_conf_theme_status_right='#{prefix}#{pairing}#{synchronized} #{?battery_status, #{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root} | #{hostname} '
|
||||
tmux_conf_theme_status_right=" IP:#(ip route get 8.8.8.8 | head -1 | cut -d' ' -f7) , \
|
||||
DNS:#(echo $(cat /etc/resolv.conf | grep 'nameserver [0-9]' | awk '{print $2}')) , \
|
||||
Gateway:#(echo $(route -n | sed -n '3p' | awk '{print $2}')) #{prefix}#{pairing} #[fg=green]#($TMUX_PLUGIN_MANAGER_PATH/tmux-mem-cpu-load/tmux-mem-cpu-load --colors --powerline-right --interval 2) , #{?battery_status, #{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root} | #{hostname}"
|
||||
|
||||
|
||||
# status left style
|
||||
tmux_conf_theme_status_left_fg='#000000,#e4e4e4,#e4e4e4' # black, white , white
|
||||
tmux_conf_theme_status_left_bg='#ffff00,#ff00af,#00afff' # yellow, pink, white blue
|
||||
tmux_conf_theme_status_left_attr='bold,none,none'
|
||||
|
||||
# status right style
|
||||
tmux_conf_theme_status_right_fg='#8a8a8a,#e4e4e4,#000000' # light gray, white, black
|
||||
tmux_conf_theme_status_right_bg='#080808,#d70000,#e4e4e4' # dark gray, red, white
|
||||
tmux_conf_theme_status_right_attr='none,none,bold'
|
||||
|
||||
# pairing indicator
|
||||
tmux_conf_theme_pairing='👓 ' # U+1F453
|
||||
tmux_conf_theme_pairing_fg='none'
|
||||
tmux_conf_theme_pairing_bg='none'
|
||||
tmux_conf_theme_pairing_attr='none'
|
||||
|
||||
# prefix indicator
|
||||
tmux_conf_theme_prefix='⌨ ' # U+2328
|
||||
tmux_conf_theme_prefix_fg='none'
|
||||
tmux_conf_theme_prefix_bg='none'
|
||||
tmux_conf_theme_prefix_attr='none'
|
||||
|
||||
# root indicator
|
||||
tmux_conf_theme_root='!'
|
||||
tmux_conf_theme_root_fg='none'
|
||||
tmux_conf_theme_root_bg='none'
|
||||
tmux_conf_theme_root_attr='bold,blink'
|
||||
|
||||
# synchronized indicator
|
||||
tmux_conf_theme_synchronized='🔒' # U+1F512
|
||||
tmux_conf_theme_synchronized_fg='none'
|
||||
tmux_conf_theme_synchronized_bg='none'
|
||||
tmux_conf_theme_synchronized_attr='none'
|
||||
|
||||
# battery bar symbols
|
||||
# tmux_conf_battery_bar_symbol_full='◼'
|
||||
# tmux_conf_battery_bar_symbol_empty='◻'
|
||||
tmux_conf_battery_bar_symbol_full='♥'
|
||||
tmux_conf_battery_bar_symbol_empty='·'
|
||||
|
||||
# battery bar length (in number of symbols), possible values are:
|
||||
# - auto
|
||||
# - a number, e.g. 5
|
||||
tmux_conf_battery_bar_length='auto'
|
||||
|
||||
# battery bar palette, possible values are:
|
||||
# - gradient (default)
|
||||
# - heat
|
||||
# - 'colour_full_fg,colour_empty_fg,colour_bg'
|
||||
tmux_conf_battery_bar_palette='gradient'
|
||||
#tmux_conf_battery_bar_palette='#d70000,#e4e4e4,#000000' # red, white, black
|
||||
|
||||
# battery hbar palette, possible values are:
|
||||
# - gradient (default)
|
||||
# - heat
|
||||
# - 'colour_low,colour_half,colour_full'
|
||||
tmux_conf_battery_hbar_palette='gradient'
|
||||
#tmux_conf_battery_hbar_palette='#d70000,#ff5f00,#5fff00' # red, orange, green
|
||||
|
||||
# battery vbar palette, possible values are:
|
||||
# - gradient (default)
|
||||
# - heat
|
||||
# - 'colour_low,colour_half,colour_full'
|
||||
tmux_conf_battery_vbar_palette='gradient'
|
||||
#tmux_conf_battery_vbar_palette='#d70000,#ff5f00,#5fff00' # red, orange, green
|
||||
|
||||
# symbols used to indicate whether battery is charging or discharging
|
||||
# tmux_conf_battery_status_charging='↑' # U+2191
|
||||
# tmux_conf_battery_status_discharging='↓' # U+2193
|
||||
# tmux_conf_battery_status_charging='⚡ ' # U+26A1
|
||||
tmux_conf_battery_status_charging='🔌 ' # U+1F50C # if you can't see this, fonts are not working
|
||||
tmux_conf_battery_status_discharging='🔋 ' # U+1F50B
|
||||
|
||||
# clock style (when you hit <prefix> + t)
|
||||
# you may want to use %I:%M %p in place of %R in tmux_conf_theme_status_right
|
||||
tmux_conf_theme_clock_colour='#00afff' # light blue
|
||||
tmux_conf_theme_clock_style='24'
|
||||
|
||||
|
||||
# -- clipboard -----------------------------------------------------------------
|
||||
|
||||
# in copy mode, copying selection also copies to the OS clipboard
|
||||
# - true
|
||||
# - false (default)
|
||||
# on macOS, this requires installing reattach-to-user-namespace, see README.md
|
||||
# on Linux, this requires xsel or xclip
|
||||
tmux_conf_copy_to_os_clipboard=false
|
||||
|
||||
|
||||
# -- user customizations -------------------------------------------------------
|
||||
# this is the place to override or undo settings
|
||||
|
||||
# increase history size
|
||||
#set -g history-limit 10000
|
||||
|
||||
# start with mouse mode enabled
|
||||
#set -g mouse on
|
||||
|
||||
# force Vi mode
|
||||
# really you should export VISUAL or EDITOR environment variable, see manual
|
||||
set -g status-keys vi
|
||||
set -g mode-keys vi
|
||||
|
||||
# replace C-b by C-a instead of using both prefixes
|
||||
set -gu prefix2
|
||||
unbind C-a
|
||||
# unbind C-b
|
||||
# set -g prefix C-a
|
||||
# bind C-a send-prefix
|
||||
set -g prefix M-x
|
||||
bind M-x send-prefix
|
||||
|
||||
# move status line to top
|
||||
#set -g status-position top
|
||||
|
||||
bind \\ split-window -h -c "#{pane_current_path}" # Split panes horizontal
|
||||
bind - split-window -v -c "#{pane_current_path}" # Split panes vertical
|
||||
|
||||
# Use Alt-vim keys without prefix key to switch panes
|
||||
bind -n M-h select-pane -L
|
||||
bind -n M-j select-pane -D
|
||||
bind -n M-k select-pane -U
|
||||
bind -n M-l select-pane -R
|
||||
# Use Alt-arrow keys without prefix key to switch panes
|
||||
bind -n M-Left select-pane -L
|
||||
bind -n M-Right select-pane -R
|
||||
bind -n M-Up select-pane -U
|
||||
bind -n M-Down select-pane -D
|
||||
set -g mouse on
|
||||
# to enable mouse scroll, see https://github.com/tmux/tmux/issues/145#issuecomment-150736967
|
||||
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
|
||||
bind j resize-pane -D 5
|
||||
bind k resize-pane -U 5
|
||||
bind l resize-pane -R 5
|
||||
bind h resize-pane -L 5
|
||||
|
||||
# Copy to system clipboard using xlip
|
||||
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
|
||||
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
|
||||
|
||||
bind-key s set-window-option synchronize-panes\; display-message "synchronize-panes is now #{?pane_synchronized,on,off}"
|
||||
|
||||
set-option -g default-shell /bin/zsh
|
||||
|
||||
set-window-option -g aggressive-resize
|
||||
|
||||
# Putting this in .tmux.conf.local does not work :/ 3.0a
|
||||
# Custom added - MUST be in the end
|
||||
# List of plugins
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
|
||||
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
||||
set -g @resurrect-processes 'vi vim nvim man less more tail top htop'
|
||||
|
||||
set -g @plugin 'tmux-plugins/tmux-continuum'
|
||||
|
||||
#set -g @continuum-restore 'on'
|
||||
set -g @continuum-restore 'off'
|
||||
|
||||
set -g @plugin 'thewtex/tmux-mem-cpu-load'
|
||||
|
||||
set -g default-command "${SHELL}"
|
||||
|
||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||
run -b '~/.tmux/plugins/tpm/tpm'
|
||||
486
.vimrc
486
.vimrc
|
|
@ -1,486 +0,0 @@
|
|||
" Source vimrc on vim startup
|
||||
" autocmd! VimEnter * source ~/.vimrc
|
||||
|
||||
" Load rename plugin
|
||||
" so ~/.vim/Rename.vim
|
||||
|
||||
" let g:EclimCompletionMethod = 'omnifunc'
|
||||
" Java Autocomplete
|
||||
" let g:acp_behaviorJavaEclimLength=3
|
||||
" function MeetsForJavaEclim(context)
|
||||
" return g:acp_behaviorJavaEclimLength >= 0 &&
|
||||
" \ a:context =~ '\k\.\k\{' . g:acp_behaviorJavaEclimLength . ',}$'
|
||||
" endfunction
|
||||
" let g:acp_behavior = {
|
||||
" \ 'java': [{
|
||||
" \ 'command': "\<c-x>\<c-u>",
|
||||
" \ 'completefunc' : 'eclim#java#complete#CodeComplete',
|
||||
" \ 'meets' : 'MeetsForJavaEclim',
|
||||
" \ }]
|
||||
" \ }
|
||||
|
||||
" Rezise splits
|
||||
"nnoremap <C-Left> :vertical resize -20<CR>
|
||||
|
||||
|
||||
" Autoindent html
|
||||
" autocmd BufWritePre *.html :normal gg=G
|
||||
|
||||
" Remove spaces at end of lines
|
||||
autocmd BufWritePre * %s/\s\+$//e
|
||||
|
||||
" Fold all with leader + f
|
||||
nnoremap <Leader>f :call ToggleFold()<CR>
|
||||
|
||||
" Set relative line number and number to see current line number
|
||||
" set rnu
|
||||
set number
|
||||
" Show commands as being written
|
||||
set showcmd
|
||||
|
||||
" Set syntastic settings
|
||||
set statusline+=%#warningmsg#
|
||||
if exists("SyntasticStatuslineFlag")
|
||||
set statusline+=%{SyntasticStatuslineFlag()}
|
||||
endif
|
||||
set statusline+=%*
|
||||
|
||||
" Disables syntastic popup window with messages
|
||||
" Set both to 1 to turn it on
|
||||
let g:syntastic_always_populate_loc_list = 1
|
||||
let g:syntastic_auto_loc_list = 1
|
||||
let g:syntastic_check_on_open = 1
|
||||
let g:syntastic_check_on_wq = 0
|
||||
" 3 errors is more than enough
|
||||
let g:syntastic_loc_list_height=3
|
||||
nnoremap <F10> :SyntasticCheck mypy<CR>
|
||||
" Set xptemplate trigger key to tab
|
||||
" let g:xptemplate_key = '<Tab>'
|
||||
|
||||
" Autocomplete with Tab
|
||||
" inoremap <Tab> <C-x><Space><CR>
|
||||
"inoremap <Caps> <space><space><space><space>
|
||||
|
||||
|
||||
" Rebind <Leader> key
|
||||
" I like to have it here becuase it is easier to reach than the default and
|
||||
" it is next to ``m`` and ``n`` which I use for navigating between tabs.
|
||||
let mapleader = ","
|
||||
|
||||
" Swap lines
|
||||
nnoremap <Leader>k :-1,-1m+0<CR>k
|
||||
nnoremap <Leader>j :+0,+0m+1<CR>
|
||||
vnoremap <Leader>k :m '<-2<CR>gv=gv
|
||||
vnoremap <Leader>j :m '>+1<CR>gv=gv
|
||||
|
||||
" Enable folding with spacebar
|
||||
nnoremap <space> za
|
||||
|
||||
" Make surrounding with various characters easier
|
||||
nmap <Leader>' ysiW'
|
||||
nmap <Leader>" ysiW"
|
||||
nmap <Leader>0 ysiW)
|
||||
|
||||
" Go to normal mode by tapping jk or kj
|
||||
inoremap kj <Esc>
|
||||
inoremap jk <Esc>
|
||||
|
||||
" Easier buffer closing
|
||||
nnoremap <Leader>q :bd<CR>
|
||||
|
||||
" Close splits instead of buffers
|
||||
" nnoremap <Leader>q :<C-w>q<CR>
|
||||
|
||||
" Swap to previous buffer
|
||||
nnoremap <Leader><Tab> :b#<CR>
|
||||
|
||||
" Map backspace to delete
|
||||
nnoremap <BS> h<DEL>
|
||||
vnoremap <BS> d
|
||||
|
||||
" Save with <Leader>s in normal and insert mode
|
||||
noremap <silent> <Leader>s :update<CR>
|
||||
inoremap <silent> <Leader>s <ESC>:update<CR>
|
||||
" Sudo save with <Leader>S
|
||||
noremap <silent> <Leader>S :w !sudo tee % > /dev/null<CR>
|
||||
" map sort function to a key
|
||||
vnoremap <Leader>s :sort<CR>
|
||||
|
||||
" Writes to all buffers when switching to another buffer
|
||||
set autowrite
|
||||
|
||||
" Enable tabs plugin
|
||||
let g:airline#extensions#tabline#enabled = 1
|
||||
let g:airline#extensions#tabline#left_sep = ' '
|
||||
let g:airline#extensions#tabline#left_alt_sep = '|'
|
||||
" let g:airline_left_sep='>'
|
||||
" let g:airline_right_sep='<'
|
||||
" let g:airline_detect_modified=1
|
||||
let g:airline_powerline_fonts=1
|
||||
" let g:airline_section_b = '%{strftime("%c")}'
|
||||
" let g:airline_section_y = 'BN: %{bufnr("%")} FT: %y'
|
||||
let g:airline#extensions#ale#enabled = 1
|
||||
|
||||
" Enable wildmenu which is an enhanced command completion
|
||||
"
|
||||
set wildmenu
|
||||
" Better copy & paste
|
||||
" When you want to paste large blocks of code into vim, press F2 before you
|
||||
" paste. At the bottom you should see ``-- INSERT (paste) --``.
|
||||
|
||||
set pastetoggle=<F2>
|
||||
set clipboard=unnamed
|
||||
|
||||
" Mouse and backspace
|
||||
set mouse=a " on OSX press ALT and click
|
||||
set bs=2 " make backspace behave like normal again
|
||||
|
||||
" Remember the cursor last position
|
||||
if has("autocmd")
|
||||
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
|
||||
endif
|
||||
|
||||
" Set VIMHOME
|
||||
if has('win32') || has ('win64')
|
||||
let $VIMHOME = $VIM."/vimfiles"
|
||||
else
|
||||
let $VIMHOME = $HOME."/.vim"
|
||||
endif
|
||||
|
||||
" Bind nohl
|
||||
" Removes highlight of your last search
|
||||
" ``<C>`` stands for ``CTRL`` and therefore ``<C-n>`` stands for ``CTRL+n``
|
||||
noremap <F3> :nohl<CR>
|
||||
vnoremap <F3> :nohl<CR>
|
||||
"inoremap <C-n> :nohl<CR>
|
||||
noremap <F5> :syntax sync fromstart<CR>
|
||||
vnoremap <F5> :syntax sync fromstart<CR>
|
||||
|
||||
" Tab switching
|
||||
noremap<C-tab> :b#
|
||||
vnoremap <C-tab> :b#
|
||||
"inoremap <C-n> :b#
|
||||
|
||||
" Quicksave command
|
||||
" noremap <C-Z> :update<CR>
|
||||
" vnoremap <C-Z> <C-C>:update<CR>
|
||||
" inoremap <C-Z> <C-O>:update<CR>
|
||||
|
||||
" bind Ctrl+<movement> keys to move around the windows, instead of using
|
||||
" Ctrl+w + <movement>
|
||||
" Every unnecessary keystroke that can be saved is good for your health :)
|
||||
"nmap <c-j> :wincmd j
|
||||
map <c-j> <c-w>j
|
||||
map <c-k> <c-w>k
|
||||
map <c-l> <c-w>l
|
||||
map <c-h> <c-w>h
|
||||
|
||||
" easier moving between tabs
|
||||
map <Leader>m <esc>;bn<CR>
|
||||
map <Leader>n <esc>;bp<CR>
|
||||
|
||||
" Create empty buffer and open it
|
||||
map <Leader>t <esc>:enew<CR>
|
||||
|
||||
" easier moving of code blocks
|
||||
" Try to go into visual mode (v), thenselect several lines of code here and
|
||||
" then press `>` several times.
|
||||
vnoremap < <gv " better indentation
|
||||
vnoremap > >gv " better indentation
|
||||
|
||||
" Show whitespace
|
||||
" MUST be inserted BEFORE the colorscheme command
|
||||
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
|
||||
au InsertLeave * match ExtraWhitespace /\s\+$/
|
||||
|
||||
" Color scheme
|
||||
" mkdir -p ~/.vim/colors && cd ~/.vim/colors
|
||||
" wget -O wombat256mod.vim
|
||||
" http://www.vim.org/scripts/download_script.php?src_id=13400
|
||||
set t_Co=256
|
||||
color wombat256mod
|
||||
" color ronakg
|
||||
" color mayansmoke
|
||||
" color github
|
||||
|
||||
" Spelling
|
||||
" set spell
|
||||
" set complete+=kpspell
|
||||
|
||||
" Enable syntax highlighting
|
||||
" You need to reload this file for the change to apply
|
||||
filetype off
|
||||
filetype plugin indent on
|
||||
syntax on
|
||||
|
||||
" In visual mode searches for the selected word
|
||||
vnoremap // y/<C-R>"<CR>
|
||||
|
||||
" Showing line numbers and length
|
||||
set tw=0 " width of document (used by gd)
|
||||
" set tw=120 " width of document (used by gd)
|
||||
set nowrap " don't automatically wrap on load
|
||||
set fo-=t " don't automatically wrap text when typing
|
||||
" set colorcolumn=80
|
||||
set colorcolumn=0
|
||||
" highlight ColorColumn ctermbg=233
|
||||
highlight ColorColumn ctermbg=001
|
||||
|
||||
|
||||
" Useful settings
|
||||
set history=700
|
||||
set undolevels=700
|
||||
|
||||
" Real programmers don't use TABs but spaces
|
||||
set tabstop=4
|
||||
set softtabstop=4
|
||||
set shiftwidth=4
|
||||
set shiftround
|
||||
set expandtab
|
||||
|
||||
" Make search case insensitive
|
||||
set hlsearch
|
||||
set incsearch
|
||||
set ignorecase
|
||||
set smartcase
|
||||
|
||||
" Disable stupid backup and swap files - they trigger too many events
|
||||
" for file system watchers
|
||||
"set nobackup
|
||||
"set nowritebackup
|
||||
"set noswapfile
|
||||
|
||||
" Backup files are great so lets keep them in 1 place
|
||||
" Make sure you have ~/vimtmp/ folder. In the future will
|
||||
" move /vimtmp/ in $VIMHOME
|
||||
set backupdir=~/.vim/tmp//,.
|
||||
set directory=~/.vim/tmp//,.
|
||||
set dir=~/.vim/tmp//,.
|
||||
set undodir=~/.vim/tmp/undo//
|
||||
|
||||
" Setup Pathogen to manage your plugins
|
||||
" mkdir -p ~/.vim/autoload ~/.vim/bundle
|
||||
" curl -so ~/.vim/autoload/pathogen.vim
|
||||
" https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim
|
||||
" Now you can install any plugin into a .vim/bundle/plugin-name/ folder
|
||||
|
||||
" Pathogen does not work in combatability mode so disable
|
||||
set nocp
|
||||
" let g:pathogen_disabled = ["syntastic"]
|
||||
call pathogen#infect()
|
||||
|
||||
|
||||
" Settings for vim-powerline
|
||||
" cd ~/.vim/bundle
|
||||
" git clone git://github.com/Lokaltog/vim-powerline.git
|
||||
set laststatus=2
|
||||
|
||||
" Settings for ctrlp
|
||||
" cd ~/.vim/bundle
|
||||
" git clone https://github.com/kien/ctrlp.vim.git
|
||||
let g:ctrlp_max_height = 30
|
||||
let g:ctrlp_working_path_mode = 'ar'
|
||||
set wildignore+=*.pyc
|
||||
set wildignore+=*_build/*
|
||||
set wildignore+=*/coverage/*
|
||||
|
||||
" Settings for python-mode
|
||||
" Note: I'm no longer using this. Leave this commented out
|
||||
" and uncomment the part about jedi-vim instead
|
||||
" cd ~/.vim/bundle
|
||||
" git clone https://github.com/klen/python-mode
|
||||
"" map <Leader>g :call RopeGotoDefinition()<CR>
|
||||
"" let ropevim_enable_shortcuts = 1
|
||||
"" let g:pymode_rope_goto_def_newwin = "vnew"
|
||||
" let g:pymode_rope_extended_complete = 1
|
||||
"" let g:pymode_breakpoint = 0
|
||||
"" let g:pymode_syntax = 1
|
||||
"" let g:pymode_syntax_builtin_objs = 0
|
||||
"" let g:pymode_syntax_builtin_funcs = 0
|
||||
"" map <Leader>b Oimport ipdb; ipdb.set_trace() # BREAKPOINT<C-c>
|
||||
" let g:SuperTabDefaultCompletionType = "<c-p>"
|
||||
" Settings for jedi-vim
|
||||
" cd ~/.vim/bundle
|
||||
" git clone git://github.com/davidhalter/jedi-vim.git
|
||||
" let g:jedi#usages_command = "<leader>z"
|
||||
" let g:jedi#popup_on_dot = 1
|
||||
" let g:jedi#popup_select_first = 0
|
||||
" let g:jedi#force_py_version = 3
|
||||
" let g:jedi#completions_command = '.'
|
||||
" let g:jedi#show_call_signatures = 1
|
||||
" map <Leader>b Oimport ipdb; ipdb.set_trace() # BREAKPOINT<C-c>
|
||||
|
||||
" Map C-a to select entire file
|
||||
"nnoremap <C-a> ggVG
|
||||
|
||||
" Real vimmers dont use those
|
||||
noremap <Up> <NOP>
|
||||
noremap <Down> <NOP>
|
||||
noremap <Left> <NOP>
|
||||
noremap <Right> <NOP>
|
||||
|
||||
" Do splits with Leader-\ and Leader--
|
||||
" nnoremap <silent> <C-Right> :vsp<CR>
|
||||
" nnoremap <silent> <C-Up> :sp<CR>
|
||||
noremap <leader>\ :vsp<CR>
|
||||
noremap <leader>- :sp<CR>
|
||||
|
||||
" NERDTree settings
|
||||
" Open NERDTree by default
|
||||
"autocmd VimEnter * NERDTree
|
||||
"autocmd VimEnter * wincmd p
|
||||
" Toggle NEDRTree plugin
|
||||
noremap <C-b> :NERDTreeToggle<CR>
|
||||
let NERDTreeIgnore = ['\.pyc$', '__pycache__', '.mypy_cache', '.pytest_cache']
|
||||
let NERDTreeShowHidden=1
|
||||
|
||||
" Better navigating through omnicomplete option list
|
||||
" See
|
||||
"http://stackoverflow.com/questions/2170023/how-to-map-keys-for-popup-menu-in-vim
|
||||
set completeopt=longest,menuone
|
||||
function! OmniPopup(action)
|
||||
if pumvisible()
|
||||
if a:action == 'j'
|
||||
return "\<C-N>"
|
||||
elseif a:action == 'k'
|
||||
return "\<C-P>"
|
||||
endif
|
||||
endif
|
||||
return a:action
|
||||
endfunction
|
||||
|
||||
" Python folding
|
||||
" mkdir -p ~/.vim/ftplugin
|
||||
" wget -O ~/.vim/ftplugin/python_editing.vim
|
||||
"http://www.vim.org/scripts/download_script.php?src_id=5492
|
||||
set foldenable
|
||||
|
||||
" Keep undo history even after closing file
|
||||
set undofile
|
||||
|
||||
" Setups template files (more on this - https://shapeshed.com/vim-templates/)
|
||||
if has("autocmd")
|
||||
augroup templates
|
||||
autocmd BufNewFile *.py 0r ~/.vim/templates/skeleton.py
|
||||
autocmd BufNewFile *.sh 0r ~/.vim/templates/skeleton.sh
|
||||
augroup END
|
||||
endif
|
||||
|
||||
" comment out highlighted lines according to file type
|
||||
" put a line like the following in your ~/.vim/filetype.vim file
|
||||
" and remember to turn on filetype detection: filetype on
|
||||
" au! BufRead,BufNewFile *.sh,*.tcl,*.php,*.pl let Comment="#"
|
||||
" if the comment character for a given filetype happens to be @
|
||||
" then use let Comment="\@" to avoid problems...
|
||||
" function! CommentLines()
|
||||
" "let Comment="#" " shell, tcl, php, perl
|
||||
" exe ":s@^@".g:Comment."@g"
|
||||
" exe ":s@$@".g:EndComment."@g"
|
||||
" endfunction
|
||||
" " map visual mode keycombo 'co' to this function
|
||||
" vmap co :call CommentLines()<CR>
|
||||
|
||||
" Encryption algo (vim -x file)
|
||||
set cm=blowfish2
|
||||
|
||||
" Improve perfomance with long lines
|
||||
set synmaxcol=200
|
||||
|
||||
set autoread
|
||||
|
||||
" Autosave
|
||||
" augroup autoSaveAndRead
|
||||
" autocmd!
|
||||
" autocmd TextChanged,InsertLeave,FocusLost * silent! wall
|
||||
" autocmd CursorHold * silent! checktime
|
||||
" augroup END
|
||||
|
||||
" Lion alignment operator config (see https://github.com/tommcdo/vim-lion)
|
||||
let b:lion_squeeze_spaces = 1
|
||||
|
||||
set showmatch
|
||||
set matchtime=3
|
||||
|
||||
" Fold functions in bash
|
||||
let g:sh_fold_enabled=3
|
||||
|
||||
" Recompute syntax highlighting
|
||||
nnoremap <silent> <F4> :syntax sync fromstart<CR>
|
||||
|
||||
autocmd FileType markdown syntax sync fromstart
|
||||
|
||||
set cursorline
|
||||
" Minimal number of lines before scrolling
|
||||
set scrolloff=3
|
||||
set sidescrolloff=3
|
||||
|
||||
" Easier line joining
|
||||
if v:version > 703 || v:version == 703 && has('patch541')
|
||||
set formatoptions+=j
|
||||
endif
|
||||
|
||||
set relativenumber
|
||||
|
||||
" nnoremap <leader>Q :qa<CR>
|
||||
|
||||
" Remap ; to be : - save 1 key press :P
|
||||
nnoremap ; :
|
||||
nnoremap : ;
|
||||
|
||||
" Gundo docs https://sjl.bitbucket.io/gundo.vim/
|
||||
let g:gundo_prefer_python3 = 1
|
||||
nnoremap <F6> :GundoToggle<CR>
|
||||
|
||||
" Auto encrypt files related to courseworks at uni
|
||||
augroup encrypted
|
||||
autocmd BufNewFile */soton/*/coursework* :X
|
||||
augroup END
|
||||
|
||||
" SEttings for Go
|
||||
let g:neocomplete#enable_at_startup = 1 " DO NOT MOVE in another file
|
||||
let g:xptemplate_key = '<Space><Space>'
|
||||
|
||||
" Put these lines at the very end of your vimrc file.
|
||||
|
||||
" Load all plugins now.
|
||||
" Plugins need to be added to runtimepath before helptags can be generated.
|
||||
packloadall
|
||||
" Load all of the helptags now, after plugins have been loaded.
|
||||
" All messages and errors will be ignored.
|
||||
silent! helptags ALL
|
||||
|
||||
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git'
|
||||
|
||||
au BufNewFile,BufRead,BufReadPost *.thrift set syntax=thrift
|
||||
|
||||
" Autosave sessions
|
||||
fu! SaveSess()
|
||||
execute 'mksession! ' . '~/.vim/tmp/sessions/' . substitute(getcwd(), "/", '!', "g"). '.session.vim'
|
||||
endfunction
|
||||
|
||||
fu! RestoreSess()
|
||||
let l:name = expand('~/.vim/tmp/sessions/') . substitute(getcwd(), "/", '!', "g") . '.session.vim'
|
||||
if filereadable(l:name)
|
||||
execute 'so ' . l:name
|
||||
endif
|
||||
endfunction
|
||||
|
||||
autocmd VimLeave,BufWritePost * call SaveSess()
|
||||
" autocmd VimEnter * nested call RestoreSess()
|
||||
nnoremap <leader>r :call RestoreSess()<CR>
|
||||
|
||||
set updatetime=100
|
||||
|
||||
" highlight GitGutterDelete guifg=#990000 ctermfg=1
|
||||
" highlight GitGutterAdd guifg=#009900 ctermfg=2
|
||||
" highlight GitGutterChange guifg=#997c00 ctermfg=3
|
||||
|
||||
" Move up and down in autocomplete with <c-j> and <c-k>
|
||||
" inoremap <expr> <c-j> ("\<C-n>")
|
||||
" inoremap <expr> <c-k> ("\<C-p>")
|
||||
" inoremap <expr> <TAB> pumvisible() ? '<C-n>' : <TAB> " pumvisible is slow
|
||||
" inoremap <expr> k pumvisible() ? '<C-p>' : 'k'
|
||||
"
|
||||
" inoremap <expr> <TAB> '<C-n>'
|
||||
" inoremap <expr> <S-TAB> '<C-p>'
|
||||
" let g:pymode=0
|
||||
File diff suppressed because it is too large
Load diff
17
.zshenv
17
.zshenv
|
|
@ -1,17 +0,0 @@
|
|||
# export PYENV_ROOT="$HOME/.pyenv"
|
||||
# export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
# eval "$(pyenv init -)"
|
||||
|
||||
#export PATH="/home/viktor/.pyenv/bin:$PATH"
|
||||
#eval "$(pyenv init -)"
|
||||
#eval "$(pyenv virtualenv-init -)"
|
||||
|
||||
|
||||
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
|
||||
export VIRTUALENV_PYTHON=python3
|
||||
export WORKON_HOME=$HOME/.virtualenvs
|
||||
# export VIRTUALENV_PYTHON=python
|
||||
|
||||
if [ -f $HOME/.virtualenvwrapper.sh ]; then
|
||||
source $HOME/.virtualenvwrapper.sh
|
||||
fi
|
||||
175
.zshrc
175
.zshrc
|
|
@ -1,175 +0,0 @@
|
|||
zmodload zsh/zprof
|
||||
#[[ $TERM != "screen" ]] && exec tmux
|
||||
# If you come from bash you might have to change your $PATH.
|
||||
# export PATH=$HOME/bin:/usr/local/bin:$PATH
|
||||
|
||||
# Path to your oh-my-zsh installation.
|
||||
export ZSH=~/.oh-my-zsh
|
||||
# unset LD_PRELOAD
|
||||
|
||||
# Set name of the theme to load. Optionally, if you set this to "random"
|
||||
# it'll load a random theme each time that oh-my-zsh is loaded.
|
||||
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
|
||||
ZSH_THEME="bira"
|
||||
# ZSH_THEME="adben"
|
||||
|
||||
# Uncomment the following line to use case-sensitive completion.
|
||||
# CASE_SENSITIVE="true"
|
||||
#
|
||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
||||
|
||||
HISTSIZE=9000
|
||||
HISTFILESIZE=9000
|
||||
#HISTFILE="~/.bash_history"
|
||||
|
||||
# Uncomment the following line to use hyphen-insensitive completion. Case
|
||||
# sensitive completion must be off. _ and - will be interchangeable.
|
||||
HYPHEN_INSENSITIVE="true"
|
||||
|
||||
# Uncomment the following line to disable bi-weekly auto-update checks.
|
||||
DISABLE_AUTO_UPDATE="true"
|
||||
|
||||
# Uncomment the following line to change how often to auto-update (in days).
|
||||
# export UPDATE_ZSH_DAYS=13
|
||||
|
||||
# Uncomment the following line to disable colors in ls.
|
||||
# DISABLE_LS_COLORS="true"
|
||||
|
||||
# Uncomment the following line to disable auto-setting terminal title.
|
||||
# DISABLE_AUTO_TITLE="true"
|
||||
|
||||
# Uncomment the following line to enable command auto-correction.
|
||||
# ENABLE_CORRECTION="true"
|
||||
|
||||
# Uncomment the following line to display red dots whilst waiting for completion.
|
||||
COMPLETION_WAITING_DOTS="true"
|
||||
|
||||
# Uncomment the following line if you want to disable marking untracked files
|
||||
# under VCS as dirty. This makes repository status check for large repositories
|
||||
# much, much faster.
|
||||
DISABLE_UNTRACKED_FILES_DIRTY="true"
|
||||
|
||||
# Uncomment the following line if you want to change the command execution time
|
||||
# stamp shown in the history command output.
|
||||
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
|
||||
HIST_STAMPS="dd.mm.yyyy"
|
||||
|
||||
# Would you like to use another custom folder than $ZSH/custom?
|
||||
# ZSH_CUSTOM=/path/to/new-custom-folder
|
||||
|
||||
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
|
||||
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
|
||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||
# Add wisely, as too many plugins slow down shell startup.
|
||||
plugins=(encode64 gitignore zsh-z)
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
# Update PROMPT to include current time
|
||||
local time='%{$terminfo[bold]$fg[red]%}%*%{$reset_color%}'
|
||||
PROMPT="╭─${user_host}${time}${current_dir}${rvm_ruby}${git_branch}${venv_prompt}
|
||||
╰─%B${user_symbol}%b "
|
||||
# tmux source-file /home/viktor/.tmux.conf
|
||||
|
||||
# User configuration
|
||||
|
||||
# export MANPATH="/usr/local/man:$MANPATH"
|
||||
|
||||
# You may need to manually set your language environment
|
||||
# export LANG=en_US.UTF-8
|
||||
|
||||
# Preferred editor for local and remote sessions
|
||||
if [[ -n $SSH_CONNECTION ]]; then
|
||||
export EDITOR='vim'
|
||||
else
|
||||
# export EDITOR='mvim'
|
||||
export EDITOR='vim'
|
||||
fi
|
||||
|
||||
# Compilation flags
|
||||
# export ARCHFLAGS="-arch x86_64"
|
||||
|
||||
# ssh
|
||||
# export SSH_KEY_PATH="~/.ssh/rsa_id"
|
||||
|
||||
# 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`.
|
||||
#
|
||||
# Example aliases
|
||||
# alias zshconfig="mate ~/.zshrc"
|
||||
# alias ohmyzsh="mate ~/.oh-my-zsh"
|
||||
#eval "$(jump shell)"
|
||||
|
||||
# Load aliases
|
||||
. ~/.bash_aliases
|
||||
|
||||
# . ~/.bash_completion
|
||||
|
||||
# Locale settings for perl
|
||||
#export LC_CTYPE=en_US.UTF-8
|
||||
#export LC_ALL=C
|
||||
#export LC_ALL=en_US.UTF-8
|
||||
|
||||
# Defined in ~/.zshenv
|
||||
# PYENV_ROOT="$HOME/.pyenv"
|
||||
# PATH="$PYENV_ROOT/bin:$PATH"
|
||||
#eval "$(pyenv init -)"
|
||||
|
||||
source /usr/local/bin/virtualenvwrapper.sh
|
||||
# eval ssh-agent > /dev/null
|
||||
# VIRTUALENVWRAPPER_PYTHON=python3
|
||||
export PYTHONBREAKPOINT=ipdb.set_trace
|
||||
source ~/.zshenv
|
||||
|
||||
# Color man pages
|
||||
export LESS_TERMCAP_mb=$'\e[1;32m'
|
||||
export LESS_TERMCAP_md=$'\e[1;32m'
|
||||
export LESS_TERMCAP_me=$'\e[0m'
|
||||
export LESS_TERMCAP_se=$'\e[0m'
|
||||
export LESS_TERMCAP_so=$'\e[01;33m'
|
||||
export LESS_TERMCAP_ue=$'\e[0m'
|
||||
export LESS_TERMCAP_us=$'\e[1;4;31m'
|
||||
|
||||
# Enable extended glob
|
||||
setopt extendedglob
|
||||
|
||||
# Enable Ctrl-x-e to edit command line
|
||||
autoload -U edit-command-line
|
||||
# Emacs style
|
||||
zle -N edit-command-line
|
||||
bindkey '^xe' edit-command-line
|
||||
bindkey '^x^e' edit-command-line
|
||||
# Vi style:
|
||||
# zle -N edit-command-line
|
||||
# bindkey -M vicmd v edit-command-line
|
||||
|
||||
# add GO to path
|
||||
export PATH="/home/viktor/go/bin:$PATH"
|
||||
#export GO111MODULE=on
|
||||
export GOPATH="/home/$USER/go"
|
||||
|
||||
# add JDK 12 go path
|
||||
export PATH="/opt/jdk-12.0.1/bin:$PATH"
|
||||
|
||||
# add azure core tools to path
|
||||
# export PATH="/opt/azure/:$PATH"
|
||||
|
||||
unset command_not_found_handle
|
||||
|
||||
# Load nvm
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"# This loads nvm
|
||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"# This loads nvm bash_completion
|
||||
|
||||
export PATH="/home/viktor/.local/bin:$PATH"
|
||||
|
||||
# Load Z to jump around recent dirs
|
||||
#. ~/z.sh
|
||||
|
||||
compinit
|
||||
|
||||
# add k8s autocompletion, must be after compinit!
|
||||
if which kubectl >/dev/null 2>/dev/null; then
|
||||
source <(kubectl completion zsh)
|
||||
fi
|
||||
52
setup.sh
52
setup.sh
|
|
@ -1,52 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Get packet manager
|
||||
if [ -x "$(command -v apk)" ]; then pm=apk
|
||||
elif [ -x "$(command -v apt)" ]; then pm="apt"
|
||||
elif [ -x "$(command -v dnf)" ]; then pm="dnf"
|
||||
elif [ -x "$(command -v zypper)" ];then pm="zypper"
|
||||
else echo "FAILED TO INSTALL PACKAGE: Package manager not found. You must manually install: zsh tmux wget"
|
||||
fi
|
||||
|
||||
# Install zsh
|
||||
if which zsh 2>/dev/null > /dev/null && which tmux 2>/dev/null >/dev/null && which wget 2>/dev/null >/dev/null; then
|
||||
echo "All needed packages are installed. Skipping install step"
|
||||
else
|
||||
echo "Installing zsh, tmux and wget..."
|
||||
sudo $pm install -y zsh tmux wget
|
||||
fi
|
||||
|
||||
# Setup oh-my-zsh
|
||||
wget -O /tmp/install.sh https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
|
||||
chmod +x /tmp/install.sh
|
||||
set +e
|
||||
echo "exit" | /tmp/install.sh
|
||||
set -e
|
||||
rm /tmp/install.sh
|
||||
|
||||
# Setup zsh config files
|
||||
wget -O ~/.zshrc https://raw.githubusercontent.com/ViktorBarzin/dot_files/master/.zshrc && \
|
||||
wget -O ~/.bash_aliases https://raw.githubusercontent.com/ViktorBarzin/dot_files/master/.bash_aliases && \
|
||||
wget -O ~/.zshenv https://raw.githubusercontent.com/ViktorBarzin/dot_files/master/.zshenv && \
|
||||
|
||||
# Setup tmux
|
||||
bash -c "cd ~ && git clone https://github.com/gpakosz/.tmux.git && ln -s -f .tmux/.tmux.conf && cp .tmux/.tmux.conf.local ."
|
||||
|
||||
wget -O ~/.tmux.conf.local https://raw.githubusercontent.com/ViktorBarzin/dot_files/master/.tmux.conf.local && \
|
||||
|
||||
# Configure z (jump)
|
||||
# git clone https://github.com/agkozak/zsh-z $ZSH_CUSTOM/plugins/zsh-z && \
|
||||
git clone https://github.com/agkozak/zsh-z ~/.oh-my-zsh/plugins/zsh-z && \
|
||||
|
||||
echo '
|
||||
___ _ _ ___ ___ ___ ___ ___
|
||||
/ __| | | |/ __/ __/ _ \/ __/ __|
|
||||
\__ \ |_| | (_| (_| __/\__ \__ \
|
||||
|___/\__,_|\___\___\___||___/___/
|
||||
|
||||
|
||||
' && \
|
||||
echo ' Run tmux to enter your newly setup environment!'
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue