Compare commits

..

3 Commits

Author SHA1 Message Date
Jeremy Dormitzer
983fc50ab4 Set up eshell 2021-02-20 14:58:31 -05:00
Jeremy Dormitzer
a3d4ba6327 Move undo-tree to its own config file 2021-02-20 14:58:09 -05:00
Jeremy Dormitzer
b165c51e77 Set up IDE features 2021-02-20 14:57:40 -05:00
7 changed files with 101 additions and 8 deletions

View File

@ -61,6 +61,7 @@
;; Consult adds a bunch of completing-read based utilities
(use-package consult
:general
([remap switch-to-buffer] #'consult-buffer))
([remap switch-to-buffer] #'consult-buffer)
([remap imenu] #'consult-imenu))
(provide 'init-completion)

View File

@ -1,12 +1,5 @@
;; General text editing configuration
;; Tree-shaped undos
(use-package undo-tree
:config
(global-undo-tree-mode)
:general
("C-c C-r" #'undo-tree-visualize))
;; Better isearch
(use-package ctrlf
:config

View File

@ -0,0 +1,44 @@
(use-package eshell
:straight (:type built-in)
:config
;; Easy binding to get an eshell
(defun open-eshell (&optional arg)
(interactive "P")
(if (and (fboundp 'projectile-project-root)
(projectile-project-root))
(projectile-run-eshell arg)
(eshell arg)))
;; Actually clear the eshell buffer
(defun clear-eshell (&optional prefix)
(interactive)
(let ((input (eshell-get-old-input)))
(eshell/clear-scrollback)
(eshell-emit-prompt)
(insert input)))
(add-hook 'eshell-mode-hook
(lambda () (general-def eshell-mode-map "C-c C-o" #'clear-eshell)))
(evil-collection-eshell-setup)
;; Gotta have a good prompt
(defun jdormit-eshell-prompt ()
(let ((branch (magit-name-local-branch "HEAD")))
(format "%s%s"
(if branch (format "(%s) " branch) "")
(concat (abbreviate-file-name (eshell/pwd))
" "
(propertize
(if (= (user-uid) 0) "#" "λ")
'face `(:foreground "#859900"))
" "))))
(setq jdormit-eshell-prompt-regex "^[^#λ\n]* [#λ] ")
(setq eshell-prompt-function 'jdormit-eshell-prompt)
(setq eshell-prompt-regexp jdormit-eshell-prompt-regex)
:general
(leader-map "'" #'open-eshell)
:custom
(eshell-cmpl-cycle-completions nil))
(provide 'init-eshell)

View File

@ -1,5 +1,9 @@
;; Magit!
(use-package magit
:commands (magit-status
magit-file-dispatch
magit-dispatch
magit-name-local-branch)
:init
(leader-def-key "g" '(nil :which-key "git"))
:config

View File

@ -0,0 +1,27 @@
;; IDE features
;; Company-mode provides inline autocompletion
(use-package company
:hook (after-init . global-company-mode))
;; Flycheck gives you error squigglies
(use-package flycheck
:hook (after-init . global-flycheck-mode)
:custom
(flycheck-disabled-checkers '(emacs-lisp-checkdoc emacs-lisp)))
;; Quick file overview for supported modes
(use-package imenu
:straight (:type built-in)
:general
(leader-map "m" #'imenu))
;; Find definition/references
(use-package xref
:straight (:type built-in)
:general
(normal "M-." #'xref-find-definitions)
(normal "M-," #'xref-pop-marker-stack)
(normal "M-r" #'xref-find-references))
(provide 'init-ide)

View File

@ -0,0 +1,9 @@
;; Tree-shaped undos
(use-package undo-tree
:demand t
:config
(global-undo-tree-mode)
:bind ("C-c C-r" . undo-tree-visualize))
(provide 'init-undo)

View File

@ -19,12 +19,25 @@
(straight-use-package 'use-package)
(setq straight-use-package-by-default t)
;; Fix $PATH
(use-package exec-path-from-shell
:hook (after-init . exec-path-from-shell-initialize)
:custom
(exec-path-from-shell-variables '("PATH" "MANPATH" "LEDGER_FILE" "LOLA_HOME"
"MODELS_HOME" "LOLA_TRAVEL_SERVICE_HOME" "WORKON_HOME"
"PIPENV_VERBOSITY" "PIPENV_DONT_LOAD_ENV"
"PIPENV_MAX_DEPTH" "PYENV_ROOT" "KOPS_STATE_STORE"
"PLAID_CLIENT_ID" "PLAID_SECRET" "PLAID_ENVIRONMENT"))
(exec-path-from-shell-check-startup-files nil))
;; Don't use this file as the custom-file
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
;; Load config modules
(add-to-list 'load-path (expand-file-name "config" user-emacs-directory))
(require 'init-defaults)
(require 'init-undo)
(require 'init-evil)
(require 'init-keybindings)
(require 'init-auth)
@ -40,6 +53,8 @@
(require 'init-ui)
(require 'init-projects)
(require 'init-git)
(require 'init-ide)
(require 'init-eshell)
;; Load the custom file
(when (file-exists-p custom-file)