mirror of
https://github.com/Horhik/dotfiles.git
synced 2024-11-25 17:41:32 +00:00
add lsp
This commit is contained in:
parent
ec1cd5a713
commit
04f7734100
|
@ -567,3 +567,4 @@
|
||||||
(treemacs-load-theme 'Material)
|
(treemacs-load-theme 'Material)
|
||||||
|
|
||||||
(find-file "~/.emacs.d/startup.org")
|
(find-file "~/.emacs.d/startup.org")
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
; '(custom-safe-themes
|
; '(custom-safe-themes
|
||||||
; '("6b5c518d1c250a8ce17463b7e435e9e20faa84f3f7defba8b579d4f5925f60c1" "75b8719c741c6d7afa290e0bb394d809f0cc62045b93e1d66cd646907f8e6d43" "7661b762556018a44a29477b84757994d8386d6edee909409fabe0631952dad9" default))
|
; '("6b5c518d1c250a8ce17463b7e435e9e20faa84f3f7defba8b579d4f5925f60c1" "75b8719c741c6d7afa290e0bb394d809f0cc62045b93e1d66cd646907f8e6d43" "7661b762556018a44a29477b84757994d8386d6edee909409fabe0631952dad9" default))
|
||||||
'(package-selected-packages
|
'(package-selected-packages
|
||||||
'(org-roam-server visual-fill-column org-bullets workgroups2 neotree treemacs-persp treemacs-magit treemacs-icons-dired treemacs-projectile treemacs-evil treemacs-all-the-icons ivy-rich which-key rainbow-delimiters highlight-parentheses org-roam general use-package)))
|
'(org-roam-server visual-fill-column org-bullets workgroups2 neotree treemacs-persp treemacs-magit treemacs-icons-dired treemacs-projectile treemacs-evil which-key rainbow-delimiters highlight-parentheses org-roam general use-package)))
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
@ -156,6 +156,27 @@
|
||||||
** Treemacs
|
** Treemacs
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package all-the-icons)
|
(use-package all-the-icons)
|
||||||
|
(use-package all-the-icons-ivy
|
||||||
|
:init (add-hook 'after-init-hook 'all-the-icons-ivy-setup))
|
||||||
|
(use-package ivy
|
||||||
|
:diminish
|
||||||
|
:bind (("C-s" . swiper)
|
||||||
|
:map ivy-minibuffer-map
|
||||||
|
("TAB" . ivy-alt-done)
|
||||||
|
("C-l" . ivy-alt-done)
|
||||||
|
("C-j" . ivy-next-line)
|
||||||
|
("C-k" . ivy-previous-line)
|
||||||
|
:map ivy-switch-buffer-map
|
||||||
|
("C-k" . ivy-previous-line)
|
||||||
|
("C-l" . ivy-done)
|
||||||
|
("C-d" . ivy-switch-buffer-kill)
|
||||||
|
:map ivy-reverse-i-search-map
|
||||||
|
("C-k" . ivy-previous-line)
|
||||||
|
("C-d" . ivy-reverse-i-search-kill))
|
||||||
|
:config
|
||||||
|
(ivy-mode 1)
|
||||||
|
)
|
||||||
|
|
||||||
(use-package treemacs-all-the-icons)
|
(use-package treemacs-all-the-icons)
|
||||||
(use-package treemacs
|
(use-package treemacs
|
||||||
:after all-the-icons
|
:after all-the-icons
|
||||||
|
@ -343,7 +364,10 @@
|
||||||
|
|
||||||
* Evil Mode
|
* Evil Mode
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package undo-tree)
|
(use-package undo-tree
|
||||||
|
:init
|
||||||
|
(global-undo-tree-mode)
|
||||||
|
)
|
||||||
(use-package evil
|
(use-package evil
|
||||||
:init
|
:init
|
||||||
(setq evil-want-keybinding nil)
|
(setq evil-want-keybinding nil)
|
||||||
|
@ -381,7 +405,7 @@
|
||||||
* Keybindings
|
* Keybindings
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
||||||
(use-package counsel)
|
|
||||||
(use-package ivy
|
(use-package ivy
|
||||||
:diminish
|
:diminish
|
||||||
:bind (
|
:bind (
|
||||||
|
@ -402,6 +426,12 @@
|
||||||
("C-d" . ivy-reverse-i-search-kill))
|
("C-d" . ivy-reverse-i-search-kill))
|
||||||
:init
|
:init
|
||||||
(ivy-mode 1))
|
(ivy-mode 1))
|
||||||
|
(use-package counsel
|
||||||
|
:bind (("C-M-j" . 'counsel-switch-buffer)
|
||||||
|
:map minibuffer-local-map
|
||||||
|
("C-r" . 'counsel-minibuffer-history))
|
||||||
|
:config
|
||||||
|
(counsel-mode 1))
|
||||||
(use-package counsel-projectile
|
(use-package counsel-projectile
|
||||||
:config (counsel-projectile-mode))
|
:config (counsel-projectile-mode))
|
||||||
|
|
||||||
|
@ -419,7 +449,7 @@
|
||||||
;; (add-to-map "<SPC> b" 'lusty-buffer-explorer)
|
;; (add-to-map "<SPC> b" 'lusty-buffer-explorer)
|
||||||
;;(add-to-map "<SPC> o" 'treemacs)
|
;;(add-to-map "<SPC> o" 'treemacs)
|
||||||
;;(add-to-map "<SPC> s" 'save-buffer)
|
;;(add-to-map "<SPC> s" 'save-buffer)
|
||||||
|
(add-to-map "TAB" 'company-indent-or-complete-common)
|
||||||
(defun open-file (file)
|
(defun open-file (file)
|
||||||
"just more shortest function for opening the file"
|
"just more shortest function for opening the file"
|
||||||
(interactive)
|
(interactive)
|
||||||
|
@ -443,7 +473,7 @@
|
||||||
"f v" '(lambda() (interactive) (find-file "~/.config/nvim/init.vim" :which-key "neovim config" ))
|
"f v" '(lambda() (interactive) (find-file "~/.config/nvim/init.vim" :which-key "neovim config" ))
|
||||||
"f d" '(lambda() (interactive) (find-file "~/dotfiles/home" :which-key "dotfiles dired" ))
|
"f d" '(lambda() (interactive) (find-file "~/dotfiles/home" :which-key "dotfiles dired" ))
|
||||||
"f a" '(lambda() (interactive) (find-file "~/.config/alacritty/alacritty.yml" :which-key "alacritty"))
|
"f a" '(lambda() (interactive) (find-file "~/.config/alacritty/alacritty.yml" :which-key "alacritty"))
|
||||||
"f b" '(lambda() (interactive) (find-file "~/Brain") :which-key "my brain")
|
"f b" '(lambda() (interactive) (find-file "~/Notes") :which-key "my brain")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -467,6 +497,22 @@
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
** Company-mode
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package company
|
||||||
|
:after lsp-mode
|
||||||
|
:hook (lsp-mode . company-mode)
|
||||||
|
:bind (:map company-active-map
|
||||||
|
("<tab>" . company-complete-selection))
|
||||||
|
(:map lsp-mode-map
|
||||||
|
("<tab>" . company-indent-or-complete-common))
|
||||||
|
:custom
|
||||||
|
(company-minimum-prefix-length 1)
|
||||||
|
(company-idle-delay 0.0))
|
||||||
|
|
||||||
|
(use-package company-box
|
||||||
|
:hook (company-mode . company-box-mode))
|
||||||
|
#+end_src
|
||||||
#+RESULTS:
|
#+RESULTS:
|
||||||
|
|
||||||
* Org
|
* Org
|
||||||
|
@ -526,7 +572,7 @@
|
||||||
:hook ((org-mode . my/org-mode-setup)
|
:hook ((org-mode . my/org-mode-setup)
|
||||||
(org-mode . variable-pitch-mode)
|
(org-mode . variable-pitch-mode)
|
||||||
)
|
)
|
||||||
:config (setq org-agenda-files `("~/Brain" "~/Brain/Tasks/Tasks.org"))
|
:config (setq org-agenda-files `("~/Notes" "~/Notes/Tasks/Tasks.org"))
|
||||||
(org-bullets-mode t)
|
(org-bullets-mode t)
|
||||||
(org-indent-mode t)
|
(org-indent-mode t)
|
||||||
(setq org-ellipsis " ▸" org-hide-emphasis-markers t org-src-fontify-natively t
|
(setq org-ellipsis " ▸" org-hide-emphasis-markers t org-src-fontify-natively t
|
||||||
|
@ -683,7 +729,7 @@
|
||||||
"b h" '(org-roam-buffer-deactivate :which-key "roam buffer hide ")
|
"b h" '(org-roam-buffer-deactivate :which-key "roam buffer hide ")
|
||||||
"s" '(org-roam-server-mode :which-key "roam server "))
|
"s" '(org-roam-server-mode :which-key "roam server "))
|
||||||
:custom
|
:custom
|
||||||
(org-roam-directory "~/Brain")
|
(org-roam-directory "~/Notes")
|
||||||
:config
|
:config
|
||||||
(setq
|
(setq
|
||||||
org-roam-server-host "127.0.0.1"
|
org-roam-server-host "127.0.0.1"
|
||||||
|
@ -712,3 +758,61 @@
|
||||||
|
|
||||||
#+RESULTS:
|
#+RESULTS:
|
||||||
: org-roam-protocol
|
: org-roam-protocol
|
||||||
|
|
||||||
|
* Languages
|
||||||
|
** Flycheck
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package flycheck
|
||||||
|
:init
|
||||||
|
(flycheck-set-checker-executable "c/c++-clang" "~/code/competitive/clang++")
|
||||||
|
)
|
||||||
|
(use-package flycheck-irony
|
||||||
|
:after flycheck
|
||||||
|
(add-hook 'flycheck-mode-hook #'flycheck-irony-setup)
|
||||||
|
)
|
||||||
|
#+end_src
|
||||||
|
** LSP
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package lsp-mode
|
||||||
|
:hook ((prog-mode). lsp)
|
||||||
|
:init
|
||||||
|
(setq lsp-keymap-prefix "C-SPC c")
|
||||||
|
(setq lsp-client-packages nil
|
||||||
|
:config
|
||||||
|
(lsp-mode . lsp-enable-which-key-integration)
|
||||||
|
:commands (lsp lsp-deferred)
|
||||||
|
)
|
||||||
|
(use-package lsp-treemacs
|
||||||
|
:after lsp-mode
|
||||||
|
)
|
||||||
|
(use-package lsp-ivy)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** C/CPP
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package irony
|
||||||
|
:init
|
||||||
|
(add-hook 'c++-mode-hook 'irony-mode)
|
||||||
|
(add-hook 'c-mode-hook 'irony-mode)
|
||||||
|
(add-hook 'objc-mode-hook 'irony-mode)
|
||||||
|
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
|
||||||
|
|
||||||
|
)
|
||||||
|
#+end_src
|
||||||
|
** Markdown
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package markdown-mode)
|
||||||
|
#+end_src
|
||||||
|
** Ocaml
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package tuareg)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
** Nix
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package direnv
|
||||||
|
:config
|
||||||
|
(direnv-mode))
|
||||||
|
(add-hook 'lsp-mode-hook #'direnv-update-environment)
|
||||||
|
#+end_src
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
; '(custom-safe-themes
|
; '(custom-safe-themes
|
||||||
; '("6b5c518d1c250a8ce17463b7e435e9e20faa84f3f7defba8b579d4f5925f60c1" "75b8719c741c6d7afa290e0bb394d809f0cc62045b93e1d66cd646907f8e6d43" "7661b762556018a44a29477b84757994d8386d6edee909409fabe0631952dad9" default))
|
; '("6b5c518d1c250a8ce17463b7e435e9e20faa84f3f7defba8b579d4f5925f60c1" "75b8719c741c6d7afa290e0bb394d809f0cc62045b93e1d66cd646907f8e6d43" "7661b762556018a44a29477b84757994d8386d6edee909409fabe0631952dad9" default))
|
||||||
'(package-selected-packages
|
'(package-selected-packages
|
||||||
'(org-roam-server visual-fill-column org-bullets workgroups2 neotree treemacs-persp treemacs-magit treemacs-icons-dired treemacs-projectile treemacs-evil treemacs-all-the-icons ivy-rich which-key rainbow-delimiters highlight-parentheses org-roam general use-package)))
|
'(org-roam-server visual-fill-column org-bullets workgroups2 neotree treemacs-persp treemacs-magit treemacs-icons-dired treemacs-projectile treemacs-evil which-key rainbow-delimiters highlight-parentheses org-roam general use-package)))
|
||||||
|
|
||||||
(use-package doom-modeline
|
(use-package doom-modeline
|
||||||
:init
|
:init
|
||||||
|
@ -88,6 +88,27 @@
|
||||||
:hook (prog-mode . rainbow-delimiters-mode))
|
:hook (prog-mode . rainbow-delimiters-mode))
|
||||||
|
|
||||||
(use-package all-the-icons)
|
(use-package all-the-icons)
|
||||||
|
(use-package all-the-icons-ivy
|
||||||
|
:init (add-hook 'after-init-hook 'all-the-icons-ivy-setup))
|
||||||
|
(use-package ivy
|
||||||
|
:diminish
|
||||||
|
:bind (("C-s" . swiper)
|
||||||
|
:map ivy-minibuffer-map
|
||||||
|
("TAB" . ivy-alt-done)
|
||||||
|
("C-l" . ivy-alt-done)
|
||||||
|
("C-j" . ivy-next-line)
|
||||||
|
("C-k" . ivy-previous-line)
|
||||||
|
:map ivy-switch-buffer-map
|
||||||
|
("C-k" . ivy-previous-line)
|
||||||
|
("C-l" . ivy-done)
|
||||||
|
("C-d" . ivy-switch-buffer-kill)
|
||||||
|
:map ivy-reverse-i-search-map
|
||||||
|
("C-k" . ivy-previous-line)
|
||||||
|
("C-d" . ivy-reverse-i-search-kill))
|
||||||
|
:config
|
||||||
|
(ivy-mode 1)
|
||||||
|
)
|
||||||
|
|
||||||
(use-package treemacs-all-the-icons)
|
(use-package treemacs-all-the-icons)
|
||||||
(use-package treemacs
|
(use-package treemacs
|
||||||
:after all-the-icons
|
:after all-the-icons
|
||||||
|
@ -262,7 +283,10 @@
|
||||||
|
|
||||||
(treemacs-load-theme 'Material)
|
(treemacs-load-theme 'Material)
|
||||||
|
|
||||||
(use-package undo-tree)
|
(use-package undo-tree
|
||||||
|
:init
|
||||||
|
(global-undo-tree-mode)
|
||||||
|
)
|
||||||
(use-package evil
|
(use-package evil
|
||||||
:init
|
:init
|
||||||
(setq evil-want-keybinding nil)
|
(setq evil-want-keybinding nil)
|
||||||
|
@ -291,7 +315,6 @@
|
||||||
:config
|
:config
|
||||||
(evil-collection-init))
|
(evil-collection-init))
|
||||||
|
|
||||||
(use-package counsel)
|
|
||||||
(use-package ivy
|
(use-package ivy
|
||||||
:diminish
|
:diminish
|
||||||
:bind (
|
:bind (
|
||||||
|
@ -312,6 +335,12 @@
|
||||||
("C-d" . ivy-reverse-i-search-kill))
|
("C-d" . ivy-reverse-i-search-kill))
|
||||||
:init
|
:init
|
||||||
(ivy-mode 1))
|
(ivy-mode 1))
|
||||||
|
(use-package counsel
|
||||||
|
:bind (("C-M-j" . 'counsel-switch-buffer)
|
||||||
|
:map minibuffer-local-map
|
||||||
|
("C-r" . 'counsel-minibuffer-history))
|
||||||
|
:config
|
||||||
|
(counsel-mode 1))
|
||||||
(use-package counsel-projectile
|
(use-package counsel-projectile
|
||||||
:config (counsel-projectile-mode))
|
:config (counsel-projectile-mode))
|
||||||
|
|
||||||
|
@ -329,7 +358,7 @@
|
||||||
;; (add-to-map "<SPC> b" 'lusty-buffer-explorer)
|
;; (add-to-map "<SPC> b" 'lusty-buffer-explorer)
|
||||||
;;(add-to-map "<SPC> o" 'treemacs)
|
;;(add-to-map "<SPC> o" 'treemacs)
|
||||||
;;(add-to-map "<SPC> s" 'save-buffer)
|
;;(add-to-map "<SPC> s" 'save-buffer)
|
||||||
|
(add-to-map "TAB" 'company-indent-or-complete-common)
|
||||||
(defun open-file (file)
|
(defun open-file (file)
|
||||||
"just more shortest function for opening the file"
|
"just more shortest function for opening the file"
|
||||||
(interactive)
|
(interactive)
|
||||||
|
@ -353,7 +382,7 @@
|
||||||
"f v" '(lambda() (interactive) (find-file "~/.config/nvim/init.vim" :which-key "neovim config" ))
|
"f v" '(lambda() (interactive) (find-file "~/.config/nvim/init.vim" :which-key "neovim config" ))
|
||||||
"f d" '(lambda() (interactive) (find-file "~/dotfiles/home" :which-key "dotfiles dired" ))
|
"f d" '(lambda() (interactive) (find-file "~/dotfiles/home" :which-key "dotfiles dired" ))
|
||||||
"f a" '(lambda() (interactive) (find-file "~/.config/alacritty/alacritty.yml" :which-key "alacritty"))
|
"f a" '(lambda() (interactive) (find-file "~/.config/alacritty/alacritty.yml" :which-key "alacritty"))
|
||||||
"f b" '(lambda() (interactive) (find-file "~/Brain") :which-key "my brain")
|
"f b" '(lambda() (interactive) (find-file "~/Notes") :which-key "my brain")
|
||||||
)
|
)
|
||||||
|
|
||||||
(use-package which-key
|
(use-package which-key
|
||||||
|
@ -366,6 +395,20 @@
|
||||||
:init
|
:init
|
||||||
(ivy-rich-mode 1))
|
(ivy-rich-mode 1))
|
||||||
|
|
||||||
|
(use-package company
|
||||||
|
:after lsp-mode
|
||||||
|
:hook (lsp-mode . company-mode)
|
||||||
|
:bind (:map company-active-map
|
||||||
|
("<tab>" . company-complete-selection))
|
||||||
|
(:map lsp-mode-map
|
||||||
|
("<tab>" . company-indent-or-complete-common))
|
||||||
|
:custom
|
||||||
|
(company-minimum-prefix-length 1)
|
||||||
|
(company-idle-delay 0.0))
|
||||||
|
|
||||||
|
(use-package company-box
|
||||||
|
:hook (company-mode . company-box-mode))
|
||||||
|
|
||||||
(set-face-attribute 'variable-pitch nil
|
(set-face-attribute 'variable-pitch nil
|
||||||
;; :font "Cantarell"
|
;; :font "Cantarell"
|
||||||
:font "Hack"
|
:font "Hack"
|
||||||
|
@ -410,7 +453,7 @@
|
||||||
:hook ((org-mode . my/org-mode-setup)
|
:hook ((org-mode . my/org-mode-setup)
|
||||||
(org-mode . variable-pitch-mode)
|
(org-mode . variable-pitch-mode)
|
||||||
)
|
)
|
||||||
:config (setq org-agenda-files `("~/Brain" "~/Brain/Tasks/Tasks.org"))
|
:config (setq org-agenda-files `("~/Notes" "~/Notes/Tasks/Tasks.org"))
|
||||||
(org-bullets-mode t)
|
(org-bullets-mode t)
|
||||||
(org-indent-mode t)
|
(org-indent-mode t)
|
||||||
(setq org-ellipsis " ▸" org-hide-emphasis-markers t org-src-fontify-natively t
|
(setq org-ellipsis " ▸" org-hide-emphasis-markers t org-src-fontify-natively t
|
||||||
|
@ -551,7 +594,7 @@
|
||||||
"b h" '(org-roam-buffer-deactivate :which-key "roam buffer hide ")
|
"b h" '(org-roam-buffer-deactivate :which-key "roam buffer hide ")
|
||||||
"s" '(org-roam-server-mode :which-key "roam server "))
|
"s" '(org-roam-server-mode :which-key "roam server "))
|
||||||
:custom
|
:custom
|
||||||
(org-roam-directory "~/Brain")
|
(org-roam-directory "~/Notes")
|
||||||
:config
|
:config
|
||||||
(setq
|
(setq
|
||||||
org-roam-server-host "127.0.0.1"
|
org-roam-server-host "127.0.0.1"
|
||||||
|
@ -575,3 +618,42 @@
|
||||||
|
|
||||||
|
|
||||||
(require 'org-roam-protocol)
|
(require 'org-roam-protocol)
|
||||||
|
|
||||||
|
(use-package flycheck
|
||||||
|
:init
|
||||||
|
(flycheck-set-checker-executable "c/c++-clang" "~/code/competitive/clang++")
|
||||||
|
)
|
||||||
|
(use-package flycheck-irony
|
||||||
|
:after flycheck
|
||||||
|
(add-hook 'flycheck-mode-hook #'flycheck-irony-setup)
|
||||||
|
)
|
||||||
|
|
||||||
|
(use-package lsp-mode
|
||||||
|
:init
|
||||||
|
(setq lsp-keymap-prefix "C-SPC c")
|
||||||
|
:config
|
||||||
|
(lsp-mode . lsp-enable-which-key-integration)
|
||||||
|
:commands (lsp lsp-deferred)
|
||||||
|
)
|
||||||
|
(use-package lsp-treemacs
|
||||||
|
:after lsp-mode
|
||||||
|
)
|
||||||
|
(use-package lsp-ivy)
|
||||||
|
|
||||||
|
(use-package irony
|
||||||
|
:init
|
||||||
|
(add-hook 'c++-mode-hook 'irony-mode)
|
||||||
|
(add-hook 'c-mode-hook 'irony-mode)
|
||||||
|
(add-hook 'objc-mode-hook 'irony-mode)
|
||||||
|
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
(use-package markdown-mode)
|
||||||
|
|
||||||
|
(use-package tuareg)
|
||||||
|
|
||||||
|
(use-package direnv
|
||||||
|
:config
|
||||||
|
(direnv-mode))
|
||||||
|
(add-hook 'lsp-mode-hook #'direnv-update-environment)
|
||||||
|
|
Loading…
Reference in a new issue