From 92a20f389e9d1c38012cd106d20feedc11ed3e80 Mon Sep 17 00:00:00 2001 From: Kevin Mok Date: Sat, 31 Mar 2018 05:53:39 -0400 Subject: [PATCH] Auto-clicker/xviewer aliases, LaTeX setup changes LaTeX: - pdlb: compile bibliography - use vimtex to preview LaTeX because live-preview plugin wasn't working with bibliography --- aliases/zsh_aliases | 13 ++++++++++++- configs/NZXT/i3/config | 11 +++++++---- configs/NZXT/ranger/rc.conf | 2 +- dotfiles/Xresources | 2 +- dotfiles/vimrc | 13 ++++++++++--- 5 files changed, 31 insertions(+), 10 deletions(-) diff --git a/aliases/zsh_aliases b/aliases/zsh_aliases index 964e966..13b53d5 100644 --- a/aliases/zsh_aliases +++ b/aliases/zsh_aliases @@ -58,6 +58,7 @@ alias "f."="f .." alias "f.2"="f ..." alias fd="f ~/Downloads" +alias fds="f ~/Downloads/sch" alias doc="f ~/Documents" alias cfg="f ~/.config" @@ -104,13 +105,21 @@ alias tm="ni $usnp_dir/texmath.snippets" # applications {{{ # alias rg="ranger" +# okular function ok() { nohup okular $1 > /dev/null 2>&1& ; } +# xviewer +function xv() { nohup xviewer $1 > /dev/null 2>&1& ; } function chr() { google-chrome $1 ; } function ni() { nvim $1 ; } function sni() { sudo nvim $1 ; } alias nisw="f ~/.local/share/nvim/swap" # function mrk() { pandoc -o ${1%.*}.html $1 && chr ${1%.*}.html ; } function mrk() { pandoc -o ${1%.*}.html $1 ; } +function auc() { xdotool click --repeat 1000000 --delay $1 1 ; } +alias auc1="xdotool click --repeat 1000000 --delay 1 1" +alias auc3="xdotool click --repeat 1000000 --delay 300 1" +alias auc5="xdotool click --repeat 1000000 --delay 500 1" +alias kauc="pkill -f xdotool" alias vbn="cvlc --loop --alsa-gain 1 ~/Music/brown-noise.mp3" alias vlm="alsamixer -c 2" @@ -300,6 +309,7 @@ alias gchpc="git cherry-pick --continue" function gremotes() { git remote set-url --add --push origin $1 git remote set-url --add --push origin $2 + git remote -v } # gmrgr: merge repos {{{ # @@ -355,6 +365,7 @@ alias rml="rm *.aux *.log *.pdf" # LaTeX {{{ # function pdl() { pdflatex $1 ; } +function pdlb() { pdflatex $1 && biber $1 && pdflatex $1 ; } function cptp() { cp *template.tex cp-template.tex chmod 600 cp-template.tex @@ -381,7 +392,7 @@ cd_209="f ~/Documents/School/209"; alias 209="$cd_209" alias 9r="$cd_209/mokkar" alias 9l="$cd_209/mokkar/lab10" -alias 9a="$cd_209/mokkar/a3" +alias 9a="$cd_209/mokkar/a4" # }}} alias ll="ls -la" diff --git a/configs/NZXT/i3/config b/configs/NZXT/i3/config index a8418bd..276920e 100644 --- a/configs/NZXT/i3/config +++ b/configs/NZXT/i3/config @@ -15,10 +15,14 @@ set $sch_dir "$HOME/Documents/School" # app shortcuts {{{ # bindsym Mod4+a exec studio +bindsym Mod4+1 exec xdotool click --repeat 5 --delay 100 1 +bindsym Mod4+2 exec xdotool click --repeat 10 --delay 100 1 +bindsym Mod4+3 exec xdotool click --repeat 20 --delay 100 1 # bindsym $mod+control+Return exec i3-sensible-terminal bindsym $mod+control+Return exec $def_term bindsym Mod4+c exec google-chrome bindsym Mod4+e exec nemo +bindsym Mod4+f exec firefox bindsym Mod4+o exec okular bindsym Mod4+m exec okular $sch_dir/calc-textbook.pdf bindsym Mod4+p exec pycharm @@ -157,6 +161,7 @@ bindsym $mod+F9 workspace $ws9; exec $def_term set $ws10 "10 " assign [class="VirtualBox"] $ws10 +workspace $ws10 output $samsung bindsym Mod4+s workspace $ws10; exec spotify set $ws11 "11 " @@ -226,10 +231,8 @@ for_window [class="^.*"] border pixel 2 gaps inner 25 gaps outer 5 -# increase/decrease gaps -bindsym control+shift+plus gaps inner all plus 2;gaps outer all plus 2 -# bindsym control+shift+plus gaps inner all plus 2 -bindsym control+shift+0 gaps inner all minus 2;gaps outer all minus 2 +bindsym control+shift+plus gaps inner all set 25;gaps outer all set 5 +bindsym control+shift+0 gaps inner all set 0;gaps outer all set 0 # }}} gaps # # status bar {{{ # diff --git a/configs/NZXT/ranger/rc.conf b/configs/NZXT/ranger/rc.conf index a5a7516..b27e378 100644 --- a/configs/NZXT/ranger/rc.conf +++ b/configs/NZXT/ranger/rc.conf @@ -44,7 +44,7 @@ set confirm_on_delete multiple # Use non-default path for file preview script? # ranger ships with scope.sh, a script that calls external programs (see # README.md for dependencies) to preview images, archives, etc. -#set preview_script ~/.config/ranger/scope.sh +set preview_script ~/.config/ranger/scope.sh # Use the external preview script or display simple plain text or image previews? set use_preview_script true diff --git a/dotfiles/Xresources b/dotfiles/Xresources index 4711a3f..17db9f9 100644 --- a/dotfiles/Xresources +++ b/dotfiles/Xresources @@ -1,5 +1,5 @@ ! URxvt.font: xft:hack:size=14 -URxvt.font: xft:hack:size=13 +URxvt.font: xft:hack:size=12 URxvt*inheritPixmap: true URxvt*transparent: true diff --git a/dotfiles/vimrc b/dotfiles/vimrc index dff56f4..f7508b6 100644 --- a/dotfiles/vimrc +++ b/dotfiles/vimrc @@ -1,5 +1,5 @@ " set x=y {{{ " -set relativenumber +au BufWinEnter * set relativenumber " set background=dark set background=light " set t_Co=256 @@ -57,10 +57,13 @@ Plug '907th/vim-auto-save' let g:auto_save = 1 " compile LaTeX PDF while writing the file -Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' } +" Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' } " provides various functionality for writing LaTeX in Vim Plug 'lervag/vimtex' + au BufWritePost *.tex silent call Tex_RunLaTeX() + au BufWritePost *.tex silent !pkill -USR1 xdvi.bin + let g:vimtex_view_general_viewer = 'okular' " auto-completion for various languages Plug 'Valloric/YouCompleteMe' @@ -122,7 +125,8 @@ map :wqa map :qa! map :make -C ~/Documents/resume cv map :AutoSaveToggle -map :LLPStartPreview +" map :LLPStartPreview +map :VimtexCompile:VimtexView nnoremap :set paste"+p:set nopaste " }}} function keys " @@ -220,6 +224,9 @@ autocmd Filetype tex inoremap w \wedge autocmd Filetype tex inoremap x $x$-axis autocmd Filetype tex inoremap y $y$-axis autocmd Filetype tex inoremap Z \mathbb{Z} +" par3 +autocmd Filetype tex inoremap wx $w(x)$ +autocmd Filetype tex inoremap tx $t(x)$ " }}} tex " " }}} Local Mappings "