Added LSP to emacs

This commit is contained in:
Luka Jankovic 2025-01-04 13:41:21 +01:00
parent f85894d474
commit 3332337582

View file

@ -67,7 +67,6 @@
:hook (vterm-mode . (lambda () (display-line-numbers-mode -1)))) :hook (vterm-mode . (lambda () (display-line-numbers-mode -1))))
(use-package toggle-term (use-package toggle-term
:ensure t
:bind (("M-\\" . toggle-term-vterm)) :bind (("M-\\" . toggle-term-vterm))
:config :config
(setq toggle-term-size 25) (setq toggle-term-size 25)
@ -104,6 +103,9 @@
(setq delete-by-moving-to-trash t) (setq delete-by-moving-to-trash t)
(setq dired-listing-switches (setq dired-listing-switches
"-l --almost-all --human-readable --group-directories-first --no-group") "-l --almost-all --human-readable --group-directories-first --no-group")
(setq dired-mouse-drag-files t) ; added in Emacs 29
(setq mouse-drag-and-drop-region-cross-program t) ; added in Emacs 29
(setq dirvish-default-layout '(0 0 0))
:bind ; Bind `dirvish|dirvish-side|dirvish-dwim' as you see fit :bind ; Bind `dirvish|dirvish-side|dirvish-dwim' as you see fit
(("M-f" . dirvish-side) (("M-f" . dirvish-side)
:map dirvish-mode-map ; Dirvish inherits `dired-mode-map' :map dirvish-mode-map ; Dirvish inherits `dired-mode-map'
@ -148,8 +150,44 @@
(setq-default mode-line-format (list "%_")) (setq-default mode-line-format (list "%_"))
(setq mode-line-format (list "%_")))) (setq mode-line-format (list "%_"))))
;; LSP
(use-package lsp-mode
:ensure t
:demand t
:hook
(c-mode . lsp)
:commands lsp)
(use-package lsp-ui
:ensure t
:demand t
:commands lsp-ui-mode)
;; Projectile
(use-package projectile
:ensure t
:demand t
:)
;;; Other ;;; Other
;; TODO:
;;
;; Projectile + vertico/ivy?
;; Indent lines
;; Treesitter?
;;
;; Minimap
;; Window
(setq initial-frame-alist
(append initial-frame-alist
'((width . 100)
(height . 50))))
;; Backups
(setq backup-directory-alist `(("." . "/tmp")))
;; Line numbers ;; Line numbers
(setq-default display-line-numbers-width 5) (setq-default display-line-numbers-width 5)
(global-display-line-numbers-mode) (global-display-line-numbers-mode)
@ -204,3 +242,7 @@
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(warning-suppress-types '((use-package) (use-package)))) '(warning-suppress-types '((use-package) (use-package))))
;; LSP
(add-to-list 'load-path (expand-file-name "lib/lsp-mode" user-emacs-directory))
(add-to-list 'load-path (expand-file-name "lib/lsp-mode/clients" user-emacs-directory))