Compare commits

...

6 commits

Author SHA1 Message Date
finga 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
finga d80f02e008 dev: Add lsp config
Add configuration for the lsp-mode and Rust.
2023-11-15 11:45:53 +01:00
finga 9a0627bad0 dev: Reformat deadgrep and paredit config 2023-11-15 11:45:53 +01:00
finga 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
finga 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
finga 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

@ -19,34 +19,20 @@
;; use ripgrep in emacs
(use-package deadgrep
:ensure t
: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)
:ensure t
:bind ("M-s d" . deadgrep))
;; paredit
(use-package paredit :ensure t)
(autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t)
(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode)
(add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode)
(add-hook 'ielm-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)
(use-package paredit
:ensure t
:config
(autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t)
(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode)
(add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode)
(add-hook 'ielm-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
;; `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"))
(find-dired dir "")))
;; c
(setq c-default-style "linux"
c-basic-offset 2)
(add-hook 'c-mode-hook
(lambda ()
(set-fill-column 100)))
;; python
;; (defun my-shell-mode-hook ()
;; (add-hook
;; 'comint-output-filter-functions
;; 'python-pdbtrack-comint-output-filter-function t))
;; (add-hook 'shell-mode-hook 'my-shell-mode-hook)
;; enable flyspell checks for comments in code
(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
:ensure t
:init (setq org-export-backends '(ascii html icalendar latex odt beamer))
:mode ("\\.org\\'" . org-mode)
:bind (("C-c a" . org-agenda)))
:init (setq org-export-backends '(ascii html icalendar latex odt beamer)))
(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
: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)
(dolist (snippet config-snippets)

View file

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