From 0248ff9b6e5a2f2142550edc904142875dc610c2 Mon Sep 17 00:00:00 2001 From: Kevin Mok Date: Sat, 8 Dec 2018 20:44:09 -0500 Subject: [PATCH] Fixed ranger bookmarking and opening last dir --- aliases/zsh_aliases | 23 ++++++++++------------- configs/i3/config | 2 +- configs/ranger/rc.conf | 16 ++++++++-------- dotfiles/.vimrc | 18 +++++++++--------- dotfiles/.zshrc | 6 +++++- scripts/change-sink | 4 ++-- txt/exlude-dirs-backup.txt | 2 +- txt/key_dirs.txt | 3 ++- txt/key_files.txt | 1 + txt/pacman-pkgs/nzxt-pkgs.txt | 2 ++ 10 files changed, 41 insertions(+), 36 deletions(-) diff --git a/aliases/zsh_aliases b/aliases/zsh_aliases index 7aff284..45d3318 100644 --- a/aliases/zsh_aliases +++ b/aliases/zsh_aliases @@ -46,6 +46,7 @@ function lzip() { unzip -l $1 | less; } alias mkpk="makepkg -sri" alias mkex="chmod 777" +alias ctl="systemctl" alias ctle="systemctl enable" alias ctls="systemctl start" @@ -70,15 +71,10 @@ shrm() { # directory-related {{{ # alias l='ls -a' alias ll='ls -alFh' -# alias f="cd" -function f() { cd $1 && pwd > ~/.last_dir ; } -# function f() { cd $1 && pwd > ~/.last_dir && ls -a ; } - -# restore last dir -if [ -f ~/.last_dir ] - # then cd `cat ~/.last_dir` - then f `cat ~/.last_dir` -fi +alias f="cd" +f `cat /home/kevin/.oh-my-zsh/cache/last-working-dir` +# alias w="cd $(cat /home/kevin/.oh-my-zsh/cache/last-working-dir)" + alias rmr="rm -rf" alias mdp="mkdir -p" @@ -88,6 +84,7 @@ alias "f.."="f ..." function mvd() { mv $1 ~/Downloads ; } alias lhd="sudo fdisk -l" alias ds="df -h | grep sd" +alias chownw="sudo chown -R kevin:wheel" alias nbu="f /run/media/kevin/pc-backup/backups/nzxt && ll | grep gz" # }}} directory-related # @@ -164,7 +161,7 @@ alias hc="htop -s PERCENT_CPU" alias r="ranger" alias mr="man ranger" alias clc="cloc ." -function za() { nohup zathura $1 > /dev/null 2>&1& ; } +function z() { nohup zathura $1 > /dev/null 2>&1& ; } function ev() { nohup evince $1 > /dev/null 2>&1& ; } function chr() { google-chrome $1 ; } alias ni="nvim" @@ -253,7 +250,7 @@ function gcm(){ echo git commit -m \""$1"\" ; } function psgi() { git add . - git commit -m '.' + git commit -m -S '.' git push } alias gps="git push" @@ -333,12 +330,12 @@ alias sva="f $spv_dir/src/api" alias svg="f $spv_dir/src/graphs" alias svscs="f $spv_dir/src/static/scss" alias svcss="f $spv_dir/src/spotifyvis/static/scss" -# source ~/coding/spotify-lib-vis/src/api-keys.sh -# source "$spv_dir""/src/api-keys.sh" +source /home/kevin/coding/spotify-lib-vis/src/api-keys.sh function ssv() { source ../bin/activate python manage.py runserver } +alias sssv="sv && ssv" alias spvdb="psql -d spotifyvis -U django" function mig() { python manage.py makemigrations diff --git a/configs/i3/config b/configs/i3/config index 7ee9fbb..253d5e1 100644 --- a/configs/i3/config +++ b/configs/i3/config @@ -240,7 +240,7 @@ bindsym Mod4+s workspace $ws10; exec spotify set $ws11 "11 " # assign [class="Summoners War Exporter"] $ws11 workspace $ws11 output $samsung -bindsym $mod+F11 workspace $ws8; exec $def_term +bindsym $mod+F11 workspace $ws11; exec $def_term set $ws12 "12 " bindsym $mod+F12 workspace $ws12; exec $def_term diff --git a/configs/ranger/rc.conf b/configs/ranger/rc.conf index 4a1ba51..f0a656f 100644 --- a/configs/ranger/rc.conf +++ b/configs/ranger/rc.conf @@ -418,8 +418,8 @@ map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier) map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier) # Searching -map gr console search%space -map / fzf_select +map / console search%space +map gr fzf_select map n search_next map N search_next forward=False map ct search_next order=tag @@ -493,11 +493,11 @@ copymap zf zz # Bookmarks map ` enter_bookmark %any map ' enter_bookmark %any -map m set_bookmark %any -map um unset_bookmark %any +map b set_bookmark %any +map ub unset_bookmark %any -map m draw_bookmarks -copymap m um ` ' +# map m draw_bookmarks +# copymap m um ` ' # Generate all the chmod bindings with some python help: eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg)) @@ -674,8 +674,8 @@ map rr source ~/.config/ranger/rc.conf # backgrounds map w shell /usr/bin/wal -i %f -map md shell mv %f dim -map mb shell mv %f vibrant +map bgd shell mv %f dim +map bgb shell mv %f vibrant # bulk rename map cw eval fm.execute_console("bulkrename") if fm.thisdir.marked_items else fm.open_console("rename ") diff --git a/dotfiles/.vimrc b/dotfiles/.vimrc index 687d233..8afb6c8 100644 --- a/dotfiles/.vimrc +++ b/dotfiles/.vimrc @@ -71,13 +71,13 @@ Plug 'vim-scripts/L9' " Gotham color scheme " Plug 'whatyouhide/vim-gotham' -" collection of Vim color schemes -Plug 'flazz/vim-colorschemes' +" " collection of Vim color schemes +" Plug 'flazz/vim-colorschemes' -" preview Vim color scheme easily within Vim -Plug 'xolox/vim-colorscheme-switcher' -" prerequisite for above plugin -Plug 'xolox/vim-misc' +" " preview Vim color scheme easily within Vim +" Plug 'xolox/vim-colorscheme-switcher' +" " prerequisite for above plugin +" Plug 'xolox/vim-misc' " automatically save buffers upon returning to normal mode Plug '907th/vim-auto-save' @@ -224,10 +224,10 @@ nnoremap plc :PlugClean nnoremap plu :PlugUpdate " don't break lines nnoremap py :set tw=0 -" replace in next x lines -nnoremap r q:i.,.+s///gFsi " reload file -nnoremap rf :e +nnoremap r :e +" replace in next x lines +nnoremap re q:i.,.+s///gFsi " replace in line nnoremap rl q:i.s///g " replace in visual selection diff --git a/dotfiles/.zshrc b/dotfiles/.zshrc index 2824db3..23dddd2 100644 --- a/dotfiles/.zshrc +++ b/dotfiles/.zshrc @@ -103,6 +103,9 @@ source ~/linux-config/aliases/zsh_aliases # ZSH_THEME="agnoster" source $ZSH/custom/antigen.zsh +antigen bundle last-working-dir +antigen bundle pass + antigen bundle hlissner/zsh-autopair antigen bundle zsh-users/zsh-autosuggestions antigen bundle softmoth/zsh-vim-mode @@ -116,7 +119,7 @@ if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then fi # pywal -export PATH="${PATH}:${HOME}/.local/bin/:${HOME}/linux-config/scripts" +export PATH="${PATH}:${HOME}/.local/bin/:${HOME}/linux-config/scripts:/opt/pycharm-2018.3.1/bin" (cat ~/.cache/wal/sequences &) source ~/.cache/wal/colors.sh @@ -160,6 +163,7 @@ fi # # }}} autoreload zsh aliases # source /home/kevin/.shortcuts +source /home/kevin/coding/spotify-lib-vis/src/api-keys.sh # export pywal colors [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh diff --git a/scripts/change-sink b/scripts/change-sink index b6a23cc..f5a3f5a 100755 --- a/scripts/change-sink +++ b/scripts/change-sink @@ -2,8 +2,8 @@ #Device name variable if [ "$1" = "dac" ]; then - # devicename="alsa_output.usb-1852_DigiHug_USB_Audio-01.analog-stereo" - devicename="alsa_output.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo" + devicename="alsa_output.usb-1852_DigiHug_USB_Audio-01.analog-stereo" + # devicename="alsa_output.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo" elif [ "$1" = "line-out" ]; then devicename="alsa_output.pci-0000_00_14.2.analog-stereo" fi diff --git a/txt/exlude-dirs-backup.txt b/txt/exlude-dirs-backup.txt index a67b918..e3f2381 100644 --- a/txt/exlude-dirs-backup.txt +++ b/txt/exlude-dirs-backup.txt @@ -1,4 +1,4 @@ -/home/kevin/.cache/spotify/Storage +/home/kevin/.cache /lost+found /mnt /proc diff --git a/txt/key_dirs.txt b/txt/key_dirs.txt index 84e21e0..7fa65be 100644 --- a/txt/key_dirs.txt +++ b/txt/key_dirs.txt @@ -16,8 +16,9 @@ p /home/kevin/.password-store # cdn {{{ * cn /home/kevin/coding -j /home/kevin/Documents/journal ib /home/kevin/linux-config/configs/i3blocks-scripts +j /home/kevin/Documents/journal +lh /home/kevin/Documents/listening-history ra /home/kevin/linux-config/configs/ranger snp /home/kevin/.vim/plugged/vim-snippets/UltiSnips sv /home/kevin/coding/spotify-lib-vis/src diff --git a/txt/key_files.txt b/txt/key_files.txt index eb3639d..b0b1e25 100644 --- a/txt/key_files.txt +++ b/txt/key_files.txt @@ -20,6 +20,7 @@ z /home/kevin/linux-config/aliases/zsh_aliases hlg /home/kevin/coding/spotify-lib-vis/src/api/management/commands/update-history.log jn /home/kevin/Documents/journal/todo/12.md jt /home/kevin/Documents/journal/todo/todo.md +lh /home/kevin/Documents/listening-history/polarbier.csv no ./.gitignore ne /home/kevin/linux-config/configs/neofetch/config.conf tm /home/kevin/.vim/plugged/vim-snippets/UltiSnips/texmath.snippets diff --git a/txt/pacman-pkgs/nzxt-pkgs.txt b/txt/pacman-pkgs/nzxt-pkgs.txt index 5b11de7..dc60222 100644 --- a/txt/pacman-pkgs/nzxt-pkgs.txt +++ b/txt/pacman-pkgs/nzxt-pkgs.txt @@ -79,6 +79,7 @@ pacman pass patch pciutils +pcmanfm pdfgrep perl pipes.sh @@ -189,4 +190,5 @@ xorg-xwud zathura zathura-pdf-poppler zbar +zip zsh