<2023-05-21 Sun 21:57>

This commit is contained in:
2023-05-21 21:57:03 +09:00
parent 08273f16ed
commit 37eca57ac4
9 changed files with 104 additions and 14 deletions

View File

@ -102,5 +102,10 @@ Otherwise the startup will be very slow. "
(require 'init-rust)
(require 'init-python)
(require 'init-ruby)
(require 'init-latex)
(require 'init-verilog)
(require 'init-extra)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init.el ends here

View File

@ -0,0 +1,6 @@
;; init-extra.el -*- lexical-binding: t -*-
(use-package gnuplot)
(use-package graphviz-dot-mode)
(provide 'init-extra)
;;; init-extra.el ends here

View File

@ -45,6 +45,7 @@
;; Citre
"c" '(:ignore t :which-key "citre")
"c j" 'citre-jump+
"c J" 'dumb-jump-go-other-window
"c k" 'citre-jump-back+
"c p" 'citre-peek
"c a" 'citre-ace-peek
@ -65,6 +66,8 @@
"h t" '(hydra-text-scale/body :which-key "scale text")
"h w" '(hydra-writeroom-scale/body :which-key "scale whiteroom")
"h a" '(hydra-modify-alpha/body :which-key "modify alpha background")
"h j" '(dumb-jump-hydra/body :which-key "dumb jump hydra")
"h o" '(org-hydra/body :which-key "org hydra")
;; Insert something
"i" '(:ignore t :which-key "insert something.")
"i s" '(yas-insert-snippet :which-key "snippet")

View File

@ -0,0 +1,44 @@
;;; init-latex.el -*- lexical-binding: t -*-
(use-package auctex
:defer t
:custom
(TeX-auto-save t)
(TeX-parse-self t)
;; to use pdfview with auctex
(TeX-view-program-selection '((output-pdf "PDF Tools")))
(TeX-view-program-list '(("PDF Tools" TeX-pdf-tools-sync-view)))
(TeX-source-correlate-start-server t)
;; electric pairs in auctex
(TeX-electric-sub-and-superscript t)
(LaTeX-electric-left-right-brace t)
(TeX-electric-math (cons "$" "$"))
:config
(setq-default TeX-master nil)
;; compile to pdf
(tex-pdf-mode)
;; correlate the source and the output
(TeX-source-correlate-mode)
;; set a correct indentation in a few additional environments
(add-to-list 'LaTeX-indent-environment-list '("lstlisting" current-indentation))
(add-to-list 'LaTeX-indent-environment-list '("tikzcd" LaTeX-indent-tabular))
(add-to-list 'LaTeX-indent-environment-list '("tikzpicture" current-indentation))
;; add a few macros and environment as verbatim
(add-to-list 'LaTeX-verbatim-environments "lstlisting")
(add-to-list 'LaTeX-verbatim-environments "Verbatim")
(add-to-list 'LaTeX-verbatim-macros-with-braces "lstinline")
(add-to-list 'LaTeX-verbatim-macros-with-delims "lstinline")
;; open all buffers with the math mode and auto-fill mode
(add-hook 'LaTeX-mode-hook #'auto-fill-mode)
(add-hook 'LaTeX-mode-hook #'LaTeX-math-mode)
;; add support for references
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(customize-set-variable 'reftex-plug-into-AUCTeX t)
;; to have the buffer refresh after compilation
(add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer))
(provide 'init-latex)
;;; init-latex.el ends here

View File

@ -41,18 +41,7 @@
("Y" (hot-expand "<s" "ipython :session :exports both :results raw drawer\n$0") "ipython")
("P" (progn
(insert "#+HEADERS: :results output :exports both :shebang \"#!/usr/bin/env perl\"\n")
(hot-expand "<s" "perl")) "Perl tangled")
("<" self-insert-command "ins"))))
:bind (("C-c a" . org-agenda)
("C-c b" . org-switchb)
("C-c x" . org-capture)
:map org-mode-map
("<" . (lambda ()
"Insert org template."
(interactive)
(if (or (region-active-p) (looking-back "^\s*" 1))
(org-hydra/body)
(self-insert-command 1)))))
(hot-expand "<s" "perl")) "Perl tangled"))))
:hook (((org-babel-after-execute org-mode) . org-redisplay-inline-images) ; display image
(org-indent-mode . (lambda()
(diminish 'org-indent-mode)
@ -158,6 +147,8 @@ prepended to the element after the #+HEADER: tag."
org-pretty-entities nil
org-hide-emphasis-markers t)
(use-package org-journal
:defer t
:config
@ -208,6 +199,19 @@ prepended to the element after the #+HEADER: tag."
(rust . t)
(C . t))
"Alist of org ob languages.")
(push '("conf-unix" . conf-unix) org-src-lang-modes)
(add-to-list 'org-structure-template-alist '("sh" . "src shell"))
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
(add-to-list 'org-structure-template-alist '("cc" . "src c"))
(add-to-list 'org-structure-template-alist '("cp" . "src c++"))
(add-to-list 'org-structure-template-alist '("rs" . "src rust"))
(add-to-list 'org-structure-template-alist '("rb" . "src ruby"))
(add-to-list 'org-structure-template-alist '("py" . "src python"))
(add-to-list 'org-structure-template-alist '("oc" . "src octave"))
(add-to-list 'org-structure-template-alist '("vl" . "src verilog"))
(add-to-list 'org-structure-template-alist '("vh" . "src vhdl"))
;; ob-sh renamed to ob-shell since 26.1.
(cl-pushnew '(shell . t) load-language-alist)

View File

@ -69,8 +69,8 @@
("M-g j" . dumb-jump-go)
("M-g i" . dumb-jump-go-prompt)
("M-g x" . dumb-jump-go-prefer-external)
("M-g z" . dumb-jump-go-prefer-external-other-window)
("C-M-j" . dumb-jump-hydra/body))
("M-g z" . dumb-jump-go-prefer-external-other-window))
;;("C-M-j" . dumb-jump-hydra/body))
:init
(add-hook 'xref-backend-functions #'dumb-jump-xref-activate)
(setq dumb-jump-prefer-searcher 'rg
@ -177,6 +177,10 @@ Install the doc if it's not installed."
(add-hook 'before-save-hook
#'fish_indent-before-save))))
(use-package pkgbuild-mode)
(use-package systemd)
(provide 'init-prog)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -54,6 +54,8 @@
;; Live Coding in Python
(use-package live-py-mode))
(use-package jupyter)
(provide 'init-python)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -33,6 +33,10 @@
;; Rust
(use-package rustic)
(use-package rust-playground)
(use-package toml-mode
:defer t
:config
(add-to-list 'auto-mode-alist '("/\\(Cargo.lock\\|\\.cargo/config\\)\\'" . toml-mode)))
(provide 'init-rust)

View File

@ -0,0 +1,18 @@
;; init-verilog.el -*- lexical-binding: t -*-
(use-package verilog-mode
:ensure nil
:init
(setq verilog-indent-level 4)
(setq verilog-indent-level-module 0)
(setq verilog-indent-level-declaration 0)
(setq verilog-indent-level-behavioral 0)
(setq verilog-indent-level-directive 0)
(setq verilog-indent-lists nil)
(setq verilog-cexp-indent 4)
(setq verilog-case-indent 4)
(setq verilog-auto-newline nil))
(provide 'init-verilog)
;;; init-verilog.el ends here