Created
October 9, 2021 18:44
-
-
Save n3rio/2d0c87034558a2c0ebf746d5b836237f to your computer and use it in GitHub Desktop.
emacs init.el
This file contains hidden or 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
;; Look & feel | |
;; =========== | |
(setq inhibit-startup-message t) | |
(scroll-bar-mode -1) | |
(tool-bar-mode -1) | |
(tooltip-mode -1) | |
(set-fringe-mode 10) | |
(menu-bar-mode -1) | |
(setq visible-bell t) | |
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3") | |
;; Make ESC quit prompts | |
(global-set-key (kbd "<escape>") 'keyboard-escape-quit) | |
;; 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-refresh-contents)) | |
(require 'use-package) | |
(setq use-package-always-ensure t) | |
(use-package command-log-mode) | |
(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 flycheck) | |
(use-package py-autopep8) | |
(use-package blacken) | |
(use-package all-the-icons) | |
(use-package doom-modeline | |
:ensure t | |
:init (doom-modeline-mode 1) | |
:custom ((doom-modeline-height 10))) | |
(use-package doom-themes | |
:init (load-theme 'doom-nord t)) | |
(use-package rainbow-delimiters | |
:hook (prog-mode . rainbow-delimiters-mode)) | |
(use-package which-key | |
:init (which-key-mode) | |
:diminish which-key-mode | |
:config | |
(setq which-key-idle-delay 1)) | |
(use-package ivy-rich | |
:init | |
(ivy-rich-mode 1)) | |
(use-package counsel | |
:bind (("M-x" . counsel-M-x) | |
("C-x b" . counsel-ibuffer) | |
("C-x C-f" . counsel-find-file) | |
:map minibuffer-local-map | |
("C-r" . 'counsel-minibuffer-history))) | |
(use-package helpful | |
: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 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 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! | |
(when (file-directory-p "~/home/n3rio/work/") | |
(setq projectile-project-search-path '("~/home/n3rio/work/"))) | |
(setq projectile-switch-project-action #'projectile-dired)) | |
(use-package python-mode | |
:ensure nil | |
:hook (python-mode . lsp-deferred) | |
:custom | |
(python-shell-interpreter "python3")) | |
(defun efs/lsp-mode-setup () | |
(setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols)) | |
(lsp-headerline-breadcrumb-mode)) | |
(use-package lsp-mode | |
:commands (lsp lsp-deferred) | |
:hook (lsp-mode . efs/lsp-mode-setup) | |
:init | |
(setq lsp-keymap-prefix "C-c l") ;; Or 'C-l', 's-l' | |
:config | |
(lsp-enable-which-key-integration t)) | |
(use-package lsp-ui | |
:hook (lsp-mode . lsp-ui-mode) | |
:custom | |
(lsp-ui-doc-position 'bottom)) | |
(use-package lsp-treemacs | |
:after lsp) | |
(use-package lsp-ivy) | |
(use-package pyvenv | |
:config | |
(pyvenv-mode 1)) | |
(add-to-list 'load-path "/home/n3rio/work/") | |
(require 'py-isort) | |
(add-hook 'before-save-hook 'py-isort-before-save) | |
(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. | |
'(package-selected-packages | |
(quote | |
(pyvenv pyenv py-isort python-mode blacken py-autopep8 flycheck lsp-ivy lsp-ui lsp-treemacs lsp-mode which-key use-package typescript-mode rainbow-delimiters projectile ivy-rich hydra helpful evil-collection doom-themes doom-modeline counsel command-log-mode)))) | |
(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