init
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
# dotfiles
|
||||
Just some quick config files to (partially) terraform new machines
|
||||
Executable
+82
@@ -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$ '
|
||||
|
||||
+21
@@ -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;}}/*****####*******!!=;:~
|
||||
~::==!!!**********!!!==::-
|
||||
.,~~;;;========;;;:~-.
|
||||
..,--------,*/
|
||||
Executable
+29
@@ -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"
|
||||
|
||||
Executable
+60
@@ -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
|
||||
|
||||
@@ -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}}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 MiB |
Executable
+212
@@ -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"
|
||||
+82
@@ -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
|
||||
@@ -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
|
||||
#
|
||||
# ==============================================================================
|
||||
@@ -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
|
||||
%
|
||||
% ==============================================================================
|
||||
@@ -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
|
||||
|
||||
===============================================================================
|
||||
"""
|
||||
@@ -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
|
||||
//
|
||||
// =============================================================================
|
||||
@@ -0,0 +1 @@
|
||||
au BufRead,BufNewFile *.ano set filetype=ano
|
||||
Executable
+135
@@ -0,0 +1,135 @@
|
||||
" ==============================================================================
|
||||
" Auth: David Daub <david.daub@googlemail.com>, 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"
|
||||
@@ -0,0 +1 @@
|
||||
au BufRead,BufNewFile *.prv set filetype=prv
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
autocmd BufNewFile,BufRead *.txt set filetype=txt
|
||||
|
||||
|
||||
Executable
+231
@@ -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] <group> cterm=<style> ctermfg=<color> [ctermbg=<color>]
|
||||
" group is typically a user-made group
|
||||
" cterm is stuff like Underline and Bold
|
||||
" ctermfg is the foreground, or font color
|
||||
" ctermbg is the background color, or highlight color
|
||||
|
||||
" quotes are good
|
||||
hi quote ctermfg=DarkRed
|
||||
|
||||
" header comments are good
|
||||
hi header ctermfg=Green
|
||||
" leaving these as link because I like the color it sets
|
||||
" in theory... I could choose my own colors...
|
||||
"hi def link commentFields Underlined
|
||||
"hi def link date Underlined
|
||||
hi commentFields cterm=Underline ctermfg=Blue
|
||||
hi date cterm=Underline ctermfg=Blue
|
||||
|
||||
" comments are good
|
||||
hi SLcomment ctermfg=Cyan
|
||||
hi ILMLcomment ctermfg=Cyan
|
||||
hi colon ctermfg=Cyan
|
||||
hi commentTodo ctermfg=Black ctermbg=Yellow
|
||||
|
||||
" important notes
|
||||
" could probably do without this, tbh
|
||||
hi noteTag ctermfg=White ctermbg=Red
|
||||
hi notes ctermfg=White ctermbg=Red
|
||||
|
||||
" nicknames for the boys
|
||||
hi ambiii ctermfg=Green
|
||||
hi obrg ctermfg=Red
|
||||
" picked by archie himself
|
||||
hi both ctermfg=LightBlue
|
||||
hi parents ctermfg=DarkGray
|
||||
|
||||
let b:current_syntax = "ano"
|
||||
|
||||
Executable
+135
@@ -0,0 +1,135 @@
|
||||
" ==============================================================================
|
||||
" Auth: David Daub <david.daub@googlemail.com>, 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"
|
||||
Executable
+283
@@ -0,0 +1,283 @@
|
||||
" ====================================================================
|
||||
" Auth: jontino
|
||||
" Lang: Providence
|
||||
" Revn: 04-17-2023 1.0
|
||||
" Func: Define syntax coloring for .prv files when being edited in Vim
|
||||
"
|
||||
" TODO: begin writing, add new words
|
||||
" ====================================================================
|
||||
" CHANGE LOG
|
||||
" --------------------------------------------------------------------
|
||||
" 02-13-2023: copied from txt.vim
|
||||
" 04-17-2023: completed
|
||||
"
|
||||
" ====================================================================
|
||||
|
||||
" 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
|
||||
" each type of character gets a different color
|
||||
" Good
|
||||
" Green
|
||||
" Evil
|
||||
" DarkRed
|
||||
" Neutral/Background
|
||||
" Blue
|
||||
" Places
|
||||
" Words
|
||||
" Latin-derived words
|
||||
" LightBlue
|
||||
" Germanic words
|
||||
" LightGreen
|
||||
" Russian words
|
||||
" Red
|
||||
" Russo-Germanic words
|
||||
" Brown
|
||||
"
|
||||
|
||||
|
||||
|
||||
" 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:
|
||||
" Separated into three catergories: Good, Neutral, Bad
|
||||
" This taxonomy is pretty self-explanatory
|
||||
" keyword to the whole list of words
|
||||
" lmfao ignore case sensitivity to avoid writing things twice
|
||||
syn case ignore
|
||||
|
||||
syn keyword good dobra miro
|
||||
syn keyword neutral yaroslav
|
||||
syn keyword bad boris mstislav
|
||||
|
||||
|
||||
|
||||
" XXX Places:
|
||||
" Places! Just place names!
|
||||
" keyword to the whole list of words
|
||||
syn keyword place providence
|
||||
|
||||
|
||||
|
||||
" XXX Words:
|
||||
" Different types of words:
|
||||
" words referring to norway, russian, etc
|
||||
" Latin
|
||||
" Slavic
|
||||
" Germanic
|
||||
" Russo-Germanic
|
||||
|
||||
" Highlight norwegian shit green
|
||||
" Highlight Russian shit red
|
||||
|
||||
syn keyword latin constable
|
||||
|
||||
syn keyword slavic slava
|
||||
|
||||
syn keyword germanic reeve
|
||||
|
||||
syn keyword russogerm skazarktos
|
||||
|
||||
syn keyword norwegian nordic nordics
|
||||
syn keyword norwegian norse
|
||||
syn keyword norwegian norway
|
||||
syn keyword norwegian norge
|
||||
syn keyword norwegian norsk
|
||||
syn keyword norwegian norwegian norwegians
|
||||
|
||||
syn keyword russian russian russians
|
||||
syn keyword russian rusky ruskies
|
||||
syn keyword russian russia
|
||||
syn keyword russian slav slavs
|
||||
syn keyword russian slavic
|
||||
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] <group> cterm=<style> ctermfg=<color> [ctermbg=<color>]
|
||||
" group is typically a user-made group
|
||||
" cterm is stuff like Underline and Bold
|
||||
" ctermfg is the foreground, or font color
|
||||
" ctermbg is the background color, or highlight color
|
||||
|
||||
" quotes are good
|
||||
hi quote ctermfg=DarkRed
|
||||
|
||||
" header comments are good
|
||||
hi header ctermfg=Green
|
||||
" leaving these as link because I like the color it sets
|
||||
" in theory... I could choose my own colors...
|
||||
"hi def link commentFields Underlined
|
||||
"hi def link date Underlined
|
||||
hi commentFields cterm=Underline ctermfg=Red
|
||||
hi date cterm=Underline ctermfg=Red
|
||||
|
||||
" comments are good
|
||||
hi SLcomment ctermfg=Cyan
|
||||
hi ILMLcomment ctermfg=Cyan
|
||||
hi colon ctermfg=Cyan
|
||||
hi commentTodo ctermfg=Black ctermbg=Yellow
|
||||
|
||||
" important notes
|
||||
" could probably do without this, tbh
|
||||
hi noteTag ctermfg=White ctermbg=Red
|
||||
hi notes ctermfg=White ctermbg=Red
|
||||
|
||||
" different types of characters get different colors
|
||||
hi good ctermfg=Green
|
||||
hi neutral ctermfg=Blue
|
||||
hi bad ctermfg=DarkRed
|
||||
|
||||
" places are underlined
|
||||
" maybe give places a color?
|
||||
hi place ctermfg=White cterm=Underline
|
||||
|
||||
" color words in different registers different colors
|
||||
hi germanic ctermfg=LightGreen
|
||||
hi slavic ctermfg=Red
|
||||
hi latin ctermfg=LightBlue
|
||||
hi russogerm ctermfg=Brown
|
||||
|
||||
let b:current_syntax = "prv"
|
||||
|
||||
Executable
+385
@@ -0,0 +1,385 @@
|
||||
" Vim syntax file
|
||||
" Language: Rust
|
||||
" Maintainer: Patrick Walton <pcwalton@mozilla.com>
|
||||
" Maintainer: Ben Blum <bblum@cs.cmu.edu>
|
||||
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
||||
" Last Change: Feb 24, 2016
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Syntax definitions {{{1
|
||||
" Basic keywords {{{2
|
||||
syn keyword rustConditional match if else
|
||||
syn keyword rustRepeat loop while
|
||||
" `:syn match` must be used to prioritize highlighting `for` keyword.
|
||||
syn match rustRepeat /\<for\>/
|
||||
" Highlight `for` keyword in `impl ... for ... {}` statement. This line must
|
||||
" be put after previous `syn match` line to overwrite it.
|
||||
syn match rustKeyword /\%(\<impl\>.\+\)\@<=\<for\>/
|
||||
syn keyword rustRepeat in
|
||||
syn keyword rustTypedef type nextgroup=rustIdentifier skipwhite skipempty
|
||||
syn keyword rustStructure struct enum nextgroup=rustIdentifier skipwhite skipempty
|
||||
syn keyword rustUnion union nextgroup=rustIdentifier skipwhite skipempty contained
|
||||
syn match rustUnionContextual /\<union\_s\+\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*/ transparent contains=rustUnion
|
||||
syn keyword rustOperator as
|
||||
syn keyword rustExistential existential nextgroup=rustTypedef skipwhite skipempty contained
|
||||
syn match rustExistentialContextual /\<existential\_s\+type/ transparent contains=rustExistential,rustTypedef
|
||||
|
||||
syn match rustAssert "\<assert\(\w\)*!" contained
|
||||
syn match rustPanic "\<panic\(\w\)*!" contained
|
||||
syn match rustAsync "\<async\%(\s\|\n\)\@="
|
||||
syn keyword rustKeyword break
|
||||
syn keyword rustKeyword box
|
||||
syn keyword rustKeyword continue
|
||||
syn keyword rustKeyword crate
|
||||
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty
|
||||
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
|
||||
syn keyword rustKeyword impl let
|
||||
syn keyword rustKeyword macro
|
||||
syn keyword rustKeyword pub nextgroup=rustPubScope skipwhite skipempty
|
||||
syn keyword rustKeyword return
|
||||
syn keyword rustKeyword yield
|
||||
syn keyword rustSuper super
|
||||
syn keyword rustKeyword where
|
||||
syn keyword rustUnsafeKeyword unsafe
|
||||
syn keyword rustKeyword use nextgroup=rustModPath skipwhite skipempty
|
||||
" FIXME: Scoped impl's name is also fallen in this category
|
||||
syn keyword rustKeyword mod trait nextgroup=rustIdentifier skipwhite skipempty
|
||||
syn keyword rustStorage move mut ref static const
|
||||
syn match rustDefault /\<default\ze\_s\+\(impl\|fn\|type\|const\)\>/
|
||||
syn keyword rustAwait await
|
||||
syn match rustKeyword /\<try\>!\@!/ display
|
||||
|
||||
syn keyword rustPubScopeCrate crate contained
|
||||
syn match rustPubScopeDelim /[()]/ contained
|
||||
syn match rustPubScope /([^()]*)/ contained contains=rustPubScopeDelim,rustPubScopeCrate,rustSuper,rustModPath,rustModPathSep,rustSelf transparent
|
||||
|
||||
syn keyword rustExternCrate crate contained nextgroup=rustIdentifier,rustExternCrateString skipwhite skipempty
|
||||
" This is to get the `bar` part of `extern crate "foo" as bar;` highlighting.
|
||||
syn match rustExternCrateString /".*"\_s*as/ contained nextgroup=rustIdentifier skipwhite transparent skipempty contains=rustString,rustOperator
|
||||
syn keyword rustObsoleteExternMod mod contained nextgroup=rustIdentifier skipwhite skipempty
|
||||
|
||||
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
|
||||
syn match rustFuncName "\%(r#\)\=\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
|
||||
|
||||
syn region rustMacroRepeat matchgroup=rustMacroRepeatDelimiters start="$(" end="),\=[*+]" contains=TOP
|
||||
syn match rustMacroVariable "$\w\+"
|
||||
syn match rustRawIdent "\<r#\h\w*" contains=NONE
|
||||
|
||||
" Reserved (but not yet used) keywords {{{2
|
||||
syn keyword rustReservedKeyword become do priv typeof unsized abstract virtual final override
|
||||
|
||||
" Built-in types {{{2
|
||||
syn keyword rustType isize usize char bool u8 u16 u32 u64 u128 f32
|
||||
syn keyword rustType f64 i8 i16 i32 i64 i128 str Self
|
||||
|
||||
" Things from the libstd v1 prelude (src/libstd/prelude/v1.rs) {{{2
|
||||
" This section is just straight transformation of the contents of the prelude,
|
||||
" to make it easy to update.
|
||||
|
||||
" Reexported core operators {{{3
|
||||
syn keyword rustTrait Copy Send Sized Sync
|
||||
syn keyword rustTrait Drop Fn FnMut FnOnce
|
||||
|
||||
" Reexported functions {{{3
|
||||
" There’s no point in highlighting these; when one writes drop( or drop::< it
|
||||
" gets the same highlighting anyway, and if someone writes `let drop = …;` we
|
||||
" don’t really want *that* drop to be highlighted.
|
||||
"syn keyword rustFunction drop
|
||||
|
||||
" Reexported types and traits {{{3
|
||||
syn keyword rustTrait Box
|
||||
syn keyword rustTrait ToOwned
|
||||
syn keyword rustTrait Clone
|
||||
syn keyword rustTrait PartialEq PartialOrd Eq Ord
|
||||
syn keyword rustTrait AsRef AsMut Into From
|
||||
syn keyword rustTrait Default
|
||||
syn keyword rustTrait Iterator Extend IntoIterator
|
||||
syn keyword rustTrait DoubleEndedIterator ExactSizeIterator
|
||||
syn keyword rustEnum Option
|
||||
syn keyword rustEnumVariant Some None
|
||||
syn keyword rustEnum Result
|
||||
syn keyword rustEnumVariant Ok Err
|
||||
syn keyword rustTrait SliceConcatExt
|
||||
syn keyword rustTrait String ToString
|
||||
syn keyword rustTrait Vec
|
||||
|
||||
" Other syntax {{{2
|
||||
syn keyword rustSelf self
|
||||
syn keyword rustBoolean true false
|
||||
|
||||
" If foo::bar changes to foo.bar, change this ("::" to "\.").
|
||||
" If foo::bar changes to Foo::bar, change this (first "\w" to "\u").
|
||||
syn match rustModPath "\w\(\w\)*::[^<]"he=e-3,me=e-3
|
||||
syn match rustModPathSep "::"
|
||||
|
||||
syn match rustFuncCall "\w\(\w\)*("he=e-1,me=e-1
|
||||
syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 " foo::<T>();
|
||||
|
||||
" This is merely a convention; note also the use of [A-Z], restricting it to
|
||||
" latin identifiers rather than the full Unicode uppercase. I have not used
|
||||
" [:upper:] as it depends upon 'noignorecase'
|
||||
"syn match rustCapsIdent display "[A-Z]\w\(\w\)*"
|
||||
|
||||
syn match rustOperator display "\%(+\|-\|/\|*\|=\|\^\|&\||\|!\|>\|<\|%\)=\?"
|
||||
" This one isn't *quite* right, as we could have binary-& with a reference
|
||||
syn match rustSigil display /&\s\+[&~@*][^)= \t\r\n]/he=e-1,me=e-1
|
||||
syn match rustSigil display /[&~@*][^)= \t\r\n]/he=e-1,me=e-1
|
||||
" This isn't actually correct; a closure with no arguments can be `|| { }`.
|
||||
" Last, because the & in && isn't a sigil
|
||||
syn match rustOperator display "&&\|||"
|
||||
" This is rustArrowCharacter rather than rustArrow for the sake of matchparen,
|
||||
" so it skips the ->; see http://stackoverflow.com/a/30309949 for details.
|
||||
syn match rustArrowCharacter display "->"
|
||||
syn match rustQuestionMark display "?\([a-zA-Z]\+\)\@!"
|
||||
|
||||
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustPanic
|
||||
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustPanic
|
||||
|
||||
syn match rustEscapeError display contained /\\./
|
||||
syn match rustEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/
|
||||
syn match rustEscapeUnicode display contained /\\u{\%(\x_*\)\{1,6}}/
|
||||
syn match rustStringContinuation display contained /\\\n\s*/
|
||||
syn region rustString matchgroup=rustStringDelimiter start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeError,rustStringContinuation
|
||||
syn region rustString matchgroup=rustStringDelimiter start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell
|
||||
syn region rustString matchgroup=rustStringDelimiter start='b\?r\z(#*\)"' end='"\z1' contains=@Spell
|
||||
|
||||
" Match attributes with either arbitrary syntax or special highlighting for
|
||||
" derives. We still highlight strings and comments inside of the attribute.
|
||||
syn region rustAttribute start="#!\?\[" end="\]" contains=@rustAttributeContents,rustAttributeParenthesizedParens,rustAttributeParenthesizedCurly,rustAttributeParenthesizedBrackets,rustDerive
|
||||
syn region rustAttributeParenthesizedParens matchgroup=rustAttribute start="\w\%(\w\)*("rs=e end=")"re=s transparent contained contains=rustAttributeBalancedParens,@rustAttributeContents
|
||||
syn region rustAttributeParenthesizedCurly matchgroup=rustAttribute start="\w\%(\w\)*{"rs=e end="}"re=s transparent contained contains=rustAttributeBalancedCurly,@rustAttributeContents
|
||||
syn region rustAttributeParenthesizedBrackets matchgroup=rustAttribute start="\w\%(\w\)*\["rs=e end="\]"re=s transparent contained contains=rustAttributeBalancedBrackets,@rustAttributeContents
|
||||
syn region rustAttributeBalancedParens matchgroup=rustAttribute start="("rs=e end=")"re=s transparent contained contains=rustAttributeBalancedParens,@rustAttributeContents
|
||||
syn region rustAttributeBalancedCurly matchgroup=rustAttribute start="{"rs=e end="}"re=s transparent contained contains=rustAttributeBalancedCurly,@rustAttributeContents
|
||||
syn region rustAttributeBalancedBrackets matchgroup=rustAttribute start="\["rs=e end="\]"re=s transparent contained contains=rustAttributeBalancedBrackets,@rustAttributeContents
|
||||
syn cluster rustAttributeContents contains=rustString,rustCommentLine,rustCommentBlock,rustCommentLineDocError,rustCommentBlockDocError
|
||||
syn region rustDerive start="derive(" end=")" contained contains=rustDeriveTrait
|
||||
" This list comes from src/libsyntax/ext/deriving/mod.rs
|
||||
" Some are deprecated (Encodable, Decodable) or to be removed after a new snapshot (Show).
|
||||
syn keyword rustDeriveTrait contained Clone Hash RustcEncodable RustcDecodable Encodable Decodable PartialEq Eq PartialOrd Ord Rand Show Debug Default FromPrimitive Send Sync Copy
|
||||
|
||||
" dyn keyword: It's only a keyword when used inside a type expression, so
|
||||
" we make effort here to highlight it only when Rust identifiers follow it
|
||||
" (not minding the case of pre-2018 Rust where a path starting with :: can
|
||||
" follow).
|
||||
"
|
||||
" This is so that uses of dyn variable names such as in 'let &dyn = &2'
|
||||
" and 'let dyn = 2' will not get highlighted as a keyword.
|
||||
syn match rustKeyword "\<dyn\ze\_s\+\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)" contains=rustDynKeyword
|
||||
syn keyword rustDynKeyword dyn contained
|
||||
|
||||
" Number literals
|
||||
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="
|
||||
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="
|
||||
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="
|
||||
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="
|
||||
|
||||
" Special case for numbers of the form "1." which are float literals, unless followed by
|
||||
" an identifier, which makes them integer literals with a method call or field access,
|
||||
" or by another ".", which makes them integer literals followed by the ".." token.
|
||||
" (This must go first so the others take precedence.)
|
||||
syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\|\.\)\@!"
|
||||
" To mark a number as a normal float, it must have at least one of the three things integral values don't have:
|
||||
" a decimal point and more numbers; an exponent; and a type suffix.
|
||||
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\="
|
||||
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\(f32\|f64\)\="
|
||||
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)"
|
||||
|
||||
" For the benefit of delimitMate
|
||||
syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt0\\\"]\|x\x\{2}\|u{\%(\x_*\)\{1,6}}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
|
||||
syn region rustGenericRegion display start=/<\%('\|[^[:cntrl:][:space:][:punct:]]\)\@=')\S\@=/ end=/>/ contains=rustGenericLifetimeCandidate
|
||||
syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
|
||||
|
||||
"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting
|
||||
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
|
||||
syn match rustLabel display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*:"
|
||||
syn match rustLabel display "\%(\<\%(break\|continue\)\s*\)\@<=\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
|
||||
syn match rustCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/
|
||||
" The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII).
|
||||
syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/
|
||||
syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode
|
||||
syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u{\%(\x_*\)\{1,6}}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid
|
||||
|
||||
syn match rustShebang /\%^#![^[].*/
|
||||
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
|
||||
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
|
||||
syn region rustCommentLineDocError start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell contained
|
||||
syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell
|
||||
syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNest,rustCommentBlockDocRustCode,@Spell
|
||||
syn region rustCommentBlockDocError matchgroup=rustCommentBlockDocError start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNestError,@Spell contained
|
||||
syn region rustCommentBlockNest matchgroup=rustCommentBlock start="/\*" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell contained transparent
|
||||
syn region rustCommentBlockDocNest matchgroup=rustCommentBlockDoc start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell contained transparent
|
||||
syn region rustCommentBlockDocNestError matchgroup=rustCommentBlockDocError start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNestError,@Spell contained transparent
|
||||
|
||||
" FIXME: this is a really ugly and not fully correct implementation. Most
|
||||
" importantly, a case like ``/* */*`` should have the final ``*`` not being in
|
||||
" a comment, but in practice at present it leaves comments open two levels
|
||||
" deep. But as long as you stay away from that particular case, I *believe*
|
||||
" the highlighting is correct. Due to the way Vim's syntax engine works
|
||||
" (greedy for start matches, unlike Rust's tokeniser which is searching for
|
||||
" the earliest-starting match, start or end), I believe this cannot be solved.
|
||||
" Oh you who would fix it, don't bother with things like duplicating the Block
|
||||
" rules and putting ``\*\@<!`` at the start of them; it makes it worse, as
|
||||
" then you must deal with cases like ``/*/**/*/``. And don't try making it
|
||||
" worse with ``\%(/\@<!\*\)\@<!``, either...
|
||||
|
||||
syn keyword rustTodo contained TODO FIXME XXX NB NOTE SAFETY
|
||||
|
||||
" asm! macro {{{2
|
||||
syn region rustAsmMacro matchgroup=rustMacro start="\<asm!\s*(" end=")" contains=rustAsmDirSpec,rustAsmSym,rustAsmConst,rustAsmOptionsGroup,rustComment.*,rustString.*
|
||||
|
||||
" Clobbered registers
|
||||
syn keyword rustAsmDirSpec in out lateout inout inlateout contained nextgroup=rustAsmReg skipwhite skipempty
|
||||
syn region rustAsmReg start="(" end=")" contained contains=rustString
|
||||
|
||||
" Symbol operands
|
||||
syn keyword rustAsmSym sym contained nextgroup=rustAsmSymPath skipwhite skipempty
|
||||
syn region rustAsmSymPath start="\S" end=",\|)"me=s-1 contained contains=rustComment.*,rustIdentifier
|
||||
|
||||
" Const
|
||||
syn region rustAsmConstBalancedParens start="("ms=s+1 end=")" contained contains=@rustAsmConstExpr
|
||||
syn cluster rustAsmConstExpr contains=rustComment.*,rust.*Number,rustString,rustAsmConstBalancedParens
|
||||
syn region rustAsmConst start="const" end=",\|)"me=s-1 contained contains=rustStorage,@rustAsmConstExpr
|
||||
|
||||
" Options
|
||||
syn region rustAsmOptionsGroup start="options\s*(" end=")" contained contains=rustAsmOptions,rustAsmOptionsKey
|
||||
syn keyword rustAsmOptionsKey options contained
|
||||
syn keyword rustAsmOptions pure nomem readonly preserves_flags noreturn nostack att_syntax contained
|
||||
|
||||
" Folding rules {{{2
|
||||
" Trivial folding rules to begin with.
|
||||
" FIXME: use the AST to make really good folding
|
||||
syn region rustFoldBraces start="{" end="}" transparent fold
|
||||
|
||||
if !exists("b:current_syntax_embed")
|
||||
let b:current_syntax_embed = 1
|
||||
syntax include @RustCodeInComment <sfile>:p:h/rust.vim
|
||||
unlet b:current_syntax_embed
|
||||
|
||||
" Currently regions marked as ```<some-other-syntax> will not get
|
||||
" highlighted at all. In the future, we can do as vim-markdown does and
|
||||
" highlight with the other syntax. But for now, let's make sure we find
|
||||
" the closing block marker, because the rules below won't catch it.
|
||||
syn region rustCommentLinesDocNonRustCode matchgroup=rustCommentDocCodeFence start='^\z(\s*//[!/]\s*```\).\+$' end='^\z1$' keepend contains=rustCommentLineDoc
|
||||
|
||||
" We borrow the rules from rust’s src/librustdoc/html/markdown.rs, so that
|
||||
" we only highlight as Rust what it would perceive as Rust (almost; it’s
|
||||
" possible to trick it if you try hard, and indented code blocks aren’t
|
||||
" supported because Markdown is a menace to parse and only mad dogs and
|
||||
" Englishmen would try to handle that case correctly in this syntax file).
|
||||
syn region rustCommentLinesDocRustCode matchgroup=rustCommentDocCodeFence start='^\z(\s*//[!/]\s*```\)[^A-Za-z0-9_-]*\%(\%(should_panic\|no_run\|ignore\|allow_fail\|rust\|test_harness\|compile_fail\|E\d\{4}\|edition201[58]\)\%([^A-Za-z0-9_-]\+\|$\)\)*$' end='^\z1$' keepend contains=@RustCodeInComment,rustCommentLineDocLeader
|
||||
syn region rustCommentBlockDocRustCode matchgroup=rustCommentDocCodeFence start='^\z(\%(\s*\*\)\?\s*```\)[^A-Za-z0-9_-]*\%(\%(should_panic\|no_run\|ignore\|allow_fail\|rust\|test_harness\|compile_fail\|E\d\{4}\|edition201[58]\)\%([^A-Za-z0-9_-]\+\|$\)\)*$' end='^\z1$' keepend contains=@RustCodeInComment,rustCommentBlockDocStar
|
||||
" Strictly, this may or may not be correct; this code, for example, would
|
||||
" mishighlight:
|
||||
"
|
||||
" /**
|
||||
" ```rust
|
||||
" println!("{}", 1
|
||||
" * 1);
|
||||
" ```
|
||||
" */
|
||||
"
|
||||
" … but I don’t care. Balance of probability, and all that.
|
||||
syn match rustCommentBlockDocStar /^\s*\*\s\?/ contained
|
||||
syn match rustCommentLineDocLeader "^\s*//\%(//\@!\|!\)" contained
|
||||
endif
|
||||
|
||||
" Default highlighting {{{1
|
||||
hi def link rustDecNumber rustNumber
|
||||
hi def link rustHexNumber rustNumber
|
||||
hi def link rustOctNumber rustNumber
|
||||
hi def link rustBinNumber rustNumber
|
||||
hi def link rustIdentifierPrime rustIdentifier
|
||||
hi def link rustTrait rustType
|
||||
hi def link rustDeriveTrait rustTrait
|
||||
|
||||
hi def link rustMacroRepeatDelimiters Macro
|
||||
hi def link rustMacroVariable Define
|
||||
hi def link rustSigil StorageClass
|
||||
hi def link rustEscape Special
|
||||
hi def link rustEscapeUnicode rustEscape
|
||||
hi def link rustEscapeError Error
|
||||
hi def link rustStringContinuation Special
|
||||
hi def link rustString String
|
||||
hi def link rustStringDelimiter String
|
||||
hi def link rustCharacterInvalid Error
|
||||
hi def link rustCharacterInvalidUnicode rustCharacterInvalid
|
||||
hi def link rustCharacter Character
|
||||
hi def link rustNumber Number
|
||||
hi def link rustBoolean Boolean
|
||||
hi def link rustEnum rustType
|
||||
hi def link rustEnumVariant rustConstant
|
||||
hi def link rustConstant Constant
|
||||
hi def link rustSelf Constant
|
||||
hi def link rustFloat Float
|
||||
hi def link rustArrowCharacter rustOperator
|
||||
hi def link rustOperator Operator
|
||||
hi def link rustKeyword Keyword
|
||||
hi def link rustDynKeyword rustKeyword
|
||||
hi def link rustTypedef Keyword " More precise is Typedef, but it doesn't feel right for Rust
|
||||
hi def link rustStructure Keyword " More precise is Structure
|
||||
hi def link rustUnion rustStructure
|
||||
hi def link rustExistential rustKeyword
|
||||
hi def link rustPubScopeDelim Delimiter
|
||||
hi def link rustPubScopeCrate rustKeyword
|
||||
hi def link rustSuper rustKeyword
|
||||
hi def link rustUnsafeKeyword Exception
|
||||
hi def link rustReservedKeyword Error
|
||||
hi def link rustRepeat Conditional
|
||||
hi def link rustConditional Conditional
|
||||
hi def link rustIdentifier Identifier
|
||||
hi def link rustCapsIdent rustIdentifier
|
||||
hi def link rustModPath Include
|
||||
hi def link rustModPathSep Delimiter
|
||||
hi def link rustFunction Function
|
||||
hi def link rustFuncName Function
|
||||
hi def link rustFuncCall Function
|
||||
hi def link rustShebang Comment
|
||||
hi def link rustCommentLine Comment
|
||||
hi def link rustCommentLineDoc SpecialComment
|
||||
hi def link rustCommentLineDocLeader rustCommentLineDoc
|
||||
hi def link rustCommentLineDocError Error
|
||||
hi def link rustCommentBlock rustCommentLine
|
||||
hi def link rustCommentBlockDoc rustCommentLineDoc
|
||||
hi def link rustCommentBlockDocStar rustCommentBlockDoc
|
||||
hi def link rustCommentBlockDocError Error
|
||||
hi def link rustCommentDocCodeFence rustCommentLineDoc
|
||||
hi def link rustAssert PreCondit
|
||||
hi def link rustPanic PreCondit
|
||||
hi def link rustMacro Macro
|
||||
hi def link rustType Type
|
||||
hi def link rustTodo Todo
|
||||
hi def link rustAttribute PreProc
|
||||
hi def link rustDerive PreProc
|
||||
hi def link rustDefault StorageClass
|
||||
hi def link rustStorage StorageClass
|
||||
hi def link rustObsoleteStorage Error
|
||||
hi def link rustLifetime Special
|
||||
hi def link rustLabel Label
|
||||
hi def link rustExternCrate rustKeyword
|
||||
hi def link rustObsoleteExternMod Error
|
||||
hi def link rustQuestionMark Special
|
||||
hi def link rustAsync rustKeyword
|
||||
hi def link rustAwait rustKeyword
|
||||
hi def link rustAsmDirSpec rustKeyword
|
||||
hi def link rustAsmSym rustKeyword
|
||||
hi def link rustAsmOptions rustKeyword
|
||||
hi def link rustAsmOptionsKey rustAttribute
|
||||
|
||||
" Other Suggestions:
|
||||
" hi rustAttribute ctermfg=cyan
|
||||
" hi rustDerive ctermfg=cyan
|
||||
" hi rustAssert ctermfg=yellow
|
||||
" hi rustPanic ctermfg=red
|
||||
" hi rustMacro ctermfg=magenta
|
||||
|
||||
"syn sync minlines=200
|
||||
"syn sync maxlines=500
|
||||
|
||||
let b:current_syntax = "rust"
|
||||
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
@@ -0,0 +1,37 @@
|
||||
# ==============================================================================
|
||||
# Auth: Alex Celani
|
||||
# File: test.prv
|
||||
# Revn: 04-17-2023 1.0
|
||||
# Func: show all of the functions of the prv syntax highlighting
|
||||
#
|
||||
# TODO: update as needed
|
||||
# ==============================================================================
|
||||
# CHANGE LOG
|
||||
# ------------------------------------------------------------------------------
|
||||
# 04-17-2023: wrote and commented
|
||||
#
|
||||
# ==============================================================================
|
||||
|
||||
// we out here in that single line comment
|
||||
|
||||
/* in-line comment */ un highlighted, not in brackets
|
||||
|
||||
/* also functions as a
|
||||
multiline comment */ notice how this is not highlighted
|
||||
|
||||
// archie nicknames
|
||||
archie chach chibo
|
||||
|
||||
// olly nicknames
|
||||
olly olly bolly bear
|
||||
Oliver Boliver Rockford Gubbins
|
||||
|
||||
// both
|
||||
sink boy
|
||||
of sealaND
|
||||
|
||||
// parents
|
||||
mom and dad
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# ==============================================================================
|
||||
# Auth: Alex Celani
|
||||
# File: test.prv
|
||||
# Revn: 04-17-2023 1.0
|
||||
# Func: show all of the functions of the prv syntax highlighting
|
||||
#
|
||||
# TODO: update as needed
|
||||
# ==============================================================================
|
||||
# CHANGE LOG
|
||||
# ------------------------------------------------------------------------------
|
||||
# 04-17-2023: wrote and commented
|
||||
#
|
||||
# ==============================================================================
|
||||
|
||||
// we out here in that single line comment
|
||||
|
||||
/* in-line comment */ un highlighted, not in brackets
|
||||
|
||||
/* also functions as a
|
||||
multiline comment */ notice how this is not highlighted
|
||||
|
||||
// bad people names
|
||||
mstislav Mstislav Boris boris
|
||||
// neutral people names
|
||||
yaroslav Yaroslav
|
||||
// good people names
|
||||
miro Miro Dobra dobra
|
||||
|
||||
// place names :)
|
||||
Providence
|
||||
|
||||
|
||||
// latin word, german word
|
||||
constable reeve
|
||||
// russogermanic, slavic
|
||||
skazarktos slava
|
||||
@@ -0,0 +1,53 @@
|
||||
# ====================================================================
|
||||
# Auth: Alex Celani
|
||||
# File: template.txt
|
||||
# Revn: 10-16-2020 1.0
|
||||
# Func: Demonstrate everything the text syntax file can do
|
||||
#
|
||||
# TODO: create
|
||||
# ====================================================================
|
||||
# CHANGE LOG
|
||||
# --------------------------------------------------------------------
|
||||
# 10-16-2020: init
|
||||
#
|
||||
# ====================================================================
|
||||
|
||||
|
||||
Attribute:: explanation for a little while, really how ever long you
|
||||
want it to go on for. The double quote marks this text as
|
||||
a property. For the time being, this text also serves as
|
||||
the body, and is really hard to properly color
|
||||
-> this marks a field. This is the first field, field 1
|
||||
# this is a comment. below this is field 2
|
||||
-> here's field 2, the second field
|
||||
=> this is also a field, field 3
|
||||
==> fields can be "indented" to acknowledge that things are
|
||||
subortinate to the prior
|
||||
---> check out that quote
|
||||
-> "Ask not what your country can do for you, but what you
|
||||
can do for your country" - Old Man
|
||||
-> "I made numbers like 5 highlight differently in quotes"
|
||||
|
||||
(1) Fs = 2 * f_max
|
||||
(2) x = e^(j*2*pi*f*t)
|
||||
|
||||
==> See above in (1) where I have defined the Nyquist
|
||||
Sampling Theorem. Expressions only highlight when there
|
||||
is at least one space before and after the equal sign.
|
||||
Adding this kept it from highlighting the ==> arrows
|
||||
==> In (2), we can see that e, j (also i), and pi are seen as
|
||||
numbers
|
||||
|
||||
NOTE: I added this next part for fun!
|
||||
-> I want to live in Norway, I wish I was Norwegian, I want
|
||||
to be Norse, in Norge, Speaking Norsk like the Norwegians
|
||||
-> Or perhaps live in Russia, be Russian, a slav, and speak
|
||||
a slavic language like the Ruskies
|
||||
note: anything between "note:" and ! will be highlighted
|
||||
NoTe: the trigger is case insensitive!
|
||||
|
||||
-> whatever <this> is, I'm not sure yet, but it does it
|
||||
--> also contains <numb3rs>
|
||||
|
||||
|
||||
|
||||
Executable
+297
@@ -0,0 +1,297 @@
|
||||
" ====================================================================
|
||||
" Auth: Alex Celani
|
||||
" Lang: Text
|
||||
" Revn: 10-16-2020 1.5
|
||||
" Func: Define syntax coloring for .txt files when being edited in Vim
|
||||
"
|
||||
" TODO: make comments create new comments on line overrun and newline
|
||||
" add highlighting for titles, vocab words, definitions
|
||||
" create a better template file showing all the highlighting
|
||||
" get term=underline working to avoid using link statements
|
||||
" ====================================================================
|
||||
" CHANGE LOG
|
||||
" --------------------------------------------------------------------
|
||||
" 09-29-2020: copy over from go.vim
|
||||
" 10-01-2020: gutted entire file
|
||||
" made my own quote regex
|
||||
" made comment
|
||||
" added link to list of group names and their colors
|
||||
" 10-02-2020: rewrote quotes to allow multiline quotes with rollover
|
||||
" added recognition for numbers
|
||||
" separated numbers into numbers and numbers in quotes
|
||||
" added date recognition, underlines dates in change log
|
||||
" made comments recognize Auth, Lang, Revn, Func, Todo
|
||||
" underline Auth, Lang, Revn, Func, Todo, and Change Log
|
||||
" recognized fields, the field delimiter (::), and
|
||||
" property delimiter (->)
|
||||
" added tags for notes to self, and the body of such
|
||||
" began writing something to passively color body
|
||||
" colored things Norse things green, and Russian red
|
||||
" added Color Guide, and source
|
||||
" changed some colors up a bit
|
||||
" made property delimiter of variable length, also use =>
|
||||
" 10-03-2020: added reminded to color explicitly in Todo
|
||||
" 10-11-2020: replaced most links with explicit ctermfg statements
|
||||
" added expressions, names, operations
|
||||
" changed some colors up a bit
|
||||
" shortened lines down to <= 70 characters
|
||||
" 10-16-2020: added Norge to norwegian words
|
||||
" added spaces around = in expression to avoid confusion
|
||||
" with => marker
|
||||
" changed noteTag color from DkRed to Red to match notes
|
||||
" added <> region
|
||||
" added i, j, e, pi as numbers
|
||||
"
|
||||
" ====================================================================
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
" 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}
|
||||
syn match expression ".* = .*" contains=name,op,num skipwhite
|
||||
syn match name "\c\a\+" contained
|
||||
syn match name "\c\a\=_\a\+" contained
|
||||
syn match op "[=+-/^\*]" contained
|
||||
|
||||
|
||||
" 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
|
||||
" added contains num on the off chance I want to embed a number
|
||||
" added contains for norwegian and russian for the hell of it
|
||||
syn region quote start="\"" end="\"" contains=numQuote,norwegian,russian
|
||||
" -- 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 Unnamed Field:
|
||||
" match, because it should really only span one line
|
||||
" < and > are literals
|
||||
" .* means any character any number of times
|
||||
" contains numQuote
|
||||
syn match unnamed "<.*>" contains=numQuote
|
||||
|
||||
|
||||
" XXX Numbers:
|
||||
" num and numQuote allow for the coloring of numbers. numQuote exists
|
||||
" for the sole purpose of coloring numbers differently for when
|
||||
" they're inside of a quote, thus the contained keyword for numQuote
|
||||
" the first and last quote define the expression
|
||||
" - is the negative symbol, \? allows for 0 or 1 matchings, which
|
||||
" allows for negative numbers
|
||||
" \d is any digit [0-9], \+ is 1 or more matches, which means there
|
||||
" MUST be at least one number for a match to be seen
|
||||
" \a is any letter [a-zA-Z], * allows any number of them for variables
|
||||
" \. escapes the . character so decimal points can be represented
|
||||
" \? allows 0 or 1 matches of \., because number only have 1 decimal
|
||||
" \d for numbers after the decimal
|
||||
" * for any number of matches, using \+ (one or more matches) would
|
||||
" have only allowed for 2 digit numbers minimum
|
||||
" i, j, e, pi are all common numbers
|
||||
syn match numQuote "-\?\d\+\a*\.\?\d*" contained
|
||||
syn keyword numQuote j i e pi contained
|
||||
syn match num "-\?\d\+\a*\.\?\d*"
|
||||
syn keyword num j i e pi
|
||||
|
||||
|
||||
|
||||
" 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 comments "#.*" contains=commentFields,commentTodo,date,norwegian,russian
|
||||
" 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
|
||||
syn match commentFields contained "CHANGE LOG"
|
||||
|
||||
|
||||
" XXX Fields:
|
||||
" Denotes properties, things that are of importance
|
||||
" first and last quote define the expression
|
||||
" . is any character
|
||||
" * is any number of that character
|
||||
" :: is the literal characters '::', which denotes the property
|
||||
" Using nextgroup would have been better praxis, but this works
|
||||
" After, denote the delimiter as own syntax element to color uniquely
|
||||
" FIXME: make this better with nextgroup
|
||||
syn match fields ".*::" contains=delim
|
||||
syn match delim "::"
|
||||
|
||||
" XXX Properties:
|
||||
" Denotes a property of a field
|
||||
" -\+ is one or more hyphens
|
||||
" =\+ is one or more equals signs
|
||||
" > is a literal
|
||||
syn match properties "-\+>"
|
||||
syn match properties "=\+>"
|
||||
|
||||
|
||||
" 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
|
||||
|
||||
|
||||
" FIXME Body:
|
||||
" This is the rest of the text
|
||||
" I found out with notes, if this isn't given as contained, it'll just
|
||||
" highlight everything
|
||||
"syn region body start=" " end=" "
|
||||
|
||||
|
||||
" XXX Norwegian:
|
||||
" XXX Russian:
|
||||
" lmfao ignore case sensitivity to avoid writing things twice
|
||||
" Highlight norwegian shit green
|
||||
syn case ignore
|
||||
syn keyword norwegian nordic nordics
|
||||
syn keyword norwegian norse
|
||||
syn keyword norwegian norway
|
||||
syn keyword norwegian norge
|
||||
syn keyword norwegian norsk
|
||||
syn keyword norwegian norwegian norwegians
|
||||
" Highlight Russian shit red
|
||||
syn keyword russian russian russians
|
||||
syn keyword russian rusky ruskies
|
||||
syn keyword russian russia
|
||||
syn keyword russian slav slavs
|
||||
syn keyword russian slavic
|
||||
syn case match
|
||||
" lmfao and turn the case sensitivity back on
|
||||
|
||||
|
||||
|
||||
" 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] <group> ctermfg=<color> [ctermbg=<color>]
|
||||
" group is typically a user-made group
|
||||
" ctermfg is the foreground, or font color
|
||||
" ctermbg is the background color, or highlight color
|
||||
|
||||
" Note: Keep ctermfg for expression and op the same value
|
||||
hi expression ctermfg=Blue
|
||||
hi name ctermfg=LightGreen
|
||||
hi op ctermfg=Blue
|
||||
hi num ctermfg=Magenta
|
||||
|
||||
hi unnamed ctermfg=Magenta
|
||||
hi quote ctermfg=DarkRed
|
||||
hi numQuote ctermfg=Green
|
||||
|
||||
hi comments ctermfg=Green
|
||||
" I want the underlines, but I can't figure out how to make them work
|
||||
" Normally, you add 'term=Underline', but that doesn't quite work
|
||||
hi def link commentFields Underlined
|
||||
hi def link date Underlined
|
||||
hi colon ctermfg=Cyan
|
||||
hi commentTodo ctermfg=Black ctermbg=Yellow
|
||||
|
||||
hi fields ctermfg=Red
|
||||
hi delim ctermfg=Yellow
|
||||
|
||||
hi properties ctermfg=Red
|
||||
hi noteTag ctermfg=White ctermbg=Red
|
||||
hi notes ctermfg=White ctermbg=Red
|
||||
|
||||
"hi body ctermfg=LightBlue
|
||||
|
||||
hi norwegian ctermfg=Green
|
||||
hi russian ctermfg=Red
|
||||
|
||||
let b:current_syntax = "txt"
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
" ====================================================================
|
||||
" Auth: Alex Celani
|
||||
" File: .vimrc
|
||||
" Revn: 04-17-2023 2.0
|
||||
" Func: Define how Vim works, set parameters, define keymaps
|
||||
"
|
||||
" TODO: add in Greek keymaps
|
||||
" make goddamn numpad work on terminal/in vim
|
||||
" make all comments linewrap/<CR>wrap onto new line
|
||||
" ====================================================================
|
||||
" CHANGE LOG
|
||||
" --------------------------------------------------------------------
|
||||
" ??-??-2018: init
|
||||
" 05-2?-2019: new files of certain filetype autoinsert this opening
|
||||
" comment header block
|
||||
" 06-01-2019: fixed autocomplete braces not holding indents
|
||||
" 08-01-2019: added linewrapping
|
||||
" 03-27-2020: explicitly set syntax coloring
|
||||
" set column numbers
|
||||
" 04-16-2020: changed automatic comment header directory to .vim/*
|
||||
" 08-30-2020: changed comment#.txt to commentN.txt to avoid errors
|
||||
" 09-05-2020: changed tapstop and shiftwidth from 3 to 4
|
||||
" 10-02-2020: added .txt to files that open commentN.txt
|
||||
" 10-11-2020: made line numbers green
|
||||
" changed line wrap from 80 characters to 70
|
||||
" 03-02-2022: commented out GoLang channel inoremap ( ,- -> <- )
|
||||
" 06-20-2022: commented out GoLang instantiate inoremap ( ;= -> := )
|
||||
"*04-17-2023: added txt and book filetypes to commentN.txt
|
||||
" added laststatus to always display filename
|
||||
"
|
||||
" ====================================================================
|
||||
|
||||
" Explicitly set syntax coloring to on
|
||||
syntax on
|
||||
|
||||
" Reset highlight color for comments to lightblue
|
||||
"hi comment ctermfg=lightblue
|
||||
|
||||
" Set line numbering and color of such
|
||||
set number
|
||||
hi LineNr ctermfg=Green
|
||||
|
||||
" Set column number
|
||||
set ruler
|
||||
|
||||
" Set the amount of spaces in a tab
|
||||
set tabstop=4
|
||||
|
||||
" NFC
|
||||
set shiftwidth=4
|
||||
|
||||
" Replace tab char with spaces
|
||||
set expandtab
|
||||
|
||||
" Copies indent of last line and adds onto <CR>
|
||||
set autoindent
|
||||
|
||||
" Sets character length of line to 70 characters, linewraps
|
||||
set tw=70
|
||||
|
||||
" some way, somehow, this displays the file name at the bottom
|
||||
set laststatus=2
|
||||
|
||||
" Remap {<Enter> with auto close brace and tab in
|
||||
" THIS COULD BE BETTER, COMBINE WITH AUTOINDENT
|
||||
inoremap {<CR> {<CR>f<CR>}<Up><End><Backspace><Tab>
|
||||
|
||||
" Close that mf paren
|
||||
" THIS TAKES TIME, IS IT POSSIBLE TO MAKE IT FASTER
|
||||
" UPDATE -> this only takes time if you wait for it,
|
||||
" typing immediately expedites the process
|
||||
inoremap ( ( )<Left><Left>
|
||||
|
||||
" Skip over closed parens
|
||||
inoremap () ()
|
||||
|
||||
" Auto infer declare/instantiate operator for GoLang
|
||||
"inoremap ;= :=
|
||||
|
||||
" Auto infer channel operator for GoLang
|
||||
"inoremap ,- <-
|
||||
" Auto-insert printf
|
||||
" TODO:
|
||||
" Make language specific shit
|
||||
"inoremap Print<CR> printf();<Left><Left>
|
||||
|
||||
|
||||
" Open new files with comment blocks
|
||||
" Bash, Julia, Ruby, and Text all use pound signs ( # )
|
||||
" also book-types like Providence, ANO, etc
|
||||
autocmd BufNewFile *.sh :r ~/.vim/commentN.txt
|
||||
autocmd BufNewFile *.jl :r ~/.vim/commentN.txt
|
||||
autocmd BufNewFile *.rb :r ~/.vim/commentN.txt
|
||||
autocmd BufNewFile *.txt :r ~/.vim/commentN.txt
|
||||
autocmd BufNewFile *.prv :r ~/.vim/commentN.txt
|
||||
|
||||
" Matlab uses percent signs ( % )
|
||||
autocmd BufNewFile *.m :r ~/.vim/commentP.txt
|
||||
|
||||
" Python uses triple quotes ( """ -> """ )
|
||||
autocmd BufNewFile *.py :r ~/.vim/commentQ.txt
|
||||
|
||||
" C, Go, and Rust use double slashes
|
||||
autocmd BufNewFile *.c :r ~/.vim/commentS.txt
|
||||
autocmd BufNewFile *.go :r ~/.vim/commentS.txt
|
||||
autocmd BufNewFile *.rs :r ~/.vim/commentS.txt
|
||||
|
||||
|
||||
" So this is how you fuck around
|
||||
" When g is pressed, it sets the comment color to black, goes back to Insert
|
||||
" mode, and then types g
|
||||
" inoremap g <Esc>:hi comment ctermfg=black<CR>ig
|
||||
|
||||
+21
@@ -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;}}/*****####*******!!=;:~
|
||||
~::==!!!**********!!!==::-
|
||||
.,~~;;;========;;;:~-.
|
||||
..,--------,*/
|
||||
Executable
+76
@@ -0,0 +1,76 @@
|
||||
# ========================================================================
|
||||
# Auth: alex
|
||||
# File: setup.sh
|
||||
# Revn: 07-11-2023 0.3
|
||||
# Func: automate pi setup
|
||||
#
|
||||
# TODO: get addnet/pipe to bash stuff to work
|
||||
# test?
|
||||
# ========================================================================
|
||||
# CHANGE LOG
|
||||
# ------------------------------------------------------------------------
|
||||
# 07-05-2023: added apt installs for vim, neofetch, tmux
|
||||
# 07-06-2023: install stuffs for golang, rust, github
|
||||
# 07-10-2023: added apt install for tshark
|
||||
# 07-11-2023: mv calls for github/bash and github/TDM
|
||||
# building TDM
|
||||
# sudo echo calls for /etc/dhcpcd.conf for static ip
|
||||
# empty and refill /etc/motd
|
||||
# enabled ssh?
|
||||
# fixed typo in golang download, had one, wanted L
|
||||
#
|
||||
# ========================================================================
|
||||
|
||||
# update apt
|
||||
sudo apt update && sudo apt upgrade
|
||||
|
||||
# install vim
|
||||
sudo apt install -y vim
|
||||
|
||||
# install neofetch
|
||||
sudo apt install -y neofetch
|
||||
|
||||
# install tmux
|
||||
sudo apt install -y tmux
|
||||
|
||||
# install tshark
|
||||
sudo apt install -y tshark
|
||||
|
||||
# install golang
|
||||
wget https://dl.google.com/go/go1.14.4.linux-armv6l.tar.gz
|
||||
sudo tar -C /usr/local -xzf go1.14.4.linux-armv6l.tar.gz
|
||||
rm go1.14.4.linux-armv6l.tar.gz
|
||||
echo "PATH=$PATH:/usr/local/go/bin" >> ~/.profile
|
||||
echo "GOPATH=$HOME/go" >> ~/.profile
|
||||
|
||||
# install rust
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
|
||||
# github treats
|
||||
# lol good luck, without a PAT, this shit BREAKS
|
||||
# start with my stuff
|
||||
git clone https://github.com/alexander-the-alright/bash
|
||||
git clone https://github.com/alexander-the-alright/TDM
|
||||
# elsewhere
|
||||
git clone https://github.com/stianeikeland/go-rpio
|
||||
git clone https://github.com/golemparts/rppal
|
||||
|
||||
# enable vim and bash settings
|
||||
mv ~/bash/.bashrc ~/.bashrc
|
||||
mv ~/bash/.vimrc ~/.vimrc
|
||||
mv ~/bash/.vim ~/.vim
|
||||
|
||||
# build todo manager
|
||||
go build TDM/tdm.go
|
||||
|
||||
# create static local ip address
|
||||
sudo echo "" >> /etc/dhcpcd.conf
|
||||
sudo echo "" >> /etc/dhcpcd.conf
|
||||
sudo echo "interface wlan0" >> /etc/dhcpcd.conf
|
||||
sudo echo "static ip_address=192.168.1.160/24" >> /etc/dhcpcd.conf
|
||||
sudo echo "static routers=192.168.1.1" >> /etc/dhcpcd.conf
|
||||
sudo echo "static domain_name_servers=192.168.1.1" >> /etc/dhcpcd.conf
|
||||
|
||||
# enable ssh?
|
||||
sudo touch /boot/ssh
|
||||
|
||||
Reference in New Issue
Block a user