diff options
author | Mattias Andrée <m@maandree.se> | 2025-03-01 19:26:05 +0100 |
---|---|---|
committer | Mattias Andrée <m@maandree.se> | 2025-03-01 19:26:05 +0100 |
commit | 2574c4cabc34756eb124e69d6a8e0ffeaa56a44f (patch) | |
tree | 0b6bc70a0d2bd5cb3879eb7b998b4ea17b053575 | |
parent | m (diff) | |
download | dotfiles-2574c4cabc34756eb124e69d6a8e0ffeaa56a44f.tar.gz dotfiles-2574c4cabc34756eb124e69d6a8e0ffeaa56a44f.tar.bz2 dotfiles-2574c4cabc34756eb124e69d6a8e0ffeaa56a44f.tar.xz |
...
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rw-r--r-- | emacs-go-mode/Makefile | 11 | ||||
-rw-r--r-- | emacs-go-mode/init-go-mode.el (renamed from emacs/init-go-mode.el) | 0 | ||||
-rw-r--r-- | emacs-haskell-mode/Makefile | 11 | ||||
-rw-r--r-- | emacs-haskell-mode/init-haskell-mode.el (renamed from emacs/init-haskell-mode.el) | 0 | ||||
-rw-r--r-- | emacs/Makefile | 19 | ||||
-rw-r--r-- | emacs/init.el | 52 | ||||
-rw-r--r-- | gdb/Makefile | 11 | ||||
-rw-r--r-- | gdb/init-gdb.el (renamed from emacs/init-gdb.el) | 0 | ||||
-rwxr-xr-x | git/new-c-proj | 2 | ||||
-rw-r--r-- | ssh/Makefile | 4 | ||||
-rwxr-xr-x | ssh/ssh-archiso | 5 | ||||
-rw-r--r-- | sshexec/Makefile | 10 | ||||
-rwxr-xr-x | sshexec/sshexec-archiso | 5 |
13 files changed, 98 insertions, 32 deletions
diff --git a/emacs-go-mode/Makefile b/emacs-go-mode/Makefile new file mode 100644 index 0000000..ea3f8be --- /dev/null +++ b/emacs-go-mode/Makefile @@ -0,0 +1,11 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/emacs + test -L ~/.config/emacs/init-go-mode.el || test ! -e ~/.config/emacs/init-go-mode.el + ln -sf -- ~/.dotfiles/emacs-go-mode/init-go-mode.el ~/.config/emacs/ + +uninstall: + +! ../check-installed emacs-go-mode + -unlink -- ~/.config/emacs/init-go-mode.el + -rmdir -- ~/.config/emacs diff --git a/emacs/init-go-mode.el b/emacs-go-mode/init-go-mode.el index 56e3c16..56e3c16 100644 --- a/emacs/init-go-mode.el +++ b/emacs-go-mode/init-go-mode.el diff --git a/emacs-haskell-mode/Makefile b/emacs-haskell-mode/Makefile new file mode 100644 index 0000000..3605590 --- /dev/null +++ b/emacs-haskell-mode/Makefile @@ -0,0 +1,11 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/emacs + test -L ~/.config/emacs/init-haskell-mode.el || test ! -e ~/.config/emacs/init-haskell-mode.el + ln -sf -- ~/.dotfiles/emacs-haskell-mode/init-haskell-mode.el ~/.config/emacs/ + +uninstall: + +! ../check-installed emacs-haskell-mode + -unlink -- ~/.config/emacs/init-haskell-mode.el + -rmdir -- ~/.config/emacs diff --git a/emacs/init-haskell-mode.el b/emacs-haskell-mode/init-haskell-mode.el index 6fe75c2..6fe75c2 100644 --- a/emacs/init-haskell-mode.el +++ b/emacs-haskell-mode/init-haskell-mode.el diff --git a/emacs/Makefile b/emacs/Makefile index 9fa5799..665bde5 100644 --- a/emacs/Makefile +++ b/emacs/Makefile @@ -14,22 +14,8 @@ install: fi; \ ln -sf -- .config/emacs ~/.emacs.d; \ fi - printf '; %s\n; %s\n\n' > ~/.config/emacs/init.el \ - 'This file is generated by ~/.dotfiles/emacs/Makefile' \ - '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' - cat -- init.el >> ~/.config/emacs/init.el - if ../check-installed emacs-go-mode 2>/dev/null; then \ - printf '\n' >> ~/.config/emacs/init.el && \ - cat -- init-go-mode.el >> ~/.config/emacs/init.el; \ - fi - if ../check-installed emacs-haskell-mode; then\ - printf '\n' >> ~/.config/emacs/init.el && \ - cat -- init-haskell-mode.el >> ~/.config/emacs/init.el; \ - fi - if ../check-installed gdb; then \ - printf '\n' >> ~/.config/emacs/init.el && \ - cat -- init-gdb.el >> ~/.config/emacs/init.el; \ - fi + test -L ~/.config/emacs/init.el || test ! -e ~/.config/emacs/init.el + ln -sf -- ~/.dotfiles/emacs/init.el ~/.config/emacs/init.el if grep Ubuntu < /etc/lsb-release >/dev/null 2>/dev/null; then \ mkdir -p -- ~/.config/profile.d && \ (test ! -e ~/.config/profile.d/emacs || \ @@ -52,3 +38,4 @@ uninstall: -unlink -- ~/.emacs.d -rmdir -- ~/.config/emacs -unlink -- ~/.local/bin/e + test ! -d ../.work/emacs || (cd ../.work/emacs && $(MAKE) uninstall) diff --git a/emacs/init.el b/emacs/init.el index a807fa7..432b772 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -4,21 +4,25 @@ ;; You may delete these explanatory comments. (package-initialize) + +;; Enable the upcase-region function which is disabled by default (put 'upcase-region 'disabled nil) -(custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(inhibit-startup-screen t)) -(setq display-time-string-forms - '((propertize (concat " " 24-hours ":" minutes " ") - ))) +;; Never show the startup screen (go to scratch if there is no file specified) +(custom-set-variables '(inhibit-startup-screen t)) + + +;; Display column number after line number (column-number-mode) + + +;; Configure and display clock +(setq display-time-string-forms + '((propertize (concat " " 24-hours ":" minutes " ") ))) (display-time-mode) + ; (set-default-font "-misc-fixed-medium-r-normal--13-*-75-75-c-70-iso8859-1") ;; TODO set-default-font stopped working @@ -34,16 +38,34 @@ (set-face-foreground 'font-lock-comment-face "red") + +;; Fix up C mode +;;;; disable electric mode (add-hook 'after-change-major-mode-hook (lambda() (electric-indent-mode -1))) (add-hook 'c-mode-hook (lambda () (electric-indent-local-mode))) - +;;;; use tab as indentation (defvaralias 'c-basic-offset 'tab-width) +;; TODO trailing whitespaces are removed even where I want them + + +;; TODO I can probably remove these, do not remember why they were added (global-set-key (kbd "DEL") 'backward-delete-char) (setq c-backspace-function 'backward-delete-char) -(setq vc-follow-symlinks nil) -(setq vc-handled-backends nil) -(add-to-list 'auto-mode-alist '("/PKGBUILD$" . shell-script-mode)) -(add-to-list 'auto-mode-alist '("/APKBUILD$" . shell-script-mode)) -(setq auto-mode-alist (cons '("\.cl$" . c-mode) auto-mode-alist)) +;; Version control configurations +(setq vc-follow-symlinks nil) ; Do not follow symlinks in version control +(setq vc-handled-backends nil) ; Do not use version control features + + +;; Addition rules for major mode selection +(add-to-list 'auto-mode-alist '("/PKGBUILD$" . shell-script-mode)) ; arch linux build scripts +(add-to-list 'auto-mode-alist '("/APKBUILD$" . shell-script-mode)) ; alpine linux build scripts +(setq auto-mode-alist (cons '("\.cl$" . c-mode) auto-mode-alist)) ; OpenCL source files + + + +;; Load configurations from installed for other packages +((lambda () + (dolist (file (directory-files (expand-file-name "~/.config/emacs/") t "^init-.*\\.el$")) + (load-file file)))) diff --git a/gdb/Makefile b/gdb/Makefile new file mode 100644 index 0000000..874d896 --- /dev/null +++ b/gdb/Makefile @@ -0,0 +1,11 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/emacs + test -L ~/.config/emacs/init-gdb.el || test ! -e ~/.config/emacs/init-gdb.el + ln -sf -- ~/.dotfiles/gdb/init-gdb.el ~/.config/emacs/ + +uninstall: + +! ../check-installed gdb + -unlink -- ~/.config/emacs/init-gdb.el + -rmdir -- ~/.config/emacs diff --git a/emacs/init-gdb.el b/gdb/init-gdb.el index 51b1a35..51b1a35 100644 --- a/emacs/init-gdb.el +++ b/gdb/init-gdb.el diff --git a/git/new-c-proj b/git/new-c-proj index 8bd90f8..dfd00f9 100755 --- a/git/new-c-proj +++ b/git/new-c-proj @@ -52,7 +52,7 @@ cat > .gitignore <<EOF EOF mkdir -p -- .git/info -printf '%s\n' '_*' '.hidden' '.makeenv' >> .git/info/exclude +printf '%s\n' '_*' '._*' '.hidden' '.makeenv' >> .git/info/exclude if printf '%s\n' "$1" | grep '^lib' >/dev/null 2>/dev/null; then UPPERCASE="$(printf '%s\n' "$1" | tr '[a-z-]' '[A-Z_]')" diff --git a/ssh/Makefile b/ssh/Makefile index be4b0d5..4a3dba4 100644 --- a/ssh/Makefile +++ b/ssh/Makefile @@ -55,6 +55,9 @@ install: mkdir -p -- ~/.config/bash/aliases.d test ! -e ~/.config/bash/aliases.d/openssh || test -L ~/.config/bash/aliases.d/openssh ln -sf -- ~/.dotfiles/openssh/bash-aliases ~/.config/bash/aliases.d/openssh + mkdir -p -- ~/.local/bin + test ! -e ~/.local/bin/ssh-archiso || test -L ~/.local/bin/ssh-archiso + ln -sf -- ~/.dotfiles/openssh/ssh-archiso ~/.local/bin/ssh-archiso uninstall: +! ../check-installed ssh @@ -70,3 +73,4 @@ uninstall: -rm -f -- .ssh-config -unlink -- ~/.config/bash/aliases.d/openssh -rmdir -- ~/.config/bash/aliases.d + -unlink -- ~/.local/bin/ssh-archiso diff --git a/ssh/ssh-archiso b/ssh/ssh-archiso new file mode 100755 index 0000000..f3b7fc7 --- /dev/null +++ b/ssh/ssh-archiso @@ -0,0 +1,5 @@ +#!/bin/sh + +printf '\033[1m%s\033[m\n\n' 'The password is simply "arch"' >&2 + +exec ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@archiso "$@" diff --git a/sshexec/Makefile b/sshexec/Makefile new file mode 100644 index 0000000..c2be226 --- /dev/null +++ b/sshexec/Makefile @@ -0,0 +1,10 @@ +.POSIX: + +install: + mkdir -p -- ~/.local/bin + test ! -e ~/.local/bin/sshexec-archiso || test -L ~/.local/bin/sshexec-archiso + ln -sf -- ~/.dotfiles/sshexec/sshexec-archiso ~/.local/bin/sshexec-archiso + +uninstall: + +! ../check-installed sshexec + -unlink -- ~/.local/bin/sshexec-archiso diff --git a/sshexec/sshexec-archiso b/sshexec/sshexec-archiso new file mode 100755 index 0000000..303726c --- /dev/null +++ b/sshexec/sshexec-archiso @@ -0,0 +1,5 @@ +#!/bin/sh + +printf '\033[1m%s\033[m\n\n' 'The password is simply "arch"' >&2 + +exec sshexec -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@archiso "$@" |