Rewrite my emacs config - now it is very lightweight

Currently i am going to use it just for org-mode, but maybe i will add several things soon :)
This commit is contained in:
g1n 2021-10-03 18:30:04 +03:00
parent 5fdce552db
commit 62681d7f5c
1 changed files with 7 additions and 145 deletions

152
init.el
View File

@ -4,43 +4,13 @@
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
; use-package
(eval-when-compile
(require 'use-package))
; THEME
(require 'doom-themes)
(use-package doom-themes
:config
;; Global settings (defaults)
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
doom-themes-enable-italic t) ; if nil, italics is universally disabled
(load-theme 'doom-peacock t))
;; doom-modeline
(use-package doom-modeline
:ensure t
:init (doom-modeline-mode 1))
(load-theme 'twilight t)
;; custom
(setq custom-file "~/.emacs.d/custom.el")
(load custom-file)
; EVIL
;;; Download Evil
(unless (package-installed-p 'evil)
(package-install 'evil))
;;; Enable Evil
(setq evil-want-keybinding nil)
(require 'evil)
(require 'evil-collection nil t)
(evil-collection-init)
(evil-mode 1)
; General configuration
;; no startup message
@ -62,9 +32,6 @@
;;; No cookies
(setq url-cookie-trusted-urls '()
url-cookie-untrusted-urls '(".*"))
;; autostart all-the-icons
(require 'all-the-icons)
(all-the-icons-icon-for-mode t)
;; general keybindings
@ -75,120 +42,15 @@
;;; Calendar
(global-set-key (kbd "C-x c") 'calendar)
; LISP
(load (expand-file-name "~/.roswell/helper.el"))
; org-mode
;; Enable org-mode
(require 'org)
(global-set-key (kbd "C-c l") 'org-store-link)
(global-set-key (kbd "C-c a") 'org-agenda)
(global-set-key (kbd "C-c c") 'org-capture)
(setq org-agenda-files '("~/org/agenda"))
; exwm
(require 'exwm)
(require 'exwm-config)
(require 'exwm-systemtray)
;; These keys should always pass through to Emacs
(setq exwm-input-prefix-keys
'(?\C-x
?\C-u
?\C-h
?\M-x
?\M-`
?\M-&
?\M-:
?\C-\M-j ;; Buffer list
?\C-\ )) ;; Ctrl+Space
;; Ctrl+Q will enable the next key to be sent directly
(define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key)
;; key bindings
(setq exwm-input-global-keys
`(
;; Reset to line-mode (C-c C-k switches to char-mode via exwm-input-release-keyboard)
([?\s-r] . exwm-reset)
;; Move between windows
([s-left] . windmove-left)
([s-right] . windmove-right)
([s-up] . windmove-up)
([s-down] . windmove-down)
;; Launch applications via shell command
([?\s-&] . (lambda (command)
(interactive (list (read-shell-command "$ ")))
(start-process-shell-command command nil command)))
;; Switch workspace
([?\s-w] . exwm-workspace-switch)
([?\s-`] . (lambda () (interactive) (exwm-workspace-switch-create 0)))
;; 's-N': Switch to certain workspace with Super (Win) plus a number key (0 - 9)
,@(mapcar (lambda (i)
`(,(kbd (format "s-%d" i)) .
(lambda ()
(interactive)
(exwm-workspace-switch-create ,i))))
(number-sequence 0 9))))
(exwm-enable)
(exwm-systemtray-enable)
; elfeed
(use-package elfeed
:ensure t)
(global-set-key (kbd "C-x w") 'elfeed)
(setq elfeed-feeds
'(("https://nullprogram.com/feed/" nullprogram)
("https://codevoid.de/h/feed.xml" codevoid)
("https://xkcd.com/atom.xml" xkcd)
))
; mail
;; notmuch
(global-set-key (kbd "C-x m") 'notmuch)
(setq +notmuch-sync-backend 'mbsync)
;; gnus
(setq gnus-select-method '(nntp "news.tilde.club"))
;(add-to-list 'gnus-secondary-select-methods '(nntp "news.gnus.org"))
;(add-to-list 'gnus-secondary-select-methods '(nntp ""))
(setq gnus-read-active-file nil)
; elpher
; Open all gemini and gopher links in elpher
(advice-add 'eww-browse-url :around 'asc:eww-browse-url)
(defun asc:eww-browse-url (original url &optional new-window)
(cond ((string-match-p "\\`\\(gemini\\|gopher\\)://" url)
(require 'elpher)
(elpher-go url))
(t (funcall original url new-window))))
; dashboard
(require 'dashboard)
(dashboard-setup-startup-hook)
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))
(setq dashboard-startup-banner "~/.emacs.d/img/arch-with-emacs-icon.png")
(setq dashboard-center-content t)
(setq dashboard-items '((recents . 5)
(bookmarks . 5)
;(projects . 5) ;; have't install projectile yet
(agenda . 5)
(registers . 5)))
; EMMS
(require 'emms-setup)
(require 'emms-player-mpd)
(emms-all)
(setq emms-player-mpd-server-name "localhost")
(setq emms-player-mpd-server-port "6601")
;; mpc
(setq mpc-host "localhost:6601")
(setq org-agenda-files '("~/org/gru"))
;; Enable Org Roam
;(make-directory "~/org/roam")
(setq org-roam-directory "~/org/roam")
(setq org-roam-v2-ack t)
(org-roam-db-autosync-mode)