Skip to content

Latest commit

 

History

History
590 lines (457 loc) · 12.6 KB

config.org

File metadata and controls

590 lines (457 loc) · 12.6 KB

native

remove startup and scratch

(setq inhibit-startup-message t) 
(setq initial-scratch-message nil) 

get rid of backup files

(setq make-backup-files nil) 
(setq buffer-file-name nil) 
(setq backup-inhibited t) 
(setq auto-save-default nil) 

remove bell

(setq ring-bell-function nil) 

remove default gui

(menu-bar-mode -1) 
(tool-bar-mode -1) 
(scroll-bar-mode -1) 

tab width

(setq-default tab-width 2) 

get rid of org source indenting

(setq org-src-preserve-indentation t) 

electric pair mode

(setq electric-pair-pairs 
'((?\" . ?\")
 (?\' . ?\')
 (?\( . ?\))
 (?\[ . ?\])
 (?\{ . ?\})
 (?\< . ?\>)))

 (electric-pair-mode 1) 

auto revert mode

(global-auto-revert-mode 1) 

garbage collection

; set it to a super high number for lower rates of garbage collection and faster startup 
(setq gc-cons-threshold (* 50 1000 1000)) 

line numbers

(add-hook 'prog-mode-hook #'display-line-numbers-mode)

package preperations

(require 'package)

(setq package-archives '(("melpa" . "https://melpa.org/packages/")
			   ("org" . "https://orgmode.org/elpa/")
			   ("elpa" . "https://elpa.gnu.org/packages/")))

(package-initialize)
(unless package-archive-contents
  (package-refresh-contents))

  ;; Initialize use-package on non-Linux platforms
