Last active
June 6, 2024 22:41
-
-
Save mateusfccp/63bfd981ae801d981b678fbfd8f60849 to your computer and use it in GitHub Desktop.
init.el
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; init.el --- My personal, self-containted init.el | |
;;; Commentary: | |
;;; Code: | |
;; Style | |
(set-frame-font "Fira Code 12" nil t) | |
;; straight.el bootstrap | |
(defvar straight-use-package-by-default 'true) | |
(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)) | |
;; General | |
(add-hook 'prog-mode-hook 'display-line-numbers-mode) ;; Enable line numbers | |
(setq ring-bell-function 'ignore) ;; Prevent annoying sound when something happens | |
(tool-bar-mode -1) ;; Hide toolbar | |
(menu-bar-mode -1) ;; Hide menu bar | |
(scroll-bar-mode -1) ;; Hide scrol bar | |
;; Backup files | |
(setq backup-directory-alist `(("." . "~/.emacs.d/backup")) | |
backup-by-copying t | |
delete-old-versions t | |
kept-new-versions 6 | |
kept-old-versions 2 | |
version-control t) | |
;; Packages | |
(straight-use-package 'use-package) | |
;; Guru mode | |
(use-package guru-mode | |
:config (guru-global-mode +1)) | |
;; Projectile | |
(use-package projectile | |
:init (projectile-mode +1) | |
:bind (("s-p" . projectile-command-map) | |
:map projectile-mode-map)) | |
;; expand-region | |
(use-package expand-region | |
:bind ("C-=" . er/expand-region)) | |
;; visual-regexp-search | |
(use-package visual-regexp-steroids | |
:bind (("C-c r" . vr/replace) | |
("C-c q" . vr/query-replace) | |
("C-c m" . vr/mc-mark) | |
("C-r" . vr/isearch-backward) | |
("C-s" . vr/isearch-forward))) | |
;; diff-hl | |
(use-package diff-hl | |
:config (global-diff-hl-mode)) | |
;; Smartparens | |
(use-package smartparens | |
:config (smartparens-global-mode t)) | |
;; Theme | |
(use-package dracula-theme | |
:config (load-theme 'dracula t)) | |
;; Magit | |
(use-package magit) | |
;; Dart | |
(use-package dart-mode) | |
;; Json | |
(use-package json-mode) | |
;; Yaml | |
(use-package yaml-mode) | |
;; Yasnippet | |
(use-package yasnippet | |
:config (yas-global-mode)) | |
;; Company | |
(use-package company) | |
(setq company-minimum-prefix-length 1 | |
company-idle-delay 0.0) | |
;; Flycheck | |
(use-package flycheck | |
:config (global-flycheck-mode)) | |
;; LSP | |
(use-package lsp-mode | |
:hook ((dart-mode . lsp) | |
(lsp-mode . lsp-enable-which-key-integration)) | |
:commands lsp) | |
(setq gc-cons-threshold (* 100 1024 1024) | |
lsp-lens-enable nil | |
lsp-ui-doc-show-with-mouse nil | |
lsp-signature-auto-activate nil | |
read-process-output-max (* 2 1024 1024)) | |
(use-package lsp-ui :commands lsp-ui-mode) | |
(use-package lsp-dart) | |
(setq lsp-dart-line-length 200) | |
(use-package lsp-treemacs :commands lsp-treemacs-errors-list) | |
(use-package dap-mode) | |
(use-package which-key | |
:config (which-key-mode)) | |
;; ligatures.el | |
(use-package ligature | |
:ensure t | |
:config | |
;; Enable all Iosevka ligatures in programming modes | |
(ligature-set-ligatures 'prog-mode '("<---" "<--" "<<-" "<-" "->" "-->" "--->" "<->" "<-->" "<--->" "<---->" "<!--" "<==" "<===" "<=" "=>" "=>>" "==>" "===>" ">=" "<=>" "<==>" "<===>" "<====>" "<!---" "<~~" "<~" "~>" "~~>" "::" ":::" "==" "!=" "===" "!==" ":=" ":-" ":+" "<*" "<*>" "*>" "<|" "<|>" "|>" "+:" "-:" "=:" "<******>" "++" "+++")) | |
;; Enables ligature checks globally in all buffers. You can also do it | |
;; per mode with `ligature-mode'. | |
(global-ligature-mode t)) | |
;; Generated | |
(custom-set-variables | |
'(warning-suppress-types '((comp)))) | |
;;; init.el ends here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment