Skip to content

Instantly share code, notes, and snippets.

@matyklug18
Created December 16, 2021 06:51
Show Gist options
  • Save matyklug18/6ac1d410ab55999a6f66b5e89b482de7 to your computer and use it in GitHub Desktop.
Save matyklug18/6ac1d410ab55999a6f66b5e89b482de7 to your computer and use it in GitHub Desktop.
(setq gc-cons-threshold (* (expt 1024 3) 1)) ; 1 GB
(setq read-process-output-max (* (expt 1024 2) 1)) ; 1 MB
(recentf-mode -1)
(setq recentf-mode nil)
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
(load-theme 'dracula t)
(tool-bar-mode -1)
;(add-to-list 'load-path "~/.emacs.d/all-the-icons")
;(load "all-the-icons")
(add-to-list 'load-path "~/.emacs.d/emacs-dashboard")
(require 'dashboard)
(setq dashboard-set-heading-icons t)
(setq dashboard-set-file-icons t)
(dashboard-setup-startup-hook)
; DONT FORGET TO RECOMPILE AGAIN
(defun treemacs ()
"Lazy-load treemacs"
(interactive)
(add-to-list 'load-path "~/.emacs.d/lazy-load/treemacs/src/elisp")
(require 'treemacs)
(treemacs)
(when (boundp 'lsp-mode) (load-lsp-treemacs)))
(add-to-list 'load-path "~/.emacs.d/lisp")
(require 'undo-tree)
(setq undo-tree-auto-safe-history t)
(global-undo-tree-mode)
(run-with-idle-timer 0.1 nil (lambda ()
(add-to-list 'load-path "~/.emacs.d/evil")
(require 'evil)
(setq evil-want-fine-undo t)
(evil-set-undo-system 'undo-tree)
(evil-mode t)))
(run-with-idle-timer 0.1 nil (lambda ()
(add-to-list 'load-path "~/.emacs.d/ivy")
(require 'ivy)
(ivy-mode)))
(add-hook 'org-mode-hook (lambda ()
(add-to-list 'load-path "~/.emacs.d/lazy-load/org-mode/lisp")
(load "org")))
(setq custom-file (concat user-emacs-directory "/custom.el"))
(load-file custom-file)
(savehist-mode t)
(setq revert-without-query '(".pdf"))
(defun load-tree-sitter ()
(unless (boundp 'tree-sitter-mode)
(add-to-list 'load-path "~/.emacs.d/elisp-tree-sitter/core")
(add-to-list 'load-path "~/.emacs.d/elisp-tree-sitter/lisp")
(add-to-list 'load-path "~/.emacs.d/elisp-tree-sitter/langs")
(require 'tree-sitter)
(require 'tree-sitter-hl)
(require 'tree-sitter-langs)
(require 'tree-sitter-debug)
(require 'tree-sitter-query))
(tree-sitter-mode)
(tree-sitter-hl-mode))
;(defun load-clang-lsp ()
; (unless (boundp 'flycheck-clangcheck-analyze)
; (load-flycheck)
; (load-lsp)
; (load-tree-sitter)
; (add-to-list 'load-path "~/.emacs.d/lazy-load/flycheck-clangcheck")
; (require 'flycheck-clangcheck)
; (flycheck-set-checker-executable 'c/c++-clangcheck
; "/usr/bin/clang-check")
; (flycheck-select-checker 'c/c++-clangcheck)
; (setq flycheck-clangcheck-analyze t)))
(defun load-flycheck ()
(unless (boundp 'flycheck-mode)
(add-to-list 'load-path "~/.emacs.d/lazy-load/flycheck")
(require 'flycheck))
(flycheck-mode))
(defun load-company ()
(unless (boundp 'company-mode)
(add-to-list 'load-path "~/.emacs.d/lazy-load/company-mode")
;(add-to-list 'load-path "~/.emacs.d/lazy-load/company-quickhelp")
(require 'company)
;(require 'company-quickhelp)
;(company-quickhelp-mode)
(setq company-minimum-prefix-length 1))
(company-mode))
(defun load-lsp-ui ()
(unless (boundp 'lsp-ui-mode)
(add-to-list 'load-path "~/.emacs.d/lazy-load/lsp-ui")
(load "lsp-ui")
;(lsp-ui-sideline)
(setq lsp-ui-doc-enable t)
(setq lsp-ui-sideline-show-hover t)
;(lsp-ui-doc-show)
(setq lsp-ui-sideline-update-mode 'line)))
(defun load-lsp ()
(load-flycheck)
(load-company)
(unless (boundp 'lsp-mode)
(add-to-list 'load-path "~/.emacs.d/lazy-load/lsp-mode")
(add-to-list 'load-path "~/.emacs.d/lazy-load/lsp-mode/clients")
(load "lsp-lens")
(load "lsp-modeline")
(load "lsp-headerline")
(load "lsp-diagnostics")
(load "lsp-completion")
(load "lsp-dired")
(load "lsp-icons")
(load "lsp-protocol")
(load "lsp-semantic-tokens")
(load "lsp-mode"))
(load-lsp-ui)
(lsp-deferred))
(defun load-lsp-treemacs ()
(add-to-list 'load-path "~/.emacs.d/lazy-load/lsp-treemacs")
(require 'lsp-treemacs)
(lsp-treemacs-sync-mode t)
(lsp-treemacs-generic-mode t))
(add-hook 'c-mode-hook 'load-tree-sitter)
(add-hook 'c-mode-hook 'load-lsp)
;(add-hook 'c-mode-hook 'load-clang-lsp)
(add-hook 'emacs-lisp-mode-hook 'load-company)
;(setq backup-directory-alist
; (concat user-emacs-directory "backups"))
; Autosave doesn't really autosave, but instead makes *do not save this buffer*
; actually save the buffer anyway.
; While that is really hilarious, it's very annoying.
(setq auto-save-default nil)
(setq-default c-basic-offset 2
tab-width 2
indent-tabs-mode t)
(setq user-full-name "Mathias Klug")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment