diff options
Diffstat (limited to 'lisp/programming')
| -rw-r--r-- | lisp/programming/c++.el | 29 | ||||
| -rw-r--r-- | lisp/programming/c.el | 42 | ||||
| -rw-r--r-- | lisp/programming/common-lisp.el | 32 | ||||
| -rw-r--r-- | lisp/programming/elisp.el | 30 | ||||
| -rw-r--r-- | lisp/programming/javascript.el | 26 | ||||
| -rw-r--r-- | lisp/programming/python.el | 24 | ||||
| -rw-r--r-- | lisp/programming/rust.el | 40 | ||||
| -rw-r--r-- | lisp/programming/scheme.el | 21 |
8 files changed, 244 insertions, 0 deletions
diff --git a/lisp/programming/c++.el b/lisp/programming/c++.el new file mode 100644 index 0000000..5dca93b --- /dev/null +++ b/lisp/programming/c++.el @@ -0,0 +1,29 @@ +;;; c++.el -*- lexical-binding: t; -*- +;;; +;;; Author: Jakob L. Kreuze <zerodaysfordays@sdf.org> +;;; URL: https://git.sr.ht/~jakob/.emacs.d/ +;;; +;;; Configuration of a development environment for the C++ programming language. +;;; + +(use-package cc-mode + :straight nil + ;; Even though the Linux kernel coding style [1] was written to address C, I + ;; feel its viewpoints on indentation apply equally as well to C++. + ;; + ;; [1]: https://www.kernel.org/doc/html/v4.10/process/coding-style.html + :hook + (c++-mode . (lambda () + (setq indent-tabs-mode t) + (c-set-style "linux"))) + + ;; Enable company, Flycheck, and ElDoc, integration for all of which is + ;; provided by `irony-mode'. + :hook + (c++-mode . company-mode) + (c++-mode . flycheck-mode) + (c++-mode . eldoc-mode)) + +(use-package irony + :hook + (c++-mode . irony-mode)) diff --git a/lisp/programming/c.el b/lisp/programming/c.el new file mode 100644 index 0000000..6ba19e2 --- /dev/null +++ b/lisp/programming/c.el @@ -0,0 +1,42 @@ +;;; c.el -*- lexical-binding: t; -*- +;;; +;;; Author: Jakob L. Kreuze <zerodaysfordays@sdf.org> +;;; URL: https://git.sr.ht/~jakob/.emacs.d/ +;;; +;;; Configuration of a development environment for the C programming language. +;;; + +(use-package cc-mode + :straight nil + + ;; Generally, I adhere to the Linux kernel coding style [1]. + ;; + ;; [1]: https://www.kernel.org/doc/html/v4.10/process/coding-style.html + :hook + (c-mode . (lambda () + (setq indent-tabs-mode t) + (c-set-style "linux"))) + + ;; Enable company, Flycheck, and ElDoc, integration for all of which is + ;; provided by `irony-mode'. + :hook + (c-mode . company-mode) + (c-mode . flycheck-mode) + (c-mode . eldoc-mode)) + +(use-package irony + :hook + (c-mode . irony-mode) + (irony-mode . irony-cdb-autosetup-compile-options)) + +(use-package company-irony + :config + (add-to-list 'company-backend 'company-irony)) + +(use-package flycheck-irony + :hook + (flycheck-mode . flycheck-irony-setup)) + +(use-package irony-eldoc + :hook + (irony-mode . irony-eldoc)) diff --git a/lisp/programming/common-lisp.el b/lisp/programming/common-lisp.el new file mode 100644 index 0000000..b3aa00b --- /dev/null +++ b/lisp/programming/common-lisp.el @@ -0,0 +1,32 @@ +;;; common-lisp.el -*- lexical-binding: t; -*- +;;; +;;; Author: Jakob L. Kreuze <zerodaysfordays@sdf.org> +;;; URL: https://git.sr.ht/~jakob/.emacs.d/ +;;; +;;; Configuration of a development environment for the Common Lisp programming +;;; language. +;;; + +;; SLIME is my preferred REPL for working with Common Lisp, + +(use-package slime + ;; and SBCL is my preferred implementation. + :config + (setq inferior-lisp-program "sbcl") + + ;; Enable Smartparens and Company in the SLIME REPL. + :hook + (slime-repl-mode . (lambda () + (smartparens-mode +1) + (company-mode +1))) + + ;; Enable the SLIME backend for company. + :config + (setq slime-contribs '(slime-fancy slime-company))) + +(use-package slime-company + :after company + :hook + (lisp-mode . (lambda () (company-mode +1))) + :config + (add-to-list 'company-backends 'company-slime)) diff --git a/lisp/programming/elisp.el b/lisp/programming/elisp.el new file mode 100644 index 0000000..0b975eb --- /dev/null +++ b/lisp/programming/elisp.el @@ -0,0 +1,30 @@ +;;; elisp.el -*- lexical-binding: t; -*- +;;; +;;; Author: Jakob L. Kreuze <zerodaysfordays@sdf.org> +;;; URL: https://git.sr.ht/~jakob/.emacs.d/ +;;; +;;; Configuration of a development environment for the Emacs Lisp programming +;;; language. +;;; + +(use-package elisp-mode + :straight nil + ;; Enable company for both `lisp-interaction-mode' and `emacs-lisp-mode'. + :hook + (lisp-interaction-mode . company-mode) + (emacs-lisp-mode . company-mode) + + ;; Avoid omitting information when displaying deeply-nested lists. + :init + (setq eval-expression-print-level nil)) + +;; Helpful is a wonderful improvement upon the vanilla `describe-.*' functions, +;; capable of showing source code, keybindings, symbol properties, etc. + +(use-package helpful + :bind + ("C-h f" . helpful-callable) + ("C-h v" . helpful-variable) + ("C-h k" . helpful-key) + ("C-h C" . helpful-command) + ("C-c C-d" . helpful-at-point)) diff --git a/lisp/programming/javascript.el b/lisp/programming/javascript.el new file mode 100644 index 0000000..c74e6ac --- /dev/null +++ b/lisp/programming/javascript.el @@ -0,0 +1,26 @@ +;;; javascript.el -*- lexical-binding: t; -*- +;;; +;;; Author: Jakob L. Kreuze <zerodaysfordays@sdf.org> +;;; URL: https://git.sr.ht/~jakob/.emacs.d/ +;;; +;;; Configuration of a development environment for the Javascript programming +;;; language. +;;; + +(use-package js + :straight nil + + ;; Set up `js-mode' to interact with a LSP daemon. + :requires lsp-mode + :hook (js-mode . lsp) + :config + (lsp-register-client + (make-lsp-client :new-connection (lsp-stdio-connection "~/.bin/js-ts-stdio") + :major-modes '(js-mode) + :server-id 'js-ts-stdio)) + +;; I have yet to find a style guide I agree with, but one thing common to most +;; of them that I _do_ agree with is that Javascript is far more readable with +;; an indentation width of 2. + :init + (setq-default js-indent-level 2)) diff --git a/lisp/programming/python.el b/lisp/programming/python.el new file mode 100644 index 0000000..a6c7fc4 --- /dev/null +++ b/lisp/programming/python.el @@ -0,0 +1,24 @@ +;;; python.el -*- lexical-binding: t; -*- +;;; +;;; Author: Jakob L. Kreuze <zerodaysfordays@sdf.org> +;;; URL: https://git.sr.ht/~jakob/.emacs.d/ +;;; +;;; Configuration of a development environment for the Python programming +;;; language. +;;; + +;; Set up company. + +(use-package company-jedi + :after company + + :hook + (python-mode . company-mode) + (python-mode . jedi:setup) + + :init + (setq jedi:complete-on-dot t) + (setq jedi:tooltip-method nil) + + :config + (add-to-list 'company-backends 'company-jedi)) diff --git a/lisp/programming/rust.el b/lisp/programming/rust.el new file mode 100644 index 0000000..6e4e43b --- /dev/null +++ b/lisp/programming/rust.el @@ -0,0 +1,40 @@ +;;; rust.el -*- lexical-binding: t; -*- +;;; +;;; Author: Jakob L. Kreuze <zerodaysfordays@sdf.org> +;;; URL: https://git.sr.ht/~jakob/.emacs.d/ +;;; +;;; Configuration of a development environment for the Rust programming +;;; language. +;;; + +;; Enable flycheck. + +(use-package flycheck-rust + :after rust-mode + :hook + (flycheck-mode . flycheck-rust-setup) + (rust-mode . flycheck-mode)) + +;; Enable company, ElDoc, and racer. + +(use-package racer + :init + (setq racer-cmd "~/.cargo/bin/racer") + (setq racer-rust-src-path "~/Code/rust/src") + + :hook + (racer-mode . eldoc-mode) + (racer-mode . company-mode)) + +(use-package rust-mode + :hook + (rust-mode . racer-mode) + + ;; Run 'rustfmt' automatically. + :init + (setq rust-format-on-save t)) + +;; Enable keybindings for working with Cargo. + +(use-package cargo + :hook (rust-mode . cargo-minor-mode)) diff --git a/lisp/programming/scheme.el b/lisp/programming/scheme.el new file mode 100644 index 0000000..de9f380 --- /dev/null +++ b/lisp/programming/scheme.el @@ -0,0 +1,21 @@ +;;; scheme.el -*- lexical-binding: t; -*- +;;; +;;; Author: Jakob L. Kreuze <zerodaysfordays@sdf.org> +;;; URL: https://git.sr.ht/~jakob/.emacs.d/ +;;; +;;; Configuration of a development environment for the Scheme programming +;;; language. +;;; + +;; Geiser is my preferred REPL for working with Scheme. + +(use-package geiser + ;; Set up Geiser for all of the Scheme implementations I regularly use. + :init + (setq geiser-active-implementations '(chicken guile racket)) + (setq geiser-default-implementation 'guile) + (setenv "CHICKEN_DOC_REPOSITORY" "/home/jakob/.local/share/chicken/doc/") + + ;; Filesystem hygene. + :init + (setq geiser-repl-history-filename "~/.cache/emacs/geiser_history")) |