Browse Source

Trying to set up LSP on Emacs now

master
Julio Biason 3 years ago
parent
commit
c2310fecf3
  1. 102
      emacs.d/init.el

102
emacs.d/init.el

@ -37,6 +37,15 @@
("\C-ca" . org-agenda)
("\C-cb" . org-iswtichb)))
;; LanguageServer
(use-package lsp-mode
:ensure t
:hook ((python-mode . lsp)
(rust-mode . lsp))
:commands lsp)
(use-package lsp-ui
:commands lsp-ui-mode
:ensure t)
;; Helm, for easy access to commands
; (use-package helm
@ -46,38 +55,9 @@
; (helm-mode))
; )
;; Evil
; (use-package evil
; :ensure t
; :after (helm)
; :config (progn
; (evil-mode 1)
; (define-key evil-normal-state-map (kbd "C-w <up>") 'evil-window-up)
; (define-key evil-normal-state-map (kbd "C-w <down>") 'evil-window-down)
; (define-key evil-normal-state-map (kbd "C-w <left>") 'evil-window-left)
; (define-key evil-normal-state-map (kbd "C-w <right>") 'evil-window-right)
; (define-key evil-normal-state-map (kbd "-") 'helm-find-files)
; )
; ; Evil-leader so we can use the leader key
; (use-package evil-leader
; :ensure t
; :config (progn (global-evil-leader-mode)
; (evil-leader/set-leader "<SPC>")
; (evil-leader/set-key
; "q" 'kill-buffer-and-window
; "w" 'save-buffer
; "o" 'helm-find-files
; "a" 'org-agenda)))
; ; Commentary to comment out code
; (use-package evil-commentary
; :ensure t
; :bind (:map evil-normal-state-map ("gc" . evil-commentary))
; )
; )
;; Markdown mode
; (use-package markdown-mode
; :ensure t)
(use-package markdown-mode
:ensure t)
;; install goto last change (opens the file in the last position)
; (use-package goto-last-change
@ -87,10 +67,10 @@
; (use-package fill-column-indicator
; :ensure t)
;; install powerline
;; powerline
(use-package powerline
:ensure t
:config (powerline-center-theme))
:ensure t
:config (powerline-center-theme))
;; colorschemes
(use-package doom-themes
@ -99,27 +79,10 @@
doom-themes-enable-italic t)
(load-theme 'doom-molokai t)
)
(menu-bar-mode 0)
(tool-bar-mode 0)
(show-paren-mode 1)
(require 'whitespace)
(setq whitespace-style '(face empty tabs lines-tail trailing))
(global-whitespace-mode t)
; (setq-default fill-column 80)
; (define-globalized-minor-mode global-fci-mode fci-mode (lambda () (fci-mode 1)))
; (global-fci-mode 1)
;; line numbers
(global-linum-mode 1)
(defun configure-linum-colors ()
(set-face-foreground 'linum "#555555"))
(configure-linum-colors)
(setq linum-format " %4d ")
;; highlights the current line
(use-package hlinum
:ensure t)
@ -127,17 +90,10 @@
(set-face-background 'linum-highlight-face nil)
(hlinum-activate)
;; display line and column in the statusbar
(line-number-mode 1)
(column-number-mode 1)
;; don't show startup messages
(setq inhibit-startup-message t)
(setq initial-scratch-message nil)
;; auto-pairs
(electric-pair-mode 1)
;; git gutters
(use-package diff-hl
:ensure t
@ -151,8 +107,38 @@
:ensure t
:config (editorconfig-mode 1))
(require 'whitespace)
(setq whitespace-style '(face empty tabs lines-tail trailing))
(global-whitespace-mode t)
;; auto-pairs
(electric-pair-mode 1)
;; disable the menubar and tabbar
(menu-bar-mode 0)
(tool-bar-mode 0)
;; highlight matching paren
(show-paren-mode 1)
;; display line and column in the statusbar
(line-number-mode 1)
(column-number-mode 1)
;; line numbers
(global-linum-mode 1)
(defun configure-linum-colors ()
(set-face-foreground 'linum "#555555"))
(configure-linum-colors)
;; redefine the format; otherwise, the number will get "glued" to the code.
(setq linum-format " %5d ")
;; answer questions with 'y' instead of full 'yes'
(defalias 'yes-or-no-p 'y-or-n-p)
;; Create backup files directly in the .Trash directory
(setq backup-directory-alist '((".*" . "~/.Trash")))
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.

Loading…
Cancel
Save