diff options
author | Hsieh Chin Fan <typebrook@gmail.com> | 2022-06-18 09:15:52 +0800 |
---|---|---|
committer | Hsieh Chin Fan <typebrook@gmail.com> | 2022-06-18 09:15:52 +0800 |
commit | 184d59402c1ede63bde354a01904320ae189fda9 (patch) | |
tree | e6daf9c0f7dd50ea576cb37ecfa723b5e436d5fb | |
parent | 7deed70e3211d6b8be2e0522795aa3ba1ae3918a (diff) | |
parent | 92465fa8e10955ae38a3571717056b25512bebd4 (diff) |
Merge remote-tracking branch 'origin/dev' into dev
-rw-r--r-- | alias | 1 | ||||
-rw-r--r-- | mutt/gmail | 157 | ||||
-rwxr-xr-x | tools/init/sync.sh | 1 |
3 files changed, 159 insertions, 0 deletions
@@ -63,6 +63,7 @@ alias s='sudo systemctl' | |||
63 | alias j='sudo journalctl -xe' | 63 | alias j='sudo journalctl -xe' |
64 | alias ju='sudo journalctl -u' | 64 | alias ju='sudo journalctl -u' |
65 | alias m='mutt' | 65 | alias m='mutt' |
66 | alias gmail="mutt -F $SETTING_DIR/mutt/gmail" | ||
66 | path() { echo $PATH; } # Should not use alias, because $PATH is not initialized | 67 | path() { echo $PATH; } # Should not use alias, because $PATH is not initialized |
67 | ps1.swap() { if [ -z $PS1_bak ]; then PS1_bak="$PS1"; PS1='> '; else PS1="$PS1_bak"; unset PS1_bak; fi; } | 68 | ps1.swap() { if [ -z $PS1_bak ]; then PS1_bak="$PS1"; PS1='> '; else PS1="$PS1_bak"; unset PS1_bak; fi; } |
68 | fd() { echo /proc/$$/fd; ls -l /proc/$$/fd; } | 69 | fd() { echo /proc/$$/fd; ls -l /proc/$$/fd; } |
diff --git a/mutt/gmail b/mutt/gmail new file mode 100644 index 0000000..a1d28fb --- /dev/null +++ b/mutt/gmail | |||
@@ -0,0 +1,157 @@ | |||
1 | # IMAP/SMTP settings | ||
2 | set imap_user = "typebrook@gmail.com" | ||
3 | set imap_pass = `pass google/imap_for_typebrook` | ||
4 | set header_cache = "~/.cache/mutt" | ||
5 | set message_cachedir = "~/.cache/mutt" | ||
6 | set smtp_url = "typebrook@gmail.com" | ||
7 | set smtp_pass = "$imap_pass" | ||
8 | |||
9 | set folder = "imaps://imap.gmail.com/" | ||
10 | set spoolfile = "+INBOX" | ||
11 | set postponed = "+[Gmail]/Drafts" | ||
12 | set record = "+[Gmail]/Sent Mail" | ||
13 | set trash = "+[Gmail]/Trash" | ||
14 | |||
15 | subscribe talk-tw@openstreetmap.org | ||
16 | |||
17 | set ssl_starttls = yes | ||
18 | set ssl_force_tls = yes | ||
19 | |||
20 | # Interface | ||
21 | set editor = "vim" | ||
22 | set charset = "utf-8" | ||
23 | set send_charset = "us-ascii:utf-8" | ||
24 | set header = no | ||
25 | set pager_stop | ||
26 | set sleep_time = 0 # When changing folder | ||
27 | set timeout = 10 | ||
28 | set quit = ask-no | ||
29 | set sort = reverse-threads | ||
30 | set pager_index_lines = 5 | ||
31 | set markers = no # Remove '+' for long links with limited terminal width | ||
32 | set index_format = "%4C %8Y %Z %(%b %d) %-15.15L (%?l?%4l&%4c?) %s" | ||
33 | |||
34 | # Vim-style key binding, \c means Ctrl | ||
35 | # ref: https://fancyseeker.github.io/2015/08/19/mutt/#vim%E9%A3%8E%E6%A0%BC%E9%94%AE%E4%BD%8D%E7%BB%91%E5%AE%9A | ||
36 | bind index <Return> sync-mailbox | ||
37 | bind index q browse-mailboxes | ||
38 | bind index y edit-label | ||
39 | bind index x tag-entry | ||
40 | bind index t edit-label | ||
41 | bind index,browser l select-entry | ||
42 | bind index \cl limit | ||
43 | bind index \cj next-entry | ||
44 | bind index \ck previous-entry | ||
45 | bind index,browser G last-entry | ||
46 | bind index,browser g noop | ||
47 | bind index,browser gg first-entry | ||
48 | bind index \cf next-page | ||
49 | bind index \cb previous-page | ||
50 | bind index \cd half-down | ||
51 | bind index \cu half-up | ||
52 | bind index } bottom-page | ||
53 | bind pager G bottom | ||
54 | bind pager g noop | ||
55 | bind pager gg top | ||
56 | bind pager j next-line | ||
57 | bind pager k previous-line | ||
58 | bind pager \cf next-page | ||
59 | bind pager \cb previous-page | ||
60 | bind pager \cd half-down | ||
61 | bind pager \cu half-up | ||
62 | bind pager \cj next-entry | ||
63 | bind pager \ck previous-entry | ||
64 | bind attach x view-mailcap | ||
65 | macro generic,index,pager \cr ":source ~/.config/mutt/muttrc\n" "Reload mutt's configuration file" | ||
66 | macro index <Return> ":exec sync-mailbox\n" "Sync Mailbox" | ||
67 | macro index *a "Tall\n" "Select All" | ||
68 | macro index *n "\ctall\n" "Deselect All" | ||
69 | macro index h "\clall\n" "All messages" | ||
70 | macro index d '<tag-prefix><delete-message>' 'Delete' | ||
71 | |||
72 | set mail_check = 120 | ||
73 | set mail_check_stats | ||
74 | set imap_check_subscribed | ||
75 | set sidebar_visible = yes | ||
76 | set sidebar_format = '%B%?F? [%F]?%* %?N?%N/?%S' | ||
77 | set sidebar_short_path = yes | ||
78 | set sidebar_width = 20 | ||
79 | bind index,pager B sidebar-toggle-visible | ||
80 | bind index,pager \Cp sidebar-prev | ||
81 | bind index,pager \Cn sidebar-next | ||
82 | bind index,pager \Co sidebar-open | ||
83 | bind index,pager <F5> sidebar-prev-new | ||
84 | bind index,pager <F6> sidebar-next-new | ||
85 | color indicator cyan black | ||
86 | color sidebar_highlight white color8 | ||
87 | color sidebar_divider color8 black | ||
88 | color sidebar_flagged red black | ||
89 | color sidebar_new green black | ||
90 | |||
91 | # basic colors | ||
92 | color normal white black | ||
93 | color error red black | ||
94 | color tilde white black | ||
95 | color message cyan black | ||
96 | color markers red black | ||
97 | color attachment brightred black | ||
98 | color search brightmagenta black | ||
99 | color status brightwhite black | ||
100 | color indicator white blue | ||
101 | color tree magenta black # arrows in threads | ||
102 | |||
103 | # For list | ||
104 | # Highlight mails by their status. For a specific pattern(e.g. ~N), pleas read mutt manual 4.2 | ||
105 | color index red black "~A" # all messages | ||
106 | color index brightred black "~E" # expired messages | ||
107 | color index brightcyan black "~N" # new messages | ||
108 | color index brightcyan black "~O" # old messages | ||
109 | color index brightmagenta black "~Q" # messages that have been replied to | ||
110 | color index white black "~R" # read messages | ||
111 | color index brightblue black "~U" # unread messages | ||
112 | color index brightblue black "~U~$" # unread, unreferenced messages | ||
113 | color index brightblue black "~v" # messages part of a collapsed thread | ||
114 | color index brightblue black "~P" # messages from me | ||
115 | color index cyan black "~p!~F" # messages to me | ||
116 | color index brightgreen black "~N~p!~F" # new messages to me | ||
117 | color index brightgreen black "~U~p!~F" # unread messages to me | ||
118 | color index green black "~R~p!~F" # messages to me | ||
119 | color index red black "~F" # flagged messages | ||
120 | color index red black "~F~p" # flagged messages to me | ||
121 | color index red black "~N~F" # new flagged messages | ||
122 | color index red black "~N~F~p" # new flagged messages to me | ||
123 | color index red black "~U~F~p" # new flagged messages to me | ||
124 | color index brightgreen black "~T" # tagged messages | ||
125 | color index black brightmagenta "~D" # deleted messages | ||
126 | color index white black "~v~(!~N!~O)" # collapsed thread with no unread | ||
127 | color index magenta black "~v~(~N|~O)" # collapsed thread with some unread | ||
128 | color index magenta black "~N~v~(~N)" # collapsed thread with unread parent | ||
129 | color index red white "~v~(~F)!~N" # collapsed thread with flagged, no unread | ||
130 | color index yellow white "~v~(~F~N)" # collapsed thread with some unread & flagged | ||
131 | color index green white "~N~v~(~F~N)" # collapsed thread with unread parent & flagged | ||
132 | color index green white "~N~v~(~F)" # collapsed thread with unread parent, no unread inside, but some flagged | ||
133 | color index yellow red "~v~(~D)" # thread with deleted (doesn't differentiate between all or partial) | ||
134 | |||
135 | # color header | ||
136 | color header green black "^(From)" | ||
137 | color header brightyellow black "^(Subject)" | ||
138 | |||
139 | # Set quote's starting symbol | ||
140 | set quote_regexp = "^([ ]t]*[|>:}#])+" | ||
141 | set quote_regexp = "^([ \t ]*[>])+" | ||
142 | |||
143 | # Highlight quotes by indent | ||
144 | color quoted blue black | ||
145 | color quoted1 magenta black | ||
146 | color quoted2 cyan black | ||
147 | color quoted3 yellow black | ||
148 | color quoted4 red black | ||
149 | |||
150 | # urls | ||
151 | color body brightblue black "(^|<| )mailto:[^ ]+@[^ ]( |>|$)" | ||
152 | color body brightblue black "(^|<| )(http|https|ftp|file|telnet|news|finger)://[^ ]+( |>|$)" | ||
153 | |||
154 | # *bold*, _underline_, and /italic/ | ||
155 | color body brightcyan black "(^| )\\*[^ ]+\\*( |$)" | ||
156 | color body brightcyan black "(^| )_[^ ]+_( |$)" | ||
157 | color body brightcyan black "(^| )/[^ ]+/( |$)" | ||
diff --git a/tools/init/sync.sh b/tools/init/sync.sh index 47bd9c4..339e21a 100755 --- a/tools/init/sync.sh +++ b/tools/init/sync.sh | |||
@@ -10,6 +10,7 @@ sync() { | |||
10 | } | 10 | } |
11 | sync $SETTING_DIR & | 11 | sync $SETTING_DIR & |
12 | sync ~/blog & | 12 | sync ~/blog & |
13 | sync ~/git/vps & | ||
13 | sync ~/vimwiki & | 14 | sync ~/vimwiki & |
14 | sync ~/.task & | 15 | sync ~/.task & |
15 | sync ~/.password-store & | 16 | sync ~/.password-store & |