From 7300b6f85f0a88542d96dfab0113aefa0c8b8967 Mon Sep 17 00:00:00 2001 From: Kevin Mok Date: Thu, 29 Nov 2018 09:16:54 -0500 Subject: [PATCH] Update --- aliases/zsh_aliases | 39 +++++++++++++++++++++++++++------------ configs/i3/config | 35 +++++++++++++++++++---------------- dotfiles/vimrc | 11 ++++++++++- 3 files changed, 56 insertions(+), 29 deletions(-) diff --git a/aliases/zsh_aliases b/aliases/zsh_aliases index 73d6c29..124fea6 100644 --- a/aliases/zsh_aliases +++ b/aliases/zsh_aliases @@ -35,14 +35,15 @@ function ideb() { sudo dpkg -i $1 ; } function cld() { colordiff -y --suppress-common-lines $1 $2 ; } alias grep='grep --color=auto' # for finding files by name -function rf() { find . -name "$1" ; } +function rf() { find . -name '$1' ; } # find text inside files function rg() { grep -nr $1 * ; } function cpd() { cp -avr $1 $2 ; } # extract tar archive function untar() { tar -xzvf $1 && rm $1; } -function runzip() { unzip $1 && rm $1; } +function rzip() { unzip $1 && rm $1; } +function lzip() { unzip -l $1 | less; } function mkex() { chmod 777 $1 ; } @@ -61,7 +62,7 @@ function rmr() { rm -rf $1 ; } # todo: fix # function f.() { f $(printf "%0.s../" $(seq 1 $1 )) ; } alias "f."="f .." -alias "f.2"="f ..." +alias "f.."="f ..." alias fd="f ~/Downloads" function mvd() { mv $1 ~/Downloads ; } @@ -106,11 +107,12 @@ function rt() { # sound alias vlm="alsamixer -c 0" -alias vlh="alsamixer -c 1" +alias vlh="alsamixer -c 2" # apt -function apti() { sudo apt install $1 ; } -function aptr() { sudo apt remove $1 ; } +function apti() { sudo apt install $1 ; } +function aptr() { sudo apt remove $1 ; } +alias aptu="sudo apt upgrade" # }}} system # # config files {{{ # @@ -143,6 +145,8 @@ alias tm="ni $usnp_dir/texmath.snippets" # }}} config files # # applications {{{ # +silent="> /dev/null 2>&1& " + alias ran="ranger" # okular function ok() { nohup okular $1 > /dev/null 2>&1& ; } @@ -160,7 +164,7 @@ function auc() { xdotool click --repeat 1000000 --delay $1 1 ; } # alias auc5="xdotool click --repeat 1000000 --delay 500 1" # alias kauc="pkill -f xdotool" # alias rsl="java -jar ~/Downloads/RuneLite.jar" -alias swex="sudo nohup ~/Downloads/swex.appimage > /dev/null 2>&1&" +alias swex="sudo nohup ~/Downloads/swex.appimage $silent" alias vbn="cvlc --loop --alsa-gain 1 ~/Music/brown-noise.mp3" alias rmsw="rm .sw*" @@ -312,9 +316,8 @@ alias sv="f $spv_dir/src" alias svl="f $spv_dir/src/login" alias sva="f $spv_dir/src/api" alias svg="f $spv_dir/src/graphs" -alias slh="f ~/Music/spotify-history" -# removes all but newest file -alias rmol="ls -t | tail -n +2 | xargs rm -- &&" +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" function ssv() { @@ -329,6 +332,17 @@ function mig() { } alias cldb="python manage.py flush --no-input && ssv" alias djs="python manage.py shell" +alias upip="pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U" +alias ureq="pip freeze > requirements.txt" + +# scan history +alias slh="f ~/Music/spotify-history" +alias hlg="cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1" +alias hlgf="ni $spv_dir/src/api/management/commands/update-history.log" +alias crnl="grep \"(kevin) CMD\" /var/log/syslog | tail -n 1 && hlg" +alias hs="$spv_dir/src/update-history.sh && hlg" +# removes all but newest file +# alias rmol="ls -t | tail -n +2 | xargs rm -- && l" # }}} spotify-lib-vis # @@ -351,16 +365,17 @@ alias sta="f ~/Documents/school/sta" # 236 alias 236="f ~/Documents/school/236" -# alias a2="f ~/Documents/school/latex-notes/236/a2" +alias a3="f ~/Documents/school/latex-notes/236/a3" # 343 alias 343="f ~/Documents/school/343" # alias a1="f ~/Documents/school/latex-notes/343/a1" -alias ij="sudo ~/Downloads/idea/bin/idea.sh" +alias ij="sudo ~/Downloads/idea/bin/idea.sh $silent" alias a2="f ~/Documents/school/343/a2" alias a2j="f ~/Documents/school/343/a2/java/src" alias q2="psql -U postgres -d 343-a2 -f q2-test.sql" +alias q2o="psql -U postgres -d 343-a2 -f q2-test.sql -o q2.out" alias q2a="psql -U postgres -d 343-a2 -f q2.sql" alias q4="psql -U postgres -d 343-a2 -f q4-test.sql" alias q4a="psql -U postgres -d 343-a2 -f q4.sql" diff --git a/configs/i3/config b/configs/i3/config index be3ff5f..44f71c9 100644 --- a/configs/i3/config +++ b/configs/i3/config @@ -1,16 +1,16 @@ # startup {{{ # -set $browser "firefox" +set $browser "google-chrome" set $def_term "urxvt" -set $runelite "java -jar ~/Downloads/RuneLite.jar" -exec redshift -O 3000 +# set $runelite "java -jar ~/Downloads/RuneLite.jar" +set $swex "sudo ~/Downloads/swex.appimage" +exec redshift -O 2000 # random bg exec wal -i "$HOME/Pictures/Backgrounds/dim" exec imwheel exec --no-startup-id start-pulseaudio-x11 -# exec --no-startup-id i3-msg 'workspace 1 ; exec $def_term' -exec --no-startup-id i3-msg 'workspace 2 ; exec $def_term' -exec --no-startup-id i3-msg 'workspace 3 ; exec $browser' -# exec --no-startup-id i3-msg 'workspace 5 ; exec $runelite' +exec --no-startup-id i3-msg 'workspace $ws2; exec $def_term' +exec --no-startup-id i3-msg 'workspace $ws3; exec $browser' +# exec --no-startup-id i3-msg 'workspace $ws11; exec $swex' exec_always --no-startup-id numlockx on # }}} startup # @@ -35,17 +35,20 @@ bindsym Mod4+p workspace $ws4; exec pgadmin3 # bindsym Mod4+p exec pycharm # bindsym Mod4+r exec urxvt -e ranger bindsym Mod4+r exec $runelite +bindsym Mod4+x exec $swex bindsym Print exec ksnapshot # }}} app shortcuts # # redshift {{{ # -bindsym $mod+Mod4+1 exec redshift -O 1500 -bindsym $mod+Mod4+2 exec redshift -O 2000 -bindsym $mod+Mod4+3 exec redshift -O 2500 -bindsym $mod+Mod4+4 exec redshift -O 3000 -bindsym $mod+Mod4+5 exec redshift -O 4000 -bindsym $mod+Mod4+6 exec redshift -O 5000 -bindsym $mod+Mod4+0 exec redshift -x +bindsym $mod+Mod4+1 exec redshift -O 1000 +bindsym $mod+Mod4+2 exec redshift -O 1250 +bindsym $mod+Mod4+3 exec redshift -O 1500 +bindsym $mod+Mod4+4 exec redshift -O 2000 +bindsym $mod+Mod4+5 exec redshift -O 2500 +bindsym $mod+Mod4+6 exec redshift -O 3000 +bindsym $mod+Mod4+7 exec redshift -O 4000 +bindsym $mod+Mod4+8 exec redshift -O 5000 +bindsym $mod+Mod4+grave exec redshift -x # }}} redshift # # menu {{{ # @@ -312,8 +315,8 @@ bindsym $mod+o exec ~/linux-config/change-sink.sh line-out bindsym XF86AudioRaiseVolume exec --no-startup-id amixer -c 0 sset Master 3+ bindsym XF86AudioLowerVolume exec --no-startup-id amixer -c 0 sset Master 3- -bindsym control+$mod+plus exec --no-startup-id amixer -c 1 sset PCM 3+ -bindsym control+$mod+minus exec --no-startup-id amixer -c 1 sset PCM 3- +bindsym control+$mod+plus exec --no-startup-id amixer -c 2 sset PCM 3+ +bindsym control+$mod+minus exec --no-startup-id amixer -c 2 sset PCM 3- bindsym XF86AudioMute exec --no-startup-id amixer -D pulse set Master 0+ toggle # Media player controls diff --git a/dotfiles/vimrc b/dotfiles/vimrc index a9095b9..cb445c1 100644 --- a/dotfiles/vimrc +++ b/dotfiles/vimrc @@ -15,17 +15,22 @@ set mouse=c set clipboard+=unnamedplus set foldmethod=marker set linespace=5 +" cursor indicator {{{ " + " set listchars=tab:\|\ " set list " set cursorcolumn " set cursorline + +" }}} cursor indicator " + set timeoutlen=500 set hlsearch " }}} set x=y " autocmd VimResized * wincmd = autocmd BufNewFile,BufRead .* set syntax=sh -autocmd Filetype css,html,tex,txt,markdown set tabstop=2 shiftwidth=2 expandtab +autocmd Filetype css,htmldjango,html,tex,txt,markdown set tabstop=2 shiftwidth=2 expandtab autocmd BufNewFile,BufRead *.md set filetype=markdown autocmd Filetype markdown set textwidth=0 @@ -121,6 +126,8 @@ Plug 'tweekmonster/django-plus.vim' Plug 'jiangmiao/auto-pairs' let g:AutoPairsMapSpace = 0 +Plug 'henrik/vim-indexed-search' + call plug#end() " colorscheme gotham256 @@ -221,6 +228,7 @@ autocmd Filetype c inoremap s struct pixel " tex {{{ " autocmd Filetype tex inoremap bt \bowtie +autocmd Filetype tex inoremap d \delta autocmd Filetype tex inoremap D \Delta autocmd Filetype tex inoremap e \exists autocmd Filetype tex inoremap ep \epsilon @@ -234,6 +242,7 @@ autocmd Filetype tex inoremap N \mathbb{N} autocmd Filetype tex inoremap q \qquad autocmd Filetype tex inoremap R \Rightarrow autocmd Filetype tex inoremap st such that +autocmd Filetype tex inoremap S \Sigma autocmd Filetype tex inoremap t \times " autocmd Filetype tex inoremap T $T$ autocmd Filetype tex inoremap T \Theta