333 lines
9.5 KiB
EmacsLisp
333 lines
9.5 KiB
EmacsLisp
(setq inhibit-startup-message t)
|
|
|
|
(add-hook 'window-setup-hook 'toggle-frame-maximized t)
|
|
|
|
(scroll-bar-mode -1) ; Disable visible scrollbar
|
|
(tool-bar-mode -1) ; Disable the toolbar
|
|
(tooltip-mode -1) ; Disable tooltips
|
|
(set-fringe-mode 10) ; Give some breathing room
|
|
|
|
(menu-bar-mode -1) ; Disable the menu bar
|
|
|
|
;; setup dashboard
|
|
|
|
(use-package dashboard
|
|
:ensure t
|
|
:config
|
|
(dashboard-setup-startup-hook))
|
|
|
|
;; Set the title
|
|
(setq dashboard-banner-logo-title "Welcome to Emacs!")
|
|
|
|
;; Set the banner
|
|
(setq dashboard-startup-banner 'logo)
|
|
|
|
;; Icons
|
|
(setq dashboard-set-heading-icons t)
|
|
(setq dashboard-set-file-icons t)
|
|
|
|
;; Navigator
|
|
(setq dashboard-set-navigator t)
|
|
|
|
|
|
;; Widgets
|
|
(setq dashboard-items 'nil)
|
|
|
|
(set-face-attribute 'default nil :font "Cascadia Code" :height 100)
|
|
|
|
|
|
;; 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-install 'use-package))
|
|
|
|
(require 'use-package)
|
|
(setq use-package-always-ensure t)
|
|
|
|
(column-number-mode)
|
|
(global-display-line-numbers-mode t)
|
|
|
|
;; Disable line numbers for some modes
|
|
(dolist (mode '(org-mode-hook
|
|
term-mode-hook
|
|
shell-mode-hook
|
|
erc-mode-hook
|
|
mu4e-main-mode-hook
|
|
mu4e-headers-mode-hook
|
|
mu4e-view-mode-hook
|
|
eshell-mode-hook))
|
|
(add-hook mode (lambda () (display-line-numbers-mode 0))))
|
|
|
|
(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 all-the-icons)
|
|
|
|
(use-package doom-modeline
|
|
:ensure t
|
|
:init (doom-modeline-mode 1)
|
|
:custom ((doom-modeline-height 15)))
|
|
|
|
(use-package doom-themes)
|
|
(load-theme 'doom-dracula 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 0.1))
|
|
|
|
(use-package ivy-rich
|
|
:init
|
|
(ivy-rich-mode 1))
|
|
|
|
(use-package general)
|
|
|
|
(general-define-key
|
|
"C-M-j" 'counsel-switch-buffer
|
|
"C-M-t" 'counsel-load-theme
|
|
"C-M-A" 'text-scale-adjust)
|
|
|
|
|
|
;; transparency configuration
|
|
;;(set-frame-parameter (selected-frame) 'alpha '(<active> . <inactive>))
|
|
;;(set-frame-parameter (selected-frame) 'alpha <both>)
|
|
(set-frame-parameter (selected-frame) 'alpha '(85 . 50))
|
|
(add-to-list 'default-frame-alist '(alpha . (85 . 50)))
|
|
|
|
(defun toggle-transparency ()
|
|
(interactive)
|
|
(let ((alpha (frame-parameter nil 'alpha)))
|
|
(set-frame-parameter
|
|
nil 'alpha
|
|
(if (eql (cond ((numberp alpha) alpha)
|
|
((numberp (cdr alpha)) (cdr alpha))
|
|
;; Also handle undocumented (<active> <inactive>) form.
|
|
((numberp (cadr alpha)) (cadr alpha)))
|
|
100)
|
|
'(85 . 50) '(100 . 100)))))
|
|
(global-set-key (kbd "C-c t") 'toggle-transparency)
|
|
|
|
;; Set transparency of emacs
|
|
(defun transparency (value)
|
|
"Sets the transparency of the frame window. 0=transparent/100=opaque"
|
|
(interactive "nTransparency Value 0 - 100 opaque:")
|
|
(set-frame-parameter (selected-frame) 'alpha value))
|
|
|
|
|
|
|
|
(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)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(require 'erc)
|
|
|
|
(setq
|
|
erc-autojoin-timing 'ident
|
|
erc-fill-function 'erc-fill-static
|
|
erc-join-channel 'general
|
|
erc-hide-list '("JOIN" "PART" "QUIT")
|
|
erc-fill-static-center 10
|
|
erc-server-reconnect-attempts 5
|
|
erc-server-reconnect-timeout 3)
|
|
|
|
(global-set-key "\C-ch"
|
|
(lambda ()
|
|
(interactive)
|
|
(erc :server "rnbunker.ydns.eu"
|
|
:port "6667"
|
|
:nick "ahmd"
|
|
:full-name "Am")))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(use-package mu4e
|
|
:ensure nil
|
|
:config
|
|
|
|
;; This is set to 't' to avoid mail syncing issues when using mbsync
|
|
(setq mu4e-change-filenames-when-moving t)
|
|
|
|
;; Refresh mail using isync every 10 minutes
|
|
(setq mu4e-update-interval (* 10 60))
|
|
(setq mu4e-get-mail-command "mbsync -a")
|
|
(setq mu4e-maildir "~/Mail")
|
|
|
|
;; Make sure plain text mails flow correctly for recipients
|
|
(setq mu4e-compose-format-flowed t)
|
|
|
|
;; Configure the function to use for sending mail
|
|
(setq message-send-mail-function 'smtpmail-send-it)
|
|
|
|
;; NOTE: Only use this if you have set up a GPG key!
|
|
;; Automatically sign all outgoing mails
|
|
;; (add-hook 'message-send-hook 'mml-secure-message-sign-pgpmime)
|
|
|
|
(setq mu4e-contexts
|
|
(list
|
|
;; Work account
|
|
(make-mu4e-context
|
|
:name "Work"
|
|
:match-func
|
|
(lambda (msg)
|
|
(when msg
|
|
(string-prefix-p "/Riseup" (mu4e-message-field msg :maildir))))
|
|
:vars '((user-mail-address . "syedahmed@riseup.net")
|
|
(user-full-name . "Syed Ahmed Hussain")
|
|
(smtpmail-smtp-server . "mail.riseup.net")
|
|
(smtpmail-smtp-service . 465)
|
|
(smtpmail-stream-type . tls)
|
|
(mu4e-compose-signature . "Ahmed via Emacs")
|
|
(mu4e-drafts-folder . "/Riseup/[Riseup]/Drafts")
|
|
(mu4e-sent-folder . "/Riseup/[Riseup]/Sent Mail")
|
|
(mu4e-refile-folder . "/Riseup/[Riseup]/All Mail")
|
|
(mu4e-trash-folder . "/Riseup/[Riseup]/Trash")))
|
|
|
|
;; Personal account
|
|
(make-mu4e-context
|
|
:name "Personal"
|
|
:match-func
|
|
(lambda (msg)
|
|
(when msg
|
|
(string-prefix-p "/Disroot" (mu4e-message-field msg :maildir))))
|
|
:vars '((user-mail-address . "9ahmed@disroot.org")
|
|
(user-full-name . "ahmd")
|
|
(smtpmail-smtp-server . "disroot.org")
|
|
(smtpmail-smtp-service . 465)
|
|
(smtpmail-stream-type . ssl)
|
|
(mu4e-compose-signature . "ahmd via Emacs")
|
|
(mu4e-drafts-folder . "/Disroot/Drafts")
|
|
(mu4e-sent-folder . "/Disroot/Sent")
|
|
(mu4e-refile-folder . "/Disroot/Archive")
|
|
(mu4e-trash-folder . "/Disroot/Trash")))))
|
|
|
|
(setq mu4e-maildir-shortcuts
|
|
'(("/Inbox" . ?i)
|
|
("/[Riseup]/Sent Mail" . ?s)
|
|
("/[Riseup]/Trash" . ?t)
|
|
("/[Riseup]/Drafts" . ?d)
|
|
("/[Riseup]/All Mail" . ?a))))
|
|
|
|
|
|
|
|
|
|
(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
|
|
'(no-littering gemini-mode workgroups2 which-key use-package rainbow-delimiters org-inline-pdf ivy-rich general exwm evil-mu4e elpher doom-themes doom-modeline dashboard 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.
|
|
)
|
|
|
|
|
|
;; Change the user-emacs-directory to keep unwanted things out of ~/.emacs.d
|
|
(setq user-emacs-directory (expand-file-name "~/.cache/emacs/")
|
|
url-history-file (expand-file-name "url/history" user-emacs-directory))
|
|
|
|
;; Use no-littering to automatically set common paths to the new user-emacs-directory
|
|
(use-package no-littering)
|
|
|
|
;; Keep customization settings in a temporary file (thanks Ambrevar!)
|
|
(setq custom-file
|
|
(if (boundp 'server-socket-dir)
|
|
(expand-file-name "custom.el" server-socket-dir)
|
|
(expand-file-name (format "emacs-custom-%s.el" (user-uid)) temporary-file-directory)))
|
|
(load custom-file t)
|
|
|
|
|
|
(defvar +workspace--last nil)
|
|
(defvar +workspace--index 0)
|
|
|
|
;;;###autoload
|
|
(defface +workspace-tab-selected-face '((t (:inherit highlight)))
|
|
"The face for selected tabs displayed by `+workspace/display'"
|
|
:group 'persp-mode)
|
|
|
|
;;;###autoload
|
|
(defface +workspace-tab-face '((t (:inherit default)))
|
|
"The face for selected tabs displayed by `+workspace/display'"
|
|
:group 'persp-mode)
|
|
|
|
|
|
;;
|
|
;;; Library
|
|
|
|
(defun +workspace--protected-p (name)
|
|
(equal name persp-nil-name))
|
|
|
|
(defun +workspace--generate-id ()
|
|
(or (cl-loop for name in (+workspace-list-names)
|
|
when (string-match-p "^#[0-9]+$" name)
|
|
maximize (string-to-number (substring name 1)) into max
|
|
finally return (if max (1+ max)))
|
|
1))
|
|
|
|
|
|
;;; Predicates
|
|
;;;###autoload
|
|
(defalias #'+workspace-p #'perspective-p
|
|
"Return t if OBJ is a perspective hash table.")
|
|
|
|
;;;###autoload
|
|
(defun +workspace-exists-p (name)
|
|
"Returns t if NAME is the name of an existing workspace."
|
|
(member name (+workspace-list-names)))
|
|
|
|
;;;###autoload
|
|
(defalias #'+workspace-contains-buffer-p #'persp-contain-buffer-p
|
|
"Return non-nil if BUFFER is in WORKSPACE (defaults to current workspace).")
|
|
|