diff options
author | Thanos Apollo <[email protected]> | 2023-09-03 17:05:49 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-09-03 17:06:54 +0300 |
commit | 8efa6f3f1db166d30a4eb38780f6c47855c51439 (patch) | |
tree | 873e0c0aeb443c10153a44e14a3d89c938e68e4d /.emacs.d/modules/thanos-dev.el | |
parent | f7c3db0c688b9b98762464cc9e4cc7c87a9dbe96 (diff) |
emacs: Modularize
Diffstat (limited to '.emacs.d/modules/thanos-dev.el')
-rw-r--r-- | .emacs.d/modules/thanos-dev.el | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/.emacs.d/modules/thanos-dev.el b/.emacs.d/modules/thanos-dev.el new file mode 100644 index 0000000..f80b64b --- /dev/null +++ b/.emacs.d/modules/thanos-dev.el @@ -0,0 +1,103 @@ +;;; thanos-dev.el --- Developer Tools Configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2023 Thanos Apollo + +;; Author: Thanos Apollo <[email protected]> +;; Keywords: extensions + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see <https://www.gnu.org/licenses/>. + +;;; Commentary: + +;; + +;;; Code: +(require 'company) + +(add-hook 'after-init-hook 'global-company-mode) +(define-key company-active-map (kbd "TAB") 'company-indent-or-complete-common) +(setq company-idle-delay + (lambda () (if (company-in-string-or-comment) nil 0.0))) + +(require 'company-box) +(add-hook 'company-mode-hook 'company-box-mode) +(setf company-box-icons-alist 'company-box-icons-images) + +(setq indent-tabs-mode nil) + +(defun insert-brackets (&optional arg) + "Insert brackets." + (interactive "P") + (insert-pair arg ?\[ ?\])) + +(global-set-key (kbd "C-x M-[") 'insert-brackets) + +(require 'magit) + +(setf magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1) +(define-prefix-command 'thanos/magit) +(global-set-key (kbd "C-c g") 'thanos/magit) +(define-key thanos/magit (kbd "c") 'magit-clone) + +(define-auto-insert '("\\.sh\\'" . "Bash skeleton") + '("Description:" \n + "#!/bin/bash")) + +(add-hook 'shell-script-mode #'auto-insert) + +(setf tab-always-indent 'complete) +(add-to-list 'completion-styles 'initials t) + +(add-hook 'emacs-lisp-mode-hook #'rainbow-delimiters-mode) +(add-hook 'emacs-lisp-mode-hook #'company-mode) +(add-hook 'emacs-lisp-mode-hook #'display-line-numbers-mode) + +;; Disable checkdoc flycheck for org-src buffers +(add-hook 'org-src-mode-hook #'(lambda () + (flycheck-disable-checker 'emacs-lisp-checkdoc))) + +(setf inferior-lisp-program "sbcl") +(add-hook 'lisp-mode-hook #'rainbow-delimiters-mode) +(add-hook 'lisp-mode-hook #'company-mode) +(add-hook 'lisp-mode-hook #'display-line-numbers-mode) + +(add-hook 'scheme-mode-hook #'rainbow-delimiters-mode) +(add-hook 'scheme-mode-hook #'company-mode) + +(defun thanos/lsp-mode-setup () + (setf lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols)) + (lsp-headerline-breadcrumb-mode)) + +(require 'lsp-mode) +(add-hook 'lsp-mode #'thanos/lsp-mode-setup) +(setf lsp-keymap-prefix "C-c l") +(lsp-enable-which-key-integration t) + +(require 'lsp-ui) +(add-hook 'lsp-mode 'lsp-ui-mode) +(setf lsp-ui-doc-position 'bottom) + +;; set pylsp with lsp-mode +(setf lsp-pyls-server-command "~/usr/bin/pylsp") + +(require 'python-mode) +(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode)) +(add-hook 'python-mode 'lsp-deferred) + +(require 'json-mode) +(add-to-list 'auto-mode-alist '("\\.json'" . json-mode)) + + +(provide 'thanos-dev) +;;; thanos-dev.el ends here |