From 06ebba4c53dc2751a2aad1cbccb870bb7db6dc07 Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Thu, 2 Apr 2020 14:22:19 +0300 Subject: HUGE home cleanup --- dotfiles/.config/zsh/.inputrc | 12 --------- dotfiles/.config/zsh/.zshrc | 55 +++++++----------------------------------- dotfiles/.config/zsh/inputrc | 12 +++++++++ dotfiles/.config/zsh/shortcuts | 48 ++++++++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 58 deletions(-) delete mode 100644 dotfiles/.config/zsh/.inputrc create mode 100644 dotfiles/.config/zsh/inputrc create mode 100644 dotfiles/.config/zsh/shortcuts (limited to 'dotfiles/.config/zsh') diff --git a/dotfiles/.config/zsh/.inputrc b/dotfiles/.config/zsh/.inputrc deleted file mode 100644 index f852d3b..0000000 --- a/dotfiles/.config/zsh/.inputrc +++ /dev/null @@ -1,12 +0,0 @@ -$include /etc/inputrc -set editing-mode vi -$if mode=vi - -set keymap vi-command -# these are for vi-command mode -Control-l: clear-screen - -set keymap vi-insert -# these are for vi-insert mode -Control-l: clear-screen -$endif diff --git a/dotfiles/.config/zsh/.zshrc b/dotfiles/.config/zsh/.zshrc index a597162..4a21004 100644 --- a/dotfiles/.config/zsh/.zshrc +++ b/dotfiles/.config/zsh/.zshrc @@ -1,8 +1,5 @@ # Colors and prompt autoload -U colors && colors -if [[ -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]]; then - . /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -fi autoload -Uz vcs_info precmd_vcs_info() { vcs_info } @@ -55,50 +52,16 @@ function zle-keymap-select { } echo -ne '\e[5 q' # Use beam shape cursor on startup. -preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt. +printf "\033]2;%s\a" "$PWD" # Set terminal window title to current dir +# Repeat for every new prompt +preexec() { + echo -ne '\e[5 q' + printf "\033]2;%s\a" "$PWD" +} zle -N zle-keymap-select -# Some aliases -alias v="nvim" -alias abook="abook -C $HOME/.config/abook/abookrc --datafile $HOME/Documents/contacts/addressbook" -alias eslint="./node_modules/.bin/eslint" -alias ls="ls -hN --color=auto --group-directories-first" -weath() { curl wttr.in/$1 ;} # Check the weather (give city or leave blank). -wintitle() { printf "\033]2;%s\a" "$1";} - -# Generic shortcuts -alias music="ncmpcpp" -alias clock="ncmpcpp -s clock" -alias news="newsboat" -alias files="ranger" -alias audio="ncpamixer" -alias calendar="calcurse" -alias contacts="abook" -alias calc="R --no-save" +[ -f "$HOME/.config/zsh/shortcuts" ] && . "$HOME/.config/zsh/shortcuts" -# Mounting drive shortcuts -alias mnt="udisksctl mount -b" -alias umnt="udisksctl unmount -b" -alias dlock="udisksctl lock -b" -alias dulock="udisksctl unlock -b" - -# Internet -alias yt="youtube-dl --add-metadata -ic" # Download video link -alias yta="youtube-dl --add-metadata -xic" # Download only audio -alias YT="youtube-viewer" -alias starwars="telnet towel.blinkenlights.nl" - -# Audio and Music -alias mute="lmc mute" -alias vu="lmc up" -alias vd="lmc down" -alias play="mpc toggle" -alias next="mpc next" -alias prev="mpc prev" -alias pause="mpc pause" -alias beg="mpc seek 0%" -alias lilbak="mpc seek -10" -alias lilfor="mpc seek +10" -alias bigbak="mpc seek -120" -alias bigfor="mpc seek +120" +[ -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ] && + . /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh diff --git a/dotfiles/.config/zsh/inputrc b/dotfiles/.config/zsh/inputrc new file mode 100644 index 0000000..f852d3b --- /dev/null +++ b/dotfiles/.config/zsh/inputrc @@ -0,0 +1,12 @@ +$include /etc/inputrc +set editing-mode vi +$if mode=vi + +set keymap vi-command +# these are for vi-command mode +Control-l: clear-screen + +set keymap vi-insert +# these are for vi-insert mode +Control-l: clear-screen +$endif diff --git a/dotfiles/.config/zsh/shortcuts b/dotfiles/.config/zsh/shortcuts new file mode 100644 index 0000000..a47bbba --- /dev/null +++ b/dotfiles/.config/zsh/shortcuts @@ -0,0 +1,48 @@ +#!/bin/sh + +# Some aliases +alias v="nvim" +alias abook="abook -C $HOME/.config/abook/abookrc --datafile $HOME/Documents/contacts/addressbook" +alias eslint="./node_modules/.bin/eslint" +alias ls="ls -hN --color=auto --group-directories-first" +alias tmux="tmux -f $HOME/.config/tmux/tmux.conf" +weath() { curl wttr.in/$1 ;} # Check the weather (give city or leave blank). +corona() { curl https://corona-stats.online/$1 ;} # It's corona time +wintitle() { printf "\033]2;%s\a" "$1";} + +# Generic shortcuts +alias music="ncmpcpp" +alias clock="ncmpcpp -s clock" +alias news="newsboat" +alias files="ranger" +alias audio="ncpamixer" +alias calendar="calcurse" +alias contacts="abook" +alias calc="R --no-save" + +# Mounting drive shortcuts +alias mnt="udisksctl mount -b" +alias umnt="udisksctl unmount -b" +alias dlock="udisksctl lock -b" +alias dulock="udisksctl unlock -b" + +# Internet +alias yt="youtube-dl --add-metadata -ic" # Download video link +alias yta="youtube-dl --add-metadata -xic" # Download only audio +alias YT="youtube-viewer" +alias starwars="telnet towel.blinkenlights.nl" + +# Audio and Music +alias mute="lmc mute" +alias vu="lmc up" +alias vd="lmc down" +alias play="mpc toggle" +alias next="mpc next" +alias prev="mpc prev" +alias pause="mpc pause" +alias beg="mpc seek 0%" +alias lilbak="mpc seek -10" +alias lilfor="mpc seek +10" +alias bigbak="mpc seek -120" +alias bigfor="mpc seek +120" + -- cgit v1.2.3