]> git.eshelyaron.com Git - dotfiles.git/commitdiff
Update Emacs configuration
authorEshel Yaron <me@eshelyaron.com>
Mon, 17 Apr 2023 19:30:35 +0000 (22:30 +0300)
committerEshel Yaron <me@eshelyaron.com>
Mon, 17 Apr 2023 19:30:35 +0000 (22:30 +0300)
.emacs.d/init.el

index 5115a62e02a89bef402edd13b4b4ba9eb8f34c7f..f7c88c9ece34ff456b8cd965c915016b914814f6 100644 (file)
@@ -29,8 +29,9 @@
     (setq gc-cons-threshold init-gc-cons-threshold
           mode-line-format nil)
     (add-hook 'after-init-hook
-              (lambda () (setq gc-cons-threshold normal-gc-cons-threshold
-                               mode-line-format normal-mode-line-format)))))
+              (lambda ()
+                (setq gc-cons-threshold normal-gc-cons-threshold
+                      mode-line-format normal-mode-line-format)))))
 
 (esy/init-step vars
   "Set some variables."
                                ob-prolog
                                orderless
                                org
-                               org-modern
                                org-transclusion
                                package-lint
                                paredit
    completions-detailed nil
    completion-styles '(orderless partial-completion basic)
    completion-show-help nil
-   completions-header-format nil
+   ;; completions-header-format nil
    completion-auto-help 'visual
    completions-max-height 16
    completion-auto-wrap t
   (keymap-set search-map "l" #'rg-literal)
   (keymap-set search-map "b" #'some-button)
 
+  (keymap-set window-prefix-map "p" #'windmove-swap-states-up)
+  (keymap-set window-prefix-map "n" #'windmove-swap-states-down)
+  (keymap-set window-prefix-map "a" #'windmove-swap-states-left)
+  (keymap-set window-prefix-map "e" #'windmove-swap-states-right)
+
+  (dolist (command '(windmove-swap-states-up
+                     windmove-swap-states-down
+                     windmove-swap-states-left
+                     windmove-swap-states-right))
+    (put command 'repeat-map 'window-prefix-map))
+
   ;; unbind some keys
   (dolist (key '("s-a" "s-d" "s-e" "s-f" "s-g" "s-h" "s-j" "s-k" "s-l"
                  "s-m" "s-o" "s-p" "s-q" "s-s" "s-t" "s-u" "s-w" "s-x"
@@ -701,7 +712,8 @@ as the initial input for completion, and return that directory."
   "Configure Org mode."
   (with-eval-after-load 'org
     (keymap-unset org-mode-map "C-," t)
-    (add-to-list 'org-src-lang-modes '("prolog" . sweeprolog)))
+    (add-to-list 'org-src-lang-modes '(("SWI-prolog" . sweeprolog)
+                                       ("bash" . sh))))
 
   (with-eval-after-load 'org-agenda
     (add-to-list 'org-agenda-custom-commands
@@ -769,15 +781,15 @@ as the initial input for completion, and return that directory."
         (list string pred action))))
 
   (keymap-set minibuffer-local-completion-map
-              "<remap> <previous-line>"
+              "C-p"
               #'minibuffer-previous-completion)
 
   (keymap-set minibuffer-local-completion-map
-              "<remap> <next-line>"
+              "C-n"
               #'minibuffer-next-completion)
 
   (keymap-set minibuffer-local-completion-map
-              "<remap> <default-indent-new-line>"
+              "M-j"
               #'minibuffer-force-complete-and-exit)
 
 
@@ -947,6 +959,7 @@ as the initial input for completion, and return that directory."
   "Associate major modes with files based on their extensions."
   (dolist (cell '(("Dockerfile"  . dockerfile-ts-mode)
                   ("\\.ya?ml\\'" . yaml-ts-mode)
+                  ("\\.toml\\'"  . toml-ts-mode)
                   ("\\.json\\'"  . json-ts-mode)
                   ("\\.tfstate\\'"  . json-ts-mode)
                   ("\\.ts\\'"    . typescript-ts-mode)