Compare commits

..

6 commits

Author SHA1 Message Date
3b721d8346 org: Reduce configuration
Remove the configuration of the mode as this should be superfluous and
remove the keybinding for the org-agenda as this was never used by me.
2023-11-15 11:45:53 +01:00
d80f02e008 dev: Add lsp config
Add configuration for the lsp-mode and Rust.
2023-11-15 11:45:53 +01:00
9a0627bad0 dev: Reformat deadgrep and paredit config 2023-11-15 11:45:53 +01:00
93ed2ac975 dev, yaml: Extract yaml config into separate file
Move configuration regarding yaml into its own file.
2023-11-15 11:45:53 +01:00
1c0930fa65 dev, rust: Extract Rust config into separate file
Move configuration regarding Rust into its own file.
2023-11-15 11:45:50 +01:00
941b156a55 c, dev: Extract C config into separate file
Move configuration regarding C into its own file.
2023-11-15 11:45:22 +01:00
7 changed files with 50 additions and 37 deletions

6
.emacs.d/config/c.el Normal file
View file

@ -0,0 +1,6 @@
(setq c-default-style "linux"
c-basic-offset 2)
(add-hook 'c-mode-hook
(lambda ()
(set-fill-column 100)))

View file

@ -22,31 +22,17 @@
:ensure t :ensure t
:bind ("M-s d" . deadgrep)) :bind ("M-s d" . deadgrep))
;; rust
(use-package cargo :ensure t)
(use-package cargo-mode :ensure t)
(use-package rust-mode :ensure t)
(use-package flycheck-rust :ensure t)
;; start cargo
(add-hook 'rust-mode-hook 'cargo-minor-mode)
;; format code when saving
(setq rust-format-on-save t)
;; yaml
(use-package yaml-mode :ensure t)
(use-package flycheck-yamllint :ensure t)
;; paredit ;; paredit
(use-package paredit :ensure t) (use-package paredit
(autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t) :ensure t
(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) :config
(add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode) (autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t)
(add-hook 'ielm-mode-hook #'enable-paredit-mode) (add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode)
(add-hook 'lisp-mode-hook #'enable-paredit-mode) (add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode)
(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode) (add-hook 'ielm-mode-hook #'enable-paredit-mode)
(add-hook 'scheme-mode-hook #'enable-paredit-mode) (add-hook 'lisp-mode-hook #'enable-paredit-mode)
(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode)
(add-hook 'scheme-mode-hook #'enable-paredit-mode))
;; Hack to show only files known to git inside dired; needs the ;; Hack to show only files known to git inside dired; needs the
;; `git-find' shell script shim (taken from :open https://r0tty.org/git/dotfiles/emacs/tree/.emacs.d/config/development.el) ;; `git-find' shell script shim (taken from :open https://r0tty.org/git/dotfiles/emacs/tree/.emacs.d/config/development.el)
@ -55,13 +41,18 @@
(let ((find-program "git-find")) (let ((find-program "git-find"))
(find-dired dir ""))) (find-dired dir "")))
;; c ;; python
(setq c-default-style "linux" ;; (defun my-shell-mode-hook ()
c-basic-offset 2) ;; (add-hook
;; 'comint-output-filter-functions
(add-hook 'c-mode-hook ;; 'python-pdbtrack-comint-output-filter-function t))
(lambda () ;; (add-hook 'shell-mode-hook 'my-shell-mode-hook)
(set-fill-column 100)))
;; enable flyspell checks for comments in code ;; enable flyspell checks for comments in code
(add-hook 'prog-mode-hook #'flyspell-prog-mode) (add-hook 'prog-mode-hook #'flyspell-prog-mode)
;; language server
(use-package lsp-mode
:ensure t
:config
(add-hook 'rust-mode-hook 'lsp-deferred))

View file

@ -1,7 +1,5 @@
(use-package org (use-package org
:ensure t :ensure t
:init (setq org-export-backends '(ascii html icalendar latex odt beamer)) :init (setq org-export-backends '(ascii html icalendar latex odt beamer)))
:mode ("\\.org\\'" . org-mode)
:bind (("C-c a" . org-agenda)))
(setq org-directory "~/org") (setq org-directory "~/org")

13
.emacs.d/config/rust.el Normal file
View file

@ -0,0 +1,13 @@
(use-package cargo
:ensure t
:config
;; enable cargo keybindings
(add-hook 'rust-mode-hook 'cargo-minor-mode))
(use-package rust-mode
:ensure t
:config
;; format code when saving
(setq rust-format-on-save t))
(use-package flycheck-rust :ensure t)

2
.emacs.d/config/yaml.el Normal file
View file

@ -0,0 +1,2 @@
(use-package yaml-mode :ensure t)
(use-package flycheck-yamllint :ensure t)

View file

@ -57,7 +57,7 @@ symbols, which are converted to strings, and suffixed with \".el\"."
:group 'config-snippets :group 'config-snippets
:type '(repeat directory)) :type '(repeat directory))
(setq config-snippets '(base backups calendar dev functions gpg matrix org pass wl)) (setq config-snippets '(base backups c calendar dev functions gpg matrix org pass rust wl yaml))
(message "Loading\nconfig-snippets: %s\nconfig-snippets-path: %s" config-snippets config-snippet-path) (message "Loading\nconfig-snippets: %s\nconfig-snippets-path: %s" config-snippets config-snippet-path)
(dolist (snippet config-snippets) (dolist (snippet config-snippets)

View file

@ -2,13 +2,16 @@
!/.emacs.d/config/backups.el !/.emacs.d/config/backups.el
!/.emacs.d/config/base.el !/.emacs.d/config/base.el
!/.emacs.d/config/calendar.el !/.emacs.d/config/calendar.el
!/.emacs.d/config/c.el
!/.emacs.d/config/dev.el !/.emacs.d/config/dev.el
!/.emacs.d/config/functions.el !/.emacs.d/config/functions.el
!/.emacs.d/config/gpg.el !/.emacs.d/config/gpg.el
!/.emacs.d/config/matrix.el !/.emacs.d/config/matrix.el
!/.emacs.d/config/org.el !/.emacs.d/config/org.el
!/.emacs.d/config/pass.el !/.emacs.d/config/pass.el
!/.emacs.d/config/rust.el
!/.emacs.d/config/tramp.el !/.emacs.d/config/tramp.el
!/.emacs.d/config/yaml.el
!/.emacs.d/init.el !/.emacs.d/init.el
!/.gitignore.d/emacs !/.gitignore.d/emacs
!/.local/bin/em !/.local/bin/em