From 4c4f5b43fbf00e62a687542d6a50f91862aa8503 Mon Sep 17 00:00:00 2001 From: Kevin Mok Date: Sun, 31 Mar 2019 17:01:30 -0400 Subject: [PATCH] Autosave every 5s (Vim), HPS/309 aliases Update packages. --- aliases/key_aliases | 19 +++++++++++++--- fish/.config/fish/config.fish | 6 +++-- fish/.config/fish/functions/drop-grocery.fish | 8 +++++++ .../fish/functions/find-vim-filetype.fish | 3 +++ i3/.config/i3/config | 1 + scripts/compile_commands.json | 1 - txt/exclude-dirs-backup.txt | 2 +- txt/key_dirs.txt | 1 + txt/key_files.txt | 9 ++++---- txt/nzxt-aur.txt | 9 ++++++++ txt/nzxt-pkgs.txt | 7 +++++- vim/.vimrc | 22 +++++++++++++------ 12 files changed, 69 insertions(+), 19 deletions(-) create mode 100644 fish/.config/fish/functions/drop-grocery.fish create mode 100644 fish/.config/fish/functions/find-vim-filetype.fish delete mode 100644 scripts/compile_commands.json diff --git a/aliases/key_aliases b/aliases/key_aliases index 543bce8..0c71d06 100644 --- a/aliases/key_aliases +++ b/aliases/key_aliases @@ -65,6 +65,7 @@ fnd "find . -type f -name" rmr "rm -rf" rmd "rm ~/Downloads/*" +rmsw "rm ~/.local/share/nvim/swap/" md "mkdir -p" rsy "rsync -Pr" @@ -168,6 +169,8 @@ rx "redshift -x" sn "sudo nvim" sx "sxiv" sxa "sxiv -a" +sxt "sxiv -t *" +vmd "vimdiff" wg "wego" wp "grep wallpaper ~/.cache/wal/colors.sh" z "zathura --fork" @@ -200,6 +203,7 @@ wa "watson start" wae "watson start && watson edit" we "watson edit" wl "watson log --day" +wla "watson log --all --tag=" ww "watson log" # wlm "watson log --project coding --tag mfs" wr "watson report --day" @@ -227,6 +231,9 @@ gba "git branch --no-merged && echo '' && git branch --merged" gbu "git branch --no-merged" gbm "git branch --merged" +gmg "git merge" +gmgt "git mergetool" + # }}} branch # gr "git remote -v" @@ -416,17 +423,23 @@ hl "valgrind --tool=helgrind ./carsim light 10 20" # }}} 369 # # 309 -wl0 "watson log --all --project=309 --tag=e3" -wr0 "watson report --all --project=309 --tag=e3" +# wl0 "watson log --all --project=309 --tag=e3" +# wr0 "watson report --all --project=309 --tag=e3" nd "node" ndm "nodemon" +knd "killall node" mg "mongo" -mgd "mongod --dbpath mongo-data" + 0ht "cd ~/school/309-proj && python3 -m http.server" +mgd "mongod --dbpath mongo-data" +nds "killall node && nodemon server.js" hr "heroku" hrt "heroku ps" hrl "heroku logs --dyno web -n 1500 | rg up | awk '{ system(\"date -d \" \$1); \$1 = \"\"; print \$0 }' | paste -s -d' \n'" +wlh "watson log --all --project=hps --tag=essay" +wrh "watson report --all --project=hps --tag=essay" + # }}} school # diff --git a/fish/.config/fish/config.fish b/fish/.config/fish/config.fish index 061caf7..db81821 100644 --- a/fish/.config/fish/config.fish +++ b/fish/.config/fish/config.fish @@ -42,9 +42,11 @@ abbr mt "math" set -U spv_dir "/home/kevin/coding/spotify-lib-vis" set -U mfs_dir "/home/kevin/coding/mf-site" -# set -U PATH /usr/local/sbin /usr/local/bin /usr/bin /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl /home/kevin/linux-config/scripts +# set -U PATH /usr/local/sbin /usr/local/bin /usr/bin /usr/bin/site_perl +# /usr/bin/vendor_perl /usr/bin/core_perl /home/kevin/linux-config/scripts +# /home/kevin/linux-config/scripts/colors # (ruby -e 'print Gem.user_dir')/bin -set -x PATH $PATH /home/kevin/linux-config/scripts /home/kevin/go/bin +set -x PATH $PATH /home/kevin/linux-config/scripts /home/kevin/linux-config/scripts/colors /home/kevin/go/bin set -x PASSWORD_STORE_CLIP_TIME 120 set -xU XSET_RATE 90 set -xU XSET_DELAY 200 diff --git a/fish/.config/fish/functions/drop-grocery.fish b/fish/.config/fish/functions/drop-grocery.fish new file mode 100644 index 0000000..82e0e3b --- /dev/null +++ b/fish/.config/fish/functions/drop-grocery.fish @@ -0,0 +1,8 @@ +function drop-grocery + set collection 'stores' + switch $argv[1] + case f + set collection 'foods' + end + mongo GroceryAPI --eval "db.$collection.drop()" +end diff --git a/fish/.config/fish/functions/find-vim-filetype.fish b/fish/.config/fish/functions/find-vim-filetype.fish new file mode 100644 index 0000000..2122662 --- /dev/null +++ b/fish/.config/fish/functions/find-vim-filetype.fish @@ -0,0 +1,3 @@ +function find-vim-filetype + fd $argv[1] /usr/share/nvim/runtime/ftplugin +end diff --git a/i3/.config/i3/config b/i3/.config/i3/config index 21166d8..ee532f4 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -35,6 +35,7 @@ bindsym Mod4+a exec studio # bindsym $mod+control+Return exec $def_term bindsym control+Return exec $def_term bindsym Mod4+c exec $browser +bindsym Mod4+e exec notify-send "HPS Word Count" "$(pdftotext /home/kevin/school/latex-notes/hps/essay.pdf - | wc -w)" bindsym Mod4+f exec firefox bindsym Mod4+$mod+f exec echo 'Kevin@fosstodon.org' | xclip -selection clipboard bindsym Mod4+h exec echo 'kevin.mok@live.ca' | xclip -selection clipboard diff --git a/scripts/compile_commands.json b/scripts/compile_commands.json deleted file mode 100644 index 0637a08..0000000 --- a/scripts/compile_commands.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/txt/exclude-dirs-backup.txt b/txt/exclude-dirs-backup.txt index 08b42fd..74e0bc9 100644 --- a/txt/exclude-dirs-backup.txt +++ b/txt/exclude-dirs-backup.txt @@ -2,7 +2,7 @@ /home/kevin/.AndroidStudio3.3 /home/kevin/Android /home/kevin/.cache -/home/kevin/.local/share/Steam +/home/kevin/.local/share/Steam/steamapps/common /lost+found /mnt /proc diff --git a/txt/key_dirs.txt b/txt/key_dirs.txt index 9d5ba8d..1876cee 100644 --- a/txt/key_dirs.txt +++ b/txt/key_dirs.txt @@ -66,5 +66,6 @@ a43 /home/kevin/school/369/a4-3/fs3 hp /home/kevin/school/hps hpe /home/kevin/school/latex-notes/hps +hper /home/kevin/school/hps/w5-6-historicism # }}} sch * diff --git a/txt/key_files.txt b/txt/key_files.txt index f6aa3e3..2cf7eb1 100644 --- a/txt/key_files.txt +++ b/txt/key_files.txt @@ -20,6 +20,7 @@ z /home/kevin/linux-config/aliases/zsh_aliases # cdn {{{ * cm /tmp/commit-msg.txt +cmd ./commit-msg.txt hlg /home/kevin/coding/spotify-lib-vis/src/api/management/commands/update-history.log id /home/kevin/coding/project-ideas/ideas.md ig ./.gitignore @@ -40,10 +41,10 @@ wt /home/kevin/.config/watson/state.tmp # sch {{{ * 0c /home/kevin/school/309-proj/sass/main.scss -0h /home/kevin/school/309-proj/index.html -0m /home/kevin/school/309-proj/js/main.js -0f /home/kevin/school/309-proj/js/food.js -0s /home/kevin/school/309-proj/js/stores.js +0h /home/kevin/school/309-proj/public/index.html +0m /home/kevin/school/309-proj/public/js/main.js +0f /home/kevin/school/309-proj/public/js/food.js +0s /home/kevin/school/309-proj/public/js/stores.js 0k /home/kevin/school/309-proj/json/kevin.md # }}} sch * diff --git a/txt/nzxt-aur.txt b/txt/nzxt-aur.txt index e4eba0a..3540538 100644 --- a/txt/nzxt-aur.txt +++ b/txt/nzxt-aur.txt @@ -3,17 +3,24 @@ bear browserpass chromium-widevine cliqz-bin +curseradio-git discord dragon-drag-and-drop-git ffcast flashplugin-focusfix +heroku-cli htop-vim-git i3blocks-git +insomnia linux-kevin linux-kevin-headers linux-nzxt linux-nzxt-headers lua-cjson +mongodb-bin +mongodb-tools-bin +nerd-fonts-dejavu-complete +nerd-fonts-hack nx3-all peaclock pipes.sh @@ -29,8 +36,10 @@ steamos-xpad-dkms systemd-numlockontty texlive-local-algorithmicx texlive-local-algorithms +texlive-local-biblatex texlive-local-enumitem texlive-local-ifmtarg +texlive-local-logreq texlive-local-multirow texlive-local-numprint texlive-local-pgfplots diff --git a/txt/nzxt-pkgs.txt b/txt/nzxt-pkgs.txt index a093987..872d39f 100644 --- a/txt/nzxt-pkgs.txt +++ b/txt/nzxt-pkgs.txt @@ -7,6 +7,7 @@ automake bash bat bc +biber bison bookworm broadcom-wl @@ -19,6 +20,7 @@ cmatrix colordiff compton coreutils +cowsay cryptsetup device-mapper dhcpcd @@ -112,7 +114,6 @@ pgadmin4 pkgconf postgresql procps-ng -psensor psmisc pulseaudio python-dbus @@ -131,6 +132,8 @@ scrot sed shadow shellcheck +sl +smartmontools sqlitebrowser sshpass steam @@ -170,6 +173,8 @@ wireless_tools wkhtmltopdf wpa_actiond wpa_supplicant +xautomation +xbindkeys xclip xf86-input-evdev xf86-input-keyboard diff --git a/vim/.vimrc b/vim/.vimrc index 2427ac4..ba9dad5 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -22,10 +22,11 @@ set tabstop=4 " set t_Co=256 " set timeoutlen=500 set timeoutlen=350 -set tw=80 +" set tw=80 +set tw=75 set undodir=~/.vim/undo set undofile -set updatetime=1000 +set updatetime=5000 autocmd VimResized * wincmd = filetype plugin on @@ -47,17 +48,17 @@ au CursorHold,CursorHoldI * checktime " commands for file types {{{ " autocmd BufNewFile,BufRead .* set syntax=sh -autocmd FileType *css,htmldjango,html,javascript,markdown,tex,text,yaml set tabstop=2 shiftwidth=2 +autocmd FileType *css,htmldjango,html,javascript,json,markdown,tex,text,yaml set tabstop=2 shiftwidth=2 " autocmd BufNewFile,BufRead *.md set filetype=markdown autocmd Filetype markdown set textwidth=0 " autocmd Filetype html set foldmarker=0 - autocmd Filetype markdown map :LivedownToggle autocmd Filetype json nnoremap j :%!python -m json.tool autocmd Filetype json set foldmethod=marker autocmd FileType sh map :!clear && shellcheck % -" autocmd FileType tex map :VimtexCompile:VimtexView +autocmd FileType tex map :VimtexCompile autocmd VimEnter *.tex VimtexCompile +autocmd FileType markdown,tex,text set spell spelllang=en_us autocmd VimLeave *.tex !tex-clean %:p " " auto-reload vimrc {{{ " @@ -113,7 +114,8 @@ Plug 'vim-scripts/L9' " automatically save buffers upon returning to normal mode Plug '907th/vim-auto-save' let g:auto_save = 1 - autocmd VimEnter *.tex let g:auto_save = 0 + let g:auto_save_events = ["CursorHold", "CursorHoldI"] + " autocmd VimEnter *.tex let g:auto_save = 0 " provides various functionality for writing LaTeX in Vim Plug 'lervag/vimtex' @@ -126,6 +128,9 @@ Plug 'lervag/vimtex' \ 'global' : 0, \ 'unused' : 0, \} + " let g:vimtex_compiler_latexmk = { + " \ 'continuous' : 0, + " \} " auto-completion for various languages Plug 'Valloric/YouCompleteMe' @@ -275,7 +280,8 @@ nnoremap fi :YcmCompleter FixIt nnoremap ft /TODO nnoremap g :YcmCompleter GoTo " vimdiff split -nnoremap gd :Gvdiff HEAD +nnoremap gd :Gvdiff HEAD~ +nnoremap gdm :Gvdiff master " toggle search highlighting nnoremap h :set hlsearch! hlsearch? " help @@ -386,6 +392,8 @@ autocmd BufNewFile,BufRead *.h nnoremap x 0iextern f{hc$; autocmd Filetype fish inoremap 1 $argv[1] autocmd Filetype fish inoremap 2 $argv[2] +autocmd Filetype javascript inoremap x process.exit() + autocmd Filetype markdown nnoremap x 0f[lrx " nnoremap x 0f[lrx