Skip to content

Instantly share code, notes, and snippets.

@ishan9299
Created February 10, 2022 17:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ishan9299/aa320ad659914a2517af3772b547f9a0 to your computer and use it in GitHub Desktop.
Save ishan9299/aa320ad659914a2517af3772b547f9a0 to your computer and use it in GitHub Desktop.
minimal emacs config
;;; for performance
(setq gc-cons-threshold 100000000)
(setq read-process-output-max (* 1024 1024))
(add-hook 'after-init-hook #'(lambda ()
(setq gc-cons-threshold 800000)))
(require 'package)
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/"))
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-initialize)
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(eval-and-compile
(setq use-package-always-ensure t
use-package-expand-minimally t))
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(use-package vertico
:ensure t
:init
(vertico-mode)
:bind (:map vertico-map
("RET" . vertico-directory-enter)
("DEL" . vertico-directory-delete-char)
("M-DEL" . vertico-directory-delete-word)))
(use-package orderless
:ensure t
:init
(setq completion-style '(orderless)
completion-category-defaults nil
completion-category-overrides '((file (styles partial-completion)))))
(use-package savehist
:ensure t
:init
(savehist-mode))
(use-package go-mode
:ensure t)
(use-package ibuffer
:ensure nil
:bind ("C-x C-b" . ibuffer)
:hook (ibuffer-mode . hl-line-mode))
(use-package magit
:ensure t
:bind ("C-c g s" . magit-status)
:commands magit)
(use-package expand-region
:ensure t
:bind ("C-=" . er/expand-region))
(menu-bar-mode -1) ;;; disable menu-bar-mode
(scroll-bar-mode -1) ;;; disable scroll-bar-mode
(tool-bar-mode -1) ;;; disable tool-bar-mode
(when (version< emacs-version "26.3")
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3"))
;;; settings for camel case words
(global-subword-mode 1)
;;; highlight the current line
(global-hl-line-mode 1)
;;; font settings
(set-frame-font "Victor Mono Semibold-12" t t)
;;; time settings
(setq display-time-24hr-format t)
(setq display-time-format "%H:%M - %d %B %Y")
(display-time-mode 1)
;;; bar mode cursor
(setq-default cursor-type 'bar)
;;; don't show startup screen and scratch message
(setq inhibit-startup-screen t)
(setq initial-scratch-message "")
;;; window title
(setq-default frame-title-format '("%b"))
;;; shut up emacs
(setq ring-bell-function 'ignore)
(fset 'yes-or-no-p 'y-or-n-p)
;;; show paren mode
(show-paren-mode 1)
;;; don't create lockfiles
(setq create-lockfiles nil)
;;; tabs settings
(setq tab-width 4)
(setq indent-tabs-mode t) ;;; use tabs to indent
;;; load theme
(load-theme 'modus-vivendi t)
;;; always kill the current buffer
(defun kill-current-buffer ()
"Kills the current buffer."
(interactive)
(kill-buffer (current-buffer)))
(global-set-key (kbd "C-x k") 'kill-current-buffer)
@sepisoad
Copy link

sepisoad commented Jun 8, 2023

I just by accident deleted my own config and I did not put it into git so there was no way for me to quickly go back to my emacs experience. fortunately I found this and now I'm back at my emacs again.
thanks for sharing this

@ishan9299
Copy link
Author

ishan9299 commented Jun 8, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment