Skip to content

deepakjacob/.emacs.d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

Emacs Configuration README

Introduction

Configuration details of my Emacs setup - includes initialization of package sources, user interface configurations, and integrations with various essential Emacs packages.

Package Management

Package Initialization

Configured to handle packages through a combination of built-in package management and the use of straight.el for package installation.

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

Ensuring Availability

Ensures that all package archives are refreshed and all packages defined in my-packages are installed.

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

(dolist (p my-packages)
  (unless (package-installed-p p)
    (package-install p)))

Bootstrap Straight.el

straight.el is used for more deterministic management of packages.

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

User Interface Enhancements

Basic Settings

Sets up the visual aspects of Emacs to be more minimalistic and distraction-free.

(defun jd-ui-startup ()
  (interactive)
  (setq inhibit-startup-screen t
        inhibit-startup-echo-area-message t
        echo-keystrokes 0.1
        auto-save-default nil
        tab-width 2
        use-dialog-box nil
        frame-height 60
        frame-width 90
        create-lockfiles nil
        indent-tabs-mode nil
        default-tab-width 2
        backup-inhibited t)
  (set-frame-font "Comic Code Ligatures-14" nil t)
  (tooltip-mode -1)
  (scroll-bar-mode -1)
  (show-paren-mode 1)
  (global-hl-line-mode 1)
  (electric-pair-mode 1)
  (electric-indent-mode 1)
  (winum-mode 1)
  (fset 'yes-or-no-p 'y-or-n-p)
  (load-theme 'doom-ir-black t)
  (menu-bar-mode -1)
  (tool-bar-mode -1)
  (global-set-key (kbd "C-c d") 'delete-windows-on)
)

Keybindings

Configuration for global keybindings.

(global-set-key (kbd "C-c d") 'delete-windows-on)

Package Configurations

UI Packages

Setup for various UI enhancing packages like which-key, marginalia, vertico, corfu, lsp-mode, rust-mode, cape, all-the-icons, dirvish, and orderless.

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

(use-package marginalia
  :config
  (marginalia-mode))

(use-package vertico
  :config
  (vertico-mode))

(use-package corfu
  :custom
  (corfu-auto t)
  :bind (:map corfu-map
              ("TAB" . corfu-next)
              ([tab] . corfu-next)
              ("S-TAB" . corfu-previous)
              ([backtab] . corfu-previous))
  :init
  (global-corfu-mode))

(use-package lsp-mode
  :requires cape
  :config
  (setq lsp-headerline-breadcrumb-enable nil)
  :custom
  (lsp-completion-provider :none) ;; Corfu is used
  :init
  (setq lsp-keymap-prefix "C-c l")
  :hook ((rust-mode . lsp)
         (lsp-mode . lsp-enable-which-key-integration)
         (lsp-completion-mode . my/lsp-mode-setup-completion))
  :commands lsp)

(use-package rust-mode
  :hook (rust-mode . lsp))

(use-package cape
  :after corfu
  :config
  ;; Set up default completion-at-point functions
  (add-to-list 'completion-at-point-functions #'cape-file)
  (add-to-list 'completion-at-point-functions #'cape-dabbrev))

(use-package all-the-icons
  :if (display-graphic-p))

(use-package dirvish
  :init
  (dirvish-override-dired-mode)
  :config
  (setq dirvish-mode-line-format '(:left (sort symlink) :right (omit yank index)))
  :bind (:map dirvish-mode-map
              ("C-c f" . dirvish-fd)
              ("a" . dirvish-quick-access)
              ("f"   . dirvish-file-info-menu)
              ("y"   . dirvish-yank-menu)
              ("N"   . dirvish-narrow)
              ("^"   . dirvish-history-last)
              ("h"   . dirvish-history-jump) ; remapped `describe-mode'
              ("s"   . dirvish-quicksort)    ; remapped `dired-sort-toggle-or-edit'
              ("v"   . dirvish-vc-menu)      ; remapped `dired-view-file'
              ("TAB" . dirvish-subtree-toggle)
              ("M-f" . dirvish-history-go-forward)
              ("M-b" . dirvish-history-go-backward)
              ("M-l" . dirvish-ls-switches-menu)
              ("M-m" . dirvish-mark-menu)
              ("M-t" . dirvish-layout-toggle)
              ("M-s" . dirvish-setup-menu)
              ("M-e" . dirvish-emerge-menu)
              ("M-j" . dirvish-fd-jump)))

(use-package orderless
  :init
  (setq completion-styles '(orderless partial-completion basic)
        completion-category-defaults nil
        completion-category-overrides nil))

About

My customized emacs config

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published