(unless (package-installed-p 'use-package)
  (package-install 'use-package))

(require 'use-package)
(setq use-package-always-ensure t)

keybinds

evil

(use-package evil
  :init
  (setq evil-want-integration t)
  (setq evil-want-keybinding nil)
  (setq evil-want-C-u-scroll t)
  (setq evil-want-C-i-jump nil)
	:custom
	(evil-window-split-below t)
  :config
  (evil-mode 1)
  (define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state)
  (define-key evil-insert-state-map (kbd "C-h") 'evil-delete-backward-char-and-join)

  ;; Use visual line motions even outside of visual-line-mode buffers
  (evil-global-set-key 'motion "j" 'evil-next-visual-line)
  (evil-global-set-key 'motion "k" 'evil-previous-visual-line)

  (evil-set-initial-state 'messages-buffer-mode 'normal)
  (evil-set-initial-state 'dashboard-mode 'normal)

  (evil-set-undo-system 'undo-redo))

evil collection

(use-package evil-collection
	:after evil
		:config (evil-collection-init
						 '(dired
							 org
							 neotree
							 elfeed
							 magit
							 dashboard
							 dired-sidebar
							 eshell
							 ibuffer)))

general

(use-package general
	:commands (nvmap)
		:config (general-evil-setup t))

hydra

 (use-package hydra
	 :commands (defhydra))

(defhydra hydra-evil-scale ()
	"evil scale"
	("h" evil-window-decrease-width "decrease width")
	("l" evil-window-increase-width "increase width") 
	("j" evil-window-decrease-height "decrease height")
	("k" evil-window-increase-height "increase height"))

(defhydra hydra-evil-move ()
	"evil move window"
	("h" evil-window-left "move left")
	("l" evil-window-right "move right")
	("j" evil-window-down "move down")
	("k" evil-window-up "move up")

	("H" evil-window-move-far-left "move pane left")
	("L" evil-window-move-far-right "move pane right") 
	("J" evil-window-move-very-bottom "move pane down")
	("K" evil-window-move-very-top "move pane up"))

(nvmap :prefix "SPC"
  "e w s"   '(hydra-evil-scale/body :which-key "Evil window scale")
  "e w m"   '(hydra-evil-move/body :which-key "Evil window move"))

emacs helpers

orderless

(use-package orderless
	:commands (vertico-mode)
		:custom
		(completion-styles '(orderless basic))
		(completion-category-overrides '((file (styles basic partial-completion)))))

vertico

(use-package vertico
	:commands (execute-extended-command)
  :bind (:map vertico-map
	      ("C-j" . vertico-next)
	      ("C-k" . vertico-previous))
  :init
	(vertico-mode)
  (setq vertico-count 10)
  (setq vertico-cycle t))

consult

(use-package consult
	:commands (vertico-mode))

(nvmap :prefix "SPC"
       "c b"   '(consult-buffer :which-key "Consult buffer"))

helpful

(use-package helpful
	:commands (helpful-callable helpful-variable helpful-key helpful-at-point helpful-function helpful-command)
  :bind (("C-h f" . helpful-callable)
	 ("C-h v" . helpful-variable)
	 ("C-h k" . helpful-key)
	 ("C-c C-d" . helpful-at-point)
	 ("C-h F" . helpful-function)
	 ("C-h C" . helpful-command)))

which key

	(use-package which-key
		:config (which-key-mode))

marginalia

(use-package marginalia
	:commands (vertico-mode)
  :init (marginalia-mode))

beacon

(use-package beacon
	:defer
  :config (beacon-mode 1))

restart emacs

(use-package restart-emacs)

(nvmap :prefix "SPC"
  "r e"   '(restart-emacs :which-key "Restart emacs"))

aesthetics

themes

(use-package doom-themes
  :config
  ;; Global settings (defaults)
  (setq doom-themes-enable-bold t    ; if nil, bold is universally disabled
        doom-themes-enable-italic t) ; if nil, italics is universally disabled
  (load-theme 'doom-one t)

  ;; Enable flashing mode-line on errors
  (doom-themes-visual-bell-config)
  ;; Enable custom neotree theme (all-the-icons must be installed!)
  (doom-themes-neotree-config)
  ;; or for treemacs users
  (setq doom-themes-treemacs-theme "doom-atom") ; use "doom-colors" for less minimal icon theme
  (doom-themes-treemacs-config)
  ;; Corrects (and improves) org-mode's native fontification.
  (doom-themes-org-config))

font

(set-face-attribute 'default nil
		    :font "JetBrainsMonoMedium Nerd Font"
		    :weight 'medium)

(use-package all-the-icons)

modeline

(use-package doom-modeline
	:after doom-themes
  :config (doom-modeline-mode 1))

nyan cat

(use-package nyan-mode
  :after doom-modeline
  :config
  (setq nyan-bar-length 15
	nyan-wavy-trail t)
  (nyan-mode)
  (nyan-start-animation))

dashboard

(use-package dashboard
  :config (dashboard-setup-startup-hook))

darkroom

(use-package darkroom
	:commands (darkroom-mode)
	:custom (darkroom-text-scale-increase 1))

(nvmap :prefix "SPC"
       "d m"   '(darkroom-mode :which-key "Darkroom mode"))

programming

yasnippet

(use-package yasnippet
	:defer
  :init (add-to-list 'load-path "~/.emacs.d/snippets")
	:config (yas-global-mode))

(use-package consult-yasnippet
	:commands (consult-yasnippet))

(nvmap :prefix "SPC"
       "c y"   '(consult-yasnippet :which-key "Consult yasnippet"))

corfu

(global-unset-key (kbd "C-k"))

(use-package corfu
  :custom
  (corfu-cycle t)
  (corfu-auto t)
  (corfu-auto-delay 0)
  (corfu-auto-prefix 0)
  (completion-styels '(basic))
  (corfu-popupinfo-delay t)
  (corfu-popupinfo-resize t)
  :bind (:map corfu-map
	      ("C-j" . corfu-next)
	      ("C-k" . corfu-previous)
	      ("C-e" . corfu-quit)
	      :map evil-insert-state-map ("C-k" . nil))
  :init
  (corfu-popupinfo-mode)
	:hook (prog-mode . corfu-mode))

kind icon

(use-package kind-icon
	:commands (corfu-mode)
  :custom
  (kind-icon-default-face 'corfu-default) ; to compute blended backgrounds correctly
  :config
  (add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter))

eglot

(use-package eglot
	:hook (prog-mode . eglot-ensure))

flycheck

(use-package flycheck
	:hook (prog-mode . flycheck-mode))

 (nvmap :prefix "SPC"
      "f c"   '(flycheck-command-map :which-key "Flycheck"))

treesitter

(use-package tree-sitter
  :hook (prog-mode . tree-sitter-hl-mode))

(use-package tree-sitter-langs
	:commands (tree-sitter-langs-install-grammars))

languages

(use-package lua-mode
  :mode "\\.lua\\'")

(with-eval-after-load 'eglot
  (add-to-list 'eglot-server-programs
               `(lua-mode . ("~/.emacs.d/lsp/robloxlsp/server/bin/Windows/lua-language-server"))))

(flycheck-define-checker selene
  "raw blocks pensive face"
  :command ("selene" "--quiet" "--config" "C:\\Users\\seanj\\AppData\\Roaming\\.emacs.d\\custom-dependencies\\selene.toml" source)
  :error-patterns ((error line-start (file-name) ":" line ":" column ": " (message) line-end))
  :modes lua-mode)

(setq-default flycheck-checkers '(selene))
(use-package typescript-mode
  :mode "\\.ts\\'")

(with-eval-after-load 'eglot
  (add-to-list 'eglot-server-programs
               `(typescript-mode . ("typescript-language-server" "--stdio"))))
(use-package web-mode
  :mode "\\.tsx\\'")

(with-eval-after-load 'eglot
  (add-to-list 'eglot-server-programs
               `(web-mode . ("typescript-language-server" "--stdio"))))

google this

(use-package google-this
	:commands (google-this))

(nvmap :prefix "SPC"
       "g t"   '(google-this :which-key "Google This"))

magit

(use-package magit
	:commands magit-status)

(nvmap :prefix "SPC"
  "m s"   '(magit-status :which-key "Magit statue"))

cape

(use-package cape
	:defer
  :init
  (add-to-list 'completion-at-point-functions #'cape-dabbrev)
  (add-to-list 'completion-at-point-functions #'cape-file)
  (add-to-list 'completion-at-point-functions #'cape-symbol))

format all

(use-package format-all
	:custom
	(format-all-default-formatters
	 '(("Lua" stylua)))
	:hook (format-all-mode . format-all-ensure-formatter)
	      (before-save . format-all-buffer)
				(prog-mode . format-all-mode))

(nvmap :prefix "SPC"
  "f a"   '(format-all-buffer :which-key "Format buffer"))

elfeed

(use-package elfeed
	:commands (elfeed)
	:hook (elfeed . elfeed-update)
  :config (setq elfeed-feeds
		'(
		  ; coryxkenshin
		  "https://www.youtube.com/feeds/videos.xml?channel_id=UCiYcA0gJzg855iSKMrX3oHg"
		  ; lex fridman podcast
		  "https://www.youtube.com/feeds/videos.xml?channel_id=UCSHZKyawb77ixDdsGog4iWA"))
  (setq-default elfeed-search-filter "@6-months-ago "))

org

org itself

(use-package org
	:config (setq org-ellipsis ""))

org roam

(use-package org-roam
	:after org
  :custom (org-roam-directory "C:\\Users\\seanj\\OneDrive\\Documents\\Studies\\org-mode")
  :config
  ;; If you're using a vertical completion framework, you might want a more informative completion interface
  (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag)))
  (org-roam-db-autosync-mode))

org bullets

(use-package org-bullets
  :custom
  (org-bullets-bullet-list '("" "" "" "" "" "" ""))
  :hook (org-mode . org-bullets-mode))

dired

all the icons

(use-package all-the-icons-dired
	:hook (dired-mode . all-the-icons-dired-mode))

dired sidebar

(use-package dired-sidebar
	:commands (dired-sidebar-toggle-sidebar))

(nvmap :prefix "SPC"
       "d s"   '(dired-sidebar-toggle-sidebar :which-key "Dired sidebar"))

eshell

open keybind

(defun open-eshell-below ()
	(interactive)

	(window-resize
	 (select-window
		(split-window)) 3)

	(evil-window-decrease-height 10)
	(eshell))

(nvmap :prefix "SPC"
  "e s"   '(open-eshell-below :which-key "Open eshell"))

eshell up

; basically command is like eshell-up [directory] and not cd .. over and over
(use-package eshell-up)

custom shit

kill other buffers

(defun kill-other-buffers ()
  "Kill all buffers but the current one.
Doesn't mess with special buffers."
  (interactive)
  (when (y-or-n-p "Are you sure you want to kill all buffers but the current one? ")
    (seq-each
     #'kill-buffer
     (delete (current-buffer) (seq-filter #'buffer-file-name (buffer-list))))))