add nativecomp bits

This commit is contained in:
Grigory Shipunov 2021-09-14 11:52:46 +02:00
parent 90c88071f1
commit 1c93d64e7d
Signed by: 0xa
GPG key ID: 91FA5E5BF9AA901C

25
init.el
View file

@ -6,6 +6,15 @@
(if (version< emacs-version "26.3")
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3"))
(defconst oxa/using-native-comp (and (fboundp 'native-comp-available-p)
(native-comp-available-p)))
(if oxa/using-native-comp
(setq native-comp-deferred-compilation t
native-comp-async-query-on-exit t
native-comp-async-jobs-number 6
native-comp-async-report-warnings-errors nil))
;; Change some settings based on where we are
(defvar oxa-workplace "home")
@ -367,6 +376,22 @@
;; fill column
(setq-default fill-column 80)
;; use lsp if we have nativecomp - without it it's too slow :(
(if oxa/using-native-comp
(progn
(use-package lsp-mode
:straight t
:init
(setq lsp-keymap-prefix "C-z l")
:hook ((c-mode . lsp)
(nix-mode . lsp)
(python-mode . lsp)
(LaTeX-mode . lsp)
(TeX-mode . lsp)
(lsp-mode . lsp-enable-which-key-integration))
:commands lsp)
(use-package lsp-ui :straight t :commands lsp-ui-mode)
))
;; I use custom vars for local config, so let's put them to separate file, where
;; it's easier for git to ignore it