From caf4e67b6a5d1fe93aab90262c76505b9702def2 Mon Sep 17 00:00:00 2001 From: Kevin Mok Date: Sat, 16 Feb 2019 17:02:16 -0500 Subject: [PATCH] Added wp shuffler, rm txt/md from ycm_blacklist --- aliases/key_aliases | 18 ++++--- fish/.config/fish/config.fish | 1 + fish/.config/fish/functions/gdb-a2.fish | 9 +++- i3/.config/i3/config | 11 +++-- ranger/.config/ranger/rc.conf | 3 ++ scripts/shuffler | 63 +++++++++++++++++++++++++ txt/key_files.txt | 1 + vim/.vimrc | 17 +++++-- x/.Xresources | 4 +- 9 files changed, 107 insertions(+), 20 deletions(-) create mode 100755 scripts/shuffler diff --git a/aliases/key_aliases b/aliases/key_aliases index 535ebcd..5657759 100644 --- a/aliases/key_aliases +++ b/aliases/key_aliases @@ -97,7 +97,7 @@ pcug "sudo pacman -Syu" pcv "sudo pacman -Q" xpc "pacman -Qqe > ~/linux-config/txt/nzxt-pkgs.txt" # tri "trizen -S --noconfirm" -tri "trizen -S" +tri "trizen -S --noedit" # }}} pacman # @@ -171,7 +171,7 @@ py "python" w "watson" wa "watson start" we "watson edit" -wl "watson log" +wl "watson log --day" # wlm "watson log --project coding --tag mfs" wr "watson report" ws "watson stop" @@ -319,7 +319,7 @@ snw "spotify-now -i '%artist - %title'" # }}} spotify-lib-vis # -sc "shellcheck" +shc "shellcheck" pdl "pdflatex" tcl "tex-clean" @@ -341,10 +341,14 @@ ss "ssh kevin@192.168.0.100" # a2 m "printf '\033c' && bear make" mc "bear make clean" -mcr "bear make clean && printf '\033c' && bear make && ./carsim light 10 50" -mr "printf '\033c' && make && ./carsim stop 1 4" -# mr "printf '\033c' && bear make && ./carsim light 1 50" -hl "valgrind --tool=helgrind ./carsim stop 10 50 > helgrind.txt 2>&1 && valgrind --tool=helgrind ./carsim light 10 50 >> helgrind.txt 2>&1" +mcr "bear make clean && printf '\033c' && bear make && ./carsim light 1 20" +# mr "printf '\033c' && make && ./carsim stop 10 20" +mr "printf '\033c' && bear make && ./carsim light 1 20" +# "valgrind --tool=helgrind ./carsim stop 10 50 > helgrind.txt 2>&1 && valgrind --tool=helgrind ./carsim light 10 50 >> helgrind.txt 2>&1" +# lk "valgrind --leak-check=yes ./carsim stop 10 20" +lk "valgrind --leak-check=yes ./carsim light 1 1" +# hl "valgrind --tool=helgrind ./carsim stop 10 20" +hl "valgrind --tool=helgrind ./carsim light 10 20" # a1 # sa "ssh k@192.168.0.17" diff --git a/fish/.config/fish/config.fish b/fish/.config/fish/config.fish index 74e97b6..a7011d3 100644 --- a/fish/.config/fish/config.fish +++ b/fish/.config/fish/config.fish @@ -16,6 +16,7 @@ set -x VISUAL nvim builtin cd $last_dir bind \ce edit_command_buffer +bind \cr forward-word # fish-specific source /home/kevin/.config/fish/key_abbr.fish diff --git a/fish/.config/fish/functions/gdb-a2.fish b/fish/.config/fish/functions/gdb-a2.fish index e2a6dfc..5a7e95e 100644 --- a/fish/.config/fish/functions/gdb-a2.fish +++ b/fish/.config/fish/functions/gdb-a2.fish @@ -1,10 +1,15 @@ function gdb-a2 - gdb -ex "b safeStopSign.c:40" -ex "b safeStopSign.c:44" -ex "run" \ + # gdb -ex "b safeStopSign.c:96" -ex "run" \ + # gdb -ex "b safeTrafficLight.c:98" -ex "run" \ + gdb -ex "run" -ex "bt" \ # gdb -ex "run" \ # -ex "p cur_lane_queue.count" \ # -ex "p cur_front->car->index" \ # -ex "p cur_front->car" \ - --args ./carsim stop 1 4 + # -ex "p cur_front" \ + # --args ./carsim stop 1 4 + # --args ./carsim stop 3 20 # --args ./carsim light 1 4 + --args ./carsim light 1 20 # gdb -ex "b safeStopSign.c:86" -ex "run" --args ./carsim stop 1 10 end diff --git a/i3/.config/i3/config b/i3/.config/i3/config index 0ff196c..6958ac3 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -2,11 +2,12 @@ # set $browser "firefox" set $browser "chromium" set $def_term "urxvt" +set $scripts_path "/home/kevin/linux-config/scripts" exec redshift -O 2000 # exec redshift -O 3000 # random bg exec compton -exec wal -i "$HOME/Pictures/Backgrounds/dim/non-editing" +exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/dim/non-editing") exec imwheel exec xmodmap ~/.Xmodmap exec xset r rate 200 70 @@ -145,11 +146,11 @@ bindsym shift+x kill # container display {{{ # # backgrounds # set $colors_sh "~/.cache/wal/colors.sh" -bindsym $mod+q exec wal -i "$HOME/Pictures/Backgrounds/bright/editing" -bindsym $mod+w exec wal -i "$HOME/Pictures/Backgrounds/dim/non-editing" +bindsym $mod+q exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/bright/editing") +bindsym $mod+w exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/dim/non-editing") # bindsym $mod+w exec ~/linux-config/scripts/bg-chooser -bindsym $mod+r exec wal -i "$HOME/Pictures/Backgrounds/dim/editing" -bindsym $mod+y exec wal -i "$HOME/Pictures/Backgrounds/bright/non-editing" +bindsym $mod+r exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/dim/editing") +bindsym $mod+y exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/bright/non-editing") # enter fullscreen mode for the focused container bindsym $mod+f fullscreen toggle diff --git a/ranger/.config/ranger/rc.conf b/ranger/.config/ranger/rc.conf index 5c1aa91..7e9f530 100644 --- a/ranger/.config/ranger/rc.conf +++ b/ranger/.config/ranger/rc.conf @@ -691,3 +691,6 @@ map v. shell $EDITOR %f # map gr fzf_select source /home/kevin/.config/ranger/key_mappings.conf + +map dg shell dragon-drag-and-drop -a -x %p +# map shell dragon-drag-and-drop -a -x %p diff --git a/scripts/shuffler b/scripts/shuffler new file mode 100755 index 0000000..82e5af3 --- /dev/null +++ b/scripts/shuffler @@ -0,0 +1,63 @@ +#!/bin/bash + +# vars {{{ # + +shuffle_cache="shuffle.txt" +regen_flag=0 +dir="" + +# }}} vars # + +# usage_msg {{{ # + +function usage_msg() { + # echo "usage: shuffler [-r] [dir_name]" + cat <<-EOF + Usage: shuffler [-r] [dir_name] + -r: regenerate the shuffle cache + EOF +} + +# }}} usage_msg # + +# parse for regen_flag{{{ +while getopts ":r" opt; do + case $opt in + r) + echo "-r was triggered!" >&2 + regen_flag=1 + ;; + \?) + echo "Invalid flag: -$OPTARG" >&2 + usage_msg + exit 1 + ;; + esac +done +#}}} + +# set dir {{{ # + +shift $((OPTIND-1)) +# if no dir, use pwd +if [[ "$#" -eq 0 ]]; then + dir=$(pwd) +elif [[ "$#" -gt 1 ]] || [[ ! -d "$1" ]]; then + usage_msg + exit 1 +else + dir="$1" +fi + +# }}} set dir # + +# rebuild shuffle cache if regen_flag, doesn't exist or file empty +if [[ "$regen_flag" -eq 1 ]] || [[ ! -f "$dir"/"$shuffle_cache" ]] || \ + [[ $(wc -l "$dir"/"$shuffle_cache" | awk '{print $1}') -eq 0 ]]; then +# if [[ "$regen_flag" -eq 1 ]]; then + find "$dir"/* ! -name "$shuffle_cache" -type f | shuf > "$dir"/"$shuffle_cache" +fi +head -n 1 "$dir"/"$shuffle_cache" +printf '%s\n\n' "$(sed '1d' "$dir"/"$shuffle_cache")" > "$dir"/"$shuffle_cache" + +# vim: set tabstop=2 shiftwidth=2 expandtab: diff --git a/txt/key_files.txt b/txt/key_files.txt index 0106da6..81059f9 100644 --- a/txt/key_files.txt +++ b/txt/key_files.txt @@ -30,6 +30,7 @@ mc /home/kevin/coding/mf-site/assets/sass/main.scss mi /home/kevin/coding/mf-site/ideas.md ne /home/kevin/linux-config/configs/neofetch/config.conf re README.md +td todo.md tm /home/kevin/.vim/plugged/vim-snippets/UltiSnips/texmath.snippets wt /home/kevin/.config/watson/state.tmp diff --git a/vim/.vimrc b/vim/.vimrc index f23c8db..fa0d138 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -30,7 +30,8 @@ set linespace=5 set timeoutlen=350 set hlsearch set noswapfile -let maplocalleader="-" +" let maplocalleader="-" +let maplocalleader="\\" " }}} set x=y " " commands for file types {{{ " @@ -46,7 +47,6 @@ autocmd BufRead commit-msg.txt set filetype=gitcommit tw=72 autocmd BufNewFile,BufRead *.md set filetype=markdown autocmd Filetype markdown set textwidth=0 " autocmd Filetype html set foldmarker=0 -autocmd Filetype c let maplocalleader="\\" autocmd BufWritePost key_* !sync-shortcuts autocmd VimLeave *.tex !tex-clean % @@ -106,6 +106,16 @@ Plug 'lervag/vimtex' " auto-completion for various languages Plug 'Valloric/YouCompleteMe' +let g:ycm_filetype_blacklist = { + \ 'tagbar': 1, + \ 'qf': 1, + \ 'notes': 1, + \ 'unite': 1, + \ 'vimwiki': 1, + \ 'pandoc': 1, + \ 'infolog': 1, + \ 'mail': 1 + \} " wrote short bits of text that expand into whatever you want " demo: https://www.youtube.com/watch?v=Zik6u0klD40 @@ -227,6 +237,7 @@ nnoremap fc /[<>=\|]\{7\} nnoremap ff :set foldmethod=marker zM " find copied text nnoremap ft /TODO +nnoremap g :YcmCompleter GoTo " toggle search highlighting nnoremap h :set hlsearch! hlsearch? " help @@ -291,8 +302,6 @@ nnoremap z za " Local Mappings {{{ " -autocmd Filetype c nnoremap g :YcmCompleter GoTo - autocmd Filetype fish inoremap 1 $argv[1] autocmd Filetype fish inoremap 2 $argv[2] diff --git a/x/.Xresources b/x/.Xresources index aa933fc..a58400c 100644 --- a/x/.Xresources +++ b/x/.Xresources @@ -13,8 +13,8 @@ URxvt*inheritPixmap: true URxvt*transparent: true ! ! URxvt*shading: 0 (blackest) to 99 black, 101 to 200 (whitest) white -! URxvt*shading: 40 -URxvt*shading: 35 +URxvt*shading: 40 +! URxvt*shading: 35 /* }}} transparency */