Compare commits

20 Commits
Author SHA1 Message Date
romanzy313 4f051082a3 easier python env 2026-11-30 21:48:11 +01:00
romanzy313 c2bd4d9468 stricter python lsp 2026-11-30 21:41:28 +01:00
romanzy313 467450029d optimize concurrent changes 2026-11-30 17:39:10 +01:00
romanzy313 64888f9b6a clear screen 2026-11-30 17:18:04 +01:00
romanzy313 5e6a665265 simplify 2026-11-30 17:16:37 +01:00
romanzy313 a430080725 exec-watch 2026-11-30 17:12:57 +01:00
romanzy313 0f52c02146 scripts 2026-11-30 17:02:05 +01:00
romanzy313 2d659409b0 Merge branch 'lessen-fix' 2026-11-30 16:50:15 +01:00
romanzy313 44e87facfa python lessen errors 2026-11-30 16:48:41 +01:00
romanzy313 445110f8ba Merge branch 'main' of ssh://ssh.devstuff.volovoy.com:2222/romanzy313/dotfiles 2026-11-22 19:57:22 +01:00
romanzy313 8d1ae01c30 born2beroot 2026-11-21 16:09:51 +01:00
romanzy313 407e1e40d7 pycheck commands 2026-11-21 12:58:20 +01:00
romanzy313 82e363e2db major refactor 2026-11-20 21:21:54 +01:00
romanzy313 65228858bf no more interactive terminal 2026-11-20 21:19:52 +01:00
romanzy313 17e4e8974e better emacs alias 2026-11-20 21:18:08 +01:00
romanzy313 5c83cea036 aliases improved 2026-11-20 21:11:25 +01:00
romanzy313 b973d61038 deC emacs 2026-11-20 21:02:30 +01:00
romanzy313 f76918b675 emacs install script 2026-11-20 00:40:22 +01:00
romanzy313 55903f7a18 no arrows in my terminal 2026-11-19 23:26:18 +01:00
romanzy313 192dc306e0 fix oil shortcuts 2026-11-19 23:12:38 +01:00
13 changed files with 132 additions and 42 deletions
+3 -2
View File
@@ -6,14 +6,15 @@ stow:
unstow: unstow:
stow -D nvim ghostty emacs stow -D nvim ghostty emacs
# if stow is not available, symlink configs instead
# TODO: this is currently outdated
LN := ln -svf LN := ln -svf
LNDIR := ln -sv LNDIR := ln -sv
DOTFILES_DIR := $(shell pwd) DOTFILES_DIR := $(shell pwd)
TARGET_DIR := $(HOME) TARGET_DIR := $(HOME)
# if stow is not available, symlink configs instead
# this is currently outdated
.PHONY: link unlink .PHONY: link unlink
link: nvim link: nvim
+7 -1
View File
@@ -4,4 +4,10 @@
# Usage # Usage
Run `make stow` Run `make stow`.
Add the `./scripts` contents to the path for ez codin
```sh
export PATH="$PATH:$HOME/dotfiles/scripts"
```
-32
View File
@@ -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
View File
@@ -2,7 +2,11 @@
(setenv "SHELL" "/bin/bash") (setenv "SHELL" "/bin/bash")
(setq shell-file-name "/bin/bash" (setq shell-file-name "/bin/bash"
explicit-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#). ;; Disable auto-save files (#file#).
(setq auto-save-default nil) (setq auto-save-default nil)
@@ -42,3 +46,10 @@
;; Enable the theme without a confirmation prompt. ;; Enable the theme without a confirmation prompt.
(load-theme 'gruber-darker t) (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 ."))
+16 -1
View File
@@ -1,8 +1,23 @@
# No confusing symbols # No confusing symbols
font-feature = -calt, -liga, -dlig font-feature = -calt, -liga, -dlig
# Allow terminal applications to read the clipboard without confirmation # Disable clipboard annoyances
clipboard-read = allow clipboard-read = allow
clipboard-paste-protection = false
# fbnp supremacy
keybind = up=ignore
keybind = down=ignore
keybind = left=ignore
keybind = right=ignore
keybind = ctrl+up=ignore
keybind = ctrl+down=ignore
keybind = ctrl+left=ignore
keybind = ctrl+right=ignore
keybind = alt+up=ignore
keybind = alt+down=ignore
keybind = alt+left=ignore
keybind = alt+right=ignore
# Disable touchpad horizontal-swipe tab switching. # Disable touchpad horizontal-swipe tab switching.
# Will come in next version # Will come in next version
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Builds emacs from source.
# However, its better to use system package managers.
set -euo pipefail
version="31.1"
archive="emacs-${version}.tar.gz"
prefix="/opt/emacs-${version}"
workdir=$(mktemp -d)
trap 'rm -rf "$workdir"' EXIT
sudo apt-get install build-essential libxpm-dev libjpeg-dev libgif-dev \
libtiff-dev libgnutls28-dev
curl -fL -o "$workdir/$archive" "https://ftp.gnu.org/gnu/emacs/$archive"
tar -xzf "$workdir/$archive" -C "$workdir"
cd "$workdir/emacs-$version"
./configure --prefix="$prefix"
make -j 4
sudo make install
cat <<EOF
Add this to your shell config (~/.bashrc, ~/.zshrc, ...):
export PATH="$prefix/bin:\$PATH"
EOF
+2 -3
View File
@@ -58,10 +58,9 @@ Git shortcuts:
- `[h`, `]h`, `[H`, `]H` jump to hunks - `[h`, `]h`, `[H`, `]H` jump to hunks
- `<leader>th` — toggle the expanded hunk view - `<leader>th` — toggle the expanded hunk view
Oil usage: Oil shortcuts:
- `-`, `<BS>` goes to the parent directory - `gp` opens preview panel
- `<C-p>` previews the selected entry
Toggle shortcuts: Toggle shortcuts:
@@ -110,12 +110,14 @@ local servers = {
settings = { settings = {
basedpyright = { basedpyright = {
analysis = { analysis = {
typeCheckingMode = "strict",
diagnosticSeverityOverrides = { diagnosticSeverityOverrides = {
reportUnannotatedClassAttribute = "none", reportUnannotatedClassAttribute = "none",
reportAny = "none", reportAny = "none",
reportExplicitAny = "none", reportExplicitAny = "none",
reportUnknownVariableType = "none", reportUnknownVariableType = "none",
reportImplicitStringConcatenation = "none" reportImplicitStringConcatenation = "none",
reportUnusedCallResult = "none"
}, },
}, },
}, },
@@ -125,6 +127,9 @@ local servers = {
init_options = { init_options = {
settings = { settings = {
lineLength = 79, lineLength = 79,
lint = {
extendSelect = { "ANN2" }, -- Missing return annotations.
},
}, },
}, },
}, },
@@ -30,7 +30,8 @@ require("oil").setup({
["gR"] = "actions.refresh", -- replaces default <C-l> behavior ["gR"] = "actions.refresh", -- replaces default <C-l> behavior
["<F5>"] = "actions.refresh", ["<F5>"] = "actions.refresh",
["<C-s>"] = false, ["<C-s>"] = false,
["<C-p>"] = { "actions.preview", opts = { vertical = true, split = "belowright" } }, ["<C-p>"] = false,
["gp"] = { "actions.preview", opts = { vertical = true, split = "belowright" } },
["<BS>"] = { "actions.parent", mode = "n" }, ["<BS>"] = { "actions.parent", mode = "n" },
}, },
view_options = { view_options = {
+25
View File
@@ -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
+9
View File
@@ -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
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
set -euo pipefail
flake8 --color=never . && echo "Success: flake8"
mypy --strict .
Executable
+14
View File
@@ -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