Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save zhangchunsheng-science/1aa241e8b8312d983d5fc204b73a1da4 to your computer and use it in GitHub Desktop.

Select an option

Save zhangchunsheng-science/1aa241e8b8312d983d5fc204b73a1da4 to your computer and use it in GitHub Desktop.
My minimal Emacs config
;; Package configs
(require 'package)
(setq package-enable-at-startup nil)
(setq package-archives '(("org" . "http://orgmode.org/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")))
(package-initialize)
;; Bootstrap `use-package`
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(require 'use-package)
;; Avy package, not loaded until avy-goto-word-1 called
(use-package avy :ensure t
:commands (avy-goto-word-1))
;; Packages
(use-package which-key :ensure t)
(use-package helm :ensure t)
(use-package counsel :ensure t)
(use-package hydra :ensure t)
(use-package evil :ensure t)
(use-package doom-themes :ensure t)
;; Start packages
(which-key-mode)
(evil-mode 1)
;; Config
(setq which-key-separator " ")
(setq which-key-prefix-prefix "+")
(setq helm-mode-fuzzy-match t)
(setq helm-completion-in-region-fuzzy-match t)
(setq helm-candidate-number-list 50)
;; Main keybinding
(use-package general :ensure t
:config (general-define-key
:states '(normal visual insert emacs)
:prefix "SPC"
:non-normal-prefix "M-SPC"
"/" '(counsel-rg :which-key "ripgrep")
"TAB" '(switch-to-prev-buffer :which-key "previous buffer")
"SPC" '(helm-M-x :which-key "M-x")
"pf" '(helm-find-file :which-key "find files")
;; Buffers
"bb" '(helm-buffers-list :which-key "buffers list")
;; Window
"wl" '(windmove-right :which-key "move right")
"wh" '(windmove-left :which-key "move left")
"wk" '(windmove-up :which-key "move up")
"wj" '(windmove-down :which-key "move bottom")
"w/" '(split-window-right :which-key "split right")
"w-" '(split-window-below :which-key "split bottom")
"wx" '(delete-window :which-key "delete window")
))
(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-enabled-themes (quote (doom-one)))
'(custom-safe-themes
(quote
("9d9fda57c476672acd8c6efeb9dc801abea906634575ad2c7688d055878e69d6" "a566448baba25f48e1833d86807b77876a899fc0c3d33394094cf267c970749f" default)))
'(menu-bar-mode nil)
'(mouse-wheel-progressive-speed nil)
'(mouse-wheel-scroll-amount (quote (1 ((shift) . 5) ((control)))))
'(package-selected-packages
(quote
(evil which-key use-package hydra general counsel avy)))
'(scroll-bar-mode nil)
'(tool-bar-mode nil)
'(tooltip-mode 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