From b731482680df4fcd19cb3627180bbe4ea2372820 Mon Sep 17 00:00:00 2001 From: gxlin Date: Thu, 15 Jul 2021 08:51:09 +0800 Subject: More config --- .emacs.d/.gitignore | 4 ++++ .emacs.d/init.el | 32 ++++---------------------------- .emacs.d/lisp/init-lang.el | 8 +++++--- .emacs.d/lisp/init-misc.el | 29 ++++++++++++++++++++++++++++- .emacs.d/lisp/init-mu4e.el | Bin 2610 -> 2740 bytes .emacs.d/lisp/init-org.el | 7 ++++++- .emacs.d/lisp/init-package.el | 4 ++-- .gitattributes | 4 ++-- .macos | 4 ++++ .mbsyncrc | Bin 0 -> 1772 bytes .msmtprc | Bin 0 -> 518 bytes .mutt/accounts/foo | Bin 258 -> 0 bytes .mutt/accounts/personal | Bin 0 -> 366 bytes .mutt/accounts/work | Bin 0 -> 374 bytes .mutt/display | 8 ++++++++ .mutt/keybindings | 14 ++++++++++++++ .mutt/mailboxes | Bin 174 -> 0 bytes .mutt/mailcap | 2 ++ .mutt/muttrc | Bin 419 -> 878 bytes .mutt/theme | 42 ++++++++++++++++++++++++++++++++++++++++++ .urlview | 2 ++ .zshrc | 5 ++++- bootstrap.sh | 2 ++ 23 files changed, 129 insertions(+), 38 deletions(-) create mode 100644 .macos create mode 100644 .mbsyncrc create mode 100644 .msmtprc delete mode 100644 .mutt/accounts/foo create mode 100644 .mutt/accounts/personal create mode 100644 .mutt/accounts/work create mode 100644 .mutt/display create mode 100644 .mutt/keybindings delete mode 100644 .mutt/mailboxes create mode 100644 .mutt/mailcap create mode 100644 .mutt/theme create mode 100644 .urlview diff --git a/.emacs.d/.gitignore b/.emacs.d/.gitignore index d01fcd1..dd01222 100644 --- a/.emacs.d/.gitignore +++ b/.emacs.d/.gitignore @@ -4,3 +4,7 @@ backups custom.el elpa *.eld +bookmarks +network-security.data +org-clock-save.el +transient diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 4c4f865..e070fc2 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -12,38 +12,14 @@ (defconst *is-a-mac* (eq system-type 'darwin)) -(when (version<= "26.0.50" emacs-version) - (global-display-line-numbers-mode)) -(setq vc-follow-symlinks t) -(setq backup-directory-alist - `(("." . ,(concat user-emacs-directory "backups")))) -(setq-default fill-column 72) -(menu-bar-mode -1) -(xterm-mouse-mode 1) ;; Enable mouse - (require 'init-package) - -(use-package atom-one-dark-theme - :config - (load-theme 'atom-one-dark t)) -(set-face-attribute 'default nil :font "Monaco" :height 150) - -(use-package which-key - :ensure t - :config - (which-key-mode)) - -(use-package undo-tree - :config - (global-undo-tree-mode)) - (require 'init-evil) (require 'init-org) (require 'init-mu4e) (require 'init-lang) +(require 'init-misc) (setq custom-file (expand-file-name "custom.el" user-emacs-directory)) -(when (file-exists-p custom-file) - (load custom-file)) - -(require 'init-local nil t) +(unless (file-exists-p custom-file) + (write-region "" nil custom-file)) +(load custom-file) diff --git a/.emacs.d/lisp/init-lang.el b/.emacs.d/lisp/init-lang.el index f8e96b6..b4b7e89 100644 --- a/.emacs.d/lisp/init-lang.el +++ b/.emacs.d/lisp/init-lang.el @@ -1,5 +1,7 @@ (use-package ledger-mode - :mode (("\\.journal$" . ledger-mode))) + :mode (("\\.journal$" . ledger-mode)) + :config + (setq ledger-default-date-format ledger-iso-date-format)) (use-package markdown-mode :ensure t @@ -15,15 +17,15 @@ (use-package go-mode :ensure t :commands (go-mode) - :mode (("\\.go\\'" . go-mode)) + :mode (("\\.go$" . go-mode)) :hook ((go-mode . (lambda () (setq tab-width 4))))) (use-package lsp-mode :ensure t + :commands (lsp lsp-deferred) :hook ((go-mode . lsp-deferred) (lsp-mode . lsp-enable-which-key-integration)) - :commands (lsp lsp-deferred) :config (evil-define-key 'normal lsp-mode-map (kbd "gd") 'lsp-find-definition diff --git a/.emacs.d/lisp/init-misc.el b/.emacs.d/lisp/init-misc.el index 07eef14..bda9ca3 100644 --- a/.emacs.d/lisp/init-misc.el +++ b/.emacs.d/lisp/init-misc.el @@ -1,6 +1,29 @@ (setq tab-always-indent 'complete completion-cycle-threshold t) +(when (version<= "26.0.50" emacs-version) + (global-display-line-numbers-mode)) +(setq vc-follow-symlinks t) +(setq backup-directory-alist + `(("." . ,(concat user-emacs-directory "backups")))) +(setq-default fill-column 72) +(menu-bar-mode -1) +(xterm-mouse-mode 1) ;; Enable mouse + +(use-package atom-one-dark-theme + :config + (load-theme 'atom-one-dark t)) +(set-face-attribute 'default nil :font "Monaco" :height 150) + +(use-package which-key + :ensure t + :config + (which-key-mode)) + +(use-package undo-tree + :config + (global-undo-tree-mode)) + (use-package recentf :ensure nil :config @@ -41,7 +64,9 @@ :init (setq company-global-modes '(emacs-lisp-mode go-mode ledger-mode)) - :hook ((after-init . global-company-mode))) + :hook ((after-init . global-company-mode)) + :config + (setq company-minimum-prefix-length 1)) (use-package projectile :init @@ -50,3 +75,5 @@ :config (setq projectile-cache-file (expand-file-name ".cache/projectile" user-emacs-directory)) (projectile-mode 1)) + +(provide 'init-misc) diff --git a/.emacs.d/lisp/init-mu4e.el b/.emacs.d/lisp/init-mu4e.el index 8a2c5a6..ebf684c 100644 Binary files a/.emacs.d/lisp/init-mu4e.el and b/.emacs.d/lisp/init-mu4e.el differ diff --git a/.emacs.d/lisp/init-org.el b/.emacs.d/lisp/init-org.el index caadeec..50061b2 100644 --- a/.emacs.d/lisp/init-org.el +++ b/.emacs.d/lisp/init-org.el @@ -33,10 +33,15 @@ (kbd "oih") 'org-insert-heading (kbd "oci") 'org-clock-in (kbd "oco") 'org-clock-out - (kbd "sp") 'org-set-property) + (kbd "sp") 'org-set-property + (kbd "+") 'org-priority-up + (kbd "-") 'org-priority-down) (setq org-tags-exclude-from-inheritance '("PROJECT")) + (setq org-clock-persist 'history) + (org-clock-persistence-insinuate) + ;; refile (setq org-refile-targets '((nil :maxlevel . 9) (org-agenda-files :maxlevel . 9)) diff --git a/.emacs.d/lisp/init-package.el b/.emacs.d/lisp/init-package.el index 5e6a0c7..ab9b1fa 100644 --- a/.emacs.d/lisp/init-package.el +++ b/.emacs.d/lisp/init-package.el @@ -1,7 +1,7 @@ (require 'package) (setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/") - ("melpa" . "https://melpa.org/packages/"))) -(setq package-enable-at-startup nil) + ("mepla" . "https://melpa.org/packages/") + ("melpa-stable" . "https://stable.melpa.org/packages/"))) (package-initialize) (dolist (package '(use-package)) diff --git a/.gitattributes b/.gitattributes index 0da544c..28e2c7a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,6 @@ .emacs.d/lisp/init-mu4e.el filter=git-crypt diff=git-crypt offlineimap/.offlineimaprc filter=git-crypt diff=git-crypt -.mutt/muttrc filter=git-crypt diff=git-crypt -.mutt/mailboxes filter=git-crypt diff=git-crypt .mutt/accounts/* filter=git-crypt diff=git-crypt +.mbsyncrc filter=git-crypt diff=git-crypt +.msmtprc filter=git-crypt diff=git-crypt .authinfo filter=git-crypt diff=git-crypt diff --git a/.macos b/.macos new file mode 100644 index 0000000..3d556f3 --- /dev/null +++ b/.macos @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +export BROWSER='open -a safari' +[ -d /Applications/Firefox.app ] && export BROWSER='open -a firefox' diff --git a/.mbsyncrc b/.mbsyncrc new file mode 100644 index 0000000..5d6fdb0 Binary files /dev/null and b/.mbsyncrc differ diff --git a/.msmtprc b/.msmtprc new file mode 100644 index 0000000..48dc1fb Binary files /dev/null and b/.msmtprc differ diff --git a/.mutt/accounts/foo b/.mutt/accounts/foo deleted file mode 100644 index d044a5b..0000000 Binary files a/.mutt/accounts/foo and /dev/null differ diff --git a/.mutt/accounts/personal b/.mutt/accounts/personal new file mode 100644 index 0000000..6cd1d35 Binary files /dev/null and b/.mutt/accounts/personal differ diff --git a/.mutt/accounts/work b/.mutt/accounts/work new file mode 100644 index 0000000..5c7bc7c Binary files /dev/null and b/.mutt/accounts/work differ diff --git a/.mutt/display b/.mutt/display new file mode 100644 index 0000000..12519cf --- /dev/null +++ b/.mutt/display @@ -0,0 +1,8 @@ +# vim: filetype=muttrc + +set date_format="%y-%m-%d %T" +set index_format="%2C | %Z [%d] %-30.30F (%-4.4c) %s" + +set pager_index_lines=10 + +source ~/.mutt/theme diff --git a/.mutt/keybindings b/.mutt/keybindings new file mode 100644 index 0000000..60e3178 --- /dev/null +++ b/.mutt/keybindings @@ -0,0 +1,14 @@ +# vim: filetype=muttrc + +bind pager j next-line +bind pager k previous-line +bind attach,index,pager \CD next-page +bind attach,index,pager \CU previous-page +bind pager gg top +bind pager G bottom +bind attach,index g noop +bind attach,index gg first-entry +bind attach,index G last-entry + +bind index,pager \Cn sidebar-next +bind index,pager \Cp sidebar-prev diff --git a/.mutt/mailboxes b/.mutt/mailboxes deleted file mode 100644 index 01ee6d6..0000000 Binary files a/.mutt/mailboxes and /dev/null differ diff --git a/.mutt/mailcap b/.mutt/mailcap new file mode 100644 index 0000000..51d7e68 --- /dev/null +++ b/.mutt/mailcap @@ -0,0 +1,2 @@ +text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -collapse_br_tags -dump %s; nametemplate=%s.html; copiousoutput + diff --git a/.mutt/muttrc b/.mutt/muttrc index 8f52596..efe5ba5 100644 Binary files a/.mutt/muttrc and b/.mutt/muttrc differ diff --git a/.mutt/theme b/.mutt/theme new file mode 100644 index 0000000..aa77d0f --- /dev/null +++ b/.mutt/theme @@ -0,0 +1,42 @@ +############################################################################### +# Dracula Theme for Mutt: https://draculatheme.com/ +# +# @author Paul Townsend + +# general ------------ foreground ---- background ----------------------------- +color error color231 color212 +color indicator color231 color241 +color markers color210 default +color message default default +color normal default default +color prompt default default +color search color84 default +color status color141 color236 +color tilde color231 default +color tree color141 default + +# message index ------ foreground ---- background ----------------------------- +color index color210 default ~D # deleted messages +color index color84 default ~F # flagged messages +color index color117 default ~N # new messages +color index color212 default ~Q # messages which have been replied to +color index color215 default ~T # tagged messages +color index color141 default ~v # messages part of a collapsed thread + +# message headers ---- foreground ---- background ----------------------------- +color hdrdefault color117 default +color header color231 default ^Subject:.* + +# message body ------- foreground ---- background ----------------------------- +color attachment color228 default +color body color231 default [\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+ # email addresses +color body color228 default (https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+ # URLs +color body color231 default (^|[[:space:]])\\*[^[:space:]]+\\*([[:space:]]|$) # *bold* text +color body color231 default (^|[[:space:]])_[^[:space:]]+_([[:space:]]|$) # _underlined_ text +color body color231 default (^|[[:space:]])/[^[:space:]]+/([[:space:]]|$) # /italic/ text +color quoted color61 default +color quoted1 color117 default +color quoted2 color84 default +color quoted3 color215 default +color quoted4 color212 default +color signature color212 default diff --git a/.urlview b/.urlview new file mode 100644 index 0000000..1cbfad7 --- /dev/null +++ b/.urlview @@ -0,0 +1,2 @@ +REGEXP (((http|https|ftp|gopher)|mailto)[.:][^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t>">\):] +COMMAND $BROWSER %s diff --git a/.zshrc b/.zshrc index 39a53bb..dd9ce52 100644 --- a/.zshrc +++ b/.zshrc @@ -2,7 +2,8 @@ setopt histignorealldups sharehistory # Use emacs keybindings even if our EDITOR is set to vi bindkey -e -EDITOR=vim +export VISUAL=vim +export EDITOR=vim export LANG=en_US.UTF-8 export GPG_KEY=$(tty) @@ -37,6 +38,8 @@ Darwin) alias ls='ls -G' alias ll='ls -lhG' alias bug='brew upgrade --greedy' + + source ~/.macos ;; Linux) # commands for Linux diff --git a/bootstrap.sh b/bootstrap.sh index ca2e734..aea2465 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -3,3 +3,5 @@ dotfiles_dir=$(cd -- "$(dirname ${BASH_SOURCE})" > /dev/null 2>&1; pwd -P) ln -s $dotfiles_dir/.emacs.d $HOME/.emacs.d +ln -s $dotfiles_dir/.macos $HOME/.macos +ln -s $dotfiles_dir/.urlview $HOME/.urlview -- cgit v1.2.3