Compare commits
16
Commits
8d1ae01c30
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f051082a3 | ||
|
|
c2bd4d9468 | ||
|
|
467450029d | ||
|
|
64888f9b6a | ||
|
|
5e6a665265 | ||
|
|
a430080725 | ||
|
|
0f52c02146 | ||
|
|
2d659409b0 | ||
|
|
44e87facfa | ||
|
|
445110f8ba | ||
|
|
407e1e40d7 | ||
|
|
82e363e2db | ||
|
|
65228858bf | ||
|
|
17e4e8974e | ||
|
|
5c83cea036 | ||
|
|
b973d61038 |
@@ -6,14 +6,15 @@ stow:
|
||||
unstow:
|
||||
stow -D nvim ghostty emacs
|
||||
|
||||
# if stow is not available, symlink configs instead
|
||||
# TODO: this is currently outdated
|
||||
|
||||
LN := ln -svf
|
||||
LNDIR := ln -sv
|
||||
|
||||
DOTFILES_DIR := $(shell pwd)
|
||||
TARGET_DIR := $(HOME)
|
||||
|
||||
# if stow is not available, symlink configs instead
|
||||
# this is currently outdated
|
||||
.PHONY: link unlink
|
||||
link: nvim
|
||||
|
||||
|
||||
@@ -4,4 +4,10 @@
|
||||
|
||||
# Usage
|
||||
|
||||
Run `make stow`
|
||||
Run `make stow`.
|
||||
|
||||
Add the `./scripts` contents to the path for ez codin
|
||||
|
||||
```sh
|
||||
export PATH="$PATH:$HOME/dotfiles/scripts"
|
||||
```
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
cc-clean(){
|
||||
rm -rf ./**/*.out 2>/dev/null
|
||||
}
|
||||
|
||||
# compile and run a single C program. Useful for prototyping.
|
||||
cc-run(){
|
||||
local file
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: cc-run <file> [args...]" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
file="$1"
|
||||
shift
|
||||
|
||||
gcc "${file}" -o "${file}.out" -Wall -Wextra -Werror -g3 -fsanitize=address $@ && \
|
||||
"./${file}.out"
|
||||
|
||||
rm "${file}.out"
|
||||
}
|
||||
|
||||
# https://pypi.org/project/c-formatter-42/
|
||||
# install via
|
||||
# pip3 install --user c-formatter-42
|
||||
norm(){
|
||||
c_formatter_42 *.c *.h
|
||||
}
|
||||
|
||||
pcheck(){
|
||||
flake8 . && echo "flake good"
|
||||
mypy --strict .
|
||||
}
|
||||
+12
-1
@@ -2,7 +2,11 @@
|
||||
(setenv "SHELL" "/bin/bash")
|
||||
(setq shell-file-name "/bin/bash"
|
||||
explicit-shell-file-name "/bin/bash"
|
||||
shell-command-switch "-ic")
|
||||
shell-command-switch "-c")
|
||||
|
||||
;; Start the compile prompt with an empty command.
|
||||
(setq-default compile-command "")
|
||||
|
||||
|
||||
;; Disable auto-save files (#file#).
|
||||
(setq auto-save-default nil)
|
||||
@@ -42,3 +46,10 @@
|
||||
|
||||
;; Enable the theme without a confirmation prompt.
|
||||
(load-theme 'gruber-darker t)
|
||||
|
||||
;; Python
|
||||
|
||||
(defun pycheck ()
|
||||
"Run flake8 and mypy in the current directory."
|
||||
(interactive)
|
||||
(compile "flake8 --color=never . && echo 'Success: flake8' && mypy --strict ."))
|
||||
|
||||
@@ -110,12 +110,14 @@ local servers = {
|
||||
settings = {
|
||||
basedpyright = {
|
||||
analysis = {
|
||||
typeCheckingMode = "strict",
|
||||
diagnosticSeverityOverrides = {
|
||||
reportUnannotatedClassAttribute = "none",
|
||||
reportAny = "none",
|
||||
reportExplicitAny = "none",
|
||||
reportUnknownVariableType = "none",
|
||||
reportImplicitStringConcatenation = "none"
|
||||
reportImplicitStringConcatenation = "none",
|
||||
reportUnusedCallResult = "none"
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -125,6 +127,9 @@ local servers = {
|
||||
init_options = {
|
||||
settings = {
|
||||
lineLength = 79,
|
||||
lint = {
|
||||
extendSelect = { "ANN2" }, -- Missing return annotations.
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
script_name=$(basename "$0")
|
||||
|
||||
if [ "$#" -eq 0 ]; then
|
||||
echo "Usage: $script_name command [args ...]" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if ! command -v inotifywait >/dev/null; then
|
||||
echo "$script_name: inotifywait was not found. Install inotify-tools." >&2
|
||||
exit 127
|
||||
fi
|
||||
|
||||
while true; do
|
||||
if [ -t 1 ]; then
|
||||
clear 2>/dev/null || true
|
||||
fi
|
||||
|
||||
( "$@" ) || echo "$script_name: command exited with status $?" >&2
|
||||
inotifywait --quiet --recursive --event close_write,move,create,delete . >/dev/null
|
||||
sleep 0.2
|
||||
done
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# https://pypi.org/project/c-formatter-42/
|
||||
# install via
|
||||
# pip3 install --user c-formatter-42
|
||||
|
||||
c_formatter_42 *.c *.h
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
flake8 --color=never . && echo "Success: flake8"
|
||||
|
||||
mypy --strict .
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
# Run with `source pyvenv`
|
||||
|
||||
if [ -n "${VIRTUAL_ENV:-}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ ! -f .venv/bin/activate ]; then
|
||||
python3 -m venv .venv || return $?
|
||||
if [ -f requirements.txt ]; then
|
||||
.venv/bin/python -m pip install -r requirements.txt || return $?
|
||||
fi
|
||||
fi
|
||||
|
||||
. .venv/bin/activate
|
||||
Reference in New Issue
Block a user