Adding new stuff
This commit is contained in:
parent
39ee792ad4
commit
a410da0e04
722 changed files with 331 additions and 189 deletions
|
|
@ -31,6 +31,7 @@ alias omg="sudo service NetworkManager restart"
|
|||
alias zsh_fix="mv ~/.zsh_history ~/.zsh_history_bad; strings ~/.zsh_history_bad > ~/.zsh_history;fc -R ~/.zsh_history; rm ~/.zsh_history_bad"
|
||||
alias whatismyip="curl ifconfig.co"
|
||||
alias rmswp="find ~/.vim/tmp/ -iname \"*swp\" -delete"
|
||||
alias root="sudo su"
|
||||
|
||||
function download_github_folder() {
|
||||
svn checkout $(echo $1 | sed "s/\/tree\/[a-zA-Z]\+/\/trunk/")
|
||||
|
|
@ -70,3 +71,40 @@ function secureme(){
|
|||
cd /home/viktor/;
|
||||
sudo openvpn --config viktor.ovpn &
|
||||
}
|
||||
|
||||
function in(){
|
||||
if [ $# -ne 1 ] && [ $# -ne 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
|
||||
|
||||
if [ "$1" = "new" ] && [ $# -eq 2 ]
|
||||
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
|
||||
docker run -it --name $container_name $image_name /bin/bash
|
||||
else
|
||||
docker start $container_name >> /dev/null
|
||||
docker exec -it $container_name /bin/bash
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
334
.tmux.conf
334
.tmux.conf
|
|
@ -1,26 +1,22 @@
|
|||
# cat << EOF > /dev/null
|
||||
# https://github.com/gpakosz/.tmux
|
||||
# (‑●‑●)> released under the WTFPL v2 license, by Gregory Pakosz (@gpakosz)
|
||||
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
|
||||
# without any warranty.
|
||||
# Copyright 2012— Gregory Pakosz (@gpakosz).
|
||||
# /!\ do not edit this file
|
||||
# instead, override settings in ~/.tmux.conf.local
|
||||
# instead, override settings in ~/.tmux.conf.local, see README.md
|
||||
|
||||
|
||||
# -- general -------------------------------------------------------------------
|
||||
|
||||
set -g default-terminal "screen-256color" # colors!
|
||||
set -g xterm-keys on
|
||||
setw -g xterm-keys on
|
||||
set -s escape-time 10 # faster command sequences
|
||||
set -sg repeat-time 600 # increase repeat timeout
|
||||
set -s focus-events on
|
||||
|
||||
|
||||
# set -g prefix2 C-a # GNU-Screen compatible prefix
|
||||
# bind C-a send-prefix -2
|
||||
|
||||
unbind C-x
|
||||
unbind M-x
|
||||
set prefix M-x
|
||||
bind-key M-x send-prefix
|
||||
set -g prefix2 C-a # GNU-Screen compatible prefix
|
||||
bind C-a send-prefix -2
|
||||
|
||||
set -q -g status-utf8 on # expect UTF-8 (tmux < 2.2)
|
||||
setw -q -g utf8 on
|
||||
|
|
@ -51,7 +47,7 @@ set -g display-time 1000 # slightly longer status messages display time
|
|||
set -g status-interval 10 # redraw status line every 10 seconds
|
||||
|
||||
# clear both screen and history
|
||||
bind -n C-l send-keys C-l \; run 'sleep 0.05 && tmux clear-history'
|
||||
bind -n C-l send-keys C-l \; run 'sleep 0.1' \; clear-history
|
||||
|
||||
# activity
|
||||
set -g monitor-activity on
|
||||
|
|
@ -60,9 +56,17 @@ set -g visual-activity off
|
|||
|
||||
# -- navigation ----------------------------------------------------------------
|
||||
|
||||
# create session
|
||||
bind C-c new-session
|
||||
|
||||
# find session
|
||||
bind C-f command-prompt -p find-session 'switch-client -t %%'
|
||||
|
||||
# split current window horizontally
|
||||
bind - split-window -v
|
||||
# split current window vertically
|
||||
bind _ split-window -h
|
||||
|
||||
# pane navigation
|
||||
bind -r h select-pane -L # move left
|
||||
bind -r j select-pane -D # move down
|
||||
|
|
@ -71,6 +75,9 @@ bind -r l select-pane -R # move right
|
|||
bind > swap-pane -D # swap current pane with the next one
|
||||
bind < swap-pane -U # swap current pane with the previous one
|
||||
|
||||
# maximize current pane
|
||||
bind + run 'cut -c3- ~/.tmux.conf | sh -s _maximize_pane #{session_name} #D'
|
||||
|
||||
# pane resizing
|
||||
bind -r H resize-pane -L 2
|
||||
bind -r J resize-pane -D 2
|
||||
|
|
@ -122,16 +129,13 @@ run -b 'tmux bind -ct vi-edit Escape cancel 2> /dev/null || true'
|
|||
# -- copy mode -----------------------------------------------------------------
|
||||
|
||||
bind Enter copy-mode # enter copy mode
|
||||
bind b list-buffers # list paster buffers
|
||||
bind p paste-buffer # paste from the top pate buffer
|
||||
bind P choose-buffer # choose which buffer to paste from
|
||||
|
||||
run -b 'tmux bind -t vi-copy v begin-selection 2> /dev/null || true'
|
||||
run -b 'tmux bind -T copy-mode-vi v send -X begin-selection 2> /dev/null || true'
|
||||
run -b 'tmux bind -t vi-copy C-v rectangle-toggle 2> /dev/null || true'
|
||||
run -b 'tmux bind -T copy-mode-vi C-v send -X rectangle-toggle 2> /dev/null || true'
|
||||
run -b 'tmux bind -t vi-copy y copy-selection 2> /dev/null || true'
|
||||
run -b 'tmux bind -T copy-mode-vi y send -X copy-selection 2> /dev/null || true'
|
||||
run -b 'tmux bind -T copy-mode-vi y send -X copy-selection-and-cancel 2> /dev/null || true'
|
||||
run -b 'tmux bind -t vi-copy Escape cancel 2> /dev/null || true'
|
||||
run -b 'tmux bind -T copy-mode-vi Escape send -X cancel 2> /dev/null || true'
|
||||
run -b 'tmux bind -t vi-copy H start-of-line 2> /dev/null || true'
|
||||
|
|
@ -147,6 +151,13 @@ if -b 'command -v clip.exe > /dev/null 2>&1' 'bind y run -b "tmux save-buffer -
|
|||
if -b '[ -c /dev/clipboard ]' 'bind y run -b "tmux save-buffer - > /dev/clipboard"'
|
||||
|
||||
|
||||
# -- buffers -------------------------------------------------------------------
|
||||
|
||||
bind b list-buffers # list paste buffers
|
||||
bind p paste-buffer # paste from the top paste buffer
|
||||
bind P choose-buffer # choose which buffer to paste from
|
||||
|
||||
|
||||
# -- user defined overrides ----------------------------------------------------
|
||||
|
||||
if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'
|
||||
|
|
@ -154,7 +165,7 @@ if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'
|
|||
|
||||
# -- 8< ------------------------------------------------------------------------
|
||||
|
||||
# run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
|
||||
run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
|
||||
|
||||
|
||||
# EOF
|
||||
|
|
@ -209,80 +220,91 @@ if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'
|
|||
# }
|
||||
#
|
||||
# _toggle_mouse() {
|
||||
# if tmux show -g -w | grep -q mode-mouse; then
|
||||
# old=$(tmux show -g -w | grep mode-mouse | cut -d' ' -f2)
|
||||
# new=""
|
||||
# old=$(tmux show -gv mouse)
|
||||
# new=""
|
||||
#
|
||||
# if [ "$old" = "on" ]; then
|
||||
# new="off"
|
||||
# else
|
||||
# new="on"
|
||||
# fi
|
||||
#
|
||||
# tmux set -g mode-mouse $new \;\
|
||||
# set -g mouse-resize-pane $new \;\
|
||||
# set -g mouse-select-pane $new \;\
|
||||
# set -g mouse-select-window $new \;\
|
||||
# display "mouse: $new"
|
||||
# if [ "$old" = "on" ]; then
|
||||
# new="off"
|
||||
# else
|
||||
# old=$(tmux show -g | grep mouse | head -n 1 | cut -d' ' -f2)
|
||||
# new=""
|
||||
#
|
||||
# if [ "$old" = "on" ]; then
|
||||
# new="off"
|
||||
# else
|
||||
# new="on"
|
||||
# fi
|
||||
#
|
||||
# tmux set -g mouse $new \;\
|
||||
# display "mouse: $new"
|
||||
# new="on"
|
||||
# fi
|
||||
#
|
||||
# tmux set -g mouse $new \;\
|
||||
# display "mouse: $new"
|
||||
# }
|
||||
#
|
||||
# _battery() {
|
||||
# charge=0
|
||||
# uname_s=$(uname -s)
|
||||
# case "$uname_s" in
|
||||
# *Darwin*)
|
||||
# batt=$(pmset -g batt)
|
||||
# percentage=$(echo "$batt" |egrep -o [0-9]+%) || return
|
||||
# discharging=$(echo "$batt" | grep -qi "discharging" && echo "true" || echo "false")
|
||||
# charge="${percentage%%%} / 100"
|
||||
# while IFS= read -r line; do
|
||||
# if [ x"$discharging" != x"true" ]; then
|
||||
# discharging=$(printf '%s' "$line" | grep -qi "discharging" && echo "true" || echo "false")
|
||||
# fi
|
||||
# percentage=$(printf '%s' "$line" | grep -E -o '[0-9]+%')
|
||||
# charge=$(awk -v charge="$charge" -v percentage="${percentage%%%}" 'BEGIN { print charge + percentage / 100 }')
|
||||
# count=$((count + 1))
|
||||
# done << EOF
|
||||
# $(pmset -g batt | grep 'InternalBattery')
|
||||
# EOF
|
||||
# ;;
|
||||
# *Linux*)
|
||||
# batpath=/sys/class/power_supply/BAT0
|
||||
# if [ ! -d $batpath ]; then
|
||||
# batpath=/sys/class/power_supply/BAT1
|
||||
# fi
|
||||
# discharging=$(grep -qi "discharging" $batpath/status && echo "true" || echo "false")
|
||||
# bat_capacity=$batpath/capacity
|
||||
# bat_energy_full=$batpath/energy_full
|
||||
# bat_energy_now=$batpath/energy_now
|
||||
# if [ -r "$bat_capacity" ]; then
|
||||
# charge="$(cat $bat_capacity) / 100"
|
||||
# else
|
||||
# if [ ! -r "$bat_energy_full" ] || [ ! -r "$bat_energy_now" ]; then
|
||||
# return
|
||||
# while IFS= read -r batpath; do
|
||||
# if [ x"$discharging" != x"true" ]; then
|
||||
# discharging=$(grep -qi "discharging" "$batpath/status" && echo "true" || echo "false")
|
||||
# fi
|
||||
# charge="$(cat $bat_energy_now) / $(cat $bat_energy_full)" || return
|
||||
# fi
|
||||
# bat_capacity="$batpath/capacity"
|
||||
# if [ -r "$bat_capacity" ]; then
|
||||
# charge=$(awk -v charge="$charge" -v capacity="$(cat "$bat_capacity")" 'BEGIN { print charge + capacity / 100 }')
|
||||
# else
|
||||
# bat_energy_full="$batpath/energy_full"
|
||||
# bat_energy_now="$batpath/energy_now"
|
||||
# if [ -r "$bat_energy_full" ] && [ -r "$bat_energy_now" ]; then
|
||||
# charge=$(awk -v charge="$charge" -v energy_now="$(cat "$bat_energy_now")" -v energy_full="$(cat "$bat_energy_full")" 'BEGIN { print charge + energy_now / energy_full }')
|
||||
# fi
|
||||
# fi
|
||||
# count=$((count + 1))
|
||||
# done << EOF
|
||||
# $(find /sys/class/power_supply -maxdepth 1 -iname '*bat*')
|
||||
# EOF
|
||||
# ;;
|
||||
# *CYGWIN*)
|
||||
# wmic path Win32_Battery 2>&1 | grep -q 'No Instance' && return
|
||||
# discharging=$(wmic path Win32_Battery Get BatteryStatus 2>/dev/null | grep -q 1 && echo "true" || echo "false")
|
||||
# percentage=$(wmic path Win32_Battery Get EstimatedChargeRemaining /format:list 2>/dev/null | grep '[^[:blank:]]' | cut -d= -f2)
|
||||
# charge="${percentage} / 100"
|
||||
# *CYGWIN*|*MSYS*|*MINGW*)
|
||||
# while IFS= read -r line; do
|
||||
# [ -z "$line" ] && continue
|
||||
# if [ x"$discharging" != x"true" ]; then
|
||||
# discharging=$(printf '%s' "$line" | awk '{ s = ($1 == 1) ? "true" : "false"; print s }')
|
||||
# fi
|
||||
# charge=$(printf '%s' "$line" | awk -v charge="$charge" '{ print charge + $2 / 100 }')
|
||||
# count=$((count + 1))
|
||||
# done << EOF
|
||||
# $(wmic path Win32_Battery get BatteryStatus, EstimatedChargeRemaining | tr -d '\r' | tail -n +2)
|
||||
# EOF
|
||||
# ;;
|
||||
# *OpenBSD*)
|
||||
# discharging=$(sysctl -n hw.sensors.acpibat0.raw0 | grep -q 1 && echo "true" || echo "false")
|
||||
# if sysctl -n hw.sensors.acpibat0 | grep -q amphour; then
|
||||
# charge="$(sysctl -n hw.sensors.acpibat0.amphour3 | cut -d' ' -f1) / $(sysctl -n hw.sensors.acpibat0.amphour0 | cut -d' ' -f1)"
|
||||
# else
|
||||
# charge="$(sysctl -n hw.sensors.acpibat0.watthour3 | cut -d' ' -f1) / $(sysctl -n hw.sensors.acpibat0.watthour0 | cut -d' ' -f1)"
|
||||
# fi
|
||||
# for batid in 0 1 2; do
|
||||
# sysctl -n "hw.sensors.acpibat$batid.raw0" 2>&1 | grep -q 'not found' && continue
|
||||
# if [ x"$discharging" != x"true" ]; then
|
||||
# discharging=$(sysctl -n "hw.sensors.acpibat$batid.raw0" | grep -q 1 && echo "true" || echo "false")
|
||||
# fi
|
||||
# if sysctl -n "hw.sensors.acpibat$batid" | grep -q amphour; then
|
||||
# charge=$(awk -v charge="$charge" -v remaining="$(sysctl -n hw.sensors.acpibat$batid.amphour3 | cut -d' ' -f1)" -v full="$(sysctl -n hw.sensors.acpibat$batid.amphour0 | cut -d' ' -f1)" 'BEGIN { print charge + remaining / full }')
|
||||
# else
|
||||
# charge=$(awk -v charge="$charge" -v remaining="$(sysctl -n hw.sensors.acpibat$batid.watthour3 | cut -d' ' -f1)" -v full="$(sysctl -n hw.sensors.acpibat$batid.watthour0 | cut -d' ' -f1)" 'BEGIN { print charge + remaining / full }')
|
||||
# fi
|
||||
# count=$((count + 1))
|
||||
# done
|
||||
# ;;
|
||||
# *)
|
||||
# return
|
||||
# esac
|
||||
# charge=$(awk -v charge="$charge" -v count="$count" 'BEGIN { print charge / count }')
|
||||
# if [ "$charge" -eq 0 ]; then
|
||||
# tmux set -ug '@battery_status' \;\
|
||||
# set -ug '@battery_bar' \;\
|
||||
# set -ug '@battery_hbar' \;\
|
||||
# set -ug '@battery_vbar' \;\
|
||||
# set -ug '@battery_percentage'
|
||||
# return
|
||||
# fi
|
||||
#
|
||||
# variables=$(tmux show -gqv '@battery_bar_symbol_full' \;\
|
||||
# show -gqv '@battery_bar_symbol_empty' \;\
|
||||
|
|
@ -431,7 +453,7 @@ if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'
|
|||
# ssh_only=$2
|
||||
# # shellcheck disable=SC2039
|
||||
# if [ x"$OSTYPE" = x"cygwin" ]; then
|
||||
# pid=$(ps -a | awk -v tty="${tty##/dev/}" '$5 == tty && /ssh/ && && !/vagrant ssh/ && !/autossh/ && !/-W/ { print $1 }')
|
||||
# pid=$(ps -a | awk -v tty="${tty##/dev/}" '$5 == tty && /ssh/ && !/vagrant ssh/ && !/autossh/ && !/-W/ { print $1 }')
|
||||
# [ -n "$pid" ] && ssh_parameters=$(tr '\0' ' ' < "/proc/$pid/cmdline" | sed 's/^ssh //')
|
||||
# else
|
||||
# ssh_parameters=$(ps -t "$tty" -o command= | awk '/ssh/ && !/vagrant ssh/ && !/autossh/ && !/-W/ { $1=""; print $0; exit }')
|
||||
|
|
@ -514,7 +536,7 @@ if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'
|
|||
# boot=$(sysctl -q -n kern.boottime | awk -F'[ ,:]+' '{ print $4 }')
|
||||
# now=$(date +%s)
|
||||
# ;;
|
||||
# *Linux*|*CYGWIN*)
|
||||
# *Linux*|*CYGWIN*|*MSYS*|*MINGW*)
|
||||
# now=$(cut -d' ' -f1 < /proc/uptime)
|
||||
# ;;
|
||||
# *OpenBSD*)
|
||||
|
|
@ -583,81 +605,96 @@ if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'
|
|||
# }
|
||||
#
|
||||
# _apply_bindings() {
|
||||
# line=$(tmux list-keys | grep new-window | head -1)
|
||||
# prefix=${line%new-window*}
|
||||
# column=${#prefix}
|
||||
#
|
||||
# tmux_conf_new_window_retain_current_path=${tmux_conf_new_window_retain_current_path:-false}
|
||||
# if _is_enabled "$tmux_conf_new_window_retain_current_path"; then
|
||||
# tmux bind c new-window -c '#{pane_current_path}'
|
||||
# else
|
||||
# tmux bind c new-window
|
||||
# fi
|
||||
# while IFS= read -r line; do
|
||||
# [ -z "$line" ] && continue
|
||||
# left=$(printf '%s' "$line" | cut -c-"$column" | sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g')
|
||||
# if _is_enabled "$tmux_conf_new_window_retain_current_path"; then
|
||||
# right=$(printf '%s' "$line" | cut -c"$column-" | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/new-window$/new-window -c "#{pane_current_path}"/g')
|
||||
# else
|
||||
# right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/-c[ \t]+"#\{pane_current_path\}"$//g')
|
||||
# fi
|
||||
# eval "tmux $left $right" 2>/dev/null || true
|
||||
# done << EOF
|
||||
# $(tmux list-keys 2>/dev/null | grep -e 'new-window\(\s\+-c\s\+"#{pane_current_path}\|$\)')
|
||||
# EOF
|
||||
#
|
||||
# tmux_conf_new_pane_retain_current_path=${tmux_conf_new_pane_retain_current_path:-true}
|
||||
# while IFS= read -r line; do
|
||||
# [ -z "$line" ] && continue
|
||||
# left=$(printf '%s' "$line" | cut -c-"$column" | sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g')
|
||||
# if _is_enabled "$tmux_conf_new_pane_retain_current_path"; then
|
||||
# right=$(printf '%s' "$line" | cut -c"$column-" | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/split-window([ \t]+-(h|v))?$/& -c "#{pane_current_path}"/g')
|
||||
# else
|
||||
# right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/-c[ \t]+"#\{pane_current_path\}"$//g')
|
||||
# fi
|
||||
# eval "tmux $left $right" 2>/dev/null || true
|
||||
# done << EOF
|
||||
# $(tmux list-keys 2>/dev/null | grep -e 'split\(-\|_\)window')
|
||||
# EOF
|
||||
#
|
||||
# tmux_conf_new_pane_reconnect_ssh=${tmux_conf_new_pane_reconnect_ssh:-false}
|
||||
# if _is_enabled "$tmux_conf_new_pane_reconnect_ssh"; then
|
||||
# if _is_enabled "$tmux_conf_new_pane_retain_current_path"; then
|
||||
# tmux bind '"' run "cut -c3- ~/.tmux.conf | sh -s _split_window #{pane_tty} -v -c '#{pane_current_path}'" \;\
|
||||
# bind % run "cut -c3- ~/.tmux.conf | sh -s _split_window #{pane_tty} -h -c '#{pane_current_path}'" \;\
|
||||
# bind - run "cut -c3- ~/.tmux.conf | sh -s _split_window #{pane_tty} -v -c '#{pane_current_path}'" \;\
|
||||
# bind _ run "cut -c3- ~/.tmux.conf | sh -s _split_window #{pane_tty} -h -c '#{pane_current_path}'"
|
||||
# while IFS= read -r line; do
|
||||
# [ -z "$line" ] && continue
|
||||
# left=$(printf '%s' "$line" | cut -c-"$column" | sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g')
|
||||
# if _is_enabled "$tmux_conf_new_pane_reconnect_ssh"; then
|
||||
# right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/split-window([^;]+)/run-shell "cut -c3- ~\/\.tmux\.conf | sh -s _split_window #{pane_tty}\1"/g')
|
||||
# else
|
||||
# tmux bind '"' run "cut -c3- ~/.tmux.conf | sh -s _split_window #{pane_tty} -v" \;\
|
||||
# bind % run "cut -c3- ~/.tmux.conf | sh -s _split_window #{pane_tty} -h" \;\
|
||||
# bind - run "cut -c3- ~/.tmux.conf | sh -s _split_window #{pane_tty} -v" \;\
|
||||
# bind _ run "cut -c3- ~/.tmux.conf | sh -s _split_window #{pane_tty} -h"
|
||||
# right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/run-shell "cut -c3- ~\/\.tmux\.conf \| sh -s _split_window #\{pane_tty\}([^;]+)"/split-window\1/g' -e 's/#\{.+\}/\"&\"/g')
|
||||
# fi
|
||||
# else
|
||||
# if _is_enabled "$tmux_conf_new_pane_retain_current_path"; then
|
||||
# tmux bind '"' split-window -v -c '#{pane_current_path}' \;\
|
||||
# bind % split-window -h -c '#{pane_current_path}' \;\
|
||||
# bind - split-window -v -c '#{pane_current_path}' \;\
|
||||
# bind _ split-window -h -c '#{pane_current_path}'
|
||||
# else
|
||||
# tmux bind '"' split-window -v \;\
|
||||
# bind % split-window -h \;\
|
||||
# bind - split-window -v \;\
|
||||
# bind _ split-window -h
|
||||
# fi
|
||||
# fi
|
||||
# eval "tmux $left $right" 2>/dev/null || true
|
||||
# done << EOF
|
||||
# $(tmux list-keys 2>/dev/null | grep -e 'split\(-\|_\)window')
|
||||
# EOF
|
||||
#
|
||||
# tmux_conf_new_session_prompt=${tmux_conf_new_session_prompt:-false}
|
||||
# if _is_enabled "$tmux_conf_new_session_prompt"; then
|
||||
# tmux bind C-c command-prompt -p new-session 'new-session -s "%%"'
|
||||
# else
|
||||
# tmux bind C-c new-session
|
||||
# fi
|
||||
#
|
||||
# if tmux -q -L swap-pane-test -f /dev/null new-session -d \; new-window \; new-window \; swap-pane -t :1 \; kill-session; then
|
||||
# tmux bind + run 'cut -c3- ~/.tmux.conf | sh -s _maximize_pane #{session_name} #D'
|
||||
# else
|
||||
# tmux bind + display 'your tmux version has a buggy swap-pane command - see ticket #108, fixed in upstream commit 78e783e'
|
||||
# fi
|
||||
# while IFS= read -r line; do
|
||||
# [ -z "$line" ] && continue
|
||||
# left=$(printf '%s' "$line" | cut -c-"$column" | sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g')
|
||||
# if _is_enabled "$tmux_conf_new_session_prompt"; then
|
||||
# right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/new-session$/command-prompt -p new-session \"new-session -s %%\"/g')
|
||||
# else
|
||||
# right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }'| sed -E -e 's/command-prompt -p new-session[^;]+/new-session/g')
|
||||
# fi
|
||||
# eval "tmux $left $right" 2>/dev/null || true
|
||||
# done << EOF
|
||||
# $(tmux list-keys 2>/dev/null | grep -e 'new-session')
|
||||
# EOF
|
||||
#
|
||||
# tmux_conf_copy_to_os_clipboard=${tmux_conf_copy_to_os_clipboard:-false}
|
||||
# if _is_enabled "$tmux_conf_copy_to_os_clipboard"; then
|
||||
# if command -v pbcopy > /dev/null 2>&1; then
|
||||
# tmux bind -t vi-copy y copy-pipe 'pbcopy' 2> /dev/null || true
|
||||
# tmux bind -T copy-mode-vi y send -X copy-pipe-and-cancel 'pbcopy' 2> /dev/null || true
|
||||
# fi
|
||||
# if command -v reattach-to-user-namespace > /dev/null 2>&1; then
|
||||
# tmux bind -t vi-copy y copy-pipe 'reattach-to-user-namespace pbcopy' 2> /dev/null || true
|
||||
# tmux bind -T copy-mode-vi y send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy' 2> /dev/null || true
|
||||
# fi
|
||||
# if command -v xsel > /dev/null 2>&1; then
|
||||
# tmux bind -t vi-copy y copy-pipe 'xsel -i -b' 2> /dev/null || true
|
||||
# tmux bind -T copy-mode-vi y send -X copy-pipe-and-cancel 'xsel -i -b' 2> /dev/null || true
|
||||
# fi
|
||||
# if ! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1; then
|
||||
# tmux bind -t vi-copy y copy-pipe 'xclip -i -selection clipboard > /dev/null 2>&1' 2> /dev/null || true
|
||||
# tmux bind -T copy-mode-vi y send -X copy-pipe-and-cancel 'xclip -i -selection clipboard > /dev/null 2>&1' 2> /dev/null || true
|
||||
# fi
|
||||
# if command -v clip.exe > /dev/null 2>&1; then
|
||||
# tmux bind -t vi-copy y copy-pipe 'clip.exe' 2> /dev/null || true
|
||||
# tmux bind -T copy-mode-vi y send -X copy-pipe-and-cancel 'clip.exe' 2> /dev/null || true
|
||||
# fi
|
||||
# if [ -c /dev/clipboard ] > /dev/null 2>&1; then
|
||||
# tmux bind -t vi-copy y copy-pipe 'cat > /dev/clipboard' 2> /dev/null || true
|
||||
# tmux bind -T copy-mode-vi y send -X copy-pipe-and-cancel 'cat > /dev/clipboard' 2> /dev/null || true
|
||||
# fi
|
||||
# fi
|
||||
# command -v pbcopy > /dev/null 2>&1 && command='pbcopy'
|
||||
# command -v reattach-to-user-namespace > /dev/null 2>&1 && command='reattach-to-user-namespace pbcopy'
|
||||
# command -v xsel > /dev/null 2>&1 && command='xsel -i -b'
|
||||
# ! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1 && command='xclip -i -selection clipboard > \/dev\/null 2>\&1'
|
||||
# command -v clip.exe > /dev/null 2>&1 && command='clip\.exe'
|
||||
# [ -c /dev/clipboard ] && command='cat > \/dev\/clipboard'
|
||||
#
|
||||
# if [ -n "$command" ]; then
|
||||
# # shellcheck disable=SC2086
|
||||
# for table in "" "-t emacs-copy" "-t vi-copy"; do
|
||||
# line=$(tmux list-keys $table 2>/dev/null | grep -e 'copy-selection\|copy-pipe' | head -1)
|
||||
# prefix=${line%copy-*}
|
||||
# column=${#prefix}
|
||||
# [ -z "$line" ] && continue
|
||||
#
|
||||
# while IFS= read -r line; do
|
||||
# [ -z "$line" ] && continue
|
||||
# left=$(printf '%s' "$line" | cut -c-"$column" | sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g')
|
||||
# if _is_enabled "$tmux_conf_copy_to_os_clipboard"; then
|
||||
# right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e "s/copy-selection(-and-cancel)?$/copy-pipe\1 \"$command\"/g")
|
||||
# else
|
||||
# right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e "s/copy-pipe(-and-cancel)? \"$command\"$/copy-selection\1/g")
|
||||
# fi
|
||||
# eval "tmux $left $right" 2>/dev/null || true
|
||||
# done << EOF
|
||||
# $(tmux list-keys $table 2>/dev/null | grep -e 'copy-selection\|copy-pipe')
|
||||
# EOF
|
||||
# done
|
||||
# fi
|
||||
# }
|
||||
#
|
||||
# _apply_theme() {
|
||||
|
|
@ -867,19 +904,10 @@ if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'
|
|||
# $tmux_conf_theme_status_left
|
||||
# EOF
|
||||
# )
|
||||
#
|
||||
# # are we running a tmux in between v1.9 and v2.0?
|
||||
# if [ x"$(tmux -q -L tmux_theme_status_left_test -f /dev/null new-session -d \; show -g -v status-left \; kill-session)" = x"[#S] " ]; then
|
||||
# case "$status_left" in
|
||||
# *\ )
|
||||
# ;;
|
||||
# *)
|
||||
# status_left="$status_left "
|
||||
# ;;
|
||||
# esac
|
||||
# fi
|
||||
# fi
|
||||
#
|
||||
# status_left="$status_left "
|
||||
#
|
||||
# # -- status right style
|
||||
#
|
||||
# tmux_conf_theme_status_right=${tmux_conf_theme_status_right-'#{pairing}#{prefix} #{battery_status} #{battery_bar} #{battery_percentage} , %R , %d %b | #{username} | #{hostname} '}
|
||||
|
|
@ -1083,5 +1111,3 @@ if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'
|
|||
# }
|
||||
#
|
||||
# "$@"
|
||||
run-shell /opt/tmux-ressurect/resurrect.tmux
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
# https://github.com/gpakosz/.tmux
|
||||
# (‑●‑●)> released under the WTFPL v2 license, by Gregory Pakosz (@gpakosz)
|
||||
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
|
||||
# without any warranty.
|
||||
# Copyright 2012— Gregory Pakosz (@gpakosz).
|
||||
|
||||
|
||||
# -- navigation ----------------------------------------------------------------
|
||||
|
|
@ -128,10 +130,10 @@ 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='' # /!\ you don't need to install Powerline
|
||||
#tmux_conf_theme_left_separator_sub='' # you only need fonts patched with
|
||||
#tmux_conf_theme_right_separator_main='' # Powerline symbols or the standalone
|
||||
#tmux_conf_theme_right_separator_sub='' # PowerlineSymbols.otf font
|
||||
tmux_conf_theme_left_separator_main='' # /!\ you don't need to install Powerline
|
||||
tmux_conf_theme_left_separator_sub='' # you only need fonts patched with
|
||||
tmux_conf_theme_right_separator_main='' # Powerline symbols or the standalone
|
||||
tmux_conf_theme_right_separator_sub='' # PowerlineSymbols.otf font
|
||||
|
||||
# status left/right content:
|
||||
# - separate main sections with '|'
|
||||
|
|
@ -221,8 +223,9 @@ tmux_conf_battery_vbar_palette='gradient'
|
|||
# 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_discharging='🔋' # U+1F50B
|
||||
#tmux_conf_battery_status_charging='⚡ ' # U+26A1
|
||||
#tmux_conf_battery_status_charging='🔌 ' # U+1F50C
|
||||
#tmux_conf_battery_status_discharging='🔋 ' # U+1F50B
|
||||
|
||||
# clock style
|
||||
tmux_conf_theme_clock_colour='#00afff' # light blue
|
||||
|
|
@ -234,6 +237,8 @@ tmux_conf_theme_clock_style='24'
|
|||
# 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
|
||||
|
||||
|
||||
|
|
@ -243,44 +248,42 @@ tmux_conf_copy_to_os_clipboard=false
|
|||
# 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
|
||||
unbind C-x
|
||||
# unbind C-b
|
||||
# set -g prefix C-a
|
||||
# bind C-a send-prefix
|
||||
# replace C-b by Alt-a (M-a) instead of using both prefixes
|
||||
set -gu prefix2
|
||||
unbind C-a
|
||||
unbind C-b
|
||||
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 vertically
|
||||
|
||||
# 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 10
|
||||
bind k resize-pane -U 10
|
||||
bind l resize-pane -R 10
|
||||
bind h resize-pane -L 10
|
||||
|
||||
|
||||
unbind C-x
|
||||
run-shell /home/viktor/.tmux/resurrect/resurrect.tmux
|
||||
|
|
|
|||
10
.vimrc
10
.vimrc
|
|
@ -109,8 +109,16 @@ let g:airline#extensions#virtualenv#enabled = 1
|
|||
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'
|
||||
|
||||
|
||||
" 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
|
||||
|
|
@ -226,6 +234,8 @@ au InsertLeave * match ExtraWhitespace /\s\+$/
|
|||
" http://www.vim.org/scripts/download_script.php?src_id=13400
|
||||
set t_Co=256
|
||||
color wombat256mod
|
||||
" color mayansmoke
|
||||
" color github
|
||||
|
||||
" Spelling
|
||||
" set spell
|
||||
|
|
|
|||
20
.zshrc
20
.zshrc
|
|
@ -9,6 +9,7 @@ export ZSH=~/.oh-my-zsh
|
|||
# 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"
|
||||
|
|
@ -24,7 +25,7 @@ HISTFILESIZE=9000
|
|||
HYPHEN_INSENSITIVE="true"
|
||||
|
||||
# Uncomment the following line to disable bi-weekly auto-update checks.
|
||||
# DISABLE_AUTO_UPDATE="true"
|
||||
DISABLE_AUTO_UPDATE="true"
|
||||
|
||||
# Uncomment the following line to change how often to auto-update (in days).
|
||||
# export UPDATE_ZSH_DAYS=13
|
||||
|
|
@ -44,7 +45,7 @@ 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"
|
||||
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.
|
||||
|
|
@ -61,7 +62,7 @@ HIST_STAMPS="dd.mm.yyyy"
|
|||
plugins=()
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
tmux source-file /home/viktor/.tmux.conf
|
||||
# tmux source-file /home/viktor/.tmux.conf
|
||||
|
||||
# User configuration
|
||||
|
||||
|
|
@ -104,28 +105,15 @@ j () {
|
|||
|
||||
# . ~/.bash_completion
|
||||
|
||||
# Slows down shell.
|
||||
# source $ZSH/custom/plugins/zsh-git-prompt/zshrc.sh
|
||||
|
||||
|
||||
# Locale settings for perl
|
||||
#export LC_CTYPE=en_US.UTF-8
|
||||
|
||||
#export LC_ALL=C
|
||||
#export LC_ALL=en_US.UTF-8
|
||||
#sudo usermod -aG docker viktor
|
||||
#newgrp docker
|
||||
|
||||
# Send ssh key to server
|
||||
send_key() {
|
||||
cat ~/.ssh/id_rsa.pub | ssh $1 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
|
||||
}
|
||||
|
||||
PYENV_ROOT="$HOME/.pyenv"
|
||||
PATH="$PYENV_ROOT/bin:$PATH"
|
||||
eval "$(pyenv init -)"
|
||||
|
||||
|
||||
export VIRTUALENVWRAPPER_PYTHON=python
|
||||
export WORKON_HOME=$HOME/.virtualenvs
|
||||
# source /usr/local/bin/virtualenvwrapper.sh
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue