From: Daniel Liu Date: Thu, 3 Dec 2020 05:28:08 +0000 (-0500) Subject: update X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=1e538d57480c7eba19393a8b365f662bf0a6dfb5;p=dotfiles.git update --- diff --git a/.Xresources b/.Xresources index ba448d0..0817443 100644 --- a/.Xresources +++ b/.Xresources @@ -53,6 +53,7 @@ dmenu.selbackground: nord8 # herbe herbe.background_color: nord0 +# herbe.font_pattern: Source Code Pro:size=10,Symbols Nerd Font:style=2048-em herbe.font_pattern: Source Code Pro:size=10 herbe.width: 300 herbe.pos_x: 20 diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 35ecfab..b94dd69 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -23,6 +23,8 @@ map dd delete # =-=-=-=-= custom 'go to' commands # school +map gd cd ~/Downloads +map gS cd ~/Scripts map gs. cd ~/School map gsc cd ~/School/cs145 map gsm5 cd ~/School/math135 diff --git a/.config/ncmpcpp/config b/.config/ncmpcpp/config index 588b483..1ee7798 100644 --- a/.config/ncmpcpp/config +++ b/.config/ncmpcpp/config @@ -1,5 +1,5 @@ -execute_on_song_change = notify-send "Now Playing" "$(mpc current)" +execute_on_song_change = notify-send "Now Playing: $(mpc current)" -i "" visualizer_fifo_path = "/tmp/mpd.fifo" visualizer_output_name = "toggle_visualizer" diff --git a/.config/zathura/mkzathurarc.sh b/.config/zathura/mkzathurarc.sh deleted file mode 100755 index 2231131..0000000 --- a/.config/zathura/mkzathurarc.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -get_option() { - xrdb -query | grep $1 | awk '{print $2}' -} - -config_file=$XDG_CONFIG_HOME/zathura/zathurarc - -cat > $config_file <<- CONF -set recolor -set recolor-darkcolor "$(get_option foreground)" -set recolor-lightcolor "$(get_option *.color0:)" -set default-bg "$(get_option *.color0:)" -map i recolor - -set font Source Code Pro:size=12 -set statusbar-fg "$(get_option *.color0:)" -set statusbar-bg "$(get_option *.color2:)" -set statusbar-v-padding 2 -set statusbar-h-padding 8 - -CONF diff --git a/.vim/mysnippets/tex.snippets b/.vim/mysnippets/tex.snippets index 84bf0d4..af11478 100644 --- a/.vim/mysnippets/tex.snippets +++ b/.vim/mysnippets/tex.snippets @@ -86,6 +86,9 @@ snippet naturals "Set of Naturals" w \mathbb{N} endsnippet +snippet complex "Set of Complex" w +\mathbb{C} +endsnippet # OTHERS snippet implies "Implies" w diff --git a/.vimrc b/.vimrc index f4a86c7..54035ba 100644 --- a/.vimrc +++ b/.vimrc @@ -42,7 +42,8 @@ Plug 'lervag/vimtex' Plug 'jiangmiao/auto-pairs' Plug 'PietroPate/vim-tex-conceal' Plug 'vim-airline/vim-airline' -Plug 'habamax/vim-godot' + " Plug 'neoclide/coc.nvim', {'branch': 'release'} +" Plug 'habamax/vim-godot' Plug 'tpope/vim-commentary' call plug#end() diff --git a/Scripts/cormackscript b/Scripts/cormackscript new file mode 100755 index 0000000..ed12e57 --- /dev/null +++ b/Scripts/cormackscript @@ -0,0 +1,65 @@ +#!/bin/sh + +# CORMACKSCRIPT General Syntax +# +# IMPORTANT! +# Make sure you change the 'scriptfile' and 'targetfile' variables as you see fit. +# In addition, place +# +# For extra niceness, if you have the racket program installed it will auto execute it. +# +# +# Example: +# +# A CormackScript file contains 3 columns separated by whitespace in the format +# opcode target source +# +# +# +# You can comment with ; +# +# +# Sample code +# +# + +scriptfile="A12d.cmks" # cormackscript file +targetfile="A12d.rkt" # destination file + +# You can redefine these to whatever you want + +inst0="inc" # [tt] = [tt] + 1 +inst1="add" # [tt] = [tt] + [ss] +inst2="sub" # [tt] = max([tt] - [ss], 0) +inst3="mov" # [tt] = [ss] +inst4="" # [tt] = [tt] + 1, if [ss] = 0 +inst5="" # [tt] = [[ss]] +inst6="" # [[tt]] = [ss] +inst7="print" # display [ss] +inst8="read" # read [tt] +inst9="quit" # halt + +# Config ends here =-=-=-=-=-=-=-=-= + +sub() { + cat "$scriptfile" |\ + sed 's/\s*;.*//g; /^\s*$/ d;' |\ + sed "s/$inst0/0/" + + # finally removes any non alphanumerics in case sm breaks +} + +inject() { + tmp="$(mktemp 'tempXXX')" + sub >> "$tmp" + sed -i "/\; CMKS START/,/\; CMKS END/{/\; CMKS START/!{/\; CMKS END/!d}}; /\; CMKS START/r $tmp" "$targetfile" + rm "$tmp" +} + + +[ -f "$scriptfile" ] && [ -f "$targetfile" ] || { echo "You are missing a file, please check that the current directory contains $scriptfile and $targetfile" && exit 1; } + +# If racket is installed run it directly +# [ ! -z "$(command -v racket)" ] && racket "$targetfile" + +inject diff --git a/Scripts/fzfutil b/Scripts/fzfutil index 3916815..8d15256 100755 --- a/Scripts/fzfutil +++ b/Scripts/fzfutil @@ -2,12 +2,21 @@ fuzzy_dirs="$HOME/Scripts/* $HOME/School/* $HOME/.vim/mysnippets/* $HOME/.bashrc $HOME/.xinitrc $HOME/.Xresources $HOME/.Xmodmap $HOME/.config/*" -fzs() { +ffi() { # standard fzf on files fname="$(find $fuzzy_dirs -type f | fzf)" - [ -z $fname ] || $EDITOR $fname # make sure a file was selected + [ -z "$fname" ] && exit 1 + echo "$fname" } - -fcd() { +fdi() { # standard fzf on dirs dname="$(find $fuzzy_dirs -type d | fzf)" - [ -z $dname ] || cd $dname + [ -z "$dname" ] && exit 1 + echo "$dname" +} + +fvi() { # shortcut ffi for editor + ffi && $EDITOR "$fname" +} + +fcd() { # shortcuz fdi for cding + fdi && cd "$dname" }