From a0fcd6714ed2ba640b6bf918e1eb22f6012d7855 Mon Sep 17 00:00:00 2001 From: Kevin Mok Date: Thu, 4 Jul 2019 03:54:01 -0400 Subject: [PATCH] Update Vim, NZXT wifi i3block --- dot_config/fish/config.fish.tmpl | 1 + .../functions/{vsnp.fish => vim-snippet.fish} | 2 +- dot_config/i3/config.tmpl | 12 ++++---- dot_config/i3blocks/i3blocks.conf.tmpl | 5 ++++ dot_config/i3blocks/scripts/executable_wifi | 2 +- dot_config/mpv/mpv.conf | 3 ++ dot_vimrc.tmpl | 28 +++++++++++++++---- key_aliases.tmpl | 8 ++++-- key_dirs.tmpl | 8 ++++-- scripts/executable_change-sink | 7 ----- 10 files changed, 50 insertions(+), 26 deletions(-) rename dot_config/fish/functions/{vsnp.fish => vim-snippet.fish} (83%) create mode 100644 dot_config/mpv/mpv.conf diff --git a/dot_config/fish/config.fish.tmpl b/dot_config/fish/config.fish.tmpl index 3252510..6bcc158 100755 --- a/dot_config/fish/config.fish.tmpl +++ b/dot_config/fish/config.fish.tmpl @@ -103,6 +103,7 @@ abbr shrm "shred-rm" abbr thes "thesaurus" abbr ut "unix-timestamp" abbr uzr "unzip-rm" +abbr vsnp "vim-snippet" abbr fvft "find-vim-filetype" # ]]] fxn abbr's # diff --git a/dot_config/fish/functions/vsnp.fish b/dot_config/fish/functions/vim-snippet.fish similarity index 83% rename from dot_config/fish/functions/vsnp.fish rename to dot_config/fish/functions/vim-snippet.fish index 3ef57ef..9518bd5 100755 --- a/dot_config/fish/functions/vsnp.fish +++ b/dot_config/fish/functions/vim-snippet.fish @@ -1,4 +1,4 @@ -function vsnp +function vim-snippet set snips_dir "/home/kevin/.vim/plugged/vim-snippets/UltiSnips" $EDITOR $snips_dir/$argv[1].snippets end diff --git a/dot_config/i3/config.tmpl b/dot_config/i3/config.tmpl index 7a5cbda..dde02a2 100755 --- a/dot_config/i3/config.tmpl +++ b/dot_config/i3/config.tmpl @@ -1,15 +1,19 @@ # startup [[[ # +set $term urxvt +set $term_alt st +# set $term st +# set $term_alt urxvt {{ if eq .chezmoi.fullHostname "x1-carbon" }} exec dunst exec compton exec imwheel -exec numlockx on +xec numlockx on exec xbacklight -set 10 # exec wal -i "$(/home/kevin/scripts/shuffler \"/home/kevin/Pictures/Backgrounds/dim/non-editing\")" exec wal -i $(/home/kevin/scripts/shuffler "$HOME/Pictures/Backgrounds/dim/non-editing") {{ end }} -exec --no-startup-id i3-msg 'workspace $ws2; exec $term' +# exec --no-startup-id i3-msg 'workspace $ws2; exec $term' exec --no-startup-id i3-msg 'workspace $ws3; exec $browser' # ]]] startup # @@ -19,10 +23,6 @@ exec --no-startup-id i3-msg 'workspace $ws3; exec $browser' set $mod Mod1 set $browser "firefox" # set $browser "chromium" -# set $term st -# set $term_alt urxvt -set $term urxvt -set $term_alt st set $scripts_path "/home/kevin/scripts" set $sch_dir "$HOME/Documents/School" diff --git a/dot_config/i3blocks/i3blocks.conf.tmpl b/dot_config/i3blocks/i3blocks.conf.tmpl index 2de5842..99ef437 100755 --- a/dot_config/i3blocks/i3blocks.conf.tmpl +++ b/dot_config/i3blocks/i3blocks.conf.tmpl @@ -68,6 +68,11 @@ WIDTH=220 # sys.monitoring [[[ # {{ if eq .chezmoi.fullHostname "nzxt" }} +[wifi] +label= +instance=wlp4s0 +interval=10 + [temperature] label= interval=5 diff --git a/dot_config/i3blocks/scripts/executable_wifi b/dot_config/i3blocks/scripts/executable_wifi index 34b7e04..ef2c0aa 100755 --- a/dot_config/i3blocks/scripts/executable_wifi +++ b/dot_config/i3blocks/scripts/executable_wifi @@ -29,7 +29,7 @@ INTERFACE="${BLOCK_INSTANCE:-wlan0}" #------------------------------------------------------------------------ -QUALITY=$(grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70) }') +QUALITY=$(sudo grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70) }') # echo $QUALITY W_inter=$(ip link | grep "[1-9]: wlp" | cut -d " " -f2 | tr -d ':') W_name=$(nmcli d | grep "$W_inter" | awk '{print $4}') diff --git a/dot_config/mpv/mpv.conf b/dot_config/mpv/mpv.conf new file mode 100644 index 0000000..dc1f891 --- /dev/null +++ b/dot_config/mpv/mpv.conf @@ -0,0 +1,3 @@ +sub-auto=fuzzy +ytdl-format=best +ytdl-raw-options=sub-format=en,write-srt= diff --git a/dot_vimrc.tmpl b/dot_vimrc.tmpl index 5ecd07d..3774ace 100755 --- a/dot_vimrc.tmpl +++ b/dot_vimrc.tmpl @@ -30,7 +30,8 @@ set tw=75 set undodir=~/.vim/undo set undofile " set updatetime=1000 -set updatetime=500 +" set updatetime=500 +set updatetime=0 autocmd VimResized * wincmd = filetype plugin on @@ -58,6 +59,7 @@ autocmd FileType *css,htmldjango,html,javascript,json,markdown,tex,text,yaml set " autocmd Filetype html set foldmarker=0 autocmd BufNewFile,BufRead *.gd set expandtab! autocmd Filetype go set expandtab! sw=4 +autocmd Filetype markdown set commentstring= autocmd Filetype markdown map :LivedownToggle autocmd Filetype markdown nnoremap >>A autocmd Filetype markdown inoremap < +nnoremap Q @@ + +" folds +nnoremap , za + +" indenting nnoremap > >> nnoremap < << inoremap << <c c$ nnoremap d d$ " delete entire buffer nnoremap dg ggdG +" delete entire line +nnoremap dl 0d$ " delete lines matching pattern -nnoremap dl :g//d +nnoremap dls :g//d " show docstring for cur word nnoremap do :YcmCompleter GetDoc " delete line into system clipboard @@ -291,8 +306,9 @@ nnoremap fmi :set foldmethod=indent zM nnoremap fmm :set foldmethod=marker zM " add marker foldmethod modeline nnoremap fi :YcmCompleter FixIt -" find copied text -nnoremap ft :se ft? +" check filetype +nnoremap ft :se ft? +" check todo's nnoremap ftd /TODO nnoremap g :YcmCompleter GoTo " vimdiff split @@ -317,6 +333,8 @@ vnoremap n q:anorm nnoremap nw :set nowrap " check if in neovim nnoremap nv :echo has('nvim') +" open fold recursively +nnoremap o zO " Plug commands nnoremap p "*p nnoremap pli :PlugInstall diff --git a/key_aliases.tmpl b/key_aliases.tmpl index ace0576..3f326f8 100755 --- a/key_aliases.tmpl +++ b/key_aliases.tmpl @@ -159,7 +159,8 @@ xya "yay -Qqne > ~/{{ .chezmoi.os }}-config/txt/{{ .chezmoi.fullHostname }}-pkgs {{ end }} py "python" -pyt "python -m unittest" +pyt "pytest -vv" +pyu "python -m unittest" pipi "pip install" spipi "sudo pip install" @@ -206,6 +207,7 @@ r "ranger" rg "printf '\033c' && rg" rx "redshift -x" sn "sudo nvim" +sw "swex" vmd "vimdiff" wg "wego" wp "grep wallpaper ~/.cache/wal/colors.sh" @@ -493,7 +495,7 @@ ssc "ssh mokkar@teach.cs.utoronto.ca" jc "javac -d out *.java" jr "java -cp \"$CLASSPATH:out\"" -wl2 "watson log --all --project=263 --tag=a2" -wr2 "watson report --all --project=263 --tag=a2" +wl6 "watson log --all --project=263 --tag=a3" +wr6 "watson report --all --project=263 --tag=a3" # ]]] school # diff --git a/key_dirs.tmpl b/key_dirs.tmpl index 203b0ea..a481270 100755 --- a/key_dirs.tmpl +++ b/key_dirs.tmpl @@ -49,6 +49,7 @@ mh ~/coding/mf-site/layouts snp ~/.vim/plugged/vim-snippets/UltiSnips sv ~/coding/spotify-lib-vis/src svg ~/coding/spotify-lib-vis/src/graphs/static/graphs/scripts +swd ~/coding/swex tb ~/coding/trapbot/src/trapbot wo ~/Documents/workout-logs/11 {{ end }} @@ -61,9 +62,10 @@ sc ~/school lt ~/school/latex-notes 6 ~/school/263 -62 ~/school/263/a2 -624 ~/school/263/a2/q4 -62t ~/school/latex-notes/263/a2 +63 ~/school/263/a3 +631 ~/school/263/a3/q1 +632 ~/school/263/a3/q2 +63t ~/school/latex-notes/263/a3 al1 ~/school/algorithms/w1-union-find diff --git a/scripts/executable_change-sink b/scripts/executable_change-sink index 937cbb8..598364e 100755 --- a/scripts/executable_change-sink +++ b/scripts/executable_change-sink @@ -13,13 +13,6 @@ case $1 in # devicename="alsa_output.pci-0000_00_14.2.iec958-stereo" ;; esac -# if [ "$1" = "dac" ]; then - # devicename="alsa_output.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo" -# elif [ "$1" = "dac2" ]; then - # devicename="alsa_output.usb-1852_DigiHug_USB_Audio-01.analog-stereo" -# elif [ "$1" = "line-out" ]; then - # devicename="alsa_output.pci-0000_00_14.2.analog-stereo" -# fi echo "$devicename" #change the default sink