summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emacs/init.el32
1 files changed, 17 insertions, 15 deletions
diff --git a/emacs/init.el b/emacs/init.el
index 8bf0340..b5312c9 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -63,21 +63,21 @@ mark. Does the same of ARG number sexps if given"
(insert-pair 1 ?\( ?\))))
(defun close-or-kill ()
- "If this is the sole frame, kill emacs. Otherwise close the frame."
+ "If this is the sole frame, kill emacs. Otherwise close the frame."
(interactive)
(if (eq 1 (length (frame-list)))
- ;; sole frame, exit
(save-buffers-kill-terminal)
(delete-frame)))
(defun my/toggle-window-other-reachability ()
+ "Toggle whether this window can be selected by `other-window'."
(interactive)
(let* ((win (get-buffer-window (current-buffer)))
(current (window-parameter win 'no-other-window)))
(set-window-parameter win 'no-other-window (not current))))
(defun my/clean-prog-file (buffer)
- "Fixes whitespace in buffer"
+ "Fixes whitespace in buffer."
(save-excursion
(with-current-buffer buffer
(untabify (point-min) (point-max))
@@ -94,8 +94,8 @@ mark. Does the same of ARG number sexps if given"
(switch-to-buffer buffer))))
(defun shorten-path (path)
- "Shortens each directory in PATH except for the last directory to its
-first character."
+ "Shortens each directory in PATH except for the last directory to
+its first character."
(let* ((components (split-string path "/"))
(last-component (-last (lambda (s) (not (string-empty-p s))) components))
(shortened-components
@@ -107,8 +107,9 @@ first character."
(mapconcat 'identity shortened-components "/")))
(defun swap-other-window-buffer ()
- "Try to switch the buffer contents of the current window and the next in
-the cyclic ordering. Don't involve windows that are dedicated."
+ "Try to switch the buffer contents of the current window and the
+next in the cyclic ordering. Don't involve windows that are
+dedicated."
(interactive)
(let* ((cw (get-mru-window nil nil nil t))
(cb (window-buffer cw))
@@ -442,7 +443,7 @@ the cyclic ordering. Don't involve windows that are dedicated."
(use-package asm-mode ; asm comments and tags generation
:demand t
:custom
- (asm-comment-char ?#) ; prefer # over ; for asm comments
+ (asm-comment-char ?#) ; prefer # over ; for asm comments
:init
(defun add-asm-label-tag-generation-hook ()
(add-hook 'after-save-hook
@@ -451,20 +452,19 @@ the cyclic ordering. Don't involve windows that are dedicated."
"find . -iregex '.*\\.[sS]' -exec etags -l none -r '/\\([a-zA-Z0-9\\-_]+\\):/\1/' {} +"))
0 t))
:hook
- (asm-mode . generate-asm-label-tags))
+ (asm-mode . 'add-asm-label-tag-generation-hook))
(use-package lsp-mode
:commands (lsp)
:init
(use-package lsp-haskell)
:custom
- (lsp-completion-provider . :none)
+ (lsp-completion-provider :none)
:config
(defun corfu-lsp-setup ()
(setq-local completion-styles '(orderless)
completion-category-defaults nil))
- (add-hook 'lsp-completion-mode-hook #'corfu-lsp-setup)
- )
+ (add-hook 'lsp-completion-mode-hook #'corfu-lsp-setup))
(use-package pyvenv)
@@ -575,7 +575,9 @@ the cyclic ordering. Don't involve windows that are dedicated."
;; and use one of its "OPSW" menus.
))
(use-package racket-mode)
-(use-package rustic)
+(use-package rustic
+ :custom
+ (rustic-lsp-setup-p nil))
(progn ; elisp
(keymap-set emacs-lisp-mode-map "C-c r" 'raise-sexp))
@@ -763,10 +765,10 @@ changes."
([?\C-e] . [end])
([?\M-v] . [prior])
([?\C-v] . [next])
+ ;; edit, copy, paste
([?\C-d] . [delete])
([?\C-k] . [S-end delete])
- ;; cut/paste.
- ;; ([?\C-w] . [?\C-x])
+ ([M-backspace] . [C-backspace])
([?\M-w] . [?\C-c])
([?\C-y] . [?\C-v])
([?\C-s] . [?\C-f])))