diff --git a/aliases/key_aliases b/aliases/key_aliases index 7c1a4ca..bc8bb45 100644 --- a/aliases/key_aliases +++ b/aliases/key_aliases @@ -9,8 +9,8 @@ fi "fish" # reload urxvt ru "xrdb ~/.Xresources" # list file sizes in megabytes with depth 1 -duh "sudo du -d 1 -ah | sort -hr" -dum "sudo du -d 1 -am | sort -hr" +duh "sudo du -d 1 -h --apparent-size | sort -hr" +dum "sudo du -d 1 -m --apparent-size | sort -hr" m "man" tl "tldr" @@ -102,38 +102,45 @@ vlh "alsamixer -c 2" # pacman {{{ # -pc "sudo pacman -S" -pcq "sudo pacman -Qi" -pcr "sudo pacman -Rns" -pcud "sudo pacman -Sy" -pcug "sudo pacman -Syu" -xpc "pacman -Qqne > ~/linux-config/txt/nzxt-pkgs.txt && pacman -Qqme > ~/linux-config/txt/nzxt-aur.txt " +# pc "sudo pacman -S" +# pcq "sudo pacman -Qi" +# pcr "sudo pacman -Rns" +# pcud "sudo pacman -Sy" +# pcug "sudo pacman -Syu" +# xpc "pacman -Qqne > ~/linux-config/txt/nzxt-pkgs.txt && pacman -Qqme > ~/linux-config/txt/nzxt-aur.txt " + # tri "trizen -S --noconfirm" tri "trizen -S --noedit" +# install +ya "yay -S --answerdiff=N --answeredit=N" +# info +yaq "yay -Qi" +# remove +yar "yay -Rns" +# sync +yaud "yay -Sy" +# sync and update +yaug "yay -Syu" +# export packages +xya "yay -Qqne > ~/linux-config/txt/nzxt-pkgs.txt && yay -Qqme > ~/linux-config/txt/nzxt-aur.txt " + # }}} pacman # py "python" pipi "sudo pip install" # internet -pgo "ping -c 3 8.8.8.8" +pg "ping -c 3 -W 1 8.8.8.8" dh "sudo dhcpcd" kdh "sudo killall dhcpcd" rdh "sudo killall dhcpcd && sudo dhcpcd" id "identify" -# }}} system # - -# config files {{{ # -rf "source ~/.config/fish/config.fish" -srf "sync-shortcuts && source ~/.config/fish/config.fish" -rz "source ~/linux-config/aliases/zsh_aliases" +# rz "source ~/linux-config/aliases/zsh_aliases" -pipes "pipes.sh -t 3" - -# }}} config files # +# }}} system # # applications {{{ # @@ -148,11 +155,13 @@ gpe "gpg --encrypt --recipient" htc "htop -s PERCENT_CPU" htm "htop -s PERCENT_MEM" kd "killall Discord && killall Discord" +kt "killall thunderbird" mp "mpv --volume=50" mra "man ranger" n "nvim" nd "node" p3 "python3" +pipes "pipes.sh -t 3" py "python" r "ranger" rx "redshift -x" @@ -198,6 +207,7 @@ wrw "watson report" wre "watson restart" ws "watson status && watson stop" wse "watson stop && watson edit" +wsc "watson cancel" wsl "watson stop && watson log --day" wt "watson status" @@ -272,6 +282,7 @@ gcam "git add -A . && git commit --amend -S" psgi "git add . && git commit -m 'Update' -S && git push" gps "git push" +gpsi "git config credential.helper store && git push" # gpsn "git push --set-upstream origin master" gpsn "eval (git push 2>&1 | tail -n 2)" gpsf "git push --force" @@ -321,10 +332,9 @@ rgt "rg TODO" # svscs "f $spv_dir/src/static/scss" # svcss "f $spv_dir/src/spotifyvis/static/scss" # start spv server from dir -pg "sudo systemctl start postgresql.service && systemctl status postgresql.service" +# pg "sudo systemctl start postgresql.service && systemctl status postgresql.service" ssv "bash ../bin/activate && python manage.py runserver" # start spv server outside dir -sssv "sv && ssv" # open spv db in psql spvdb "psql -d spotifyvis -U django" mig "python manage.py makemigrations && python manage.py migrate --run-syncdb && ssv" @@ -372,12 +382,16 @@ rt "python ~/coding/rt-scraper/rt-scraper.py" # 369 {{{ # +ssc "ssh mokkar@teach.cs.utoronto.ca" + ma "printf '\033c' && bear make" mc "bear make clean" +mca "bear make clean && printf '\033c' && bear make" +rmc "rm compile_commands.json" rms "rm swapfile.*" -wl6 "watson log --all --project=369 --tag=a3" -wr6 "watson report --all --project=369 --tag=a3" +wl6 "watson log --all --project=369 --tag=a4" +wr6 "watson report --all --project=369 --tag=a4" # a2 {{{ # @@ -401,8 +415,8 @@ hl "valgrind --tool=helgrind ./carsim light 10 20" # 309 0ht "cd ~/school/309-proj && python3 -m http.server" -wl0 "watson log --all --project=309 --tag=project" -wr0 "watson report --all --project=309 --tag=project" +wl0 "watson log --all --project=309 --tag=e3" +wr0 "watson report --all --project=309 --tag=e3" e3t "node test-app.js" diff --git a/fish/.config/fish/config.fish b/fish/.config/fish/config.fish index 9b47c98..7edccb3 100644 --- a/fish/.config/fish/config.fish +++ b/fish/.config/fish/config.fish @@ -9,25 +9,34 @@ set -x GPG_TTY (tty) # }}} login to X # -# input +# fish-specific {{{ # + fish_vi_key_bindings set -x EDITOR nvim set -x VISUAL nvim +set -U fish_help_browser firefox builtin cd $last_dir bind \ce edit_command_buffer bind \cr forward-word -# fish-specific +/home/kevin/linux-config/scripts/sync-shortcuts +source /home/kevin/.config/fish/key_abbr.fish set -U fish_fxn_dir "/home/kevin/linux-config/fish/.config/fish/functions" abbr ff "cd $fish_fxn_dir" for fxn in (find $fish_fxn_dir -name '*.fish') source $fxn end -source /home/kevin/.config/fish/key_abbr.fish +abbr rf "source ~/.config/fish/config.fish" +abbr rfs "sync-shortcuts && source ~/.config/fish/config.fish" abbr xf "fish_config" abbr f. "cd .." abbr f.. "cd ../.." +abbr mt "math ''" + +# }}} fish-specific # + +# universal var's {{{ # # spv set -U spv_dir "/home/kevin/coding/spotify-lib-vis" @@ -43,7 +52,12 @@ set -xU XSET_DELAY 200 # xmodmap ~/.Xmodmap && xset r rate $XSET_DELAY $XSET_RATE # xset r rate $XSET_DELAY $XSET_RATE -# fxn abbr's +set -U BROWSER "chromium" + +# }}} universal var's # + +# fxn abbr's {{{ # + abbr ag "grep-aliases" abbr bq "benq-brightness" abbr cpc "copy cat" @@ -65,19 +79,26 @@ abbr hst "$EDITOR ~/.local/share/fish/fish_history" abbr ut "unix-timestamp" abbr uzr "unzip-rm" -set -U BROWSER "chromium" +# }}} fxn abbr's # + abbr hm "cd $mfs_dir && hugo serve -D --disableFastRender" +# school {{{ # + # 309 -abbr r0t "revert-e3-json restaurants" -abbr r0s "revert-e3-json reservations" +# abbr r0t "./revert-e3-json restaurants" +# abbr r0s "./revert-e3-json reservations" # 369 abbr grc "grep-c" abbr grh "grep-headers" abbr rgh "rg-headers" -abbr r6 "run-a3 f d o" -abbr r6g "run-a3 f d g" -abbr r6s "run-a3 s c o" -abbr g6 "source $fish_fxn_dir/369/a3/gdb-a3-break.fish && gdb-a3-break c c" +abbr r6 "run-a4 h e" + +# abbr r6 "run-a3 f d o" +# abbr r6g "run-a3 f d g" +# abbr r6s "run-a3 s c o" +# abbr g6 "source $fish_fxn_dir/369/a3/gdb-a3-break.fish && gdb-a3-break c c" + +# }}} school # diff --git a/fish/.config/fish/functions/369/a4/block-to-line.fish b/fish/.config/fish/functions/369/a4/block-to-line.fish new file mode 100644 index 0000000..f4bb1ee --- /dev/null +++ b/fish/.config/fish/functions/369/a4/block-to-line.fish @@ -0,0 +1,5 @@ +function block-to-line + set block_size 1024 + set bytes_per_line 16 + math "($block_size*$argv[1])/$bytes_per_line + 1" +end diff --git a/fish/.config/fish/functions/369/a4/hex.fish b/fish/.config/fish/functions/369/a4/hex.fish new file mode 100644 index 0000000..5bad58e --- /dev/null +++ b/fish/.config/fish/functions/369/a4/hex.fish @@ -0,0 +1,12 @@ +function hex + switch $argv[1] + case h + # print dec/bin. + printf "%d " (echo "ibase=16;obase=A;$argv[2]" | bc) + printf "%d\n" (echo "ibase=16;obase=2;$argv[2]" | bc) + case d + # print hex/bin. + printf "%s " (echo "obase=16;$argv[2]" | bc) + printf "%d\n" (echo "obase=2;$argv[2]" | bc) + end +end diff --git a/fish/.config/fish/functions/369/a4/run-a4.fish b/fish/.config/fish/functions/369/a4/run-a4.fish new file mode 100644 index 0000000..a1bf6ac --- /dev/null +++ b/fish/.config/fish/functions/369/a4/run-a4.fish @@ -0,0 +1,29 @@ +function run-a4 + # 1 = ex, 2 = img + printf '\033c' + # and bear make clean + bear make + + set img_file 'imgs/emptydisk.img' + switch $argv[2] + case 1 + set img_file 'imgs/onefile.img' + case m + set img_file 'imgs/multilevel.img' + case l + set img_file 'imgs/largefile.img' + end + + switch $argv[1] + case h + ./ext2_helpers_tester 'imgs/multilevel.img' '/level1/level2/bfile' + case hg + gdb -ex "run" -ex "bt" -ex "q" \ + --args ./ext2_helpers_tester './imgs/multilevel.img' '/level1/level2/level3//' + case m + ./ext2_mkdir $img_file '/' + # ./ext2_mkdir 'imgs/multilevel.img' '/level1/level2/bfile' + case '*' + ./readimage $img_file + end +end diff --git a/fish/.config/fish/functions/grep-aliases.fish b/fish/.config/fish/functions/grep-aliases.fish index e136bc9..094a3a9 100644 --- a/fish/.config/fish/functions/grep-aliases.fish +++ b/fish/.config/fish/functions/grep-aliases.fish @@ -1,5 +1,5 @@ function grep-aliases set key_aliases /home/kevin/linux-config/aliases/key_aliases - # grep $argv[1] $key_aliases - rg "^$argv[1]" $key_aliases + rg $argv[1] $key_aliases + # rg "^$argv[1]" $key_aliases end diff --git a/fish/.config/fish/functions/revert-e3-json.fish b/fish/.config/fish/functions/revert-e3-json.fish deleted file mode 100644 index bf372b7..0000000 --- a/fish/.config/fish/functions/revert-e3-json.fish +++ /dev/null @@ -1,3 +0,0 @@ -function revert-e3-json - cp $argv[1]_example.json $argv[1].json -end diff --git a/i3/.config/i3/config b/i3/.config/i3/config index 293cca8..21166d8 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -41,16 +41,17 @@ bindsym Mod4+h exec echo 'kevin.mok@live.ca' | xclip -selection clipboard bindsym Mod4+$mod+m exec pass -c uoft/markus bindsym Mod4+n exec urxvt -e nvim bindsym Mod4+o exec xclip -selection clipboard ~/.password-store/social/gmail +bindsym Mod4+$mod+o exec xset dpms force off # bindsym Mod4+p workspace $ws4; exec pgadmin3 # bindsym Mod4+p exec pycharm bindsym Mod4+p exec passmenu +# bindsym Mod4+$mod+p exec notify-send "ping" "$(ping -c 3 -W 1 8.8.8.8)" bindsym Mod4+q exec qdirstat bindsym Mod4+r exec urxvt -e ranger bindsym Mod4+$mod+r exec notify-send "watson restart" "$(watson restart)" bindsym control+$mod+s exec systemctl suspend -bindsym Mod4+$mod+s exec xset dpms force off # bindsym Mod4+t exec st -bindsym Mod4+t exec xclip -selection clipboard ~/.password-store/social/trapbot +bindsym Mod4+$mod+t exec xclip -selection clipboard ~/.password-store/social/trapbot bindsym Mod4+u exec echo 'kevin.mok@mail.utoronto.ca' | xclip -selection clipboard bindsym Mod4+$mod+u exec pass -c uoft/acorn bindsym Mod4+w exec notify-send "watson status" "$(watson status)" @@ -231,7 +232,8 @@ set $ws5 "5 " workspace $ws5 output $samsung assign [class="Steam"] $ws5 bindsym $mod+F5 workspace $ws5; exec $browser -bindsym Mod4+g workspace $ws5; layout stacking; exec urxvt -e steam +# bindsym Mod4+g workspace $ws5; layout stacking; exec urxvt -e steam +bindsym Mod4+t workspace $ws5; exec thunderbird set $ws6 "6 " workspace $ws6 output $samsung diff --git a/ranger/.config/ranger/rc.conf b/ranger/.config/ranger/rc.conf index cc460f5..45e3410 100644 --- a/ranger/.config/ranger/rc.conf +++ b/ranger/.config/ranger/rc.conf @@ -668,11 +668,14 @@ set preview_images_method w3m # }}} image preview # +# custom {{{ # + # editing ranger config map R chain shell nvim -p ~/.config/ranger/rc.conf %rangerdir/config/rc.conf; source ~/.config/ranger/rc.conf map rr source ~/.config/ranger/rc.conf -# backgrounds +# backgrounds {{{ # + map w shell /usr/bin/wal -i %f map bde shell mv %f dim/editing map bdn shell mv %f dim/non-editing @@ -681,6 +684,8 @@ map bbn shell mv %f bright/non-editing map be shell mv %f editing map bn shell mv %f non-editing +# }}} backgrounds # + # bulk rename map cw eval fm.execute_console("bulkrename") if fm.thisdir.marked_items else fm.open_console("rename ") @@ -698,3 +703,5 @@ map dg shell dragon-drag-and-drop -a -x %p # a plugin that adds file glyphs / icon support to Ranger: # https://github.com/alexanderjeurissen/ranger_devicons default_linemode devicons + +# }}} custom # diff --git a/txt/exclude-dirs-backup.txt b/txt/exclude-dirs-backup.txt index d4c3ce5..08b42fd 100644 --- a/txt/exclude-dirs-backup.txt +++ b/txt/exclude-dirs-backup.txt @@ -1,3 +1,6 @@ +/home/kevin/.android +/home/kevin/.AndroidStudio3.3 +/home/kevin/Android /home/kevin/.cache /home/kevin/.local/share/Steam /lost+found diff --git a/txt/key_dirs.txt b/txt/key_dirs.txt index 525a186..f935c0f 100644 --- a/txt/key_dirs.txt +++ b/txt/key_dirs.txt @@ -53,8 +53,11 @@ e3 /home/kevin/school/309/e3 # 369 6 /home/kevin/school/369 +6l /home/kevin/school/369/notes/lectures + 6f /home/kevin/linux-config/fish/.config/fish/functions/369/a3 -a3 /home/kevin/school/369/a3/a3 +a4d /home/kevin/school/369/a4/a4 +a43 /home/kevin/school/369/a4-3/fs3 hp /home/kevin/school/hps lt /home/kevin/school/latex-notes diff --git a/txt/nzxt-aur.txt b/txt/nzxt-aur.txt index 4e76342..e4eba0a 100644 --- a/txt/nzxt-aur.txt +++ b/txt/nzxt-aur.txt @@ -1,14 +1,18 @@ +android-studio bear browserpass chromium-widevine -cliqz +cliqz-bin discord dragon-drag-and-drop-git ffcast +flashplugin-focusfix htop-vim-git i3blocks-git linux-kevin linux-kevin-headers +linux-nzxt +linux-nzxt-headers lua-cjson nx3-all peaclock @@ -26,11 +30,11 @@ systemd-numlockontty texlive-local-algorithmicx texlive-local-algorithms texlive-local-enumitem -texlive-local-hyperref texlive-local-ifmtarg texlive-local-multirow texlive-local-numprint texlive-local-pgfplots +texlive-local-siunitx texlive-local-tkz-base texlive-local-tkz-euclide texlive-local-xifthen @@ -38,8 +42,9 @@ texlive-localmanager-git tor-browser trizen ttf-emojione +vidir watson weechat-vimode-git wego -xboxdrv yad +yay diff --git a/txt/nzxt-pkgs.txt b/txt/nzxt-pkgs.txt index b1a9192..a093987 100644 --- a/txt/nzxt-pkgs.txt +++ b/txt/nzxt-pkgs.txt @@ -30,7 +30,6 @@ e2fsprogs electrum encfs evince -evolution fakeroot fd feh @@ -39,6 +38,7 @@ filesystem findutils firefox fish +flashplugin flex fzf gawk @@ -52,6 +52,8 @@ glibc grep grub gzip +hexyl +highlight hugo i3-gaps i3status @@ -72,7 +74,6 @@ logrotate lolcat lsd lsof -lutris lvm2 lxappearance make @@ -82,6 +83,7 @@ mdadm meld mpv nano +ncdu neofetch neomutt neovim @@ -117,6 +119,7 @@ python-dbus python-pip python-pywal python-setuptools +qemu qrencode ranger redshift @@ -143,9 +146,12 @@ tar texinfo texlive-core the_silver_searcher +thunderbird tidy +time tmux tor +transmission-cli transmission-gtk ttf-dejavu ttf-font-awesome @@ -158,10 +164,8 @@ valgrind vi vim virtualbox -vlc w3m which -wine wireless_tools wkhtmltopdf wpa_actiond @@ -187,7 +191,6 @@ xfsprogs xorg-bdftopcf xorg-iceauth xorg-luit -xorg-mkfontdir xorg-mkfontscale xorg-server xorg-sessreg diff --git a/vim/.vimrc b/vim/.vimrc index 907914c..f3d71fa 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -1,23 +1,36 @@ " set x=y {{{ " -au BufWinEnter * set relativenumber -" set background=dark -set encoding=utf-8 -set background=light -" set t_Co=256 -filetype plugin on -syntax on -set tabstop=4 -set tw=80 -set linebreak -" set colorcolumn=80 -set shiftwidth=4 + set autoindent -" set mouse=c -set mouse=a +set autoread +set background=dark +" set colorcolumn=80 set clipboard+=unnamedplus -set foldmethod=marker +set diffopt=filler,context:3 +set encoding=utf-8 +set expandtab " set foldmethod=indent +set foldmethod=marker +set hlsearch +set linebreak set linespace=5 +set mouse=a +" set mouse=c +" set noswapfile +set relativenumber +set shiftwidth=4 +set tabstop=4 +" set t_Co=256 +" set timeoutlen=500 +set timeoutlen=350 +set tw=80 +set updatetime=1000 + +autocmd VimResized * wincmd = +filetype plugin on +filetype indent on +syntax on +au CursorHold,CursorHoldI * checktime + " cursor indicator {{{ " " set listchars=tab:\|\ @@ -26,25 +39,14 @@ set linespace=5 " set cursorline " }}} cursor indicator " -set diffopt=filler,context:3 -" set timeoutlen=500 -set timeoutlen=350 -set hlsearch -" set noswapfile -" let maplocalleader="-" -let maplocalleader="\\" " }}} set x=y " " commands for file types {{{ " -autocmd VimResized * wincmd = autocmd BufNewFile,BufRead .* set syntax=sh -filetype plugin on -filetype indent on -autocmd FileType *css,htmldjango,html,javascript,markdown,tex,yaml set tabstop=2 shiftwidth=2 expandtab -autocmd BufNewFile,BufRead *.txt set tabstop=2 shiftwidth=2 expandtab -autocmd BufNewFile,BufRead *.md set filetype=markdown +autocmd FileType *css,htmldjango,html,javascript,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 @@ -55,7 +57,6 @@ autocmd FileType sh map :!clear && shellcheck % " autocmd FileType tex map :VimtexCompile:VimtexView autocmd VimEnter *.tex VimtexCompile autocmd VimLeave *.tex !tex-clean %:p -" map :VimtexCompile " " auto-reload vimrc {{{ " @@ -81,7 +82,7 @@ autocmd BufNewFile,BufRead key_* map :silent !sync-shortcuts " }}} commands for specific files " -" vim-plug {{{ " +" vim-plug {{{ " plug auto-install if empty(glob('~/.vim/autoload/plug.vim')) silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs @@ -200,8 +201,13 @@ Plug 'PotatoesMaster/i3-vim-syntax' Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'terryma/vim-multiple-cursors' " let g:multi_cursor_select_all_word_key='' + let g:multi_cursor_exit_from_visual_mode=0 + let g:multi_cursor_exit_from_insert_mode=0 Plug 'dag/vim-fish' +Plug 'shime/vim-livedown' Plug 'tpope/vim-fugitive' +" auto reload file +Plug 'djoshea/vim-autoread' call plug#end() @@ -218,12 +224,16 @@ map :xa map :q! map :qa! map :AutoSaveToggle +" reload file +nnoremap :e nnoremap :set paste"+p:set nopaste +nnoremap :set paste"*p:set nopaste " }}} function keys " map O " swap text visually vnoremap `.``gvP``P +ino yiW==0 " splits {{{ " nnoremap @@ -237,6 +247,7 @@ nnoremap | " leader mappings {{{ " let mapleader="\" +" let maplocalleader="-" " find alias nnoremap a /^ @@ -285,10 +296,8 @@ nnoremap plc :PlugClean nnoremap plu :PlugUpdate " don't break lines nnoremap py :set tw=0 -" reload file -nnoremap r :e " replace in next x lines -nnoremap re q:i.,.+s///gFsi +nnoremap r q:i.,.+s///gFsi " replace in line nnoremap rl q:i.s///g " replace in visual selection @@ -329,6 +338,8 @@ nnoremap z za " Local Mappings {{{ " +let maplocalleader="\\" + " tex {{{ " autocmd Filetype tex inoremap bt \bowtie @@ -367,6 +378,8 @@ autocmd Filetype tex inoremap tx $t(x)$ " }}} tex " +autocmd Filetype c inoremap uc unsigned char + autocmd Filetype fish inoremap 1 $argv[1] autocmd Filetype fish inoremap 2 $argv[2] diff --git a/zathura/.config/zathura/zathurarc b/zathura/.config/zathura/zathurarc index f4cc787..9b8b0ec 100644 --- a/zathura/.config/zathura/zathurarc +++ b/zathura/.config/zathura/zathurarc @@ -1,3 +1,4 @@ set recolor true set recolor-darkcolor "#dcdccc" set recolor-lightcolor "#1f1f1f" +set selection-clipboard clipboard