Added a bunch of packages, including eglot (LSP client), powerline (cool powerline) and others
This commit is contained in:
parent
80bed3a2ce
commit
2054d46570
2 changed files with 230 additions and 16 deletions
|
|
@ -321,10 +321,17 @@ A->B
|
|||
(setq python-shell-completion-native-enable nil)
|
||||
|
||||
(let* ((wanted-packages
|
||||
'(flycheck
|
||||
company
|
||||
org-appear
|
||||
org-fragtog))
|
||||
'(flycheck ; grammar
|
||||
flycheck-grammalecte ; grammar
|
||||
company ; auto-complete
|
||||
org-appear ; org emphasis appear
|
||||
org-fragtog ; see latex fragment in org
|
||||
use-package
|
||||
eglot ; LSP client
|
||||
counsel ; ivy autocomplete for M-x
|
||||
eldoc-box ; adding popup for eldoc
|
||||
powerline ; A cool powerline
|
||||
))
|
||||
(missing-wanted-packages (remove-if #'package-installed-p wanted-packages)))
|
||||
(when missing-wanted-packages
|
||||
(message "Missing wanted packages: %s" missing-wanted-packages)
|
||||
|
|
@ -333,7 +340,8 @@ A->B
|
|||
(package-install pkg)
|
||||
(message "Wanted package %s has been installed" pkg))))
|
||||
|
||||
(global-company-mode)
|
||||
(require 'powerline)
|
||||
(powerline-default-theme)
|
||||
|
||||
;; When loading org-mode turns off auto-fill-mode
|
||||
(add-hook 'org-mode-hook 'turn-off-auto-fill)
|
||||
|
|
@ -344,14 +352,38 @@ A->B
|
|||
|
||||
(add-hook 'org-mode-hook 'org-fragtog-mode)
|
||||
|
||||
(global-company-mode)
|
||||
|
||||
(ivy-mode 1)
|
||||
|
||||
(setq ivy-use-virtual-buffers t)
|
||||
(setq ivy-count-format "(%d/%d) ")
|
||||
|
||||
; Enables LSP for the provided languages
|
||||
(require 'use-package)
|
||||
|
||||
(use-package eglot
|
||||
:defer t
|
||||
:commands (eglot eglot-ensure)
|
||||
:hook
|
||||
((ess-mode . eglot-ensure))
|
||||
:config
|
||||
(setq eglot-stay-out-of '(company))
|
||||
;(add-to-list 'eglot-server-programs '((c-mode c++-mode) "clangd-10"))
|
||||
)
|
||||
|
||||
(with-eval-after-load 'eglot
|
||||
(add-to-list 'eglot-server-programs
|
||||
'(ess-mode . ("R" "--slave" "-e" "languageserver::run()"))))
|
||||
|
||||
(require 'eldoc-box)
|
||||
(add-hook 'eglot-managed-mode-hook #'eldoc-box-hover-mode t)
|
||||
|
||||
(load-theme 'leuven t)
|
||||
(custom-set-variables
|
||||
;; custom-set-variables was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(org-format-latex-options
|
||||
'(:foreground default :background default :scale 1.5 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers
|
||||
("begin" "$1" "$" "$$" "\\(" "\\[")))
|
||||
'(package-selected-packages
|
||||
'(org-fragtog org-appear magit htmlize flycheck ess company auctex)))
|
||||
'(powerline cmake-mode use-package treemacs-tab-bar treemacs-projectile treemacs-persp treemacs-magit treemacs-icons-dired treemacs-evil org-fragtog org-appear lsp-pyright htmlize helm flycheck-grammalecte ess eldoc-box eglot counsel company auctex)))
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
# -*- mode: org -*-
|
||||
#+TITLE: Emacs init file written in org-mode
|
||||
#+AUTHOR: Arnaud Legrand, Konrad Hinsen
|
||||
|
|
@ -508,10 +509,17 @@ This often fails, yielding an ugly warning, and isn't of any use in Org-mode any
|
|||
** Installing wanted packages
|
||||
#+begin_src emacs-lisp :tangle init.el
|
||||
(let* ((wanted-packages
|
||||
'(flycheck
|
||||
company
|
||||
org-appear
|
||||
org-fragtog))
|
||||
'(flycheck ; grammar
|
||||
flycheck-grammalecte ; grammar
|
||||
company ; auto-complete
|
||||
org-appear ; org emphasis appear
|
||||
org-fragtog ; see latex fragment in org
|
||||
use-package
|
||||
eglot ; LSP client
|
||||
counsel ; ivy autocomplete for M-x
|
||||
eldoc-box ; adding popup for eldoc
|
||||
powerline ; A cool powerline
|
||||
))
|
||||
(missing-wanted-packages (remove-if #'package-installed-p wanted-packages)))
|
||||
(when missing-wanted-packages
|
||||
(message "Missing wanted packages: %s" missing-wanted-packages)
|
||||
|
|
@ -520,9 +528,27 @@ This often fails, yielding an ugly warning, and isn't of any use in Org-mode any
|
|||
(package-install pkg)
|
||||
(message "Wanted package %s has been installed" pkg))))
|
||||
#+end_src
|
||||
** Global enable Company-mode :completion:
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
; :tangle init.el
|
||||
;; Install straight.el
|
||||
(defvar bootstrap-version)
|
||||
(let ((bootstrap-file
|
||||
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
||||
(bootstrap-version 5))
|
||||
(unless (file-exists-p bootstrap-file)
|
||||
(with-current-buffer
|
||||
(url-retrieve-synchronously
|
||||
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
|
||||
'silent 'inhibit-cookies)
|
||||
(goto-char (point-max))
|
||||
(eval-print-last-sexp)))
|
||||
(load bootstrap-file nil 'nomessage))
|
||||
#+end_src
|
||||
** Powerline
|
||||
#+begin_src emacs-lisp :tangle init.el
|
||||
(global-company-mode)
|
||||
(require 'powerline)
|
||||
(powerline-default-theme)
|
||||
#+end_src
|
||||
** Disabling auto-fill-mode when using org
|
||||
This snippet disables the auto-fill-mode which wraps the line when it exceeds a certain length
|
||||
|
|
@ -543,7 +569,7 @@ This mode makes the emphasis markers appear when the cursor is on it
|
|||
#+begin_src emacs-lisp :tangle init.el
|
||||
(add-hook 'org-mode-hook 'org-fragtog-mode)
|
||||
#+end_src
|
||||
** Remote image display
|
||||
** Remote image display :disabled:
|
||||
This code was taken from https://emacs.stackexchange.com/questions/42281/org-mode-is-it-possible-to-display-online-images and makes use of the =org-yt= package.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
|
|
@ -569,6 +595,162 @@ This code was taken from https://emacs.stackexchange.com/questions/42281/org-mod
|
|||
"imghttps"
|
||||
:image-data-fun #'org-image-link)
|
||||
#+end_src
|
||||
** Global enable Company-mode :completion:
|
||||
#+begin_src emacs-lisp :tangle init.el
|
||||
(global-company-mode)
|
||||
#+end_src
|
||||
** Ivy for Emacs command completion
|
||||
#+begin_src emacs-lisp :tangle init.el
|
||||
(ivy-mode 1)
|
||||
|
||||
(setq ivy-use-virtual-buffers t)
|
||||
(setq ivy-count-format "(%d/%d) ")
|
||||
#+end_src
|
||||
** LSP and other IDE features
|
||||
*** Enabling eglot and adding ess-mode lsp
|
||||
Language Server Protocol (LSP) provides intellisense completion and other nice features of VS Code.
|
||||
#+begin_src emacs-lisp :tangle init.el
|
||||
; Enables LSP for the provided languages
|
||||
(require 'use-package)
|
||||
|
||||
(use-package eglot
|
||||
:defer t
|
||||
:commands (eglot eglot-ensure)
|
||||
:hook
|
||||
((ess-mode . eglot-ensure))
|
||||
:config
|
||||
(setq eglot-stay-out-of '(company))
|
||||
;(add-to-list 'eglot-server-programs '((c-mode c++-mode) "clangd-10"))
|
||||
)
|
||||
|
||||
(with-eval-after-load 'eglot
|
||||
(add-to-list 'eglot-server-programs
|
||||
'(ess-mode . ("R" "--slave" "-e" "languageserver::run()"))))
|
||||
|
||||
#+end_src
|
||||
*** Floating pop-up for eldoc
|
||||
#+begin_src emacs-lisp :tangle init.el
|
||||
(require 'eldoc-box)
|
||||
(add-hook 'eglot-managed-mode-hook #'eldoc-box-hover-mode t)
|
||||
#+end_src
|
||||
** Treemacs :disabled:
|
||||
#+begin_src emacs-lisp
|
||||
;:tangle init.el
|
||||
(use-package treemacs
|
||||
:ensure t
|
||||
:defer t
|
||||
:init
|
||||
(with-eval-after-load 'winum
|
||||
(define-key winum-keymap (kbd "M-0") #'treemacs-select-window))
|
||||
:config
|
||||
(progn
|
||||
(setq treemacs-collapse-dirs (if treemacs-python-executable 3 0)
|
||||
treemacs-deferred-git-apply-delay 0.5
|
||||
treemacs-directory-name-transformer #'identity
|
||||
treemacs-display-in-side-window t
|
||||
treemacs-eldoc-display 'simple
|
||||
treemacs-file-event-delay 2000
|
||||
treemacs-file-extension-regex treemacs-last-period-regex-value
|
||||
treemacs-file-follow-delay 0.2
|
||||
treemacs-file-name-transformer #'identity
|
||||
treemacs-follow-after-init t
|
||||
treemacs-expand-after-init t
|
||||
treemacs-find-workspace-method 'find-for-file-or-pick-first
|
||||
treemacs-git-command-pipe ""
|
||||
treemacs-goto-tag-strategy 'refetch-index
|
||||
treemacs-header-scroll-indicators '(nil . "^^^^^^")
|
||||
treemacs-hide-dot-git-directory t
|
||||
treemacs-indentation 2
|
||||
treemacs-indentation-string " "
|
||||
treemacs-is-never-other-window nil
|
||||
treemacs-max-git-entries 5000
|
||||
treemacs-missing-project-action 'ask
|
||||
treemacs-move-forward-on-expand nil
|
||||
treemacs-no-png-images nil
|
||||
treemacs-no-delete-other-windows t
|
||||
treemacs-project-follow-cleanup nil
|
||||
treemacs-persist-file (expand-file-name ".cache/treemacs-persist" user-emacs-directory)
|
||||
treemacs-position 'left
|
||||
treemacs-read-string-input 'from-child-frame
|
||||
treemacs-recenter-distance 0.1
|
||||
treemacs-recenter-after-file-follow nil
|
||||
treemacs-recenter-after-tag-follow nil
|
||||
treemacs-recenter-after-project-jump 'always
|
||||
treemacs-recenter-after-project-expand 'on-distance
|
||||
treemacs-litter-directories '("/node_modules" "/.venv" "/.cask")
|
||||
treemacs-project-follow-into-home nil
|
||||
treemacs-show-cursor nil
|
||||
treemacs-show-hidden-files t
|
||||
treemacs-silent-filewatch nil
|
||||
treemacs-silent-refresh nil
|
||||
treemacs-sorting 'alphabetic-asc
|
||||
treemacs-select-when-already-in-treemacs 'move-back
|
||||
treemacs-space-between-root-nodes t
|
||||
treemacs-tag-follow-cleanup t
|
||||
treemacs-tag-follow-delay 1.5
|
||||
treemacs-text-scale nil
|
||||
treemacs-user-mode-line-format nil
|
||||
treemacs-user-header-line-format nil
|
||||
treemacs-wide-toggle-width 70
|
||||
treemacs-width 35
|
||||
treemacs-width-increment 1
|
||||
treemacs-width-is-initially-locked t
|
||||
treemacs-workspace-switch-cleanup nil)
|
||||
|
||||
;; The default width and height of the icons is 22 pixels. If you are
|
||||
;; using a Hi-DPI display, uncomment this to double the icon size.
|
||||
;;(treemacs-resize-icons 44)
|
||||
|
||||
(treemacs-follow-mode t)
|
||||
(treemacs-filewatch-mode t)
|
||||
(treemacs-fringe-indicator-mode 'always)
|
||||
(when treemacs-python-executable
|
||||
(treemacs-git-commit-diff-mode t))
|
||||
|
||||
(pcase (cons (not (null (executable-find "git")))
|
||||
(not (null treemacs-python-executable)))
|
||||
(`(t . t)
|
||||
(treemacs-git-mode 'deferred))
|
||||
(`(t . _)
|
||||
(treemacs-git-mode 'simple)))
|
||||
|
||||
(treemacs-hide-gitignored-files-mode nil))
|
||||
:bind
|
||||
(:map global-map
|
||||
("M-0" . treemacs-select-window)
|
||||
("C-x t 1" . treemacs-delete-other-windows)
|
||||
("C-x t t" . treemacs)
|
||||
("C-x t d" . treemacs-select-directory)
|
||||
("C-x t B" . treemacs-bookmark)
|
||||
("C-x t C-t" . treemacs-find-file)
|
||||
("C-x t M-t" . treemacs-find-tag)))
|
||||
|
||||
(use-package treemacs-evil
|
||||
:after (treemacs evil)
|
||||
:ensure t)
|
||||
|
||||
(use-package treemacs-projectile
|
||||
:after (treemacs projectile)
|
||||
:ensure t)
|
||||
|
||||
(use-package treemacs-icons-dired
|
||||
:hook (dired-mode . treemacs-icons-dired-enable-once)
|
||||
:ensure t)
|
||||
|
||||
(use-package treemacs-magit
|
||||
:after (treemacs magit)
|
||||
:ensure t)
|
||||
|
||||
(use-package treemacs-persp ;;treemacs-perspective if you use perspective.el vs. persp-mode
|
||||
:after (treemacs persp-mode) ;;or perspective vs. persp-mode
|
||||
:ensure t
|
||||
:config (treemacs-set-scope-type 'Perspectives))
|
||||
|
||||
(use-package treemacs-tab-bar ;;treemacs-tab-bar if you use tab-bar-mode
|
||||
:after (treemacs)
|
||||
:ensure t
|
||||
:config (treemacs-set-scope-type 'Tabs))
|
||||
#+end_src
|
||||
* Theme
|
||||
** Activation du thème
|
||||
#+begin_src emacs-lisp :tangle init.el
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue