Skip to content

Latest commit

 

History

History
975 lines (800 loc) · 28.7 KB

init.org

File metadata and controls

975 lines (800 loc) · 28.7 KB

Emacs Config

Initial Setup and helpers

System specific settings

When on macos (i.e. darwin) don’t use the dired flag in ls as it isn’t supported.

(when (string= system-type "darwin")       
  (setq dired-use-ls-dired nil))

Load Paths

Add “lisp” directory to load-path. This enables the ability toe load files in this sub-folder. Eventually, all code in these files will be moved to the org config file (this file…).

(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory))
(setq load-prefer-newer t)

Potentially makes things snappier by doing garbage collection out of frame.

(add-hook 'focus-out-hook #'garbage-collect)

Misc setup

  • turn off system bell
  • turn off backup-files
  • Set custom file
  • add function reload-config to reload .emacs file.
;;;;;;;;;
;; Initialize config
;;;;;;;;;

(setq ring-bell-function 'ignore)
(setq make-backup-files nil)

(setq custom-file "~/.emacs.d/custom.el")
(load custom-file 'noerror)

(defun reload-config ()
  "Reload the config for emacs."
  (interactive)
  (load-file "~/.emacs"))

Setup Package

We are moving to a straight.el way of downloading packages.

;; (require 'package)

Package sources

Add package archives and set priorities

  • melpa pulls from master branch of git repos for packages
  • melpa-stable pulls from stable branches
  • gnu is the official gnu-elpa repository of packages.
;; (setq package-archives
;;       `(("melpa" . "https://melpa.org/packages/")
;;         ("gnu"     . "https://elpa.gnu.org/packages/")))

;; (setq package-archive-priorities
;;       '(("gnu" . 5)
;;         ("melpa" . 0)))

initialize package

Makes installed packages available, and refreshes contents if needed (i.e. on a fresh install).

;; (setq package-enable-at-startup nil)
;; (package-initialize)
;; (unless package-archive-contents (package-refresh-contents))

I’m taking this configuration from this blog.

First we need to download the bootstrap file and load it.

(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 6))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

After this we need to integrate straight into use-package.

;; (setq straight-use-package-by-default t)

The use-package macro allows you to isolate package configuration in your .emacs file in a way that is both performance-oriented and, well, tidy. I created it because I have over 80 packages that I use in Emacs, and things were getting difficult to manage. Yet with this utility my total load time is around 2 seconds, with no loss of functionality!

(straight-use-package 'use-package)
(use-package straight
  :custom
  (straight-use-package-by-default t))
;; (unless (package-installed-p 'use-package) (package-install 'use-package))
;; (eval-when-compile (require 'use-package))
;; (straight-use-package 'org)

This package provides two minor modes which automatically recompile Emacs Lisp source files. Together these modes guarantee that Emacs never loads outdated byte code files.

(use-package auto-compile
  :hook ((after-init . auto-compile-on-load-mode)
         (after-init . auto-compile-on-save-mode)))

Useful misc packages/functions used in other configs

  • diminish: A diminished mode is a minor mode that has had its mode line display diminished, usually to nothing, although diminishing to a shorter word or a single letter is also supported. This package implements diminished modes.
  • fullframe: This is a library that package developers can use to provide user friendly single window per frame execution of buffer exposing commands, as well as to use in personal emacs configurations to attain the same goal for packages that don’t use fullframe or the likes of it themselves.
(use-package diminish :straight t)
(use-package fullframe :straight t)

string manipulation

The long lost Emacs string manipulation library.

(use-package s
  :straight t
  :demand t)

request, request-deferred – an elisp HTTP library

Uses curl as its backend or Emacs’s native url.el library if curl is not found.

(use-package request
  :straight t
  :demand t)

(use-package request-deferred
  :straight t
  :demand t)

mapcar*

(defun mapcar* (function &rest args)
  "Apply FUNCTION to successive cars of all ARGS.
Return the list of results."
  ;; If no list is exhausted,
  (if (not (memq nil args))
      ;; apply function to CARs.
      (cons (apply function (mapcar #'car args))
            (apply #'mapcar* function
                   ;; Recurse for rest of elements.
                   (mapcar #'cdr args)))))

Tramp

;; (setq remote-file-name-inhibit-cache nil)
;; (setq vc-ignore-dir-regexp
;;       (format "%s\\|%s"
;;                     vc-ignore-dir-regexp
;;                     tramp-file-name-regexp))
;; (setq tramp-verbose 1)

Keybind setup

This is a global minor mode for entering Emacs commands without modifier keys. It’s similar to Vim’s separation of command mode and insert mode.

(use-package god-mode
  :straight t
  :bind (("<escape>" . god-local-mode))
  :config
  ;; (defun my-god-mode-update-mode-line ()
  ;;   (cond
  ;;    (god-local-mode
  ;;     (set-face-attribute 'mode-line nil
  ;;                         :foreground "#604000"
  ;;                         :background "#fff29a")
  ;;     (set-face-attribute 'mode-line-inactive nil
  ;;                         :foreground "#3f3000"
  ;;                         :background "#fff3da"))
  ;;    (t ;; back to default
  ;;     (set-face-attribute 'mode-line nil
  ;;       		  :foreground "#0a0a0a"
  ;;       		  :background "#d7d7d7")
  ;;     (set-face-attribute 'mode-line-inactive nil
  ;;       		  :foreground "#404148"
  ;;       		  :background "#efefef"))))

  ;; (defun mattroot/god-mode-update-mode-line-enable ()
  ;;   (set-face-attribute )

  ;;   )
    ;; (add-hook 'post-command-hook 'my-god-mode-update-mode-line))
  )
(use-package which-key
  :straight t
  :config
  (setq which-key-idle-delay 0.25)
  (which-key-mode)
  (which-key-enable-god-mode-support)
  (diminish 'which-key-mode))
(use-package general
  :straight t
  :config
  
  ;; Reset some keys
  (general-define-key
   "M-m" nil)

  ;; Some basic key defines
  (general-define-key
   "M-a" 'back-to-indentation)

  (general-create-definer root-leader
    :prefix "M-m")

  (root-leader
    ;; :prefix my-leader
    ;; or without a variable
    "" '(nil :which-key "Root Leader")
    "c" '(:ignore t :which-key "comments"))

  (root-leader
    "cl" 'comment-line
    "cd" 'comment-dwim
    "cr" 'comment-or-uncomment-region))

Some keybinds

(global-unset-key (kbd "C-x C-c"))

Visuals

misc settings

(setq column-number-mode t)
(tool-bar-mode -1)
(toggle-scroll-bar -1)
(setq inhibit-startup-screen t)
(defalias 'yes-or-no-p 'y-or-n-p)
(if (s-contains? "ChunkyBoi.lan" (system-name))
    (add-to-list 'default-frame-alist '(font . "Hack-20"))
    (add-to-list 'default-frame-alist '(font . "Hack-14")))
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
(add-to-list 'default-frame-alist '(vertical-scroll-bars . nil))
(add-to-list 'default-frame-alist '(horizontal-scroll-bars . nil))
(use-package monokai-theme
  :straight t
  :config
  (load-theme 'monokai t))

Powerline/Spaceline

(use-package spaceline
  :straight t
  :config
  (require 'spaceline-config)
  (setq powerline-image-apple-rgb t)
  (spaceline-emacs-theme))

;; (use-package powerline
;;   :straight t
;;   :config
;;   (setq powerline-image-apple-rgb t)
;;   (powerline-default-theme))
(use-package dimmer
  :straight t
  :config
  (dimmer-mode))

Fringe bitmap

Change empty line to tilde (from spacemacs).

;;;;;
;; Change empty line bitmap to tilde (if active)
;;;;;
(progn
  (define-fringe-bitmap 'tilde [0 0 0 113 219 142 0 0] nil nil 'center)
  (setcdr (assq 'empty-line fringe-indicator-alist) 'tilde))

Hydras

setup

(use-package hydra
  :straight t
  :functions
  mattroot/hydra-prepare-dynamic-names-helper
  mattroot/hydra-prepare-dynamic-names
  mattroot/hydra-prepare-dynamic-heads
  :defines mattroot/hydra-dynamic-selectors
  :config
  (setq mattroot/hydra-dynamic-selectors
        (mapcar 'identity "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"))

  (defun mattroot/hydra-prepare-dynamic-names-helper (a b)
    (if (string= b highlight-name)
        (propertize
         (concat " [ _" (char-to-string a) "_ " b " ] ")
         'face
         highlight-list)
      (concat " _" (char-to-string a) "_ " b " "))
    )

  (defun mattroot/hydra-prepare-dynamic-names (keys
                                               names
                                               &optional
                                               highlight-name
                                               highlight-list)
    
    (unless highlight-list
      (setq highlight-list '(:foreground "red")))

    (mapconcat 'identity
	       (mapcar*
                'mattroot/hydra-prepare-dynamic-names-helper
	        keys names)
	       " | "))

  (defun mattroot/hydra-prepare-dynamic-heads (keys names func)
  (mapcar* (lambda (a b)
	       (list (char-to-string a)
		     `(funcall ',func ',b)))
           keys names)))

Persp-mode

Persp and Eybrowse

(root-leader
  "l" '(:ignore t :which-key "persp")
  "e" '(:ignore t :which-key "eyebrowse"))
(use-package refine
  :straight t)

Persp-mode

(use-package persp-mode
  :straight t
  :hook ((after-init . persp-mode)
         (emacs-startup . toggle-frame-maximized))
  :defines ivy-sort-functions-alist
  :functions
  persp-reorder
  :init
  (defun persp-reorder ()
    (interactive)
    (refine 'persp-names-cache))
  :custom
  (persp-nil-name "default")
  (persp-set-last-persp-for-new-frames nil)
  (persp-auto-resume-time 0.1)
  (persp-autokill-buffer-on-remove t)
  :config

  (add-hook 'persp-common-buffer-filter-functions
            (lambda (b) (or (string-prefix-p "*" (buffer-name b))
			    (string-prefix-p "magit" (buffer-name b)))))
  
  (with-eval-after-load "ivy"
    (add-hook 'ivy-ignore-buffers
              #'(lambda (b)
                  (when persp-mode
                    (let ((persp (get-current-persp)))
                      (if persp
                          (not (persp-contain-buffer-p b persp))
                        nil)))))

    (setq ivy-sort-functions-alist
          (append ivy-sort-functions-alist
                  '((persp-kill-buffer   . nil)
                    (persp-remove-buffer . nil)
                    (persp-add-buffer    . nil)
                    (persp-switch        . nil)
                    (persp-window-switch . nil)
                    (persp-frame-switch  . nil)))))


  
  (with-eval-after-load "hydra"
    (bind-keys ("M-m l" .
                (lambda ()
                  (interactive)
                  (call-interactively
                   (eval `(defhydra mattroot/hydra-persp (:hint nil :exit t)
			    ;; Docstring
                            (concat "Select Perspective: "
				    "\n"
				    (mattroot/hydra-prepare-dynamic-names mattroot/hydra-dynamic-selectors
									  persp-names-cache
									  (safe-persp-name (get-frame-persp)))
				    "\n")
			    ;; Heads
                            ,@(mattroot/hydra-prepare-dynamic-heads mattroot/hydra-dynamic-selectors
								    persp-names-cache
								    'persp-frame-switch)
			    ("n" (progn
				   (persp-next)
				   (message "Current Perspective: %s" (safe-persp-name (get-frame-persp))))
			     "next" :color pink)
			    ("p" (progn
				   (persp-prev)
				   (message "Current Perspective: %s" (safe-persp-name (get-frame-persp))))
			     "previous" :color pink)
			    ("c" (progn
				   (interactive)
				   (let ((new-persp (read-string "A name for the new perspective: ")))
				     (persp-add-new new-persp)
				     (persp-frame-switch new-persp)
				     (message "Created new perspective %s" new-persp))
				   )
			     "create-and-switch")
			    ("k" persp-kill "kill")
			    ("r" persp-reorder "reorder")
			    ("a" (progn
				   (persp-add-buffer (current-buffer)))  "add-current-buffer")
                            ("q" nil "quit" :color blue)
			    )))))))
  )

Eyebrowse

(use-package eyebrowse :demand t :straight t
  :init
  ;; (setq eyebrowse-keymap-prefix (kbd "M-m e"))
  (global-unset-key (kbd "C-c C-w"))
  :functions
  mattroot/eyebrowse--get-tags
  mattroot/eyebrowse--get-slots
  mattroot/eyebrowse--get-current-tag
  mattroot/eyebrowse--get-current-slot-idx
  :custom
  (eyebrowse-wrap-around t)
  :config
  (eyebrowse-mode)
  (add-hook 'persp-before-switch-functions
	    #'workspaces/update-eyebrowse-for-perspective)
  (add-hook 'eyebrowse-post-window-switch-hook
	    #'workspaces/save-eyebrowse-for-perspective)
  (add-hook 'persp-activated-functions
	    #'workspaces/load-eyebrowse-for-perspective)
  (add-hook 'persp-before-save-state-to-file-functions #'workspaces/update-eyebrowse-for-perspective)
  (add-hook 'persp-after-load-state-functions #'workspaces/load-eyebrowse-after-loading-layout)
  
  (defun mattroot/eyebrowse--get-tags ()
    (--map
     (let ((split-tag (split-string (eyebrowse-format-slot it) ":")))
       (if (eq (length split-tag) 2)
	   (nth 1 split-tag)
	 (car split-tag)))
     (eyebrowse--get 'window-configs)))
  
  (defun mattroot/eyebrowse--get-slots ()
    (--map (int-to-string (car it))
           (eyebrowse--get 'window-configs)))

  (defun mattroot/eyebrowse--get-current-slot-idx ()
    (cl-position (number-to-string (eyebrowse--get 'current-slot)) (mattroot/eyebrowse--get-slots) :test 'equal))

  (defun mattroot/eyebrowse--get-current-tag ()
    (let* ((current-config (nth (mattroot/eyebrowse--get-current-slot-idx) (eyebrowse--get 'window-configs)))
	   (split-tag (split-string (eyebrowse-format-slot current-config) ":")))
      (if (eq (length split-tag) 2)
  	  (nth 1 split-tag)
  	(car split-tag))))

  (mattroot/hydra-prepare-dynamic-names (mapcar 'string-to-char (mattroot/eyebrowse--get-slots))
					(mattroot/eyebrowse--get-tags)
					(mattroot/eyebrowse--get-current-tag))

  (with-eval-after-load "hydra"
    (bind-keys ("M-m e" .
		(lambda ()
		  (interactive)
		  (call-interactively
		   (eval `(defhydra mattroot/hydra-eyebrowse (:color blue :hint nil)
			    (concat
			     "Current Slots: "
			     (mattroot/hydra-prepare-dynamic-names (mapcar 'string-to-char (mattroot/eyebrowse--get-slots))
								   (mattroot/eyebrowse--get-tags)
								   (mattroot/eyebrowse--get-current-tag))
			     "
^Navigate^          ^Modify^
^^^^^^^----------------------------
_p_ -> previous     _k_ -> kill 
_n_ -> next         _c_ -> choose
_l_ -> last         _r_ -> rename     _q_ quit")
			    ("p" (progn
				   (eyebrowse-prev-window-config nil)
				   (message "%s" (mattroot/eyebrowse--get-current-tag)))
			     :exit nil)
			    ("l" #'eyebrowse-last-window-config)
			    ("n" (progn
				   (eyebrowse-next-window-config nil)
				   (message "%s" (mattroot/eyebrowse--get-current-tag)))
			     :exit nil)
			    ("k" #'eyebrowse-close-window-config :exit nil)
			    ("c" #'eyebrowse-switch-to-window-config)
			    ("r" #'eyebrowse-rename-window-config :color blue)
			    ("q" nil)
			    ("0" #'eyebrowse-switch-to-window-config-0 :color blue)
			    ("1" #'eyebrowse-switch-to-window-config-1 :color blue)
			    ("2" #'eyebrowse-switch-to-window-config-2 :color blue)
			    ("3" #'eyebrowse-switch-to-window-config-3 :color blue)
			    ("4" #'eyebrowse-switch-to-window-config-4 :color blue)
			    ("5" #'eyebrowse-switch-to-window-config-5 :color blue)
			    ("6" #'eyebrowse-switch-to-window-config-6 :color blue)
			    ("7" #'eyebrowse-switch-to-window-config-7 :color blue)
			    ("8" #'eyebrowse-switch-to-window-config-8 :color blue)
			    ("9" #'eyebrowse-switch-to-window-config-9 :color blue))
			 )))))))

Persp-mode + eyebrowse

;;;;;
;; Bridge for eyebrowse and persp-mode
;; Code from https://gist.github.com/gilbertw1/8d963083efea41f28bfdc85ed3c93eb4
;;;;;

(defun workspaces/get-persp-workspace (&optional persp frame)
  "Get the correct workspace parameters for perspective.
PERSP is the perspective, and defaults to the current perspective.
FRAME is the frame where the parameters are expected to be used, and
defaults to the current frame."
  (let ((param-names (if (display-graphic-p frame)
                         '(gui-eyebrowse-window-configs
                           gui-eyebrowse-current-slot
                           gui-eyebrowse-last-slot)
                       '(term-eyebrowse-window-configs
                         term-eyebrowse-current-slot
                         term-eyebrowse-last-slot))))
    (--map (persp-parameter it persp) param-names)))

(defun workspaces/set-persp-workspace (workspace-params &optional persp frame)
  "Set workspace parameters for perspective.
WORKSPACE-PARAMS should be a list containing 3 elements in this order:
- window-configs, as returned by (eyebrowse--get 'window-configs)
- current-slot, as returned by (eyebrowse--get 'current-slot)
- last-slot, as returned by (eyebrowse--get 'last-slot)
PERSP is the perspective, and defaults to the current perspective.
FRAME is the frame where the parameters came from, and defaults to the
current frame.
Each perspective has two sets of workspace parameters: one set for
graphical frames, and one set for terminal frames."
  (let ((param-names (if (display-graphic-p frame)
                         '(gui-eyebrowse-window-configs
                           gui-eyebrowse-current-slot
                           gui-eyebrowse-last-slot)
                       '(term-eyebrowse-window-configs
                         term-eyebrowse-current-slot
                         term-eyebrowse-last-slot))))
    (--zip-with (set-persp-parameter it other persp)
                param-names workspace-params)))

(defun workspaces/load-eyebrowse-for-perspective (type &optional frame)
  "Load an eyebrowse workspace according to a perspective's parameters.
 FRAME's perspective is the perspective that is considered, defaulting to
 the current frame's perspective.
 If the perspective doesn't have a workspace, create one."
  (when (eq type 'frame)
    (let* ((workspace-params (workspaces/get-persp-workspace (get-frame-persp frame) frame))
           (window-configs (nth 0 workspace-params))
           (current-slot (nth 1 workspace-params))
           (last-slot (nth 2 workspace-params)))
      (if window-configs
          (progn
            (eyebrowse--set 'window-configs window-configs frame)
            (eyebrowse--set 'current-slot current-slot frame)
            (eyebrowse--set 'last-slot last-slot frame)
            (eyebrowse--load-window-config current-slot))
        (eyebrowse--set 'window-configs nil frame)
        (eyebrowse-init frame)
        (workspaces/save-eyebrowse-for-perspective frame)))))

(defun workspaces/load-eyebrowse-after-loading-layout (_state-file _phash persp-names)
  "Bridge between `persp-after-load-state-functions' and
`workspaces/load-eyebrowse-for-perspective'.
_PHASH is the hash were the loaded perspectives were placed, and
PERSP-NAMES are the names of these perspectives."
  (let ((cur-persp (get-current-persp)))
    ;; load eyebrowse for current perspective only if it was one of the loaded
    ;; perspectives
    (when (member (or (and cur-persp (persp-name cur-persp))
                      persp-nil-name)
                  persp-names)
      (workspaces/load-eyebrowse-for-perspective 'frame))))
(defun workspaces/update-eyebrowse-for-perspective (&rest _args)
  "Update and save current frame's eyebrowse workspace to its perspective."
  (let* ((current-slot (eyebrowse--get 'current-slot))
         (current-tag (nth 2 (assoc current-slot (eyebrowse--get 'window-configs)))))
    (eyebrowse--update-window-config-element
     (eyebrowse--current-window-config current-slot current-tag)))
  (workspaces/save-eyebrowse-for-perspective))
(defun workspaces/save-eyebrowse-for-perspective (&optional frame)
  "Save FRAME's eyebrowse workspace to FRAME's perspective.
FRAME defaults to the current frame."
  (workspaces/set-persp-workspace (list (eyebrowse--get 'window-configs frame)
                                        (eyebrowse--get 'current-slot frame)
                                        (eyebrowse--get 'last-slot frame))
                                  (get-frame-persp frame)
				  frame))

Ivy

(use-package ivy
  :straight t
  :config
  (ivy-mode 1)
  (setq ivy-use-virtual-buffers t)
  (setq enable-recursive-minibuffers t)
  (setq ivy-use-selectable-prompt t))

(use-package ivy-bibtex
  :straight t)

(use-package counsel
  :straight t
  :bind (("M-x" . counsel-M-x)
	 ("C-s" . swiper)
	 ("C-x C-r" . counsel-recentf)
	 ("C-x C-f" . counsel-find-file)))

Editor

(windmove-default-keybindings)

(setq-default indicate-empty-lines t)
(global-subword-mode 1)
(diminish 'subword-mode)

(global-visual-line-mode)
(diminish 'visual-line-mode)

(diminish 'auto-rev-mode)

(setq indent-tabs-mode nil)

(use-package unfill
  :straight t
  :bind ("M-m u" . unfill-paragraph))

;;;
;; Delimiters
;;;

(show-paren-mode 1)

;; (use-package autopair
;;   :straight t
;;   :diminish autopair-mode
;;   :config
;;   (autopair-global-mode)
;;   )

(use-package rainbow-delimiters
  :diminish rainbow-delimiters-mode
  :straight t
  :hook (prog-mode . (lambda () (rainbow-delimiters-mode))))


(use-package flyspell
  :straight t
  :diminish flyspell-mode
  :hook (text-mode . (lambda () (flyspell-mode 1))))


  

(use-package company
  :straight t
  :config
  (global-company-mode))

(use-package company-quickhelp
  :straight t
  :config
  (eval-after-load 'company
    '(define-key company-active-map (kbd "C-c h") #'company-quickhelp-manual-begin)))

(use-package hl-line
  :straight t
  :hook (prog-mode . hl-line-mode))

(use-package multiple-cursors
  :straight t
  :bind (("C->" . mc/mark-next-like-this)
	 ("C-<" . mc/mark-previous-like-this)
	 ("C-c C-<" . mc/mark-all-like-this)
	 ("C-S-c C-S-c" . mc/edit-lines)))

(use-package ibuffer
  :bind ([remap list-buffers] . ibuffer)
  :config (fullframe ibuffer ibuffer-quit))

(use-package magit
  :straight t
  :bind (("C-x g" . magit-status)))

(use-package undo-tree
  :straight t
  :bind (("C-/" . undo)
         ("C-?" . redo))
  :custom
  (undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo")))
  :config
  (global-undo-tree-mode 1))

(use-package yasnippet
  :straight t)

(use-package yasnippet-snippets
  :straight t)

(use-package lsp-mode
  :straight t
  :commands (lsp lsp-deffered))

(use-package lsp-ui :straight t :commands lsp-ui-mode)
;; (use-package company-lsp :straight t :commands company-lsp)
(use-package helm-lsp :straight t :commands helm-lsp-workspace-symbol)

;; (diminish 'eldoc-mode)

(use-package hl-todo
  :straight t
  :config
  (add-hook 'prog-mode-hook 'hl-todo-mode))


(remove-hook 'LaTeX-mode-hook 'latex/auto-fill-mode)
  ;; (add-hook 'LaTeX-mode-hook 'visual-line-mode)

(use-package yaml-mode
  :straight t)

(root-leader
  "t" "neotree")

(use-package neotree
  :straight t
  :bind (("M-m t" . neotree))
  :config (setq neo-smart-open t))

;; Javascript tab level
(setq js-indent-level 2)

(use-package visual-fill-column
  :straight t)

(use-package poly-markdown
  :straight t)

(use-package highlight-numbers
  :straight t)

Project

Copilot

Language inits

Initialize tree sitter

(use-package tree-sitter
  :straight t
  :config
  (global-tree-sitter-mode)

  (setq treesit-language-source-alist
   '((bash "https://github.com/tree-sitter/tree-sitter-bash")
     (cmake "https://github.com/uyha/tree-sitter-cmake")
     (css "https://github.com/tree-sitter/tree-sitter-css")
     (elisp "https://github.com/Wilfred/tree-sitter-elisp")
     (go "https://github.com/tree-sitter/tree-sitter-go")
     (html "https://github.com/tree-sitter/tree-sitter-html")
     (javascript "https://github.com/tree-sitter/tree-sitter-javascript" "master" "src")
     (json "https://github.com/tree-sitter/tree-sitter-json")
     (make "https://github.com/alemuller/tree-sitter-make")
     (markdown "https://github.com/ikatyang/tree-sitter-markdown")
     (python "https://github.com/tree-sitter/tree-sitter-python")
     (toml "https://github.com/tree-sitter/tree-sitter-toml")
     (tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")
     (typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")
     (yaml "https://github.com/ikatyang/tree-sitter-yaml")))
  
  ;; (setq major-mode-remap-alist
  ;;       '((python-mode . python-ts-mode)))

        )

(use-package tree-sitter-langs
  :straight t)

Python

;; (use-package python
;;   :hook ((python-mode . tree-sitter-hl-mode)
;;          (python-mode . highlight-numbers-mode))
;;   :config
;;   ;; (define-key python-mode-map (kbd "<tab>") 'python-indent-shift-right)
;;   ;; (define-key python-mode-map (kbd "S-<tab>") 'python-indent-shift-left)
;;   )

(use-package python
    :hook ((python-mode . tree-sitter-hl-mode)
           (python-mode . highlight-numbers-mode))
    :config
    ;; (add-hook 'python-hook (lambda ()
    ;;                               (setq
    ;;                                python-indent-guess-indent-offset-verbose
    ;;                                nil)
    ;;                               )
    ;;           )
    ;; (add-hook 'python-mode-hook 'company-mode)
    ;; (add-hook 'python-mode-hook #'yas-minor-mode)
    ;; (add-hook 'python-mode-hook 'eglot-ensure)
    ;; (add-hook 'python-mode-hook (lambda () (setq eglot-connect-timeout 120)))
    ;; (add-hook 'python-mode-hook (lambda () (setq eglot-autoshutdown t)))
    )
  
;; (use-package pyvenv
  ;; :straight t
  ;; :init
  ;; (setenv "WORKON_HOME" "~/opt/miniconda3/envs")
  ;; (setenv "WORKON_HOME" "~/.pyenv/shims/")
  ;; (pyvenv-mode 1))

(use-package pyimport
  :straight t)

(use-package py-isort
  :straight t)

(use-package python-pytest
  :straight t)

Other inits (still needing to be ported)

;;;;;;
;; Core 
;;;;;;

;; (require 'init-package)
;; (require 'init-funcs)
;; (require 'init-keybinds)
;; (require 'init-visuals)
;; (require 'init-hydra)
;; (require 'init-persp)
;; (require 'init-ivy)
;; (require 'init-editor)
(require 'init-project)

;;;;;;;;
;; Mode configs
;;;;;;;;
(require 'init-org)
(require 'init-tex)
(require 'init-julia)
;; (require 'init-python)


;;;;;;;;
;; Extras
;;;;;;;;
(require 'init-org-notes)

SQL Databases: