Update dotfiles
This commit is contained in:
@@ -5,9 +5,9 @@ My personal configurations, managed with the 'dotdrop' submodule.
|
|||||||
|
|
||||||
[Nord-themed.](https://www.nordtheme.com/)
|
[Nord-themed.](https://www.nordtheme.com/)
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
+ Distro: `Fedora 31`
|
+ Distro: `Fedora 31`
|
||||||
|
|||||||
2
dotdrop
2
dotdrop
Submodule dotdrop updated: f1ce2eb198...c48ea15a7c
@@ -14,8 +14,8 @@ floating_modifier $mod
|
|||||||
|
|
||||||
### Keybinds ###
|
### Keybinds ###
|
||||||
#Terminal
|
#Terminal
|
||||||
bindsym $mod+Return exec alacritty
|
bindsym $mod+Return exec --no-startup-id alacritty
|
||||||
bindsym $mod+Ctrl+Return exec xterm
|
bindsym $mod+Ctrl+Return exec --no-startup-id xterm
|
||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
bindsym $mod+h focus left
|
bindsym $mod+h focus left
|
||||||
@@ -108,7 +108,6 @@ bindsym $mod+Shift+0 move container to workspace number $ws10
|
|||||||
|
|
||||||
bindsym $mod+Shift+c reload
|
bindsym $mod+Shift+c reload
|
||||||
bindsym $mod+Shift+r restart
|
bindsym $mod+Shift+r restart
|
||||||
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'Itterasshai!' -B 'Hai!' 'i3-msg exit'"
|
|
||||||
|
|
||||||
### Design ###
|
### Design ###
|
||||||
new_window 1pixel
|
new_window 1pixel
|
||||||
@@ -140,6 +139,8 @@ bar {
|
|||||||
status_command i3status
|
status_command i3status
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'Itterasshai!' -B 'Hai!' 'i3-msg exit'"
|
||||||
|
|
||||||
# Locking
|
# Locking
|
||||||
bindsym $mod+Shift+BackSpace exec "~/scripts/lock-work"
|
bindsym $mod+Shift+BackSpace exec "~/scripts/lock-work"
|
||||||
|
|
||||||
@@ -155,6 +156,9 @@ exec "~/scripts/startup-laptop"
|
|||||||
# i3 doesnt let me put this in the startscript
|
# i3 doesnt let me put this in the startscript
|
||||||
exec_always --no-startup-id ~/.config/polybar/start.sh &
|
exec_always --no-startup-id ~/.config/polybar/start.sh &
|
||||||
|
|
||||||
|
# Powermenu
|
||||||
|
bindsym $mod+Shift+e exec "~/scripts/powermenu"
|
||||||
|
|
||||||
# Locking
|
# Locking
|
||||||
bindsym $mod+Shift+BackSpace exec "~/scripts/lock-laptop"
|
bindsym $mod+Shift+BackSpace exec "~/scripts/lock-laptop"
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ enable-ipc = false
|
|||||||
font-0 = "Inconsolata:pixelsize=11;2"
|
font-0 = "Inconsolata:pixelsize=11;2"
|
||||||
font-1 = "IPAGothic:fontformat=truetype:antialias=false:pixelsize=11"
|
font-1 = "IPAGothic:fontformat=truetype:antialias=false:pixelsize=11"
|
||||||
font-2 = "Siji:size=7;2"
|
font-2 = "Siji:size=7;2"
|
||||||
|
font-3 = "InconsolataLGC Nerd Font Mono:pixelsize=12;4"
|
||||||
|
|
||||||
bottom = false
|
bottom = false
|
||||||
fixed-center = true
|
fixed-center = true
|
||||||
@@ -68,7 +69,7 @@ override-redirect = true
|
|||||||
|
|
||||||
modules-left = i3
|
modules-left = i3
|
||||||
modules-center =
|
modules-center =
|
||||||
modules-right = spotify volume battery network date
|
modules-right = spotify backlight volume battery network date
|
||||||
separator =
|
separator =
|
||||||
|
|
||||||
wm-name = i3
|
wm-name = i3
|
||||||
@@ -148,11 +149,14 @@ format-padding = 2
|
|||||||
[module/cpu]
|
[module/cpu]
|
||||||
type = internal/cpu
|
type = internal/cpu
|
||||||
|
|
||||||
interval = 0.5
|
interval = 5
|
||||||
|
|
||||||
|
format-background = ${colors.frost1}
|
||||||
|
format-foreground = ${colors.nord0}
|
||||||
|
|
||||||
format = <label>
|
format = <label>
|
||||||
format-prefix =
|
format-prefix =
|
||||||
format-padding = 1
|
format-padding = 2
|
||||||
|
|
||||||
label = " %percentage%%"
|
label = " %percentage%%"
|
||||||
|
|
||||||
@@ -265,11 +269,17 @@ ramp-signal-4 =
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
[module/backlight]
|
[module/backlight]
|
||||||
type = internal/backlight
|
type = internal/backlight
|
||||||
|
|
||||||
|
format-padding = 2
|
||||||
|
format-background = ${colors.frost0}
|
||||||
|
format-foreground = ${colors.nord0}
|
||||||
|
|
||||||
# ls -1 /sys/class/backlight
|
# ls -1 /sys/class/backlight
|
||||||
card = amdgpu_bl0
|
card = amdgpu_bl0
|
||||||
|
|
||||||
format = <label>
|
format = <label>
|
||||||
label = %percentage%%
|
format-prefix =
|
||||||
|
label = " %percentage%%"
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
[module/load]
|
[module/load]
|
||||||
@@ -279,10 +289,24 @@ interval = 5.0
|
|||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
[module/spotify]
|
[module/spotify]
|
||||||
|
type = custom/script
|
||||||
|
|
||||||
format-padding = 2
|
format-padding = 2
|
||||||
format-background = ${colors.blue3}
|
format-background = ${colors.blue3}
|
||||||
|
format-prefix = " "
|
||||||
|
|
||||||
type = custom/script
|
|
||||||
exec = ~/.config/polybar/scripts/spotify.sh %artist% - %title%
|
exec = ~/.config/polybar/scripts/spotify.sh %artist% - %title%
|
||||||
tail = true
|
tail = true
|
||||||
interval = 2
|
interval = 2
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
[module/powerbutton]
|
||||||
|
type = custom/text
|
||||||
|
|
||||||
|
content-padding = 2
|
||||||
|
content-background = ${colors.nord1}
|
||||||
|
content-foreground = ${colors.frost2}
|
||||||
|
|
||||||
|
content = "襤"
|
||||||
|
|
||||||
|
click-left = ~/scripts/powermenu
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
configuration {
|
configuration {
|
||||||
modi: "drun,ssh";
|
modi: "drun";
|
||||||
hide-scrollbar: true;
|
hide-scrollbar: true;
|
||||||
separator-style: none;
|
|
||||||
show-icons: true;
|
show-icons: true;
|
||||||
terminal: "alacritty";
|
|
||||||
font: "Inconsolata 13";
|
font: "Inconsolata 13";
|
||||||
lines: 7;
|
lines: 7;
|
||||||
display-drun: "理";
|
display-drun: "";
|
||||||
display-ssh: "力";
|
|
||||||
theme: "nord.rasi";
|
theme: "nord.rasi";
|
||||||
width: 750;
|
width: 750;
|
||||||
fullscreen: true;
|
fullscreen: true;
|
||||||
|
|||||||
49
dotfiles/rofi/xrandrmenu.sh
Executable file
49
dotfiles/rofi/xrandrmenu.sh
Executable file
@@ -0,0 +1,49 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# options to be displyed
|
||||||
|
option0="activate all monitors"
|
||||||
|
option1="monitor <monitor0> off"
|
||||||
|
option2="monitor <monitor1> off"
|
||||||
|
option3="monitor <monitor0> primary"
|
||||||
|
option4="monitor <monitor1> primary"
|
||||||
|
option5="monitor <monitor1> same as <monitor0>"
|
||||||
|
option6="monitor <monitor1> right of <monitor0>"
|
||||||
|
option7="monitor <monitor1> left of <monitor0>"
|
||||||
|
option8="monitor <monitor1> above <monitor0>"
|
||||||
|
option9="monitor <monitor1> below <monitor0>"
|
||||||
|
option10="rotate monitor <monitor1> right"
|
||||||
|
option11="rotate monitor <monitor1> left"
|
||||||
|
option12="rotate monitor <monitor1> normal"
|
||||||
|
|
||||||
|
# Variable passed to rofi
|
||||||
|
options="$option0\n$option1\n$option2\n$option3\n$option4\n$option5\n$option6\n$option7\n$option8\n$option9\n$option10\n$option11\n$option12"
|
||||||
|
|
||||||
|
selected="$(echo -e "$options" | rofi -lines 13 -dmenu -p "xrandr")"
|
||||||
|
case $selected in
|
||||||
|
$option0)
|
||||||
|
xrandr --auto;;
|
||||||
|
$option1)
|
||||||
|
xrandr --output <monitor0> --off;;
|
||||||
|
$option2)
|
||||||
|
xrandr --output <monitor1> --off;;
|
||||||
|
$option3)
|
||||||
|
xrandr --output <monitor0> --primary;;
|
||||||
|
$option4)
|
||||||
|
xrandr --output <monitor1> --primary;;
|
||||||
|
$option5)
|
||||||
|
xrandr --output <monitor1> --same-as <monitor0>;;
|
||||||
|
$option6)
|
||||||
|
xrandr --output <monitor1> --right-of <monitor0>;;
|
||||||
|
$option7)
|
||||||
|
xrandr --output <monitor1> --left-of <monitor0>;;
|
||||||
|
$option8)
|
||||||
|
xrandr --output <monitor1> --above <monitor0>;;
|
||||||
|
$option9)
|
||||||
|
xrandr --output <monitor1> --below <monitor0>;;
|
||||||
|
$option10)
|
||||||
|
xrandr --output <monitor1> --rotate left;;
|
||||||
|
$option11)
|
||||||
|
xrandr --output <monitor1> --rotate right;;
|
||||||
|
$option12)
|
||||||
|
xrandr --output <monitor1> --rotate normal;;
|
||||||
|
esac
|
||||||
@@ -1,47 +1,60 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
blank="ffffff00"
|
||||||
|
|
||||||
|
nord0="2e3440"
|
||||||
|
nord1="3b4252"
|
||||||
|
|
||||||
|
frost2="eceff4"
|
||||||
|
|
||||||
|
blue2="88c0d0"
|
||||||
|
blue3="5e81ac"
|
||||||
|
|
||||||
|
red="bf616a"
|
||||||
|
yellow="ebcb8b"
|
||||||
|
green="a3be8c"
|
||||||
|
|
||||||
|
inside="${nord0}77"
|
||||||
|
|
||||||
i3lock \
|
i3lock \
|
||||||
--blur=10 \
|
--blur=10 \
|
||||||
--keylayout 1 \
|
|
||||||
\
|
\
|
||||||
--insidecolor=3b42527F \
|
--insidecolor=${inside} \
|
||||||
--ringcolor=2e34407f \
|
--ringcolor=${nord0}ff \
|
||||||
--line-uses-ring \
|
--linecolor=${blank} \
|
||||||
--keyhlcolor=a3be8c7f \
|
--keyhlcolor=${green}ff \
|
||||||
--bshlcolor=d087707f \
|
--bshlcolor=${red}ff \
|
||||||
--separatorcolor=2e34407f \
|
--separatorcolor=${blue3}ff \
|
||||||
\
|
\
|
||||||
--insidevercolor=ebcb8b7F \
|
--insidevercolor=${inside} \
|
||||||
--ringvercolor=ebcb8b6f \
|
--ringvercolor=${yellow}ff \
|
||||||
--verifcolor=ebcb8bff \
|
--verifcolor=${yellow}ff \
|
||||||
\
|
\
|
||||||
--insidewrongcolor=BF616A7F \
|
--insidewrongcolor=${inside} \
|
||||||
--ringwrongcolor=bf616a7f \
|
--ringwrongcolor=${red}ff \
|
||||||
--wrongcolor=bf616aff \
|
--wrongcolor=${red}ff \
|
||||||
\
|
\
|
||||||
--layoutcolor=ECEFF4ff \
|
--layoutcolor=ECEFF4ff \
|
||||||
--timecolor=ECEFF4ff \
|
--timecolor=ECEFF4ff \
|
||||||
--datecolor=ECEFF4ff \
|
--datecolor=ECEFF4ff \
|
||||||
\
|
\
|
||||||
--timepos="ix:iy-300" \
|
--clock \
|
||||||
--timestr="%H:%M" \
|
--indicator \
|
||||||
--datestr="%Y-%m-%d" \
|
|
||||||
\
|
\
|
||||||
--timesize=20 \
|
--timestr="%H:%M" \
|
||||||
--datesize=20 \
|
--datestr="%B %d, %Y" \
|
||||||
--layoutsize=20 \
|
--timepos="ix:iy-10" \
|
||||||
--verifsize=20 \
|
\
|
||||||
--wrongsize=20 \
|
--timesize=19 \
|
||||||
|
--datesize=15 \
|
||||||
\
|
\
|
||||||
--time-font=Inconsolata \
|
--time-font=Inconsolata \
|
||||||
--date-font=Inconsolata \
|
--date-font=Inconsolata \
|
||||||
--layout-font=Inconsolata \
|
|
||||||
--verif-font=Inconsolata \
|
|
||||||
--wrong-font=Inconsolata \
|
|
||||||
\
|
\
|
||||||
--veriftext="Tadasu..." \
|
--veriftext="" \
|
||||||
--noinputtext="" \
|
--noinputtext="" \
|
||||||
--locktext="Itterasshai!" \
|
--locktext="" \
|
||||||
--wrongtext="Chigau!" \
|
--wrongtext="" \
|
||||||
\
|
\
|
||||||
--ring-width 4
|
--ring-width 4 \
|
||||||
|
--radius 100
|
||||||
|
|||||||
23
dotfiles/scripts/powermenu
Executable file
23
dotfiles/scripts/powermenu
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# options to be displayed
|
||||||
|
option0=" Lock"
|
||||||
|
option1=" Logout"
|
||||||
|
option2=" Reboot"
|
||||||
|
option3=" Shutdown"
|
||||||
|
|
||||||
|
# options passed into variable
|
||||||
|
options="$option0\n$option1\n$option2\n$option3"
|
||||||
|
|
||||||
|
chosen="$(echo -e "$options" | rofi -lines 8 -dmenu -p "")"
|
||||||
|
|
||||||
|
case $chosen in
|
||||||
|
$option0)
|
||||||
|
~/scripts/lock-laptop;;
|
||||||
|
$option1)
|
||||||
|
i3-msg exit;;
|
||||||
|
$option2)
|
||||||
|
systemctl reboot;;
|
||||||
|
$option3)
|
||||||
|
systemctl poweroff;;
|
||||||
|
esac
|
||||||
100
dotfiles/scripts/wifimenu
Executable file
100
dotfiles/scripts/wifimenu
Executable file
@@ -0,0 +1,100 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Starts a scan of available broadcasting SSIDs
|
||||||
|
# nmcli dev wifi rescan
|
||||||
|
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
FIELDS=SSID,SECURITY
|
||||||
|
POSITION=0
|
||||||
|
YOFF=0
|
||||||
|
XOFF=0
|
||||||
|
FONT="INCONSOLATA 13"
|
||||||
|
|
||||||
|
if [ -r "$DIR/config" ]; then
|
||||||
|
source "$DIR/config"
|
||||||
|
elif [ -r "$HOME/.config/rofi/wifi" ]; then
|
||||||
|
source "$HOME/.config/rofi/wifi"
|
||||||
|
else
|
||||||
|
echo "WARNING: config file not found! Using default values."
|
||||||
|
fi
|
||||||
|
|
||||||
|
LIST=$(nmcli --fields "$FIELDS" device wifi list | sed '/^--/d')
|
||||||
|
# For some reason rofi always approximates character width 2 short... hmmm
|
||||||
|
RWIDTH=$(($(echo "$LIST" | head -n 1 | awk '{print length($0); }')+2))
|
||||||
|
# Dynamically change the height of the rofi menu
|
||||||
|
LINENUM=$(echo "$LIST" | wc -l)
|
||||||
|
# Gives a list of known connections so we can parse it later
|
||||||
|
KNOWNCON=$(nmcli connection show)
|
||||||
|
# Really janky way of telling if there is currently a connection
|
||||||
|
CONSTATE=$(nmcli -fields WIFI g)
|
||||||
|
|
||||||
|
CURRSSID=$(LANGUAGE=C nmcli -t -f active,ssid dev wifi | awk -F: '$1 ~ /^yes/ {print $2}')
|
||||||
|
|
||||||
|
if [[ ! -z $CURRSSID ]]; then
|
||||||
|
HIGHLINE=$(echo "$(echo "$LIST" | awk -F "[ ]{2,}" '{print $1}' | grep -Fxn -m 1 "$CURRSSID" | awk -F ":" '{print $1}') + 1" | bc )
|
||||||
|
fi
|
||||||
|
|
||||||
|
# HOPEFULLY you won't need this as often as I do
|
||||||
|
# If there are more than 8 SSIDs, the menu will still only have 8 lines
|
||||||
|
if [ "$LINENUM" -gt 8 ] && [[ "$CONSTATE" =~ "enabled" ]]; then
|
||||||
|
LINENUM=8
|
||||||
|
elif [[ "$CONSTATE" =~ "disabled" ]]; then
|
||||||
|
LINENUM=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [[ "$CONSTATE" =~ "enabled" ]]; then
|
||||||
|
TOGGLE="toggle off"
|
||||||
|
elif [[ "$CONSTATE" =~ "disabled" ]]; then
|
||||||
|
TOGGLE="toggle on"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CHENTRY=$(echo -e "$TOGGLE\nmanual\n$LIST" | uniq -u | rofi -dmenu -p "Wi-Fi SSID: " -lines "$LINENUM" -a "$HIGHLINE" -location "$POSITION" -yoffset "$YOFF" -xoffset "$XOFF" -width -"$RWIDTH")
|
||||||
|
#echo "$CHENTRY"
|
||||||
|
CHSSID=$(echo "$CHENTRY" | sed 's/\s\{2,\}/\|/g' | awk -F "|" '{print $1}')
|
||||||
|
#echo "$CHSSID"
|
||||||
|
|
||||||
|
# If the user inputs "manual" as their SSID in the start window, it will bring them to this screen
|
||||||
|
if [ "$CHENTRY" = "manual" ] ; then
|
||||||
|
# Manual entry of the SSID and password (if appplicable)
|
||||||
|
MSSID=$(echo "enter the SSID of the network (SSID,password)" | rofi -dmenu -p "Manual Entry: " -font "$FONT" -lines 1)
|
||||||
|
# Separating the password from the entered string
|
||||||
|
MPASS=$(echo "$MSSID" | awk -F "," '{print $2}')
|
||||||
|
|
||||||
|
#echo "$MSSID"
|
||||||
|
#echo "$MPASS"
|
||||||
|
|
||||||
|
# If the user entered a manual password, then use the password nmcli command
|
||||||
|
if [ "$MPASS" = "" ]; then
|
||||||
|
nmcli dev wifi con "$MSSID"
|
||||||
|
else
|
||||||
|
nmcli dev wifi con "$MSSID" password "$MPASS"
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [ "$CHENTRY" = "toggle on" ]; then
|
||||||
|
nmcli radio wifi on
|
||||||
|
|
||||||
|
elif [ "$CHENTRY" = "toggle off" ]; then
|
||||||
|
nmcli radio wifi off
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
# If the connection is already in use, then this will still be able to get the SSID
|
||||||
|
if [ "$CHSSID" = "*" ]; then
|
||||||
|
CHSSID=$(echo "$CHENTRY" | sed 's/\s\{2,\}/\|/g' | awk -F "|" '{print $3}')
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Parses the list of preconfigured connections to see if it already contains the chosen SSID. This speeds up the connection process
|
||||||
|
if [[ $(echo "$KNOWNCON" | grep "$CHSSID") = "$CHSSID" ]]; then
|
||||||
|
nmcli con up "$CHSSID"
|
||||||
|
else
|
||||||
|
if [[ "$CHENTRY" =~ "WPA2" ]] || [[ "$CHENTRY" =~ "WEP" ]]; then
|
||||||
|
WIFIPASS=$(echo "if connection is stored, hit enter" | rofi -dmenu -p "password: " -lines 1 -font "$FONT" )
|
||||||
|
fi
|
||||||
|
nmcli dev wifi con "$CHSSID" password "$WIFIPASS"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
@@ -56,7 +56,6 @@ set guifont="InconsolataLGC Nerd Font Mono"
|
|||||||
let g:nord_bold = 0
|
let g:nord_bold = 0
|
||||||
let g:nord_italic = 1
|
let g:nord_italic = 1
|
||||||
let g:nord_underline = 1
|
let g:nord_underline = 1
|
||||||
let g:nord_italic_comments = 1
|
|
||||||
|
|
||||||
" fzf
|
" fzf
|
||||||
nmap <C-f> :Files<CR>
|
nmap <C-f> :Files<CR>
|
||||||
|
|||||||
@@ -1,154 +0,0 @@
|
|||||||
## Prompt
|
|
||||||
autoload -Uz vcs_info
|
|
||||||
autoload -U colors && colors
|
|
||||||
precmd_vcs_info() { vcs_info }
|
|
||||||
precmd_functions+=( precmd_vcs_info )
|
|
||||||
setopt prompt_subst
|
|
||||||
#export PROMPT="%{$fg[yellow]%}%m %{$fg_bold[green]%}➜ %{$fg_bold[blue]%}%~ %{$fg_bold[green]%}\$vcs_info_msg_0_ %{$reset_color%}"
|
|
||||||
export PROMPT="%{$fg[yellow]%}%m %{$fg_bold[blue]%}%~ %{$fg_bold[green]%}\$vcs_info_msg_0_ %{$reset_color%}"
|
|
||||||
zstyle ':vcs_info:git:*' formats '%b'
|
|
||||||
|
|
||||||
## Exports
|
|
||||||
export TERM="xterm-256color"
|
|
||||||
export EDITOR="vim"
|
|
||||||
export LANG="en_US.UTF-8"
|
|
||||||
export PATH=$PATH:$HOME/.local/bin:$HOME/scripts
|
|
||||||
|
|
||||||
## Aliases
|
|
||||||
alias vimrc="vim ~/.vimrc"
|
|
||||||
alias zshrc="vim ~/.zshrc"
|
|
||||||
|
|
||||||
alias dotf="cd ~/dotfiles/dotfiles"
|
|
||||||
alias dotdrop="~/dotfiles/dotdrop.sh" --cfg="~/dotfiles/config.yaml"
|
|
||||||
|
|
||||||
alias fonts="/home/$USER/.local/share/fonts"
|
|
||||||
alias listfonts="fc-list :scalable=true:spacing=mono: family"
|
|
||||||
alias cachefonts="fc-cache -f -v"
|
|
||||||
|
|
||||||
alias w="vim ~/vimwiki/index.md"
|
|
||||||
alias r="ranger"
|
|
||||||
|
|
||||||
alias l='ls -lFh' #size,show type,human readable
|
|
||||||
alias la='ls -lAFh' #long list,show almost all,show type,human readable
|
|
||||||
alias ll='ls -l' #long list
|
|
||||||
|
|
||||||
alias c='clear'
|
|
||||||
|
|
||||||
alias rm='rm -i' # Ask before removal
|
|
||||||
alias cp='cp -i' # Ask before removal
|
|
||||||
alias mv='mv -i' # Ask before removal
|
|
||||||
|
|
||||||
alias gaa="git add ."
|
|
||||||
alias gst="git status"
|
|
||||||
alias gd="git diff"
|
|
||||||
alias gc="git commit -v"
|
|
||||||
alias gc!="git commit -v --amend"
|
|
||||||
alias gl="git pull"
|
|
||||||
alias gp="git push"
|
|
||||||
alias glog="git log --oneline --decorate --graph"
|
|
||||||
|
|
||||||
## Local Aliases
|
|
||||||
if [ -f ~/.zshrc_local ]; then
|
|
||||||
source ~/.zshrc_local
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Keybinds
|
|
||||||
bindkey -s "^e" "ranger\n"
|
|
||||||
|
|
||||||
## Completion
|
|
||||||
unsetopt menu_complete # do not autoselect the first completion entry
|
|
||||||
unsetopt flowcontrol
|
|
||||||
setopt auto_menu # show completion menu on successive tab press
|
|
||||||
setopt complete_in_word
|
|
||||||
setopt always_to_end
|
|
||||||
zstyle ':completion:*' menu select
|
|
||||||
|
|
||||||
autoload -Uz compinit
|
|
||||||
compinit -C
|
|
||||||
_comp_options+=(globdots)
|
|
||||||
|
|
||||||
# Case Insensitive completion
|
|
||||||
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
|
||||||
|
|
||||||
## Directory navigation
|
|
||||||
setopt autocd autopushd
|
|
||||||
|
|
||||||
## History command configuration
|
|
||||||
setopt extended_history # record timestamp of command in HISTFILE
|
|
||||||
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
|
|
||||||
setopt hist_ignore_dups # ignore duplicated commands history list
|
|
||||||
setopt hist_ignore_space # ignore commands that start with space
|
|
||||||
setopt hist_verify # show command with history expansion to user before running it
|
|
||||||
setopt share_history # share command history data inside tmux
|
|
||||||
export HISTFILE="$HOME/.zsh_history"
|
|
||||||
|
|
||||||
## ssh-agent
|
|
||||||
if [ -f ~/.ssh/agent.env ] ; then
|
|
||||||
. ~/.ssh/agent.env > /dev/null
|
|
||||||
if ! kill -0 $SSH_AGENT_PID > /dev/null 2>&1; then
|
|
||||||
echo "Stale agent file found. Spawning a new agent. "
|
|
||||||
eval `ssh-agent | tee ~/.ssh/agent.env`
|
|
||||||
ssh-add
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "Starting ssh-agent"
|
|
||||||
eval `ssh-agent | tee ~/.ssh/agent.env`
|
|
||||||
ssh-add
|
|
||||||
fi
|
|
||||||
|
|
||||||
## vi-mode
|
|
||||||
bindkey -v
|
|
||||||
export KEYTIMEOUT=1
|
|
||||||
|
|
||||||
# Change cursor shape for different vi modes.
|
|
||||||
function zle-keymap-select {
|
|
||||||
if [[ ${KEYMAP} == vicmd ]] ||
|
|
||||||
[[ $1 = 'block' ]]; then
|
|
||||||
echo -ne '\e[1 q'
|
|
||||||
elif [[ ${KEYMAP} == main ]] ||
|
|
||||||
[[ ${KEYMAP} == viins ]] ||
|
|
||||||
[[ ${KEYMAP} = '' ]] ||
|
|
||||||
[[ $1 = 'beam' ]]; then
|
|
||||||
echo -ne '\e[5 q'
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
zle -N zle-keymap-select
|
|
||||||
|
|
||||||
zle-line-init() {
|
|
||||||
zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
|
|
||||||
echo -ne "\e[5 q"
|
|
||||||
}
|
|
||||||
zle -N zle-line-init
|
|
||||||
|
|
||||||
echo -ne '\e[5 q' # Use beam shape cursor on startup.
|
|
||||||
precmd() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
|
|
||||||
|
|
||||||
# Enable backspace to delete in vi-mode
|
|
||||||
bindkey -v '^?' backward-delete-char
|
|
||||||
|
|
||||||
## fzf
|
|
||||||
export FZF_DEFAULT_OPTS='--preview="head {}" --layout=reverse --bind=tab:down --bind=btab:up'
|
|
||||||
|
|
||||||
## fzf Bindings in zsh (C-r and C-t)
|
|
||||||
if [[ -x $(which fzf 2> /dev/null) ]]
|
|
||||||
then
|
|
||||||
source ~/.vim/bundle/fzf/shell/key-bindings.zsh
|
|
||||||
else
|
|
||||||
bindkey '^R' history-incremental-search-backward
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Use C-z for 'fg'
|
|
||||||
fancy-ctrl-z () {
|
|
||||||
if [[ $#BUFFER -eq 0 ]]; then
|
|
||||||
BUFFER="fg"
|
|
||||||
zle accept-line
|
|
||||||
else
|
|
||||||
zle push-input
|
|
||||||
zle clear-screen
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
zle -N fancy-ctrl-z
|
|
||||||
bindkey '^Z' fancy-ctrl-z
|
|
||||||
|
|
||||||
## Nord dir colors
|
|
||||||
test -r "~/.dir_colors" && eval $(dircolors ~/.dir_colors)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user