separate into files

This commit is contained in:
Your Name 2025-12-06 06:09:42 -05:00
parent 8f94aee2bc
commit 8cb86a87a3
8 changed files with 168 additions and 110 deletions

3
.gitignore vendored
View file

@ -7,3 +7,6 @@ url
*.data *.data
eshell eshell
auto-save-list auto-save-list
multisession
games
transient

View file

@ -0,0 +1,16 @@
(menu-bar-mode -1)
(tool-bar-mode -1)
(display-time-mode)
(defun my-display-numbers-hook ()
(display-line-numbers-mode 1)
)
(defun my-spotlight-mode-hook ()
(hl-line-mode 1)
)
(add-hook 'prog-mode-hook 'my-display-numbers-hook)
(add-hook 'text-mode-hook 'my-display-numbers-hook)
(add-hook 'prog-mode-hook 'my-spotlight-mode-hook)
(add-hook 'text-mode-hook 'my-spotlight-mode-hook)
(add-hook 'dired-mode-hook 'my-spotlight-mode-hook)
(setq-default cursor-type 'box)
(provide 'appearance-settings)

24
elisp/blog-settings.el Normal file
View file

@ -0,0 +1,24 @@
(defun open-site () (interactive)(dired "/ssh:admin@feelinblue.wiki#9051:/usr/local/www/nanachi/"))
(defun insert-html-keybind (keybind)
(interactive "sKeybind:")
(insert "<span class=\"keybind\">" keybind "</span>")
)
(defun insert-html-blogpost-tag (tag)
(interactive "sTag:")
(insert "<span class=\"tag-" tag "\"><a href=\"blog/" tag ".html\">" tag"</a></span>")
)
(defun insert-html-template ()
(interactive)
(insert "<!DOCTYPE html>
<head>
<link rel=\"stylesheet\" href=\"/css/style.css\">
<meta charset=\"utf-8\">
</head>
<body>
<a href=".."> Back</a>
</body>
</html>
")
)
(provide 'blog-settings)

54
elisp/exwm-settings.el Normal file
View file

@ -0,0 +1,54 @@
(use-package exwm
:config
;; Set the default number of workspaces
(setq exwm-workspace-number 5)
;; When window "class" updates, use it to set the buffer name
;; (add-hook 'exwm-update-class-hook #'efs/exwm-update-class)
;; These keys should always pass through to Emacs
(setq exwm-input-prefix-keys
'(?\C-x
?\C-u
?\C-h
?\M-x
?\M-`
?\M-&
?\M-:
?\C-\M-j ;; Buffer list
?\C-\ )) ;; Ctrl+Space
;; Ctrl+Q will enable the next key to be sent directly
(define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key)
;; Set up global key bindings. These always work, no matter the input state!
;; Keep in mind that changing this list after EXWM initializes has no effect.
(setq exwm-input-global-keys
`(
;; Reset to line-mode (C-c C-k switches to char-mode via exwm-input-release-keyboard)
([?\s-r] . exwm-reset)
;; Move between windows
([s-left] . windmove-left)
([s-right] . windmove-right)
([s-up] . windmove-up)
([s-down] . windmove-down)
;; Launch applications via shell command
([?\s-&] . (lambda (command)
(interactive (list (read-shell-command "$ ")))
(start-process-shell-command command nil command)))
;; Switch workspace
([?\s-w] . exwm-workspace-switch)
;; 's-N': Switch to certain workspace with Super (Win) plus a number key (0 - 9)
,@(mapcar (lambda (i)
`(,(kbd (format "s-%d" i)) .
(lambda ()
(interactive)
(exwm-workspace-switch-create ,i))))
(number-sequence 0 9))))
(exwm-wm-mode))
(provide 'exwm-settings)

28
elisp/irc-settings.el Normal file
View file

@ -0,0 +1,28 @@
(setq circe-network-options
'(("Libera Chat"
:tls t
:tls-keylist (("/home/tate/.config/weechat/libera.pem"
"/home/tate/.config/weechat/libera.pem"))
:host "irc.libera.chat"
:sasl-external t
:nick "nanach1"
:channels ("#emacs" "##japanese" "#openbsd" "##")
)))
(setq circe-reduce-lurker-spam t)
(enable-circe-color-nicks)
(add-hook 'circe-chat-mode-hook 'my-circe-prompt)
(defun my-circe-prompt ()
(lui-set-prompt
(concat (propertize (concat (buffer-name) ">")
'face 'circe-prompt-face)
" ")))
(setq
lui-time-stamp-position 'left-margin
lui-time-stamp-format "%H:%M")
(add-hook 'lui-mode-hook 'my-circe-set-margin)
(defun my-circe-set-margin ()
(setq left-margin-width 5))
(setq circe-format-say "{nick:-16s} {body}")
(setq circe-format-self-say "<{nick}> {body}")
(provide 'irc-settings)

View file

@ -0,0 +1,8 @@
(keymap-global-set "C-c d" (lambda () (interactive)
(call-process-shell-command "firefox &")
))
(keymap-global-set "C-c s" (lambda () (interactive) (term "/bin/ksh")
))
(keymap-global-set "C-c e" 'eshell)
(keymap-global-set "C-c f" 'elfeed)
(provide 'keybind-settings)

3
elisp/laptop-settings.el Normal file
View file

@ -0,0 +1,3 @@
(keymap-global-set "C-c b u" (lambda () (interactive) (call-process-shell-command "xbacklight -inc 10 &")))
(keymap-global-set "C-c b d" (lambda () (interactive) (call-process-shell-command "xbacklight -dec 10 &")))
(provide 'laptop-settings)

140
init.el
View file

@ -1,8 +1,16 @@
(add-to-list 'load-path "~/.emacs.d/elisp/") (add-to-list 'load-path "~/.emacs.d/elisp")
;; OpenBSD KNF for C/C++ (custom-set-faces
(require 'openbsd-knf-style) ;; custom-set-faces was added by Custom.
(c-add-style "OpenBSD" openbsd-knf-style) ;; If you edit it by hand, you could mess it up, so be careful.
(setq c-default-style '((c-mode . "OpenBSD"))) ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :extend nil :stipple nil :background "#25202a" :foreground "#cfccd2" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight regular :height 102 :width normal :foundry "xos4" :family "Screen"))))
'(line-number ((t (:inherit (shadow default) :background "gray9"))))
'(line-number-current-line ((t (:inherit line-number :foreground "dark goldenrod"))))
'(mode-line ((t (:box (:line-width (2 . 2) :color "grey75" :style released-button)))))
'(mode-line-active ((t (:inherit mode-line))))
'(tab-bar ((t (:inherit default :background "black" :foreground "white" :box nil)))))
(custom-set-variables (custom-set-variables
;; custom-set-variables was added by Custom. ;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
@ -10,7 +18,8 @@
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(blink-cursor-mode nil) '(blink-cursor-mode nil)
'(circe-default-realname "narehate") '(circe-default-realname "narehate")
'(custom-enabled-themes '(inkpot)) '(circe-default-user "narehate")
'(custom-enabled-themes nil)
'(custom-safe-themes '(custom-safe-themes
'("2422f18687980d29da5e276547171c99f1cc1b2cb4cdbec124a53e1f34143001" '("2422f18687980d29da5e276547171c99f1cc1b2cb4cdbec124a53e1f34143001"
"058ba0ed929f801fc4077617e816797654c7775382943520875642d5507d8696" "058ba0ed929f801fc4077617e816797654c7775382943520875642d5507d8696"
@ -22,120 +31,33 @@
default)) default))
'(elfeed-feeds '("https://bimshwel.com/?feed=rss2")) '(elfeed-feeds '("https://bimshwel.com/?feed=rss2"))
'(package-selected-packages '(package-selected-packages
'(abyss-theme acme-theme circe dirvish elfeed evangelion-theme exwm '(abc-mode abyss-theme acme-theme circe dirvish elfeed
faff-theme inkpot-theme inverse-acme-theme mingus evangelion-theme exwm faff-theme helm inkpot-theme
pass vmd-mode)) inverse-acme-theme mingus nerd-icons pass vmd-mode w3m
ytdious))
'(rmail-spool-directory "/home/tate/Mail/INBOX") '(rmail-spool-directory "/home/tate/Mail/INBOX")
'(tab-bar-mode t) '(tab-bar-mode t)
'(tool-bar-mode nil) '(tool-bar-mode nil)
'(transient-mark-mode nil)) '(transient-mark-mode nil))
(custom-set-faces
;; custom-set-faces 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.
'(default ((t (:inherit nil :extend nil :stipple nil :background "#1e1e27" :foreground "#cfbfad" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight regular :height 91 :width normal :foundry "SGI" :family "Comic Mono"))))
'(line-number ((t (:inherit (shadow default) :background "gray9"))))
'(line-number-current-line ((t (:inherit line-number :foreground "dark goldenrod"))))
'(mode-line ((t (:background "indian red" :foreground "white" :box nil))))
'(mode-line-active ((t (:inherit mode-line :background "purple")))))
;;
;; ====== Appearance ======
;;
(menu-bar-mode -1)
(tool-bar-mode -1)
(display-time-mode)
(defun my-display-numbers-hook ()
(display-line-numbers-mode 1)
)
(defun my-spotlight-mode-hook ()
(hl-line-mode 1)
)
(add-hook 'prog-mode-hook 'my-display-numbers-hook)
(add-hook 'text-mode-hook 'my-display-numbers-hook)
(add-hook 'prog-mode-hook 'my-spotlight-mode-hook)
(add-hook 'text-mode-hook 'my-spotlight-mode-hook)
(add-hook 'dired-mode-hook 'my-spotlight-mode-hook)
(setq-default cursor-type 'box)
;; (require 'laptop-settings)
;; ====== Keybinds ====== (require 'irc-settings)
;; (require 'appearance-settings)
(require 'keybind-settings)
(require 'blog-settings)
(require 'openbsd-knf-style)
(require 'exwm-settings)
(c-add-style "OpenBSD" openbsd-knf-style)
(setq c-default-style '((c-mode . "OpenBSD")))
(keymap-global-set "C-c s" (lambda () (interactive) (term "/bin/ksh")))
(keymap-global-set "C-c e" 'eshell)
(keymap-global-set "C-c f" 'elfeed)
;; ;; melpa
;; ====== Exwm ======
;;
(use-package exwm
:config
;; Set the default number of workspaces
(setq exwm-workspace-number 5)
;; When window "class" updates, use it to set the buffer name
;; (add-hook 'exwm-update-class-hook #'efs/exwm-update-class)
;; These keys should always pass through to Emacs
(setq exwm-input-prefix-keys
'(?\C-x
?\C-u
?\C-h
?\M-x
?\M-`
?\M-&
?\M-:
?\C-\M-j ;; Buffer list
?\C-\ )) ;; Ctrl+Space
;; Ctrl+Q will enable the next key to be sent directly
(define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key)
;; Set up global key bindings. These always work, no matter the input state!
;; Keep in mind that changing this list after EXWM initializes has no effect.
(setq exwm-input-global-keys
`(
;; Reset to line-mode (C-c C-k switches to char-mode via exwm-input-release-keyboard)
([?\s-r] . exwm-reset)
;; Move between windows
([s-left] . windmove-left)
([s-right] . windmove-right)
([s-up] . windmove-up)
([s-down] . windmove-down)
;; Launch applications via shell command
([?\s-&] . (lambda (command)
(interactive (list (read-shell-command "$ ")))
(start-process-shell-command command nil command)))
;; Switch workspace
([?\s-w] . exwm-workspace-switch)
;; 's-N': Switch to certain workspace with Super (Win) plus a number key (0 - 9)
,@(mapcar (lambda (i)
`(,(kbd (format "s-%d" i)) .
(lambda ()
(interactive)
(exwm-workspace-switch-create ,i))))
(number-sequence 0 9))))
(exwm-wm-mode))
(require 'package) (require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
;; Comment/uncomment this line to enable MELPA Stable if desired. See `package-archive-priorities` ;; Comment/uncomment this line to enable MELPA Stable if desired. See `package-archive-priorities`
;; and `package-pinned-packages`. Most users will not need or want to do this. ;; and `package-pinned-packages`. Most users will not need or want to do this.
;;(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t) ;;(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(package-initialize) (package-initialize)
(setq circe-network-options
'(("Libera Chat"
:tls t
:tls-keylist (("/home/tate/.config/weechat/libera.pem"
"/home/tate/.config/weechat/libera.pem"))
:host "irc.libera.chat"
:sasl-external t
:nick "nanach1"
:channels ("#emacs")
)))