adding dev environment stuff

This commit is contained in:
2025-11-25 11:22:55 -05:00
parent 69aeca9282
commit 7ea4b2fe8b
3 changed files with 319 additions and 1 deletions

176
dev-settings.el Normal file
View File

@@ -0,0 +1,176 @@
;;; dev-settings.el --- Development environment configuration
;; Disable warnings for config files
(setq byte-compile-warnings '(not free-vars unresolved noruntime lexical make-local))
;;; Package Management
;; Package initialization already done in init.el
(require 'use-package)
(setq use-package-always-ensure t)
;;; Core Development Packages
;; Company - autocomplete
(use-package company
:defer 1
:config
(global-company-mode)
(setq company-idle-delay 0.2
company-minimum-prefix-length 2
company-show-numbers t
company-tooltip-align-annotations t))
;; Flycheck - syntax checking
(use-package flycheck
:defer 2
:config
(global-flycheck-mode)
;; Disable for emacs lisp in config directories
(setq-default flycheck-disabled-checkers '(emacs-lisp-checkdoc)))
;; LSP Mode - language server protocol
(use-package lsp-mode
:defer t
:commands (lsp lsp-deferred)
:init
(setq lsp-keymap-prefix "C-c l")
:config
(setq lsp-enable-snippet t
lsp-enable-symbol-highlighting t
lsp-enable-on-type-formatting nil
lsp-signature-auto-activate t
lsp-signature-render-documentation t
lsp-completion-provider :capf
lsp-headerline-breadcrumb-enable t))
(use-package lsp-ui
:defer t
:commands lsp-ui-mode
:config
(setq lsp-ui-doc-enable t
lsp-ui-doc-show-with-cursor t
lsp-ui-doc-position 'at-point
lsp-ui-sideline-enable t
lsp-ui-sideline-show-hover t))
;; Company integration with LSP
(use-package company-capf
:ensure nil
:after company)
;; Debugging with DAP
(use-package dap-mode
:defer t
:after lsp-mode
:commands dap-mode
:config
(dap-auto-configure-mode)
(require 'dap-gdb-lldb))
;; Project management - already in init.el, just configure for dev
;; Projectile configuration merged with init.el settings
;; Git integration - already in init.el
;;; C/C++ Configuration
(use-package cc-mode
:ensure nil
:hook ((c-mode . lsp-deferred)
(c++-mode . lsp-deferred))
:config
(setq c-basic-offset 4
c-default-style "linux"))
;; Install clangd for C/C++ LSP support
;; You'll need to install clangd separately:
;; - Windows: Download from LLVM releases
;; - Linux: sudo apt install clangd
;; Modern C++ font-lock
(use-package modern-cpp-font-lock
:hook (c++-mode . modern-c++-font-lock-mode))
;;; Common Lisp Configuration
(use-package slime
:defer t
:commands slime
:config
(setq inferior-lisp-program "sbcl") ; or "ccl", "clisp", etc.
(setq slime-contribs '(slime-fancy slime-company))
(setq slime-lisp-implementations
'((sbcl ("sbcl") :coding-system utf-8-unix)
(ccl ("ccl") :coding-system utf-8-unix))))
(use-package slime-company
:defer t
:after (slime company)
:config
(setq slime-company-completion 'fuzzy))
;;; Emacs Lisp Configuration
(use-package elisp-mode
:ensure nil
:hook ((emacs-lisp-mode . eldoc-mode)
(emacs-lisp-mode . company-mode))
:config
;; Disable checkdoc warnings in config files
(add-hook 'emacs-lisp-mode-hook
(lambda ()
(when (or (string-match-p "\\.emacs\\.d" (or buffer-file-name ""))
(string-match-p "init\\.el" (or buffer-file-name ""))
(string-match-p "dev-settings" (or buffer-file-name "")))
(setq-local flycheck-disabled-checkers '(emacs-lisp-checkdoc))))))
;; Better elisp docs
(use-package helpful
:bind (("C-h f" . helpful-callable)
("C-h v" . helpful-variable)
("C-h k" . helpful-key)))
;;; Additional Useful Packages
;; Parentheses management - rainbow-delimiters already in init.el
(use-package smartparens
:defer 1
:hook (prog-mode . smartparens-mode)
:config
(require 'smartparens-config))
;; Snippets
(use-package yasnippet
:defer 2
:config
(yas-global-mode 1))
(use-package yasnippet-snippets
:defer t
:after yasnippet)
;; Better search
(use-package ag
:defer t
:commands ag
:if (executable-find "ag"))
;; Treemacs for project navigation
(use-package treemacs
:defer t
:commands treemacs
:bind (("C-c t" . treemacs)))
(use-package treemacs-projectile
:defer t
:after (treemacs projectile))
;;; Conditional loading of work-specific settings (Windows only)
(when (eq system-type 'windows-nt)
(let ((work-settings (expand-file-name "dev-settings-work.el" user-emacs-directory)))
(when (file-exists-p work-settings)
(load work-settings))))
(provide 'dev-settings)
;;; dev-settings.el ends here