commit 6bfb112b2af7e6ad175bbae7cad975618f9c997e Author: Adamska Date: Sat Sep 9 16:09:18 2023 -0400 init diff --git a/README.md b/README.md new file mode 100644 index 0000000..1a8b88e --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# dotfiles +Just some quick config files to (partially) terraform new machines diff --git a/mac/.zshrc b/mac/.zshrc new file mode 100755 index 0000000..6c61b2e --- /dev/null +++ b/mac/.zshrc @@ -0,0 +1,82 @@ +# ============================================================================== +# Auth: dodd +# File: .zshrc +# Revn: 09-06-2023 0.1 +# Func: Define user-made aliases and functions to make using the terminal easier +# +# TODO: come up with new things to change +# ============================================================================== +# CHANGE LOG +# ------------------------------------------------------------------------------ +# 09-06-2023: init +# copied over useful aliases from ocelot +# wrote function to ssh into ocelot remotely, ip robust +# 09-09-2023: added aliases to gcc and g++ +# +# ============================================================================== + + +# User specific aliases and functions +## Aliases + +### Shows everything in detail, except . and .. +alias ll="ls -AFGhl" +alias l="ls -AFGhl" + +### Go home +alias home="cd ~" + +### mac gcc is an alias for clang +### after downloading gcc, it's not in the global bin, it's local +alias gcc="/usr/local/bin/gcc-13" +alias g++="/usr/local/bin/g++-13" + +### donut +alias donut="~/donut" + +### load changes to .zshrc +alias src="source ~/.zshrc" + +### ssh into ocelot +alias ocelot="ssh ocelot@192.168.1.120" + +### ssh into sentinel +alias sentinel="ssh pi@192.168.1.169" + +## Aliases + +## Functions +### ssh into ocelot remotely +rocelot() { + # grab ip from ip repo + ip=$( cat ~/Documents/work/tax-returns-1997/data ) + # ssh into ip from repo + ssh ocelot@$ip +} + +### ssh into ocelot remotely +rsentinel() { + # grab ip from ip repo + ip=$( cat ~/Documents/work/tax-returns-1997/data ) + # ssh into ip from repo + # specify port 23, according to router settings, ssh port was + # moved from 22 to 23, to avoid collision with ocelot + ssh -p 23 pi@$ip +} + +## Functions + + +autoload -Uz vcs_info +precmd() { vcs_info } + +zstyle ':vcs_info:git:*' formats '%b ' + +# zsh.sourceforge.io/Doc/Release/Prompt-Expansion.html +setopt PROMPT_SUBST +# %F{color}...%f colors the encompassed text /color/ +# %m - shows the short machine name +# %1d - current working directory +PROMPT='%F{green}%m%f:%F{blue}%1~%f ⇌ ' +#PROMPT='%F{green}%*%f %F{blue}%~%f %F{red}${vcs_info_msg0}%f$ ' + diff --git a/mac/donut.c b/mac/donut.c new file mode 100644 index 0000000..0cfcce4 --- /dev/null +++ b/mac/donut.c @@ -0,0 +1,21 @@ + k;double sin() + ,cos();main(){float A= + 0,B=0,i,j,z[1760];char b[ + 1760];printf("\x1b[2J");for(;; + ){memset(b,32,1760);memset(z,0,7040) + ;for(j=0;6.28>j;j+=0.07)for(i=0;6.28 + >i;i+=0.02){float c=sin(i),d=cos(j),e= + sin(A),f=sin(j),g=cos(A),h=d+2,D=1/(c* + h*e+f*g+5),l=cos (i),m=cos(B),n=s\ +in(B),t=c*h*g-f* e;int x=40+30*D* +(l*h*m-t*n),y= 12+15*D*(l*h*n ++t*m),o=x+80*y, N=8*((f*e-c*d*g + )*m-c*d*e-f*g-l *d*n);if(22>y&& + y>0&&x>0&&80>x&&D>z[o]){z[o]=D;;;b[o]= + ".,-~:;=!*#$@"[N>0?N:0];}}/*#****!!-*/ + printf("\x1b[H");for(k=0;1761>k;k++) + putchar(k%80?b[k]:10);A+=0.04;B+= + 0.02;}}/*****####*******!!=;:~ + ~::==!!!**********!!!==::- + .,~~;;;========;;;:~-. + ..,--------,*/ diff --git a/mac/mac_dl.sh b/mac/mac_dl.sh new file mode 100755 index 0000000..4018080 --- /dev/null +++ b/mac/mac_dl.sh @@ -0,0 +1,29 @@ +# ============================================================================== +# Auth: Alex Celani +# File: mac_dl.sh +# Revn: 09-09-2023 0.1 +# Func: print the apps and links of stuff to download +# +# TODO: create +# ============================================================================== +# CHANGE LOG +# ------------------------------------------------------------------------------ +# 09-09-2023: init +# +# ============================================================================== + +echo "chrome" +echo "https://www.google.com/chrome/" + +echo "spotify" +echo "https://www.spotify.com/us/download/mac/" + +echo "minecraft" +echo "https://www.minecraft.net/en-us/download" + +echo "notion" +echo "https://www.notion.so/desktop" + +echo "arduino" +echo "https://www.arduino.cc/en/software" + diff --git a/mac/mac_setup.sh b/mac/mac_setup.sh new file mode 100755 index 0000000..7cb786e --- /dev/null +++ b/mac/mac_setup.sh @@ -0,0 +1,60 @@ +# ============================================================================== +# Auth: Alex Celani +# File: mac_setup.sh +# Revn: 09-09-2023 0.1 +# Func: re-setup terminal tools in mac +# +# TODO: create +# ============================================================================== +# CHANGE LOG +# ------------------------------------------------------------------------------ +# 09-09-2023: init +# +# ============================================================================== + +brew help > out 2> errout +rm out + +if [ -n errout ]; then + rm errout + echo "installing brew" + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +fi + + +brew install gcc +brew install go +brew install htop +brew install neofetch +brew install onefetch +brew install rust +brew install tmux +brew install wireshark + +/usr/local/bin/gcc-13 -o donut donut.c > /dev/null 2> errout + +if [ -n errout ]; then + rm errout + echo "gcc failed" +else + mv donut ~/ +fi + + +echo "generate a github PAT" + +cd ~/Documents/ +mkdir work +cd work + +git clone https://github.com/alexander-the-alright/dotfiles +cp dotfiles/mac/.zshrc ~/ +cp dotfiles/mac/.vimrc ~/ +cp -r dotfiles/mac/.vim ~/ + +git clone https://github.com/alexander-the-alright/TDM +go build TDM/tdm.go +mv tdm ~/ + +git clone https://github.com/alexander-the-alright/soary + diff --git a/mac/texmf/tex/latex/5311.sty b/mac/texmf/tex/latex/5311.sty new file mode 100644 index 0000000..d4fcec6 --- /dev/null +++ b/mac/texmf/tex/latex/5311.sty @@ -0,0 +1,107 @@ +% Style file for CS5311 "Theory of Computation" documents +% Charles Wallace +% These style settings are what I use to format the lecture notes and homework assignments. +% Feel free to use as much (or as little) of them as you like. + +\usepackage{amsmath} +\usepackage{amsthm} +\usepackage{latexsym} +\usepackage{fullpage,parskip,paralist} +\usepackage{amsmath,amsthm,amssymb} +\usepackage{graphicx} + +\ifdefined\nosol + \newcommand{\sol}[1]{} + \newcommand{\soltitle}{} +\else + \newcommand{\sol}[1]{{\bf Solution.} #1} + \newcommand{\soltitle}{: Solutions} +\fi + +\newcommand{\thetitle}[1]{\title{#1\soltitle}} +\author{} +\date{CS5311, Theory of Computation} + +% \ie, \eg: the abbreviations the way they are supposed to be written +\newcommand{\ie}{{\em i.e.,}} +\newcommand{\eg}{{\em e.g.,}} + +% These set common formats for various kinds of names +% \prob{P}: name of problem/language P +\newcommand{\prob}[1]{\mbox{\bf #1}} +% \pprob{P}{M}: problem P restricted to machine class M +\newcommand{\pprob}[2]{\mbox{$\prob{#1}_{\prob{\tiny #2}}$}} +% \prog{M}: name of program/machine M +\newcommand{\prog}[1]{\mbox{\tt #1}} +% \enc{M}: string encoding of machine M +\newcommand{\enc}[1]{\mbox{[\prog{#1}]}} +% \lang{M}: language accepted by machine M +\newcommand{\lang}[1]{\mbox{\bf L(\prog{#1})}} + +% definition environment (unnumbered) +\theoremstyle{definition} +\newtheorem*{definition}{Definition} +% numbered environments: theorem, proof, lemma, corollary, claim +\newtheorem{theorem}{Theorem} +\newtheorem{lemma}{Lemma} +\newtheorem{corollary}{Corollary} +\newtheorem{claim}{Claim} + +% Proof opening statement +\newcommand{\prf}{{\em Proof.}} +\newcommand{\prfout}{{\em Proof outline.}} + +% \code{L}{P}{I}{C}: Turing Machine code (as a box containing formatted text) +% L: horizontal length of box +% P: name of program +% I: names of inputs +% C: program code +\newcommand{\code}[4]{\fbox{\parbox{#1} +{\prog{#2}\hfill (Input: #3) +\begin{enumerate} +#4 +\end{enumerate}}}} + +% some common problems +\newcommand{\atm}{\pprob{A}{TM}} +\newcommand{\etm}{\pprob{E}{TM}} +\newcommand{\alltm}{\pprob{All}{TM}} +\newcommand{\acfl}{\pprob{A}{CFL}} +\newcommand{\allcfl}{\pprob{All}{CFL}} +\newcommand{\areg}{\pprob{A}{RL}} +\newcommand{\allreg}{\pprob{All}{RL}} +\newcommand{\anfa}{\pprob{A}{NFA}} +\newcommand{\adfa}{\pprob{A}{DFA}} + +% \bigo{T}: big-O of term T +\newcommand{\bigo}[1]{\mbox{O$(#1)$}} +% \expbigo{T}: 2^(big-O of term T) +\newcommand{\expbigo}[1]{\mbox{$2^{\mbox{O$(#1)$}}$}} +% \bigom{T}: big-Omega of term T +\newcommand{\bigom}[1]{\mbox{$\Omega(#1)$}} +% time/space complexity terms +\newcommand{\TIME}[1]{\mbox{TIME$(#1)$}} +\newcommand{\NTIME}[1]{\mbox{NTIME$(#1)$}} +\newcommand{\SPACE}[1]{\mbox{SPACE$(#1)$}} +\newcommand{\NSPACE}[1]{\mbox{NSPACE$(#1)$}} +% some common complexity classes +\newcommand{\PTIME}{\mbox{P}} +\newcommand{\NPTIME}{\mbox{NP}} +\newcommand{\EXPTIME}{\mbox{EXPTIME}} +\newcommand{\PSPACE}{\mbox{PSPACE}} +\newcommand{\NPSPACE}{\mbox{NPSPACE}} +\newcommand{\LSPACE}{\mbox{L}} +\newcommand{\NLSPACE}{\mbox{NL}} +\newcommand{\coNLSPACE}{\mbox{coNL}} +\newcommand{\NC}{\mbox{NC}} +\newcommand{\NPcomplete}{\NPTIME-complete} + +% \polyreduce{P}{Q} polynomial-time reduction relation +\newcommand{\polyreduce}[2]{$\prob{#1}\leq_{\mbox{\small P}}\prob{#2}$} +% \logreduce{P}{Q}: log-space reduction relation +\newcommand{\logreduce}[2]{$\prob{#1}\leq_{\mbox{\small L}}\prob{#2}$} + +\newcommand{\gad}{\mathbf{Gadget}} +\newcommand{\domino}[2] +{\begin{tabular}{|l|} \hline $#1$\\ \hline $#2$ \\ \hline \end{tabular}} + diff --git a/mac/yosemite.jpg b/mac/yosemite.jpg new file mode 100644 index 0000000..8acdf23 Binary files /dev/null and b/mac/yosemite.jpg differ diff --git a/pi/.bash_profile b/pi/.bash_profile new file mode 100755 index 0000000..5a5cb55 --- /dev/null +++ b/pi/.bash_profile @@ -0,0 +1,212 @@ +# ============================================================================== +# Auth: Alex Celani +# File: .bash_profile +# Revn: 03-06-2022 2.3 +# Func: Define user-made aliases and functions to make using the terminal easier +# +# TODO: fix alias to cd +# color files in ls, and color different file differently +# pick a new color and prompt scheme +# rename mkcd() +# ============================================================================== +# CHANGE LOG +# ------------------------------------------------------------------------------ +# ??-??-2018: init +# 05-31-2019: added header comment block +# 06-01-2019: fixed newcd, added alias of cc to newcd +# commented functions +# removed mkcd +# made hide, ssy, and SSY aliases instead of functions +# 06-21-2019: finally wrote Func field in header +# 03-25-2020: copied from .bashrc +# removed school-based functions to go to directories that do not +# exist on boofnet +# 05-11-2020: added control structure to detect architecure and make decisions +# about directories for grad() and src() +# 09-29-2020: wrote gitMake() +# renamed newcd() to mkcd() +# 10-07-2020: fixed src() and grad() not working on colossus by changing call +# to arch from "arch" to "$(arch)" +# added call to src() at the beginning of the file +# 10-12-2020: added -F to ll and l aliases +# 10-21-2020: added alias to spotify to make it work globally to +# avoid setting PATH +# added alias for neofetch +# finally made PS1 work with PROMPT_COMMAND +# made short function for showing short now playing +# 10-24-2020: deleted .bashrc; call to static .bashrc on colossus +# will change source to .bash_profile +# changed alias for spotify to sp +# added parse_git_branch() to get branch name for PS1 +# changed grad() to work without probing the architecture +# removed colors from PS1, got obnoxious +# added mkcd() again +# 01-18-2021: added alias for 'remake' +# 03-06-2022: added alias for donut, and wordle executables +# +# ============================================================================== + + +# User specific aliases and functions +## Aliases + +### Shows everything in detail, except . and .. +alias ll="ls -AFGhl" +alias l="ls -AFGhl" + +### Used for login +alias s="ssh sacelani@colossus.it.mtu.edu" + +### Move to desktop fast +alias desk="cd ~/Desktop" + +### Move to desktop fast, verbose +alias DESK="CD ~/Desktop" + +### Go home +alias home="cd ~" + +### Go home, verbose +alias HOME="CD ~" + +### Control Spotify with command line +alias sp="~/spotify" + +### neofetch +alias neofetch="~/neofetch" + +### donut +alias donut="~/donut" + +### wordle +alias wordle="~/wordle" +alias worlde="~/wordle" + +## Aliases + +## Exports + +# Holy shit, export PS1 kept failing, so I had to make it reload every +# time a command is run. Hacky and probably really slow, but it works +# PROMPT_COMMAND is a command run before it prints the prompt +# export PS1 is the command prompt, won't run in this file, only runs +# in actual terminal, or here apparently +# \e[0;31m is red +# \W is the current folder +# \e[0;34m is blue +# ' -> ' is a space and then an arrow, and then a space +# \e0;31m is red again +# \e[m is no color +#export PROMPT_COMMAND="export PS1='\[\e[0;32m\]\W\[\e[1;31m\] -> \[\e[0;32m\]'" +#export PROMPT_COMMAND="export PS1='\e[0;31m$(parse_git_branch) \e[m\W -> '" +export PROMPT_COMMAND="export PS1='\W -> '" +#export LSCOLORS=exfxcxdxbxegabagacad + +## Functions + +### LaTeX make function +tecc() { + pdflatex $1 >> /dev/null # compile tex file, output dies + rm $1.log # get rid of trash files + rm $1.aux +} + +### Print name of git branch +parse_git_branch() { + # call git branch to return list of all branches + # redirect output from 2 (error) to null + # pipe standard output to grep, get line with * + # pipe THAT to function that removes the leading space and * + git branch 2>/dev/null | grep '^*' | colrm 1 2 +} + +### Print Now Playing, short +playing() { + echo -n $(~/spotify status artist) # Print the artist, no newline + echo -n " - " # Print delimiter + echo $(~/spotify status track) # Print track, with newline +} + +### Change branch name on Github to daddy +daddy() { + if [ "$#" -eq 1 ]; then + git branch -m master $1 + git push -u origin $1 + else + git branch -m master daddy + git push -u origin daddy + fi + + echo "Log in to GitHub and change the default branch" + echo "Then call 'daddy2'" + +} + +daddy2() { + git push origin --delete master + git remote set-head origin -a +} + +### Detect architecture and load correct source file +src() { + if [ arch == "x86_64" ]; then # Check to see if using colossus + source ~/.bashrc # Reload colossus bash profile + else # If not colossus, boofnet + source ~/.bash_profile # Reload boofnet bash profile + fi +} + + +### Change directory and show contents +CD() { + cd $1 # Move + clear # Clear screen + ll # Print directory +} + +### If cd fails, make the new directory and cd in +mkcd() { + oldD=$(pwd) # Snag the current directory + cd $1 >/dev/null 2>/dev/null # cd, direct error output to null + newD=$(pwd) # Snag current directory again + + if [ $oldD == $newD ]; then # If new is same as old, didn't move + mkdir $1 # Make the new directory + cd $1 # cd in + fi +} + +### Jump to grad school directory, user specified semester if possible +grad() { + old=$(pwd); + cd ~/Desktop/grad 2>/dev/null + if [ $old == $(pwd) ]; then + cd ~/Documents/everything 2>/dev/null + fi +# if [ arch == "x86_64" ]; then # Check to see using colossus +# cd ~/Desktop/grad/ # Jump to grad directory, colossus +# else # If not colossus, boofnet +# cd ~/Documents/everything # Jump to grad directory, boofnet +# fi + + if [ "$#" -eq 1 ]; then # See if user entered a semester argument + cd "semester-$1" 2>/dev/null # Go to semester, error silently + fi +} + +### Take new repository and connect it to a Github repository +gitMake() { + if [ "$#" -eq 1 ]; then + # These three lines were given by github.com + git remote add origin https://github.com/sacelani/$1.git + git branch -M master + git push -u origin master + else # If the user doesn't give a name for the repo + echo -e "Usage:: gitMake REPO" # Print usage + echo -e "\tConnect local repo REPO to Github repo" + fi +} + +## Functions + +. "$HOME/.cargo/env" diff --git a/pi/.bashrc b/pi/.bashrc new file mode 100644 index 0000000..740a413 --- /dev/null +++ b/pi/.bashrc @@ -0,0 +1,82 @@ + +# make less more friendly for non-text input files, see lesspipe(1) +[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +#force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# some more ls aliases +alias ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' + +# Add an "alert" alias for long running commands. Use like so: +# sleep 10; alert +alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if [ -f /etc/bash_completion ] && ! shopt -oq posix; then + . /etc/bash_completion +fi diff --git a/pi/.vim/commentN.txt b/pi/.vim/commentN.txt new file mode 100644 index 0000000..c0721ca --- /dev/null +++ b/pi/.vim/commentN.txt @@ -0,0 +1,13 @@ +# ============================================================================== +# Auth: Alex Celani +# File: XXX.xx +# Revn: MM-DD-YYYY 0.0 +# Func: +# +# TODO: create +# ============================================================================== +# CHANGE LOG +# ------------------------------------------------------------------------------ +# MM-DD-YYYY: init +# +# ============================================================================== diff --git a/pi/.vim/commentP.txt b/pi/.vim/commentP.txt new file mode 100644 index 0000000..f7ba4e0 --- /dev/null +++ b/pi/.vim/commentP.txt @@ -0,0 +1,13 @@ +% ============================================================================== +% Auth: Alex Celani +% File: XXX.xx +% Revn: MM-DD-YYYY 0.0 +% Func: +% +% TODO: create +% ============================================================================== +% CHANGE LOG +% ------------------------------------------------------------------------------ +% MM-DD-YYYY: init +% +% ============================================================================== diff --git a/pi/.vim/commentQ.txt b/pi/.vim/commentQ.txt new file mode 100644 index 0000000..31deb28 --- /dev/null +++ b/pi/.vim/commentQ.txt @@ -0,0 +1,15 @@ +""" + =============================================================================== + Auth: Alex Celani + File: XXX.py + Revn: MM-DD-YYYY 0.0 + Func: + + TODO: create + =============================================================================== + CHANGE LOG + ------------------------------------------------------------------------------- + MM-DD-YYYY: init + + =============================================================================== +""" diff --git a/pi/.vim/commentS.txt b/pi/.vim/commentS.txt new file mode 100644 index 0000000..a189ae0 --- /dev/null +++ b/pi/.vim/commentS.txt @@ -0,0 +1,13 @@ +// ============================================================================= +// Auth: Alex Celani +// File: XXX.xx +// Revn: MM-DD-YYYY 0.0 +// Func: +// +// TODO: create +// ============================================================================= +// CHANGE LOG +// ----------------------------------------------------------------------------- +// MM-DD-YYYY: init +// +// ============================================================================= diff --git a/pi/.vim/ftdetect/ano.vim b/pi/.vim/ftdetect/ano.vim new file mode 100644 index 0000000..d7e32bb --- /dev/null +++ b/pi/.vim/ftdetect/ano.vim @@ -0,0 +1 @@ +au BufRead,BufNewFile *.ano set filetype=ano diff --git a/pi/.vim/ftdetect/go.vim b/pi/.vim/ftdetect/go.vim new file mode 100755 index 0000000..aba646a --- /dev/null +++ b/pi/.vim/ftdetect/go.vim @@ -0,0 +1,135 @@ +" ============================================================================== +" Auth: David Daub , Alex +" Lang: GoLang +" Revn: 15-11-2009 Official, 03-27-2020 1.4 +" Func: Define syntax coloring for .go files when being edited in Vim +" +" TODO: very much +" learn regex +" learn Go +" ============================================================================== +" CHANGE LOG +" ------------------------------------------------------------------------------ +" 12-31-2018: init +" 01-01-2019: added header block +" added coloring for bool type +" changed print/println to Print/Println, added Printf/Sprintf +" changed boolean values link to Keyword (Yellow) from Boolean +" (Green?) +" 01-02-2019: added coloring for main and Scanln +" 12-26-2019: changed goBoolean link from Keyword to Type +" added coloring for error +" 03-27-2020: added while to list of repetition structures +" +" ============================================================================== + +" Quit when a (custom) syntax file was already loaded +if exists("b:current_syntax") + finish +endif + + +" A bunch of useful Go keywords +syn keyword goStatement select +syn keyword goStatement defer +syn keyword goStatement fallthrough range type +syn keyword goStatement return + +syn keyword goClause import package +syn keyword goConditional if else switch +syn keyword goBranch goto break continue +syn keyword goLabel case default +syn keyword goRepeat for +syn keyword goRepeat while +" Added this line ^^^ +syn keyword goType struct const interface func +syn keyword goType var map +syn keyword goType uint8 uint16 uint32 uint64 +syn keyword goType int8 int16 int32 int64 +syn keyword goType float32 float64 +syn keyword goType float32 float64 +syn keyword goType byte +syn keyword goType uint int float uintptr string +syn keyword goType bool +" Added this line ^^^ +syn keyword goType error +" Added this line ^^^ + +syn keyword goConcurrent chan go + +syn keyword goValue nil +syn keyword goBoolean true false + +syn keyword goConstant iota + +" Builtin functions +syn keyword goBif len make new close closed cap map + +" According to the language specification it is not garanteed to stay in the +" language. See http://golang.org/doc/go_spec.html#Bootstrapping +syn keyword goBif Print Println Printf Sprintf Scanln +" Changed print[ln] to Print[ln] ^^^ + +syn keyword goBif panic panicln main + +" Comments +syn keyword goTodo contained TODO FIXME XXX +syn match goLineComment "\/\/.*" contains=@Spell,goTodo +syn match goCommentSkip "^[ \t]*\*\($\|[ \t]\+\)" +syn region goComment start="/\*" end="\*/" contains=@Spell,goTodo + +" Numerals +syn case ignore +"integer number, or floating point number without a dot and with "f". +syn match goNumbers display transparent "\<\d\|\.\d" contains=goNumber,goFloat,goOctError,goOct +syn match goNumbersCom display contained transparent "\<\d\|\.\d" contains=goNumber,goFloat,goOct +syn match goNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>" + +" hex number +syn match goNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" + +" oct number +syn match goOct display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=goOctZero +syn match goOctZero display contained "\<0" + +syn match goFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=" +syn match goFloat display contained "\d\+e[-+]\=\d\=\>" +syn match goFloat display "\(\.[0-9_]\+\)\(e[-+]\=[0-9_]\+\)\=[fl]\=i\=\>" + +" Literals +syn region goString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell + +syn match goSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)" +syn match goCharacter "L\='[^\\]'" +syn match goCharacter "L'[^']*'" contains=goSpecial + + +hi def link goStatement Statement +hi def link goClause Preproc +hi def link goConditional Conditional +hi def link goBranch Conditional +hi def link goLabel Label +hi def link goRepeat Repeat +hi def link goType Type +hi def link goConcurrent Statement +hi def link goValue Constant +hi def link goBoolean Type +" Changed goBoolean link from Boolean to Keyword +" Changed goBoolean link from Keyword to Type +hi def link goConstant Constant +hi def link goBif Function +hi def link goTodo Todo +hi def link goLineComment goComment +hi def link goComment Comment +hi def link goNumbers Number +hi def link goNumbersCom Number +hi def link goNumber Number +hi def link goFloat Float +hi def link goOct Number +hi def link goOctZero Number +hi def link goString String +hi def link goSpecial Special +hi def link goCharacter Character + + +let b:current_syntax = "go" diff --git a/pi/.vim/ftdetect/prv.vim b/pi/.vim/ftdetect/prv.vim new file mode 100644 index 0000000..282b4f2 --- /dev/null +++ b/pi/.vim/ftdetect/prv.vim @@ -0,0 +1 @@ +au BufRead,BufNewFile *.prv set filetype=prv diff --git a/pi/.vim/ftdetect/txt.vim b/pi/.vim/ftdetect/txt.vim new file mode 100755 index 0000000..3d876da --- /dev/null +++ b/pi/.vim/ftdetect/txt.vim @@ -0,0 +1,5 @@ + + +autocmd BufNewFile,BufRead *.txt set filetype=txt + + diff --git a/pi/.vim/syntax/ano.vim b/pi/.vim/syntax/ano.vim new file mode 100755 index 0000000..8c8d521 --- /dev/null +++ b/pi/.vim/syntax/ano.vim @@ -0,0 +1,231 @@ +" ==================================================================== +" Auth: jontino +" Lang: ANO +" Revn: 04-17-2023 1.0 +" Func: Define syntax coloring for .ano files when being edited in Vim +" +" TODO: begin writing, add new words +" implement regular expressions for match baby names +" ==================================================================== +" CHANGE LOG +" -------------------------------------------------------------------- +" 04-17-2023: copied from prv.vim +" +" ==================================================================== + +" Quit when a (custom) syntax file was already loaded +if exists("b:current_syntax") + finish +endif + + +" Required fields +" Comments +" header comments # Green +" single line comments // Cyan +" in/multi line comments /* ... */ Cyan +" Quotes +" must work multiline +" Gray? LightRed? +" Names +" + + + +" XXX Dates: +" Date highlighting for the Change Log +" the first and last quote define the expression +" \d is any digit [0-9] +" \{1,2} matches 1 or 2 times, although it should only ever get 2 +" - literal hyphen, which seperates months, days, and years +" The same three elements are repeated again for the days +" \d is any digit, used again for the years +" \{4} for only four digits can be matched +" ends with : because only dates in change log should be highlighted +" marked as contained, as it should only be highlighted in comments +" contains colon, so I can highlight the color separately +" for some reason, the colon doesn't work as keyword, so simple match +syn match date "\d\{1,2}-\d\{1,2}-\d\{4}:" contained contains=colon +syn match colon ":" contained + + + +" XXX Comments: +" comments come after # +" eg| not comment # now a comment +" # comment +" not a comment +" not +" not +" ### comment +" +" first and last quote define the expression +" # can come literally, because it doesn't need escaping +" . is every non-new line character possible +" * matches as many matches as possible +" i.e. a pound sign, and then as many characters as possible +syn match header "#.*" contains=commentFields,commentTodo,date,names,germ,rus,latin,rusgerm +syn match SLcomment "//.*" contains=names,germ,rus,latin,rusgerm +syn region ILMLcomment start="/\*" end="\*/" contains=names,germ,rus,latin,rusgerm +" commentFields and commentTodo are contained within comments, so they +" are as such in the definition of a comment, and listed as contained +" in their own definitions +" commentFields is match instead of keyword, will contain the space +syn keyword commentFields contained Auth Revn File Func +syn keyword commentTodo contained TODO todo Todo XXX FIXME +syn match commentFields contained "CHANGE LOG" + + + +" XXX Quotes: +" quotes should exist between odd pairs of quotation marks +" eg| "quote" not +" "quote" not "quote" +" "not +" quote" +" "quote only if the it rolls +" over onto the next line" +" Calling the quotation a region instead of pattern match makes it +" easier to wrap around a new line +" the first and last quote define the expression +" \ escapes the next character, allowing \" to appear as a literal " +" thus, start and end are both quotes, and the reqion can span lines +syn region quote start="\"" end="\"" contains=names,germ,rus,latin,rusgerm +" -- DEPRECATED -- +" the first and last quote define the expression +" \ is the escape character, so \" means I want to look for a quote +" . is every non-new line character possible +" \{,} is \{0,infinity}, means I'm looking for between 0 and infinity +" matches for the previous character, which is a wildcard, . +" \{-,} will prioritize the smallest amount of matches possible +" syn match quote "\".\{-,}\"" +" -- DEPRECATED -- + + + +" XXX Notes: +" Allow for notes to be left with special highlighting +" \c escapes the case, so search is entirely case insensitive +" note are all literals +" s\? will alow for either 0 or 1 of the character "s" to be matched, +" essentially allowing for both notes and note +" finally followed by a colon +" nextgroup is the actual notes to be taken, as this is just the tag +syn match noteTag "\cnotes\?:" nextgroup=notes +" define notes as starting with space, ending with exclamation mark +" if it's not denoted as contained, then the whole damn thing will be +" highlighted +syn region notes start=" " end="!" contained + + + +" XXX Names: +" keyword to the whole list of words +" lmfao ignore case sensitivity to avoid writing things twice +syn case ignore + +" nicknames for archie +syn keyword ambiii archie chicho chach chibo +syn keyword ambiii barchie chachfield archibald +syn match ambiii "Lord Archibald Mordecai Blackanddecker III" + +" nicknames for olly +syn keyword obrg olly bolly boliver oliver ogibler oboe +syn match obrg "bolly bear" +syn match obrg "bolly ball" +syn match obrg "olly ball" +syn match obrg "Sir Oliver Boliver Rockford Gubbins" + +" things that apply to both babies +syn match both "of Sealand" +syn match both "sink boy" +syn match both "baby boy" + +" us? +syn keyword parents mom dad + +syn case match +" lmfao and turn the case sensitivity back on + + + + +" keeping this as it might be useful later +" XXX Expressions: +" highlight equations, formulas, expressions, etc +" expressions: .* is any number of characters +" = is literal +" .* is any number of characters again +" added spaces around = to avoid confusion with => +" +" the idea is that it's stuff that equals stuff, and we +" worry about what it is later +" name: \c case-escapes the sequence +" \a is alphabetic characters, probably don't need escaping +" \+ is at least 1 match, so it's 1 or more letters is a name +" name: \c\a\= is 0 or 1 case-escaped alphabetic characters +" _ is literal, best I can get to subscripts +" \a\+ is 1 or more case-escaped alphabetic characters +" op: inside [] can allow for one choice from any contained characters +" =, +, -, /, ^ are all literals for operations +" \* escapes the * character, which is now multiplication +" Num: see Numbers: below +" FIXME try to make name into one thing, probably with \{,1} + + +" ColorGuide: ctermfg and ctermbg args - - - - source:: :help cterm +" Black +" LightBlue/Cyan/LightCyan, Blue/DarkBlue/DarkCyan +" Green/LightGreen, DarkGreen +" Red/LightRed, DarkRed +" Magenta/LightMagenta, DarkMagenta +" Yellow/LightYellow, DarkYellow/Brown +" White +" Gray/LightGray, DarkGray +" ColorGuide: ctermfg and ctermbg args - - - - source:: :help cterm +" ColorGuide: - - - - - - - - - - - - - - - source:: :help group-name +" Dates and fields in comments still use links for highlighting to get +" access to 'term' arguments that don't want to load correctly, namely +" Underline -> PreProc (Magenta in default colo), with underline +" ColorGuide: - - - - - - - - - - - - - - - source:: :help group-name + + +" XXX Coloring: +" hi[ghlight] cterm=