Skip to content

Instantly share code, notes, and snippets.

@joseche
Created October 15, 2025 11:14
Show Gist options
  • Select an option

  • Save joseche/1d0c5e7d74336fcf732630bc09deac42 to your computer and use it in GitHub Desktop.

Select an option

Save joseche/1d0c5e7d74336fcf732630bc09deac42 to your computer and use it in GitHub Desktop.
;; Initialize package sources
(require 'package)
;; Add Melpa and Melpa-Stable to the list of repositories
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
;; Initialize the package system
(package-initialize)
;; If the package system isn't already activated, refresh the package list.
(unless package-archive-contents
(package-refresh-contents))
;; Ensure `use-package' is installed.
;; `use-package' is a macro that simplifies configuration.
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(require 'use-package)
;; Ensure that packages are downloaded and installed before they are run.
(setq use-package-always-ensure t)
;;; Basic UI Configuration
(use-package emacs
:init
;; Disable the startup message
(setq inhibit-startup-message t)
(setq initial-scratch-message "")
;; Disable the menu bar, tool bar, and scroll bar for a cleaner look
(menu-bar-mode -1)
(tool-bar-mode -1)
;; Show line numbers in the margin
(global-display-line-numbers-mode 1)
;; Show column number in the mode line
(column-number-mode 1)
;; Better scrolling
(setq scroll-margin 10
scroll-step 1
scroll-conservatively 101
scroll-up-aggressively 0.01
scroll-down-aggressively 0.01)
;; Set a nice theme (you must install it first, see below)
(load-theme 'tango-dark t))
;;; Install and Configure Packages with 'use-package'
(use-package which-key
:init (which-key-mode)
:config
(setq which-key-idle-delay 0.3))
(use-package python-mode
:config
;; Set Python interpreter
(setq python-shell-interpreter "python3"))
(use-package evil
:config
(require 'evil)
(evil-mode 1))
(use-package lsp-mode
:init
(setq lsp-diagnostics-provider :none)
(setq lsp-keymap-prefix "C-c l")
:hook ((python-mode . lsp))
:commands lsp)
(use-package flycheck
:init (global-flycheck-mode))
(add-hook 'lsp-mode-hook #'flycheck-mode)
(use-package lsp-ui
:ensure t
:commands lsp-ui-mode
:after lsp-mode
:hook (lsp-mode . lsp-ui-mode)
:config
(setq lsp-ui-sideline-enable t
lsp-ui-sideline-show-diagnostics t
lsp-ui-doc-enable t))
(use-package doom-themes
:demand t
:config
(setq doom-themes-enable-bold t
doom-themes-enable-italic t))
;; (load-theme 'doom-challenger-deep)
;; (doom-themes-visual-bell-config)
;;(doom-themes-org-config))
(use-package dired-sidebar
:bind (("C-x C-b" . dired-sidebar-toggle-sidebar))
:ensure t
:commands (dired-sidebar-toggle-sidebar))
(use-package nerd-icons :defer t)
(use-package nerd-icons-dired
:commands (nerd-icons-dired-mode)
:hook
(dired-mode . nerd-icons-dired-mode))
(setq dired-sidebar-theme 'nerd-icons)
(use-package theme-looper
:ensure t
:bind (("C-c t n" . theme-looper-enable-next-theme)
("C-c t p" . theme-looper-enable-previous-theme)))
(use-package saveplace
:init (save-place-mode))
(save-place-mode 1)
(use-package beacon)
(beacon-mode 1)
;; (xterm-mouse-mode 1)
(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.
'(custom-safe-themes
'("d12b1d9b0498280f60e5ec92e5ecec4b5db5370d05e787bc7cc49eae6fb07bc0"
"8d3ef5ff6273f2a552152c7febc40eabca26bae05bd12bc85062e2dc224cde9a"
"dd4582661a1c6b865a33b89312c97a13a3885dc95992e2e5fc57456b4c545176"
"df6dfd55673f40364b1970440f0b0cb8ba7149282cf415b81aaad2d98b0f0290"
"aec7b55f2a13307a55517fdf08438863d694550565dee23181d2ebd973ebd6b8"
"720838034f1dd3b3da66f6bd4d053ee67c93a747b219d1c546c41c4e425daf93"
"8c7e832be864674c220f9a9361c851917a93f921fedb7717b1b5ece47690c098"
"13096a9a6e75c7330c1bc500f30a8f4407bd618431c94aeab55c9855731a95e1"
default))
'(package-selected-packages 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