perf: general improvements

This commit is contained in:
Muhammad Nauman Raza 2022-11-20 18:10:03 +00:00
parent db6d75c0d2
commit 54e8ea6c46
No known key found for this signature in database
GPG key ID: A9A36C429C9CAE31
3 changed files with 61 additions and 58 deletions

View file

@ -9,37 +9,38 @@
;;; Code:
;; Files
(general-create-definer diancite/file
:prefix leader-key)
(diancite/file
:keymaps 'normal
"f f" '(find-file :wk "Find File")
"f s" '(save-buffer :wk "Save Buffer"))
;; Magit
(general-create-definer diancite/magit
:prefix leader-key)
(diancite/magit
:keymaps 'normal
"m s" '(magit-status :wk "Status")
"m d" '(magit-dispatch :wk "Dispatch")
"m f" '(magit-file-dispatch :wk "File Dispatch"))
;; Flymake & LSP
(general-create-definer diancite/lsp
:prefix leader-key)
(diancite/lsp
:keymaps 'normal
"l" '(:wk "LSP")
"l n" '(flycheck-next-error :wk "Next Error")
"l p" '(flycheck-previous-error :wk "Previous Error")
"l f" '(eglot-format :wk "Format Buffer")
"l w" '(:wk "Server")
"l w r" '(eglot-reconnect :wk "Restart Server")
"l w q" '(eglot-shutdown :wk "Shutdown Server"))
(with-eval-after-load 'general
(general-create-definer diancite/file
:prefix leader-key)
(diancite/file
:keymaps 'normal
"f f" '(find-file :wk "Find File")
"f s" '(save-buffer :wk "Save Buffer"))
;; Magit
(general-create-definer diancite/magit
:prefix leader-key)
(diancite/magit
:keymaps 'normal
"m s" '(magit-status :wk "Status")
"m d" '(magit-dispatch :wk "Dispatch")
"m f" '(magit-file-dispatch :wk "File Dispatch"))
;; Flymake & LSP
(general-create-definer diancite/lsp
:prefix leader-key)
(diancite/lsp
:keymaps 'normal
"l" '(:wk "LSP")
"l n" '(flycheck-next-error :wk "Next Error")
"l p" '(flycheck-previous-error :wk "Previous Error")
"l f" '(eglot-format :wk "Format Buffer")
"l w" '(:wk "Server")
"l w r" '(eglot-reconnect :wk "Restart Server")
"l w q" '(eglot-shutdown :wk "Shutdown Server")))
;;; keybinds.el ends here

View file

@ -12,10 +12,21 @@
(use-package markdown-mode)
;; Diagnostics
(use-package flycheck
(use-package flycheck-rust
:after flycheck
:init
(global-flycheck-mode) ; Enable flycheck everywhere by default
(push 'rustic-clippy flycheck-checkers)) ; Use clippy for Rust
(add-hook 'flycheck-mode-hook #'flycheck-rust-setup)) ; Enable flycheck-rust where flycheck is enabled. If not a rust file, does nothing.
(use-package flycheck-inline
:after flycheck
:hook
(flycheck-mode . flycheck-inline-mode)) ; Enable flycheck-inline where flycheck is enabled
(use-package flycheck
:hook prog-mode
:init
(with-eval-after-load 'flycheck
(push 'rustic-clippy flycheck-checkers))) ; Use clippy for Rust
;; eglot - Language Server Protocol ingegration
(use-package eglot)
@ -23,19 +34,9 @@
;; Go
(use-package go-mode
:config
(add-hook 'before-save-hook 'gofmt-before-save) ; Format on save
:hook
(go-mode . flycheck-mode)) ; Enable flycheck-mode by default
(add-hook 'before-save-hook 'gofmt-before-save)) ; Format on save
;; Rust
(use-package flycheck-rust
:init
(add-hook 'flycheck-mode-hook #'flycheck-rust-setup)) ; Enable flycheck-rust where flycheck is enabled. If not a rust file, does nothing.
(use-package flycheck-inline
:hook
(flycheck-mode . flycheck-inline-mode)) ; Enable flycheck-inline where flycheck is enabled
(use-package rustic
:custom
(rustic-format-trigger 'on-save) ; Format buffer on save

View file

@ -9,24 +9,13 @@
;; org-mode ;; org-superstar
(use-package org-superstar
:after org
:custom
;; Change org-mode's heading bullets
(org-superstar-headline-bullets-list
'("🞉" "🞈" "🞇" "🞆" "🞅" "🞄"))
:hook org-mode)
;; Customize org-mode's default functionality
(setq org-ellipsis "..."
org-use-property-inheritance t
org-list-allow-alphabetical t
org-catch-invisible-edits 'smart
org-startup-indented t
org-hide-emphasis-markers t
org-startup-with-inline-images t
org-image-actual-width '(300)
org-pretty-entities t
org-adapt-indentation t)
(with-eval-after-load 'org-superstar
;; Faces for the font sizes of org-mode headings
(set-face-attribute 'org-level-8 nil :weight 'bold :inherit 'default)
@ -43,6 +32,18 @@
:inherit 'org-level-8))
(with-eval-after-load 'org
;; Customize org-mode's default functionality
(setq org-ellipsis "..."
org-use-property-inheritance t
org-list-allow-alphabetical t
org-catch-invisible-edits 'smart
org-startup-indented t
org-hide-emphasis-markers t
org-startup-with-inline-images t
org-image-actual-width '(300)
org-pretty-entities t
org-adapt-indentation t)
(plist-put org-format-latex-options :scale 2.5) ; Scale up latex elements
(setq org-directory "~/Org/") ; Set the folder used by org-mode
(setq org-agenda-files (quote ("~/Org/")))