Skip to content

Instantly share code, notes, and snippets.

@dmitriyK1
Forked from huytd/customize.material-dark-theme.md
Created June 30, 2018 17:52
Show Gist options
  • Save dmitriyK1/d21cde56d062eeb4d5f220145b489a63 to your computer and use it in GitHub Desktop.
Save dmitriyK1/d21cde56d062eeb4d5f220145b489a63 to your computer and use it in GitHub Desktop.
My minimal Emacs config

Screenshot:

Custom keybinding:

  General:
    SPC /     : ripgrep
    SPC TAB   : previous buffer
    SPC SPC   : Open M-x
  
  Files:
    SPC p f   : find files
  
  Buffers:
    SPC b b   : buffers list
    
  Window:
    SPC w l   : move right
    SPC w h   : move left 
    SPC w j   : move down
    SPC w k   : move up
    SPC w /   : split right
    SPC w -   : split bottom
    SPC w x   : close window
  
  Other:
    SPC a t   : open terminal in current buffer
;; 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)
;; 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)
;; Fancy titlebar for MacOS
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
(add-to-list 'default-frame-alist '(ns-appearance . dark))
(setq ns-use-proxy-icon nil)
(setq frame-title-format nil)
;; 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")
;; Others
"at" '(ansi-term :which-key "open terminal")
))
(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