diff --git a/.vimrc b/.vimrc index 728dbad..bdbc64e 100644 --- a/.vimrc +++ b/.vimrc @@ -55,13 +55,13 @@ colorscheme gotham256 map :wa map :wqa map :qa! -map :LLPStartPreview map :AutoSaveToggle set pastetoggle= map :PlugInstall -map o map O let mapleader="\" -" nnoremap Enter oit +nnoremap e o +nnoremap f :set foldmethod=marker +nnoremap p :LLPStartPreview nnoremap s :set syn=sh diff --git a/UltiSnips/all.snippets b/UltiSnips/all.snippets new file mode 100644 index 0000000..1de0f8b --- /dev/null +++ b/UltiSnips/all.snippets @@ -0,0 +1,17 @@ +snippet alias "Custom alias" +alias ${1:name}="${2:cmd}" +endsnippet + +snippet 1lf "One-line function" +${1:name}() { ${2:cmd} ; } +endsnippet + +snippet mlf "Multi-line function" +${1:name}() { + ${2:cmd} +} +endsnippet + +snippet ltx "LaTeX" i +LaTeX +endsnippet diff --git a/UltiSnips/c.snippets b/UltiSnips/c.snippets new file mode 100644 index 0000000..056476e --- /dev/null +++ b/UltiSnips/c.snippets @@ -0,0 +1,21 @@ +snippet forg "Generic for" +for (int i = 0; i < ${1:count}; i++) { + ${2} +} +endsnippet + +snippet mlc "malloc" i += malloc(sizeof(${1:type}) * ${2:amt}); +endsnippet + +snippet stl "strlen" +strlen(${1:var}) +endsnippet + +snippet scp "strcpy" +strcpy(${1:dest}, ${2:str}); +endsnippet + +snippet cmt "Line comment" b +/* ${1:text} */ +endsnippet diff --git a/UltiSnips/sh.snippets b/UltiSnips/sh.snippets new file mode 100644 index 0000000..4e87e22 --- /dev/null +++ b/UltiSnips/sh.snippets @@ -0,0 +1,8 @@ +snippet evr "Var with escaped quotes" i +\"$${1:var}\" +endsnippet + +snippet vr "Var with quotes" i +"$${1:var}" +endsnippet + diff --git a/UltiSnips/snippets.snippets b/UltiSnips/snippets.snippets new file mode 100644 index 0000000..5b71e97 --- /dev/null +++ b/UltiSnips/snippets.snippets @@ -0,0 +1,10 @@ +snippet ts "Tabstop" i +${${1:number}:${2:default}} +endsnippet + +snippet "b(egin)?" "begin{} / end{}" br +\begin{${1:something}} + ${0:${VISUAL}} +\end{$1} +endsnippet + diff --git a/UltiSnips/tex.snippets b/UltiSnips/tex.snippets new file mode 100644 index 0000000..ed92608 --- /dev/null +++ b/UltiSnips/tex.snippets @@ -0,0 +1,7 @@ +snippet bf "Boldface" i +\textbf{$0} +endsnippet + +snippet geq "Geq eqn" i +$\geq $0$ +endsnippet diff --git a/UltiSnips/texmath.snippets b/UltiSnips/texmath.snippets new file mode 100644 index 0000000..a4cfeb4 --- /dev/null +++ b/UltiSnips/texmath.snippets @@ -0,0 +1,23 @@ +snippet al "Align (math)" b +\begin{align*} + $0 +\end{align*} +endsnippet + +snippet pwf "Piecewise function" b +\[ + ${1:name} = \left. + \begin{cases} + ${2:equation}, & ${3:condition} \\\\ + \end{cases} + \right\\} +\] +endsnippet + +snippet int "Integral" i +\int_{${1:lower}}^{${2:upper}} \, \mathrm{d}${3:x} +endsnippet + +snippet ie "In-line equation" i +$$1$$2 +endsnippet diff --git a/X1-Carbon-terminator b/X1-Carbon-terminator index 2efb60e..ba377ba 100644 --- a/X1-Carbon-terminator +++ b/X1-Carbon-terminator @@ -38,6 +38,5 @@ font = Monospace 11 foreground_color = "#0077ff" palette = "#000000:#aa0000:#00aa00:#aa5500:#0000aa:#aa00aa:#00aaaa:#aaaaaa:#555555:#ff5555:#55ff55:#ffff55:#5555ff:#ff55ff:#55ffff:#ffffff" - scrollbar_position = hidden use_custom_command = True use_system_font = False diff --git a/aliases/.209_aliases b/aliases/.209_aliases index cf60b99..6d3fe8c 100644 --- a/aliases/.209_aliases +++ b/aliases/.209_aliases @@ -30,10 +30,17 @@ c9i() { gc9 $1 && ./"${1%.*}.out" < $2 ; } # compile and run with input file run() { while read line; do - ./$1 $line - done < $2 + # ./$1.out $line + echo ./$1.out $line + done < $1.in } + # temp + c4g() { + gcc -Wall -std=gnu99 -g -o greeting.out greeting.c + ./greeting.out "Good morning" "Emmanuel" + } + # compile a1p2 and test with simple case ca12() { gcc -Wall -std=gnu99 -g -o validate_sin.out validate_sin.c sin_helpers.c diff --git a/aliases/.bash_aliases b/aliases/.bash_aliases index 6e12029..60369bf 100644 --- a/aliases/.bash_aliases +++ b/aliases/.bash_aliases @@ -20,24 +20,25 @@ alias rmsw="rm .sw*" # unalias c d() { cd "$@" && ls -a ; } cd_up() { d $(printf "%0.s../" $(seq 1 $1 )) ; } -alias "c."="cd_up" +alias "d."="cd_up" alias cdd="d ~/Downloads" -alias dsnip="d ~/.vim/plugged/vim-snippets/UltiSnips/" -alias csnip="d ~/.vim/UltiSnips/" -vdsnip() { vi ~/.vim/plugged/vim-snippets/UltiSnips/"$1".snippets ; } -vsnip() { vi ~/.vim/UltiSnips/"$1".snippets ; } +alias dsnp="d ~/.vim/plugged/vim-snippets/UltiSnips/" +alias csnp="d ~/.vim/UltiSnips/" +vdsnp() { vi ~/.vim/plugged/vim-snippets/UltiSnips/"$1".snippets ; } +vsnp() { vi ~/.vim/UltiSnips/"$1".snippets ; } # apps ok() { okular $1 ; } -# config +## config alias lc="d ~/linux-config/" -alias lca="d ~/linux-config/aliases" -alias vb="vi $alias_folder/.bash_aliases" -alias vs="vi $alias_folder/.school_aliases" -alias vs9="vi $alias_folder/.209_aliases" alias vv="vi ~/.vimrc" alias r=". ~/.bashrc" + # aliases + alias lca="d ~/linux-config/aliases" + alias vb="vi $alias_folder/.bash_aliases" + alias vs="vi $alias_folder/.school_aliases" + alias vs9="vi $alias_folder/.209_aliases" # redshift rs(){ redshift -O $(($1 * 1000)) ; } diff --git a/aliases/.git_aliases b/aliases/.git_aliases index 19121cd..b55fc15 100644 --- a/aliases/.git_aliases +++ b/aliases/.git_aliases @@ -4,7 +4,7 @@ alias gpl="git pull --rebase" alias grbc="git rebase --continue" alias gps="git push" alias vig="vi .gitignore" -alias ga="git add -A *" +alias ga="git add -A * && gs" alias gai="git add .gitignore" alias gd="git diff -w" alias gdc="git diff --cached" @@ -16,10 +16,18 @@ alias gsl="git shortlog" alias gst="git stash" alias gstp="git stash pop" alias gclear="git stash clear" +alias egc="vim -c \"set syn=gitcommit\" -c \"set tw=72\" commit-msg.txt" + gcho() { git checkout $1 ; } gremotes() { git remote set-url --add --push origin $1 git remote set-url --add --push origin $2 } - -alias egc="vim -c \"set syn=gitcommit\" -c \"set tw=72\" commit-msg.txt" +gmrgr() { + # 1 = remote name, 2 = remote path + git remote add $1 $2 + git fetch $1 + # whichever branch you want to merge + git merge --allow-unrelated-histories $1/master + git remote remove $1 +} diff --git a/aliases/.my_pc_aliases b/aliases/.my_pc_aliases index c0aebcd..2e1d99d 100644 --- a/aliases/.my_pc_aliases +++ b/aliases/.my_pc_aliases @@ -1,7 +1,7 @@ if [ "$(whoami)" == "kevin" ]; then alias vbn="cvlc --loop ~/Downloads/brown-noise.mp3" - alias mt="ok ~/Documents/School/136/calc-textbook.pdf" + alias mt="ok ~/Documents/School/calc-textbook.pdf" alias clc="gcalccmd" - alias 36t="ok ~/Documents/School/236/236-textbook.pdf" + alias 36t="ok ~/Documents/School/236-textbook.pdf" fi diff --git a/aliases/.school_aliases b/aliases/.school_aliases index fea8046..ae0241c 100644 --- a/aliases/.school_aliases +++ b/aliases/.school_aliases @@ -1,6 +1,6 @@ in_lab=false -cd_school="d ~/Documents/School"; -if [ -d "/h/u3/c7/" ]; then +cd_school="d ~/Documents/School/notes"; +if [ $(whoami) == "mokkar" ]; then TERM=xterm-256color xmodmap -e "clear Lock" in_lab=true @@ -17,9 +17,10 @@ fi alias sch="$cd_school" alias 236="$cd_school/236" alias psy="$cd_school/psy" +alias rml="rm *.aux *.log *.pdf" pdl() { pdflatex $1 ; } cptp() { - cp template.tex cp-template.tex + cp *template.tex cp-template.tex chmod 600 cp-template.tex date=`date +%-m-%d` mv cp-template.tex "$date".tex @@ -27,5 +28,4 @@ cptp() { # 136 alias 136="$cd_school/136" -alias 136n="$cd_school/136/notes" alias pr2="$cd_school/136/par/2"