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

View file

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

View file

@ -9,24 +9,13 @@
;; org-mode ;; org-superstar ;; org-mode ;; org-superstar
(use-package org-superstar (use-package org-superstar
:after org
:custom :custom
;; Change org-mode's heading bullets ;; Change org-mode's heading bullets
(org-superstar-headline-bullets-list (org-superstar-headline-bullets-list
'("🞉" "🞈" "🞇" "🞆" "🞅" "🞄")) '("🞉" "🞈" "🞇" "🞆" "🞅" "🞄"))
:hook org-mode) :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 (with-eval-after-load 'org-superstar
;; Faces for the font sizes of org-mode headings ;; Faces for the font sizes of org-mode headings
(set-face-attribute 'org-level-8 nil :weight 'bold :inherit 'default) (set-face-attribute 'org-level-8 nil :weight 'bold :inherit 'default)
@ -43,6 +32,18 @@
:inherit 'org-level-8)) :inherit 'org-level-8))
(with-eval-after-load 'org (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 (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-directory "~/Org/") ; Set the folder used by org-mode
(setq org-agenda-files (quote ("~/Org/"))) (setq org-agenda-files (quote ("~/Org/")))