Ensure *NEARLY EVERYTHING* is optional
This commit is contained in:
parent
1a4cd272bf
commit
a7c4775960
@ -97,20 +97,15 @@
|
|||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Language server packages
|
;; development assistance packages
|
||||||
;;
|
;;
|
||||||
|
|
||||||
;; lsp toggle
|
;; lsp toggle
|
||||||
(defcustom thwap-comp-enable-lsp nil
|
(defcustom thwap-dev-enable-lsp nil
|
||||||
"Whether or not to enable lsp."
|
"Whether or not to enable lsp."
|
||||||
:type 'boolean
|
:type 'boolean
|
||||||
:group 'thwap-config-group)
|
:group 'thwap-config-group)
|
||||||
|
|
||||||
|
|
||||||
;;
|
|
||||||
;; development assistance packages
|
|
||||||
;;
|
|
||||||
|
|
||||||
;; projectile toggle
|
;; projectile toggle
|
||||||
(defcustom thwap-dev-enable-projectile nil
|
(defcustom thwap-dev-enable-projectile nil
|
||||||
"Whether or not to enable projectile."
|
"Whether or not to enable projectile."
|
||||||
@ -123,6 +118,29 @@
|
|||||||
:type 'boolean
|
:type 'boolean
|
||||||
:group 'thwap-config-group)
|
:group 'thwap-config-group)
|
||||||
|
|
||||||
|
;; Copilot toggle
|
||||||
|
(defcustom thwap-dev-enable-copilot nil
|
||||||
|
"Whether or not to enable copilot."
|
||||||
|
:type 'boolean
|
||||||
|
:group 'thwap-config-group)
|
||||||
|
|
||||||
|
;; Go toggle
|
||||||
|
(defcustom thwap-dev-enable-go nil
|
||||||
|
"Whether or not to setup Go development modes."
|
||||||
|
:type 'boolean
|
||||||
|
:group 'thwap-config-group)
|
||||||
|
|
||||||
|
;; Python toggle
|
||||||
|
(defcustom thwap-dev-enable-python nil
|
||||||
|
"Whether or not to setup Python development modes."
|
||||||
|
:type 'boolean
|
||||||
|
:group 'thwap-config-group)
|
||||||
|
|
||||||
|
;; Terraform toggle
|
||||||
|
(defcustom thwap-dev-enable-terraform nil
|
||||||
|
"Whether or not to setup Terraform development modes."
|
||||||
|
:type 'boolean
|
||||||
|
:group 'thwap-config-group)
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Org mode settings
|
;; Org mode settings
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
|
|
||||||
(straight-use-package 'dash)
|
(when thwap-dev-enable-copilot
|
||||||
(straight-use-package 'editorconfig)
|
(straight-use-package 'dash)
|
||||||
|
(straight-use-package 'editorconfig)
|
||||||
(use-package copilot
|
(use-package copilot
|
||||||
:straight (:host github :repo "zerolfx/copilot.el" :files ("dist" "*.el"))
|
:straight (:host github :repo "zerolfx/copilot.el" :files ("dist" "*.el"))
|
||||||
:ensure t)
|
:ensure t)
|
||||||
;; you can utilize :map :hook and :config to customize copilot
|
;; you can utilize :map :hook and :config to customize copilot
|
||||||
|
(add-hook 'prog-mode-hook 'copilot-mode)
|
||||||
(add-hook 'prog-mode-hook 'copilot-mode)
|
(define-key copilot-completion-map (kbd "<tab>") 'copilot-accept-completion)
|
||||||
(define-key copilot-completion-map (kbd "<tab>") 'copilot-accept-completion)
|
(define-key copilot-completion-map (kbd "TAB") 'copilot-accept-completion))
|
||||||
(define-key copilot-completion-map (kbd "TAB") 'copilot-accept-completion)
|
|
||||||
|
|
||||||
(provide 'thwap-copilot)
|
(provide 'thwap-copilot)
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
|
|
||||||
(straight-use-package 'go-mode)
|
(when thwap-dev-enable-go
|
||||||
|
(straight-use-package 'go-mode)
|
||||||
|
(straight-use-package 'eglot)
|
||||||
|
(setq lsp-go-analyses '((shadow . t)
|
||||||
|
(simplifycompositelit . :json-false)))
|
||||||
|
(when (executable-find "gopls")
|
||||||
|
(add-hook 'go-mode-hook #'lsp-deferred)
|
||||||
|
(add-hook 'go-mode-hook 'eglot-ensure))
|
||||||
|
(when (executable-find "goimports")
|
||||||
|
(setq gofmt-command "goimports"))
|
||||||
|
(add-hook 'before-save-hook 'gofmt-before-save))
|
||||||
|
|
||||||
(setq lsp-go-analyses '((shadow . t)
|
|
||||||
(simplifycompositelit . :json-false)))
|
|
||||||
|
|
||||||
|
|
||||||
(when (executable-find "gopls")
|
|
||||||
(setq gofmt-command "goimports")
|
|
||||||
(add-hook 'go-mode-hook #'lsp-deferred)
|
|
||||||
(add-hook 'before-save-hook 'gofmt-before-save)
|
|
||||||
(add-hook 'go-mode-hook 'eglot-ensure))
|
|
||||||
|
|
||||||
(provide 'thwap-go)
|
(provide 'thwap-go)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
(when thwap-comp-enable-lsp
|
(when thwap-dev-enable-lsp
|
||||||
(straight-use-package 'lsp-mode)
|
(straight-use-package 'lsp-mode)
|
||||||
(straight-use-package 'lsp-ui)
|
(straight-use-package 'lsp-ui)
|
||||||
(straight-use-package 'lsp-treemacs)
|
(straight-use-package 'lsp-treemacs)
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
(add-hook 'python-mode-hook (lambda ()
|
(when thwap-dev-enable-python
|
||||||
(setq-local tab-width 2)))
|
(add-hook 'python-mode-hook (lambda ()
|
||||||
|
(setq-local tab-width 2)))
|
||||||
(add-hook 'python-mode-hook #'lsp-deferred)
|
(add-hook 'python-mode-hook #'lsp-deferred)
|
||||||
|
(when (executable-find "pylsp")
|
||||||
(when (executable-find "pylsp")
|
(add-hook 'python-mode-hook 'eglot-ensure))
|
||||||
(add-hook 'python-mode-hook 'eglot-ensure))
|
(use-package python-black
|
||||||
|
:demand t
|
||||||
(use-package python-black
|
:straight t
|
||||||
:demand t
|
:after python
|
||||||
:straight t
|
:hook (python-mode . python-black-on-save-mode)))
|
||||||
:after python
|
|
||||||
:hook (python-mode . python-black-on-save-mode))
|
|
||||||
|
|
||||||
(provide 'thwap-py)
|
(provide 'thwap-py)
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
(use-package terraform-mode
|
(when thwap-dev-enable-terraform
|
||||||
:straight t
|
(use-package terraform-mode
|
||||||
:demand t
|
:straight t
|
||||||
:init
|
:demand t
|
||||||
(custom-set-variables
|
:init
|
||||||
'(terraform-indent-level 2)
|
(custom-set-variables
|
||||||
'(terraform-format-on-save t))
|
'(terraform-indent-level 2)
|
||||||
|
'(terraform-format-on-save t))
|
||||||
(when (executable-find "terraform-ls")
|
(when (executable-find "terraform-ls")
|
||||||
(add-hook 'terraform-mode-hook 'eglot-ensure))
|
(add-hook 'terraform-mode-hook 'eglot-ensure))
|
||||||
:config
|
:config
|
||||||
(require 'eglot)
|
(straight-use-package 'eglot)
|
||||||
(add-to-list 'eglot-server-programs
|
(require 'eglot)
|
||||||
`(terraform-mode . ("terraform-ls" "serve"))))
|
(add-to-list 'eglot-server-programs
|
||||||
|
`(terraform-mode . ("terraform-ls" "serve"))))
|
||||||
(add-hook 'terraform-mode-hook #'lsp-deferred)
|
(add-hook 'terraform-mode-hook #'lsp-deferred))
|
||||||
|
|
||||||
(provide 'thwap-tf)
|
(provide 'thwap-tf)
|
||||||
|
Loading…
Reference in New Issue
Block a user