Changed . token to _dot

This change allows the dotfiles to work with chezmoi (e.g: on windows)
and improves grepability with neovim/telescope
This commit is contained in:
2024-11-07 13:52:17 +00:00
parent 83b02bd753
commit 896af887ca
2351 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
# Runs C code via GCC without leaving a file behind
def rcc [
file: path # The file to run
] {
# Remove exe if still exists
rm $"($file).exe" --permanent --force
# Compile code to exe
^gcc ("." | path join $file | path expand) -o ("." | path join $"($file).exe" | path expand)
# Execute exe
^$"($file).exe"
# Remove exe
rm $"($file).exe" --permanent --force
}
# Runs C++ code via g++ without leaving a file behind
def r++ [
file: path # The file to run
] {
# Remove exe if still exists
rm $"($file).exe" --permanent --force
# Compile code to exe
^g++ ("." | path join $file | path expand) -o ("." | path join $"($file).exe" | path expand)
# Execute exe
^$"($file).exe"
# Remove exe
rm $"($file).exe" --permanent --force
}