Created
July 22, 2021 13:51
-
-
Save DaniruKun/7aacb2f6b705c0dc732ddb01dd44454a to your computer and use it in GitHub Desktop.
Dan's emacs config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Author: Daniils Petrovs | |
;; You will most likely need to adjust this font size for your system! | |
(defvar efs/default-font-size 180) | |
(defvar efs/default-variable-font-size 180) | |
;; Make frame transparency overridable | |
(defvar efs/frame-transparency '(100 . 100)) | |
(set-frame-parameter (selected-frame) 'alpha '(100 100)) | |
(add-to-list 'default-frame-alist '(alpha 100 100)) | |
;; The default is 800 kilobytes. Measured in bytes. | |
(setq gc-cons-threshold (* 50 2000 2000)) | |
;; Set my personal details | |
(setq user-full-name "Daniils Petrovs" | |
user-mail-address "[email protected]") | |
;; (setq frame-resize-pixelwise t) | |
(defun efs/display-startup-time () | |
(message "Emacs loaded in %s with %d garbage collections." | |
(format "%.2f seconds" | |
(float-time | |
(time-subtract after-init-time before-init-time))) | |
gcs-done)) | |
(add-hook 'emacs-startup-hook #'efs/display-startup-time) | |
(setq-default | |
delete-by-moving-to-trash t ; Delete files to trash | |
tab-width 4 ; Set width for tabs | |
uniquify-buffer-name-style 'forward ; Uniquify buffer names | |
window-combination-resize t ; take new window space from all other windows (not just current) | |
x-stretch-cursor t) ; Stretch cursor to the glyph width | |
(global-hl-line-mode +1) | |
;; Initialize package sources | |
(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) | |
(use-package random-splash-image) | |
(setq random-splash-image-dir "~/.emacs.d/splash-images") | |
(random-splash-image-set) | |
(require 'ns-auto-titlebar) | |
(when (eq system-type 'darwin) (ns-auto-titlebar-mode)) | |
(use-package auto-package-update | |
:custom | |
(auto-package-update-interval 7) | |
(auto-package-update-prompt-before-update t) | |
(auto-package-update-hide-results t) | |
:config | |
(auto-package-update-maybe) | |
(auto-package-update-at-time "09:00")) | |
;; NOTE: If you want to move everything out of the ~/.emacs.d folder | |
;; reliably, set `user-emacs-directory` before loading no-littering! | |
;(setq user-emacs-directory "~/.cache/emacs") | |
(use-package no-littering) | |
;; no-littering doesn't set this by default so we must place | |
;; auto save files in the same path as it uses for sessions | |
(setq auto-save-file-name-transforms | |
`((".*" ,(no-littering-expand-var-file-name "auto-save/") t))) | |
;; (setq inhibit-startup-message t) | |
(scroll-bar-mode -1) ; Disable visible scrollbar | |
(tool-bar-mode -1) ; Disable the toolbar | |
(tooltip-mode -1) ; Disable tooltips | |
(set-fringe-mode 10) ; Give some breathing room | |
(menu-bar-mode -1) ; Disable the menu bar | |
(column-number-mode) | |
(global-display-line-numbers-mode t) | |
;; Set frame transparency | |
(set-frame-parameter (selected-frame) 'alpha efs/frame-transparency) | |
(add-to-list 'default-frame-alist `(alpha . ,efs/frame-transparency)) | |
(set-frame-parameter (selected-frame) 'fullscreen 'maximized) | |
(add-to-list 'default-frame-alist '(fullscreen . maximized)) | |
;; Disable line numbers for some modes | |
(dolist (mode '(org-mode-hook | |
term-mode-hook | |
shell-mode-hook | |
treemacs-mode-hook | |
eww-mode-hook | |
vterm-mode-hook | |
eshell-mode-hook)) | |
(add-hook mode (lambda () (display-line-numbers-mode 0)))) | |
;; Enable Slime navigation for Elisp filed | |
(dolist (hook '(emacs-lisp-mode-hook ielm-mode-hook)) | |
(add-hook hook 'turn-on-elisp-slime-nav-mode)) | |
;; Allow to easily paste images into Org | |
(require 'org-download) | |
;; Explicitly enable all-the-icons for treemacs | |
(require 'treemacs-all-the-icons) | |
(treemacs-load-theme "all-the-icons") | |
;; Snippets and enable them globally | |
(require 'yasnippet) | |
(yas-global-mode 1) | |
;; Drag-and-drop to `org` | |
(add-hook 'dired-mode-hook 'org-download-enable) | |
(setq-default org-download-image-dir "~/org/img") | |
(setq-default org-image-actual-width 800) | |
;; Adds all-the-icons support to dired | |
(add-hook 'dired-mode-hook 'all-the-icons-dired-mode) | |
(set-face-attribute 'default nil :font "Menlo" :height efs/default-font-size) | |
;; Set the fixed pitch face | |
(set-face-attribute 'fixed-pitch nil :font "Menlo" :height efs/default-font-size) | |
;; Set the variable pitch face | |
(set-face-attribute 'variable-pitch nil :font "Menlo" :height efs/default-variable-font-size :weight 'regular) | |
;; Make ESC quit prompts | |
(global-set-key (kbd "<escape>") 'keyboard-escape-quit) | |
(use-package general | |
:after evil | |
:config | |
(general-create-definer efs/leader-keys | |
:keymaps '(normal insert visual emacs) | |
:prefix "SPC" | |
:global-prefix "C-SPC") | |
(efs/leader-keys | |
"t" '(:ignore t :which-key "toggles") | |
"tt" '(counsel-load-theme :which-key "choose theme") | |
"fde" '(lambda () (interactive) (find-file (expand-file-name "~/.emacs.d/Emacs.org"))))) | |
(use-package centaur-tabs | |
:demand | |
:config | |
(centaur-tabs-mode t) | |
:bind | |
("C-<prior>" . centaur-tabs-backward) | |
("C-<next>" . centaur-tabs-forward)) | |
(centaur-tabs-headline-match) | |
(setq centaur-tabs-set-icons t) | |
(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) | |
: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)) | |
(use-package evil-collection | |
:after evil | |
:config | |
(evil-collection-init)) | |
(use-package command-log-mode | |
:commands command-log-mode) | |
(use-package doom-themes | |
:init (load-theme 'doom-one t)) | |
(use-package all-the-icons) | |
(use-package doom-modeline | |
:init (doom-modeline-mode 1) | |
:custom ((doom-modeline-height 15))) | |
(use-package which-key | |
:defer 0 | |
:diminish which-key-mode | |
:config | |
(which-key-mode) | |
(setq which-key-idle-delay 0.5)) | |
(use-package ivy | |
:diminish | |
:bind (("C-s" . swiper) | |
:map ivy-minibuffer-map | |
("TAB" . ivy-alt-done) | |
("C-l" . ivy-alt-done) | |
("C-j" . ivy-next-line) | |
("C-k" . ivy-previous-line) | |
:map ivy-switch-buffer-map | |
("C-k" . ivy-previous-line) | |
("C-l" . ivy-done) | |
("C-d" . ivy-switch-buffer-kill) | |
:map ivy-reverse-i-search-map | |
("C-k" . ivy-previous-line) | |
("C-d" . ivy-reverse-i-search-kill)) | |
:config | |
(ivy-mode 1)) | |
(use-package ivy-rich | |
:after ivy | |
:init | |
(ivy-rich-mode 1)) | |
(use-package counsel | |
:bind (("C-M-j" . 'counsel-switch-buffer) | |
:map minibuffer-local-map | |
("C-r" . 'counsel-minibuffer-history)) | |
:custom | |
(counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only) | |
:config | |
(counsel-mode 1)) | |
(use-package ivy-prescient | |
:after counsel | |
:custom | |
(ivy-prescient-enable-filtering nil) | |
:config | |
;; Uncomment the following line to have sorting remembered across sessions! | |
;(prescient-persist-mode 1) | |
(ivy-prescient-mode 1)) | |
(use-package helpful | |
:commands (helpful-callable helpful-variable helpful-command helpful-key) | |
:custom | |
(counsel-describe-function-function #'helpful-callable) | |
(counsel-describe-variable-function #'helpful-variable) | |
:bind | |
([remap describe-function] . counsel-describe-function) | |
([remap describe-command] . helpful-command) | |
([remap describe-variable] . counsel-describe-variable) | |
([remap describe-key] . helpful-key)) | |
(use-package hydra | |
:defer t) | |
(defhydra hydra-text-scale (:timeout 4) | |
"scale text" | |
("j" text-scale-increase "in") | |
("k" text-scale-decrease "out") | |
("f" nil "finished" :exit t)) | |
(efs/leader-keys | |
"ts" '(hydra-text-scale/body :which-key "scale text")) | |
;; ParEdit configuration for everything to do with parens | |
(autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t) | |
(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) | |
(add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode) | |
(add-hook 'ielm-mode-hook #'enable-paredit-mode) | |
(add-hook 'lisp-mode-hook #'enable-paredit-mode) | |
(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode) | |
(add-hook 'scheme-mode-hook #'enable-paredit-mode) | |
(add-hook 'elixir-mode-hook #'enable-paredit-mode) | |
(add-hook 'slime-repl-mode-hook (lambda () (paredit-mode +1))) | |
;; Stop SLIME's REPL from grabbing DEL, | |
;; which is annoying when backspacing over a '(' | |
(defun override-slime-repl-bindings-with-paredit () | |
(define-key slime-repl-mode-map | |
(read-kbd-macro paredit-backward-delete-key) nil)) | |
(add-hook 'slime-repl-mode-hook 'override-slime-repl-bindings-with-paredit) | |
(defun efs/org-font-setup () | |
;; Replace list hyphen with dot | |
(font-lock-add-keywords 'org-mode | |
'(("^ *\\([-]\\) " | |
(0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•")))))) | |
;; Set faces for heading levels | |
(dolist (face '((org-level-1 . 1.2) | |
(org-level-2 . 1.1) | |
(org-level-3 . 1.05) | |
(org-level-4 . 1.0) | |
(org-level-5 . 1.1) | |
(org-level-6 . 1.1) | |
(org-level-7 . 1.1) | |
(org-level-8 . 1.1))) | |
(set-face-attribute (car face) nil :font "Menlo" :weight 'regular :height (cdr face))) | |
;; Ensure that anything that should be fixed-pitch in Org files appears that way | |
(set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch) | |
(set-face-attribute 'org-table nil :inherit 'fixed-pitch) | |
(set-face-attribute 'org-formula nil :inherit 'fixed-pitch) | |
(set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch)) | |
(set-face-attribute 'org-table nil :inherit '(shadow fixed-pitch)) | |
(set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch)) | |
(set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch)) | |
(set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch)) | |
(set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch) | |
(set-face-attribute 'line-number nil :inherit 'fixed-pitch) | |
(set-face-attribute 'line-number-current-line nil :inherit 'fixed-pitch)) | |
(defun efs/org-mode-setup () | |
(org-indent-mode) | |
(variable-pitch-mode 1) | |
(visual-line-mode 1)) | |
(setq org-directory "~/org/") | |
(use-package org | |
:pin org | |
:commands (org-capture org-agenda) | |
:hook (org-mode . efs/org-mode-setup) | |
:config | |
(setq org-ellipsis " ▾") | |
(setq org-agenda-start-with-log-mode t) | |
(setq org-log-done 'time) | |
(setq org-log-into-drawer t) | |
(setq org-agenda-files | |
'("~/.emacs.d/OrgFiles/Tasks.org" | |
"~/.emacs.d/OrgFiles/Habits.org" | |
"~/.emacs.d/OrgFiles/Birthdays.org")) | |
(require 'org-habit) | |
(add-to-list 'org-modules 'org-habit) | |
(setq org-habit-graph-column 60) | |
(setq org-todo-keywords | |
'((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)") | |
(sequence "BACKLOG(b)" "PLAN(p)" "READY(r)" "ACTIVE(a)" "REVIEW(v)" "WAIT(w@/!)" "HOLD(h)" "|" "COMPLETED(c)" "CANC(k@)"))) | |
(setq org-refile-targets | |
'(("Archive.org" :maxlevel . 1) | |
("Tasks.org" :maxlevel . 1))) | |
;; Save Org buffers after refiling! | |
(advice-add 'org-refile :after 'org-save-all-org-buffers) | |
(setq org-tag-alist | |
'((:startgroup) | |
; Put mutually exclusive tags here | |
(:endgroup) | |
("@errand" . ?E) | |
("@home" . ?H) | |
("@work" . ?W) | |
("agenda" . ?a) | |
("planning" . ?p) | |
("publish" . ?P) | |
("batch" . ?b) | |
("note" . ?n) | |
("idea" . ?i))) | |
;; Configure custom agenda views | |
(setq org-agenda-custom-commands | |
'(("d" "Dashboard" | |
((agenda "" ((org-deadline-warning-days 7))) | |
(todo "NEXT" | |
((org-agenda-overriding-header "Next Tasks"))) | |
(tags-todo "agenda/ACTIVE" ((org-agenda-overriding-header "Active Projects"))))) | |
("n" "Next Tasks" | |
((todo "NEXT" | |
((org-agenda-overriding-header "Next Tasks"))))) | |
("W" "Work Tasks" tags-todo "+work-email") | |
;; Low-effort next actions | |
("e" tags-todo "+TODO=\"NEXT\"+Effort<15&+Effort>0" | |
((org-agenda-overriding-header "Low Effort Tasks") | |
(org-agenda-max-todos 20) | |
(org-agenda-files org-agenda-files))) | |
("w" "Workflow Status" | |
((todo "WAIT" | |
((org-agenda-overriding-header "Waiting on External") | |
(org-agenda-files org-agenda-files))) | |
(todo "REVIEW" | |
((org-agenda-overriding-header "In Review") | |
(org-agenda-files org-agenda-files))) | |
(todo "PLAN" | |
((org-agenda-overriding-header "In Planning") | |
(org-agenda-todo-list-sublevels nil) | |
(org-agenda-files org-agenda-files))) | |
(todo "BACKLOG" | |
((org-agenda-overriding-header "Project Backlog") | |
(org-agenda-todo-list-sublevels nil) | |
(org-agenda-files org-agenda-files))) | |
(todo "READY" | |
((org-agenda-overriding-header "Ready for Work") | |
(org-agenda-files org-agenda-files))) | |
(todo "ACTIVE" | |
((org-agenda-overriding-header "Active Projects") | |
(org-agenda-files org-agenda-files))) | |
(todo "COMPLETED" | |
((org-agenda-overriding-header "Completed Projects") | |
(org-agenda-files org-agenda-files))) | |
(todo "CANC" | |
((org-agenda-overriding-header "Cancelled Projects") | |
(org-agenda-files org-agenda-files))))))) | |
(setq org-capture-templates | |
`(("t" "Tasks / Projects") | |
("tt" "Task" entry (file+olp "~/.emacs.d/OrgFiles/Tasks.org" "Inbox") | |
"* TODO %?\n %U\n %a\n %i" :empty-lines 1) | |
("j" "Journal Entries") | |
("jj" "Journal" entry | |
(file+olp+datetree "~/.emacs.d/OrgFiles/Journal.org") | |
"\n* %<%I:%M %p> - Journal :journal:\n\n%?\n\n" | |
;; ,(dw/read-file-as-string "~/Notes/Templates/Daily.org") | |
:clock-in :clock-resume | |
:empty-lines 1) | |
("jm" "Meeting" entry | |
(file+olp+datetree "~/.emacs.d/OrgFiles/Journal.org") | |
"* %<%I:%M %p> - %a :meetings:\n\n%?\n\n" | |
:clock-in :clock-resume | |
:empty-lines 1) | |
("w" "Workflows") | |
("we" "Checking Email" entry (file+olp+datetree "~/.emacs.d/OrgFiles/Journal.org") | |
"* Checking Email :email:\n\n%?" :clock-in :clock-resume :empty-lines 1) | |
("m" "Metrics Capture") | |
("mw" "Weight" table-line (file+headline "~/.emacs.d/OrgFiles/Metrics.org" "Weight") | |
"| %U | %^{Weight} | %^{Notes} |" :kill-buffer t))) | |
(define-key global-map (kbd "C-c j") | |
(lambda () (interactive) (org-capture nil "jj"))) | |
(efs/org-font-setup)) | |
(setq org-capture-templates | |
'(("c" "Cookbook" entry (file "~/org/cookbook.org") | |
"%(org-chef-get-recipe-from-url)" | |
:empty-lines 1) | |
("m" "Manual Cookbook" entry (file "~/org/cookbook.org") | |
"* %^{Recipe title: }\n :PROPERTIES:\n :source-url:\n :servings:\n :prep-time:\n :cook-time:\n :ready-in:\n :END:\n** Ingredients\n %?\n** Directions\n\n"))) | |
(use-package org-bullets | |
:hook (org-mode . org-bullets-mode) | |
:custom | |
(org-bullets-bullet-list '("◉" "○" "●" "○" "●" "○" "●"))) | |
(defun efs/org-mode-visual-fill () | |
(setq visual-fill-column-width 100 | |
visual-fill-column-center-text t) | |
(visual-fill-column-mode 1)) | |
(use-package visual-fill-column | |
:hook (org-mode . efs/org-mode-visual-fill)) | |
(with-eval-after-load 'org | |
(org-babel-do-load-languages | |
'org-babel-load-languages | |
'((emacs-lisp . t) | |
(python . t))) | |
(push '("conf-unix" . conf-unix) org-src-lang-modes)) | |
(with-eval-after-load 'org | |
;; This is needed as of Org 9.2 | |
(require 'org-tempo) | |
(add-to-list 'org-structure-template-alist '("sh" . "src shell")) | |
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) | |
(add-to-list 'org-structure-template-alist '("py" . "src python"))) | |
;; Not super clear how to use org-babel yet, so will disable for now | |
;; Automatically tangle our Emacs.org config file when we save it | |
;; (defun efs/org-babel-tangle-config () | |
;; (when (string-equal (file-name-directory (buffer-file-name)) | |
;; (expand-file-name user-emacs-directory)) | |
;; ;; Dynamic scoping to the rescue | |
;; (let ((org-confirm-babel-evaluate nil)) | |
;; (org-babel-tangle)))) | |
;; (add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'efs/org-babel-tangle-config))) | |
(defun efs/lsp-mode-setup () | |
(elixir-mode . lsp)) | |
(use-package lsp-mode | |
:commands (lsp lsp-deferred) | |
:ensure t | |
:diminish lsp-mode | |
:hook (lsp-mode . efs/lsp-mode-setup) | |
:init | |
(setq lsp-keymap-prefix "C-c l") ;; Or 'C-l', 's-l' | |
(add-to-list 'exec-path "/usr/local/bin/elixir-ls") | |
:config | |
(setq lsp-headerline-enable nil | |
lsp-headerline-breadcrumb-enable nil) ;; disable headerline breadcrumbs | |
(lsp-enable-which-key-integration t)) | |
(use-package lsp-ui | |
:hook (lsp-mode . lsp-ui-mode)) | |
(use-package lsp-treemacs | |
:after lsp) | |
(use-package lsp-ivy | |
:after lsp) | |
(use-package dap-mode | |
;; Uncomment the config below if you want all UI panes to be hidden by default! | |
;; :custom | |
;; (lsp-enable-dap-auto-configure nil) | |
;; :config | |
;; (dap-ui-mode 1) | |
:commands dap-debug | |
:config | |
;; Set up Node debugging | |
(require 'dap-node) | |
(dap-node-setup) ;; Automatically installs Node debug adapter if needed | |
(setq dap-ui-mode 1 | |
dap-tooltip-mode 1 | |
tooltip-mode 1 | |
dap-ui-controls-mode 1) | |
;; Bind `C-c l d` to `dap-hydra` for easy access | |
(general-define-key | |
:keymaps 'lsp-mode-map | |
:prefix lsp-keymap-prefix | |
"d" '(dap-hydra t :wk "debugger"))) | |
;; Enable folding | |
(setq lsp-enable-folding t) | |
;; Add origami and LSP integration | |
(use-package lsp-origami) | |
(add-hook 'lsp-after-open-hook #'lsp-origami-try-enable) | |
(use-package typescript-mode | |
:mode "\\.ts\\'" | |
:hook (typescript-mode . lsp-deferred) | |
:config | |
(setq typescript-indent-level 2)) | |
(use-package python-mode | |
:ensure t | |
:hook (python-mode . lsp-deferred) | |
:custom | |
;; NOTE: Set these if Python 3 is called "python3" on your system! | |
;; (python-shell-interpreter "python3") | |
;; (dap-python-executable "python3") | |
(dap-python-debugger 'debugpy) | |
:config | |
(require 'dap-python)) | |
(use-package pyvenv | |
:after python-mode | |
:config | |
(pyvenv-mode 1)) | |
(use-package company | |
:ensure t | |
:after lsp-mode | |
:hook (lsp-mode . company-mode) | |
:bind (:map company-active-map | |
("<tab>" . company-complete-selection)) | |
(:map lsp-mode-map | |
("<tab>" . company-indent-or-complete-common)) | |
:custom | |
(company-minimum-prefix-length 1) | |
(company-idle-delay 0.1)) | |
(use-package company-box | |
:hook (company-mode . company-box-mode)) | |
(use-package projectile | |
:diminish projectile-mode | |
:config (projectile-mode) | |
:custom ((projectile-completion-system 'ivy)) | |
:bind-keymap | |
("C-c p" . projectile-command-map) | |
:init | |
;; NOTE: Set this to the folder where you keep your Git repos! | |
;; Projectile specific settings | |
(setq projectile-project-search-path '("~/projects/git/")) | |
(setq projectile-ignored-projects '("~/" "/tmp" "~/.emacs.d/.local/straight/repos/")) | |
(when (file-directory-p "~/GIT") | |
(setq projectile-project-search-path '("~/GIT"))) | |
(setq projectile-switch-project-action #'projectile-dired)) | |
(use-package counsel-projectile | |
:after projectile | |
:config (counsel-projectile-mode)) | |
(use-package magit | |
:commands magit-status | |
:custom | |
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) | |
;; NOTE: Make sure to configure a GitHub token before using this package! | |
;; - https://magit.vc/manual/forge/Token-Creation.html#Token-Creation | |
;; - https://magit.vc/manual/ghub/Getting-Started.html#Getting-Started | |
(use-package forge | |
:after magit) | |
(use-package evil-nerd-commenter | |
:bind ("M-/" . evilnc-comment-or-uncomment-lines)) | |
(use-package rainbow-delimiters | |
:hook (prog-mode . rainbow-delimiters-mode)) | |
(use-package term | |
:commands term | |
:config | |
(setq explicit-shell-file-name "zsh") ;; Change this to zsh, etc | |
;;(setq explicit-zsh-args '()) ;; Use 'explicit-<shell>-args for shell-specific args | |
;; Match the default Bash shell prompt. Update this if you have a custom prompt | |
(setq term-prompt-regexp "^[^#$%>\n]*[#$%>] *")) | |
(use-package eterm-256color | |
:hook (term-mode . eterm-256color-mode)) | |
(use-package vterm | |
:commands vterm | |
:config | |
(setq term-prompt-regexp "^[^#$%>\n]*[#$%>] *") ;; Set this to match your custom shell prompt | |
;;(setq vterm-shell "zsh") ;; Set this to customize the shell to launch | |
(setq vterm-max-scrollback 10000)) | |
(when (eq system-type 'windows-nt) | |
(setq explicit-shell-file-name "powershell.exe") | |
(setq explicit-powershell.exe-args '())) | |
(defun efs/configure-eshell () | |
;; Save command history when commands are entered | |
(add-hook 'eshell-pre-command-hook 'eshell-save-some-history) | |
;; Truncate buffer for performance | |
(add-to-list 'eshell-output-filter-functions 'eshell-truncate-buffer) | |
;; Bind some useful keys for evil-mode | |
(evil-define-key '(normal insert visual) eshell-mode-map (kbd "C-r") 'counsel-esh-history) | |
(evil-define-key '(normal insert visual) eshell-mode-map (kbd "<home>") 'eshell-bol) | |
(evil-normalize-keymaps) | |
(setq eshell-history-size 10000 | |
eshell-buffer-maximum-lines 10000 | |
eshell-hist-ignoredups t | |
eshell-scroll-to-bottom-on-input t)) | |
(use-package eshell-git-prompt | |
:after eshell) | |
(use-package eshell | |
:hook (eshell-first-time-mode . efs/configure-eshell) | |
:config | |
(with-eval-after-load 'esh-opt | |
(setq eshell-destroy-buffer-when-process-dies t) | |
(setq eshell-visual-commands '("htop" "zsh" "vim"))) | |
(eshell-git-prompt-use-theme 'powerline)) | |
(use-package dired | |
:ensure nil | |
:commands (dired dired-jump) | |
:bind (("C-x C-j" . dired-jump)) | |
:custom ((dired-listing-switches "-agho --group-directories-first")) | |
:config | |
(when (string= system-type "darwin") | |
(setq dired-use-ls-dired t | |
insert-directory-program "/usr/local/bin/gls")) | |
(evil-collection-define-key 'normal 'dired-mode-map | |
"h" 'dired-single-up-directory | |
"l" 'dired-single-buffer)) | |
(use-package dired-single | |
:commands (dired dired-jump)) | |
(use-package all-the-icons-dired | |
:hook (dired-mode . all-the-icons-dired-mode)) | |
(use-package dired-open | |
:commands (dired dired-jump) | |
:config | |
;; Doesn't work as expected! | |
;;(add-to-list 'dired-open-functions #'dired-open-xdg t) | |
(setq dired-open-extensions '(("png" . "feh") | |
("mkv" . "mpv")))) | |
(use-package dired-hide-dotfiles | |
:hook (dired-mode . dired-hide-dotfiles-mode) | |
:config | |
(evil-collection-define-key 'normal 'dired-mode-map | |
"H" 'dired-hide-dotfiles-mode)) | |
;; Make gc pauses faster by decreasing the threshold. | |
(setq gc-cons-threshold (* 2 1000 1000)) | |
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(ansi-color-names-vector | |
["#282c34" "#ff6c6b" "#98be65" "#ECBE7B" "#51afef" "#c678dd" "#46D9FF" "#bbc2cf"]) | |
'(custom-safe-themes | |
'("6c386d159853b0ee6695b45e64f598ed45bd67c47f671f69100817d7db64724d" default)) | |
'(exwm-floating-border-color "#191b20") | |
'(fci-rule-color "#5B6268") | |
'(highlight-tail-colors | |
((("#333a38" "#99bb66" "green") | |
. 0) | |
(("#2b3d48" "#46D9FF" "brightcyan") | |
. 20))) | |
'(jdee-db-active-breakpoint-face-colors (cons "#1B2229" "#51afef")) | |
'(jdee-db-requested-breakpoint-face-colors (cons "#1B2229" "#98be65")) | |
'(jdee-db-spec-breakpoint-face-colors (cons "#1B2229" "#3f444a")) | |
'(objed-cursor-color "#ff6c6b") | |
'(package-selected-packages | |
'(lsp-origami origami elixir-yasnippets dotenv-mode elisp-lint elisp-slime-nav centaur-tabs noaa paredit ns-auto-titlebar org-chef org-download vagrant dockerfile-mode enh-ruby-mode osx-lib docker-compose-mode org-vcard ox-pandoc yasnippet-snippets elixir-mode markdown-preview-mode rfc-mode xkcd google-this yasnippet pdf-tools elcord hnreader google-translate copy-as-format nginx-mode cmake-mode minesweeper lsp-ui which-key vterm visual-fill-column use-package typescript-mode rainbow-delimiters pyvenv python-mode org-bullets no-littering lsp-ivy ivy-rich ivy-prescient helpful general forge evil-nerd-commenter evil-collection eterm-256color eshell-git-prompt doom-themes doom-modeline dired-single dired-open dired-hide-dotfiles dap-mode counsel-projectile company-box command-log-mode auto-package-update all-the-icons-dired)) | |
'(pdf-view-midnight-colors (cons "#bbc2cf" "#282c34")) | |
'(rustic-ansi-faces | |
["#282c34" "#ff6c6b" "#98be65" "#ECBE7B" "#51afef" "#c678dd" "#46D9FF" "#bbc2cf"]) | |
'(send-mail-function 'mailclient-send-it) | |
'(vc-annotate-background "#282c34") | |
'(vc-annotate-color-map | |
(list | |
(cons 20 "#98be65") | |
(cons 40 "#b4be6c") | |
(cons 60 "#d0be73") | |
(cons 80 "#ECBE7B") | |
(cons 100 "#e6ab6a") | |
(cons 120 "#e09859") | |
(cons 140 "#da8548") | |
(cons 160 "#d38079") | |
(cons 180 "#cc7cab") | |
(cons 200 "#c678dd") | |
(cons 220 "#d974b7") | |
(cons 240 "#ec7091") | |
(cons 260 "#ff6c6b") | |
(cons 280 "#cf6162") | |
(cons 300 "#9f585a") | |
(cons 320 "#6f4e52") | |
(cons 340 "#5B6268") | |
(cons 360 "#5B6268"))) | |
'(vc-annotate-very-old-color nil)) | |
(custom-set-faces | |
;; custom-set-faces was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment