This commit is contained in:
Anthony Cicchetti 2021-02-26 13:20:20 -05:00
parent 53ea0624d5
commit 7081cbef4c
2 changed files with 104 additions and 48 deletions

25
emacs/custom/lsp.el Normal file
View file

@ -0,0 +1,25 @@
(use-package lsp-mode
:after (treemacs)
:init
(setq lsp-keymap-prefix "C-c l")
:hook (
;; (python-mode . lsp)
(lsp-mode . lsp-enable-which-key-integration))
:config
(setq lsp-enable-snippet nil)
:defer
(lsp-treemacs-sync-mode 1)
:commands lsp)
(use-package lsp-ui
:commands lsp-ui-mode)
(use-package lsp-pyright
:ensure t
:hook (python-mode . (lambda ()
(require 'lsp-pyright)
(lsp))))
(use-package rustic)
(provide 'lsp)

View file

@ -3,17 +3,20 @@
;;; Code:
(setq gc-cons-threshold (* 100 1024 1024))
(setq read-process-output-max (* 1024 1024))
(add-to-list 'load-path "~/.emacs.d/custom")
(require 'package)
(add-to-list 'package-archives
'(
"melpa" . "https://melpa.org/packages/") t)
'(
"melpa" . "https://melpa.org/packages/") t)
(add-to-list 'package-archives
'("org" . "https://orgmode.org/elpa/")
t)
'("org" . "https://orgmode.org/elpa/")
t)
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
(package-refresh-contents))
(unless (package-installed-p 'use-package)
(package-refresh-contents)
@ -33,6 +36,13 @@
(require 'use-package-ensure)
(setq use-package-always-ensure t)
;; Use UTF-8 pls
(prefer-coding-system 'utf-8)
(set-language-environment "UTF-8")
(setq locale-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(setq-default buffer-file-coding-system 'utf-8-unix)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
@ -48,12 +58,13 @@
'(evil-cross-lines t)
'(global-whitespace-mode t)
'(indent-tabs-mode nil)
'(inhibit-startup-screen t)
'(package-archives
'(("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/")))
'(package-selected-packages
'(flycheck origami groovy-mode avy editorconfig org-crypt tree-sitter-langs tree-sitter centaur-tabs dashboard page-break-lines wakatime-mode super-save ox-pandoc evil-surround evil-collection undo-tree toc-org evil-org org-plus-contrib evil-goggles evil-expat evil-commentary auto-package-update lispy smartparens which-key git-gutter rainbow-delimiters auto-complete-distel auto-complete evil magit evil-magit))
'(evil-lispy treemacs-magit treemacs-evil treemacs lsp-pyright lsp-ui rustic flycheck origami groovy-mode avy editorconfig org-crypt tree-sitter-langs tree-sitter centaur-tabs dashboard page-break-lines wakatime-mode super-save ox-pandoc evil-surround evil-collection undo-tree toc-org evil-org org-plus-contrib evil-goggles evil-expat evil-commentary auto-package-update lispy smartparens which-key git-gutter rainbow-delimiters auto-complete-distel auto-complete evil magit evil-magit))
'(ring-bell-function 'ignore)
'(undo-tree-auto-save-history t)
'(undo-tree-history-directory-alist '(("." . "~/.undohist-emacs")))
@ -79,10 +90,10 @@
;; auto-package-update
(use-package auto-package-update
:ensure t
:config
(setq auto-package-update-delete-old-versions t)
(auto-package-update-maybe))
:ensure t
:config
(setq auto-package-update-delete-old-versions t)
(auto-package-update-maybe))
;; Autocomplete
(use-package auto-complete
@ -92,7 +103,7 @@
(use-package base16-theme
:config (load-theme 'base16-hopscotch t))
(global-prettify-symbols-mode +1)
(global-prettify-symbols-mode 1)
;; Undo-tree
(use-package undo-tree
@ -101,20 +112,27 @@
;; EVIL
(use-package evil
:ensure t
:init
(setq evil-want-keybinding nil)
:config
(evil-mode 1))
:ensure t
:init
(setq evil-want-keybinding nil)
:config
(evil-mode 1))
(use-package evil-collection
:after evil
:ensure t
:config
(evil-collection-init))
:after evil
:ensure t
:config
(evil-collection-init))
(use-package evil-commentary
:ensure t)
:ensure t)
(use-package evil-lispy
:ensure t
:after (evil lispy)
:config
(add-hook 'emacs-lisp-mode-hook #'evil-lispy-mode)
(add-hook 'clojure-mode-hook #'evil-lispy-mode))
(use-package evil-expat
:ensure t)
@ -128,7 +146,7 @@
;; will be highlighed with `diff-removed` face which is typically
;; some red color (as defined by the color theme)
;; other faces such as `diff-added` will be used for other actions
(evil-goggles-use-diff-faces))
(evil-goggles-use-diff-faces))
(use-package evil-surround
:after evil
@ -154,6 +172,7 @@
(evil-define-key 'normal 'global (kbd "<leader>i") 'help)
(evil-define-key 'normal 'global (kbd "gc") 'evil-commentary)
(evil-define-key 'normal 'global (kbd "<leader>u") 'undo-tree-visualize)
(evil-define-key 'normal 'global (kbd "<leader> b") 'ibuffer)
;; Avy
(use-package avy
@ -180,7 +199,7 @@
;; Git gutter
(use-package git-gutter
:config (global-git-gutter-mode +1))
:config (global-git-gutter-mode 1))
;; Rainbow Delims
(use-package rainbow-delimiters
@ -189,7 +208,7 @@
;; Super Save
(use-package super-save
:config
(super-save-mode +1))
(super-save-mode 1))
;; EditorConfig
(use-package editorconfig
@ -202,8 +221,7 @@
;; :hook (after-init . global-wakatime-mode))
;; Groovy-mode
(use-package groovy-mode
)
(use-package groovy-mode)
;; Origamimode
(use-package origami
@ -230,15 +248,15 @@
(if (not (string-match "^aarch64-.*" system-configuration))
(progn
;; Tree-sitter
(use-package tree-sitter
:config
(global-tree-sitter-mode)
(add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode))
;; Tree-sitter
(use-package tree-sitter
:config
(global-tree-sitter-mode)
(add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode))
;; Tree-sitter-langs
(use-package tree-sitter-langs
:after (tree-sitter)))
;; Tree-sitter-langs
(use-package tree-sitter-langs
:after (tree-sitter)))
())
;; Org Mode
@ -250,22 +268,21 @@
(evil-define-key 'normal 'global (kbd "<leader> SPC a") 'org-agenda)
(evil-define-key 'normal 'global (kbd "<leader> SPC c") 'org-capture)
(evil-define-key 'normal 'global (kbd "<leader> SPC l") 'org-insert-link)
(evil-define-key 'normal 'global (kbd "g [") 'org-open-at-point)
)
(evil-define-key 'normal 'global (kbd "g [") 'org-open-at-point))
(use-package epa-file
:ensure nil
:config
(setq epa-file-encrypt-to '("anthony@anthonycicchetti.com"))
:custom
(epa-file-select-keys 'silent))
:ensure nil
:config
(setq epa-file-encrypt-to '("anthony@anthonycicchetti.com"))
:custom
(epa-file-select-keys 'silent))
(use-package org-crypt
:ensure nil ;; included with org-mode
:ensure nil ;; included with org-mode
:after org
:config
(org-crypt-use-before-save-magic)
(setq org-tags-exclude-from-inheritance (quote ("crypt")))
(setq org-tags-exclude-from-inheritance '("crypt"))
:custom
(org-crypt-key "anthony@anthonycicchetti.com"))
@ -282,11 +299,25 @@
(use-package flycheck
:init (global-flycheck-mode))
(use-package treemacs
:config
(setq treemacs-show-hidden-files t)
(treemacs-follow-mode t)
(evil-define-key 'normal 'global (kbd "<leader> i") 'treemacs))
(use-package treemacs-evil
:after (treemacs evil))
(use-package treemacs-magit
:after (treemacs magit))
(require 'lsp)
(progn
(setq whitespace-style (quote (face spaces tabs newline space-mark tab-mark newline-mark )))
(setq whitespace-style '(face spaces tabs newline space-mark tab-mark newline-mark))
(setq whitespace-display-mappings
(quote (
(space-mark 32 [8227] [183] [46])
(newline-mark 10 [172 10] [182 10])
(tab-mark 9 [8594 32 32 32] [8614])))))
'(
(space-mark 32 [8227] [183] [46])
(newline-mark 10 [172 10] [182 10])
(tab-mark 9 [8594 32 32 32] [8614]))))