193 lines
5.9 KiB
Org Mode
193 lines
5.9 KiB
Org Mode
#+TITLE: IDE Configuration
|
|
|
|
* Intro
|
|
Packages/configurations that makes emacs more IDE-like, such as:
|
|
- like popup completions with LSP
|
|
- error checking on-the-fly
|
|
- tree-view file explorer
|
|
- git Integration
|
|
- tree-sitter based syntax highlighting
|
|
|
|
* Tree Sitter
|
|
Tree sitter highlighting in emacs.[[https://tree-sitter.github.io/tree-sitter/syntax-highlighting][
|
|
Tree-sitter Syntax Highlighting website]]
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(use-package tree-sitter
|
|
:config
|
|
(global-tree-sitter-mode))
|
|
(use-package tree-sitter-langs
|
|
:after tree-sitter)
|
|
|
|
#+end_src
|
|
|
|
* Magit
|
|
[[https://magit.vc][Git Interface for Emacs]]
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(use-package magit
|
|
:bind
|
|
("C-x g" . magit-status)
|
|
("C-x M-g" . magit-dispatch))
|
|
|
|
#+end_src
|
|
|
|
* Treemacs
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(use-package treemacs
|
|
:defer t
|
|
:init
|
|
(with-eval-after-load 'winum
|
|
(define-key winum-keymap (kbd "M-0") #'treemacs-select-window))
|
|
:config
|
|
(add-hook 'treemacs-mode-hook (lambda ()
|
|
(setq mode-line-format nil)
|
|
(redraw-display)))
|
|
(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 t
|
|
treemacs-file-event-delay 5000
|
|
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-git-command-pipe ""
|
|
treemacs-goto-tag-strategy 'refetch-index
|
|
treemacs-indentation 2
|
|
treemacs-indentation-string " "
|
|
treemacs-indent-guide-style 'line
|
|
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-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-width-is-initially-locked nil
|
|
treemacs-width 25
|
|
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 16)
|
|
|
|
(treemacs-follow-mode t)
|
|
(treemacs-filewatch-mode t)
|
|
(treemacs-fringe-indicator-mode 'always)
|
|
|
|
(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 B" . treemacs-bookmark)
|
|
("C-x t C-t" . treemacs-find-file)
|
|
("C-x t M-t" . treemacs-find-tag)))
|
|
|
|
(use-package treemacs-icons-dired
|
|
:config (treemacs-icons-dired-mode))
|
|
|
|
(use-package treemacs-magit
|
|
:after (treemacs magit)
|
|
:ensure t)
|
|
|
|
#+end_src
|
|
|
|
* Flycheck
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(use-package flycheck
|
|
:init
|
|
(global-flycheck-mode))
|
|
|
|
#+end_src
|
|
|
|
* LSP Mode
|
|
This package provides a LSP interface for emacs, for autocompletion
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(use-package lsp-mode
|
|
:init
|
|
(setq lsp-keymap-prefix "C-l")
|
|
:hook
|
|
(lsp-mode . lsp-enable-which-key-integration)
|
|
(lsp-mode . lsp-completion-mode)
|
|
:custom
|
|
(lsp-eldoc-render-all t)
|
|
:commands (lsp lsp-mode lsp-deferred))
|
|
|
|
|
|
(use-package lsp-ui
|
|
:commands lsp-ui-mode
|
|
:custom
|
|
(lsp-ui-peek-always-show t)
|
|
(lsp-ui-sideline-show-hover t)
|
|
(lsp-ui-doc-position 'bottom))
|
|
|
|
(use-package lsp-treemacs
|
|
:after lsp-mode
|
|
:hook (lsp-mode . lsp-treemacs-symbols))
|
|
|
|
#+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
|
|
:after company
|
|
:hook (company-mode . company-box-mode))
|
|
|
|
#+end_src
|