Преглед на файлове

add other MUA related config files

mxmehl преди 2 години
родител
ревизия
04522a176e
променени са 16 файла, в които са добавени 545 реда и са изтрити 0 реда
  1. 18
    0
      msmtp/.msmtprc
  2. 98
    0
      notmuch/.notmuch-config
  3. 4
    0
      offlineimap/.gitignore
  4. 5
    0
      offlineimap/.offlineimap/getpass.py
  5. Двоични данни
      offlineimap/.offlineimap/getpass.pyc
  6. 24
    0
      offlineimap/.offlineimaprc
  7. 1
    0
      pass/.password-store/.gpg-id
  8. Двоични данни
      pass/.password-store/DAV/Baikal-mxmehl.gpg
  9. Двоични данни
      pass/.password-store/Mail/FSFE-SMTP.gpg
  10. Двоични данни
      pass/.password-store/Mail/FSFE.gpg
  11. Двоични данни
      pass/.password-store/Mail/PfadisWeb.gpg
  12. 5
    0
      vim/.vim/advanced.vim
  13. 111
    0
      vim/.vim/astroid.vim
  14. 4
    0
      vim/.vim/filetype.vim
  15. 242
    0
      vim/.vim/plugin/querycommandcomplete.vim
  16. 33
    0
      vim/.vimrc

+ 18
- 0
msmtp/.msmtprc Целия файл

@@ -0,0 +1,18 @@
1
+# Set default values for all following accounts.
2
+defaults
3
+auth           on
4
+tls            on
5
+tls_starttls   on
6
+tls_certcheck  on
7
+tls_trust_file /etc/ssl/certs/ca-certificates.crt
8
+logfile        ~/.msmtp.log
9
+
10
+# FSFE
11
+account        fsfe
12
+host           mail.fsfe.org
13
+port           587
14
+from           max.mehl@fsfe.org
15
+user           max.mehl
16
+passwordeval   pass Mail/FSFE-SMTP
17
+
18
+account default : fsfe

+ 98
- 0
notmuch/.notmuch-config Целия файл

@@ -0,0 +1,98 @@
1
+# .notmuch-config - Configuration file for the notmuch mail system
2
+#
3
+# For more information about notmuch, see http://notmuchmail.org
4
+
5
+# Database configuration
6
+#
7
+# The only value supported here is 'path' which should be the top-level
8
+# directory where your mail currently exists and to where mail will be
9
+# delivered in the future. Files should be individual email messages.
10
+# Notmuch will store its database within a sub-directory of the path
11
+# configured here named ".notmuch".
12
+#
13
+[database]
14
+path=/home/max/Mails/FSFE
15
+
16
+# User configuration
17
+#
18
+# Here is where you can let notmuch know how you would like to be
19
+# addressed. Valid settings are
20
+#
21
+#	name		Your full name.
22
+#	primary_email	Your primary email address.
23
+#	other_email	A list (separated by ';') of other email addresses
24
+#			at which you receive email.
25
+#
26
+# Notmuch will use the various email addresses configured here when
27
+# formatting replies. It will avoid including your own addresses in the
28
+# recipient list of replies, and will set the From address based on the
29
+# address to which the original email was addressed.
30
+#
31
+[user]
32
+name=Max Mehl
33
+primary_email=max.mehl@fsfe.org
34
+other_email=fsfe@mehl.mx
35
+
36
+# Configuration for "notmuch new"
37
+#
38
+# The following options are supported here:
39
+#
40
+#	tags	A list (separated by ';') of the tags that will be
41
+#		added to all messages incorporated by "notmuch new".
42
+#
43
+#	ignore	A list (separated by ';') of file and directory names
44
+#		that will not be searched for messages by "notmuch new".
45
+#
46
+#		NOTE: *Every* file/directory that goes by one of those
47
+#		names will be ignored, independent of its depth/location
48
+#		in the mail store.
49
+#
50
+[new]
51
+tags=unread
52
+ignore=
53
+
54
+# Search configuration
55
+#
56
+# The following option is supported here:
57
+#
58
+#	exclude_tags
59
+#		A ;-separated list of tags that will be excluded from
60
+#		search results by default.  Using an excluded tag in a
61
+#		query will override that exclusion.
62
+#
63
+[search]
64
+exclude_tags=del;spam;ignore;mod;cvs;archive
65
+
66
+# Maildir compatibility configuration
67
+#
68
+# The following option is supported here:
69
+#
70
+#	synchronize_flags      Valid values are true and false.
71
+#
72
+#	If true, then the following maildir flags (in message filenames)
73
+#	will be synchronized with the corresponding notmuch tags:
74
+#
75
+#		Flag	Tag
76
+#		----	-------
77
+#		D	draft
78
+#		F	flagged
79
+#		P	passed
80
+#		R	replied
81
+#		S	unread (added when 'S' flag is not present)
82
+#
83
+#	The "notmuch new" command will notice flag changes in filenames
84
+#	and update tags, while the "notmuch tag" and "notmuch restore"
85
+#	commands will notice tag changes and update flags in filenames
86
+#
87
+[maildir]
88
+synchronize_flags=true
89
+
90
+# Cryptography related configuration
91
+#
92
+# The following option is supported here:
93
+#
94
+#	gpg_path
95
+#		binary name or full path to invoke gpg.
96
+#
97
+[crypto]
98
+gpg_path=gpg

+ 4
- 0
offlineimap/.gitignore Целия файл

@@ -0,0 +1,4 @@
1
+.offlineimap/Account-FSFE
2
+.offlineimap/Repository-FSFE-local
3
+.offlineimap/Repository-FSFE-remote
4
+.offlineimap/pid

+ 5
- 0
offlineimap/.offlineimap/getpass.py Целия файл

@@ -0,0 +1,5 @@
1
+#! /usr/bin/env python2
2
+from subprocess import check_output
3
+
4
+def get_pass(account):
5
+    return check_output("pass Mail/" + account, shell=True).splitlines()[0]

Двоични данни
offlineimap/.offlineimap/getpass.pyc Целия файл


+ 24
- 0
offlineimap/.offlineimaprc Целия файл

@@ -0,0 +1,24 @@
1
+[general]
2
+# List of accounts to be synced, separated by a comma.
3
+accounts = FSFE
4
+pythonfile = ~/.offlineimap/getpass.py
5
+socktimeout = 30
6
+
7
+
8
+[Account FSFE]
9
+localrepository = FSFE-local
10
+remoterepository = FSFE-remote
11
+status_backend = sqlite
12
+folderfilter = lambda folder: folder not in ['Trash']
13
+
14
+[Repository FSFE-local]
15
+type = Maildir
16
+localfolders = ~/Mails/FSFE
17
+
18
+[Repository FSFE-remote]
19
+type = IMAP
20
+remotehost = fomalhaut.uberspace.de
21
+remoteuser = fsfe@mehl.mx
22
+sslcacertfile = /etc/ssl/certs/ca-certificates.crt
23
+remotepasseval = get_pass("FSFE")
24
+maxconnections = 2

+ 1
- 0
pass/.password-store/.gpg-id Целия файл

@@ -0,0 +1 @@
1
+96FE8C4B

Двоични данни
pass/.password-store/DAV/Baikal-mxmehl.gpg Целия файл


Двоични данни
pass/.password-store/Mail/FSFE-SMTP.gpg Целия файл


Двоични данни
pass/.password-store/Mail/FSFE.gpg Целия файл


Двоични данни
pass/.password-store/Mail/PfadisWeb.gpg Целия файл


+ 5
- 0
vim/.vim/advanced.vim Целия файл

@@ -0,0 +1,5 @@
1
+set tw=72
2
+set comments=s1:/mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-,fb:*
3
+set ai!           " auto indent
4
+set fo+=tcqn      " format options
5
+

+ 111
- 0
vim/.vim/astroid.vim Целия файл

@@ -0,0 +1,111 @@
1
+" Error message handling
2
+set shortmess=s   " less messages
3
+set cmdheight=2
4
+
5
+" Jump to To:, Cc:, Subject:
6
+nmap <M-t> 2GA
7
+map! <M-t> <ESC>2GA
8
+nmap <M-c> 3GA
9
+map! <M-c> <ESC>3GA
10
+nmap <M-b> 4GA
11
+map! <M-b> <ESC>4GA
12
+
13
+" delete lines until end
14
+nmap <C-d> dG1o
15
+map! <C-d> <ESC>dG1o
16
+
17
+" delete current line
18
+nmap <C-s> ddi
19
+map! <C-s> <ESC>ddi
20
+
21
+" add empty line
22
+nmap <C-a> 1o
23
+map! <C-a> <ESC>1o
24
+
25
+
26
+" Go to first empty line and start insert mode
27
+execute "normal /^$/\n"
28
+execute ":startinsert"
29
+
30
+" add two empty lines after header (where we jumped to)
31
+execute "call append(line('.')-1, '')"
32
+execute "call append(line('.')-1, '')"
33
+
34
+" Email auto completion for headers
35
+let g:qcc_query_command='abook --datafile ~/DAV/CardDAV/mxmehl-fsfe.abook --mutt-query'
36
+setlocal omnifunc=QueryCommandComplete
37
+
38
+" Functions
39
+
40
+" Set tw to 500 if in the first 4 lines, else 500
41
+au CursorMovedI * call ModifyTextWidth() " execute when cursor has moved, use for all files
42
+function! ModifyTextWidth()
43
+    let line=getline('.')  " get the current line number of the cursor
44
+    if line('.') < 5  " if line number smaller than 5
45
+        setlocal textwidth=500   " use high tw setting
46
+    else
47
+        setlocal textwidth=72 " Otherwise use normal textwidth
48
+    endif
49
+endfunction
50
+
51
+function! Mail_Erase_Sig()
52
+  " search for the signature pattern (takes into account signature delimiters
53
+  " from broken mailers that forget the space after the two dashes)
54
+  let i = 0
55
+  while ((i <= line('$')) && (getline(i) !~ '^> *-- \=$'))
56
+    let i = i + 1
57
+  endwhile
58
+
59
+  " if found, then
60
+  if (i != line('$') + 1)
61
+    " first, look for our own signature, to avoid deleting it
62
+    let j = i
63
+    while (j < line('$') && (getline(j + 1) !~ '^-- $'))
64
+      let j = j + 1
65
+    endwhile
66
+
67
+    " second, search for the last non empty (non sig) line
68
+    while ((i > 0) && (getline(i - 1) =~ '^\(>\s*\)*$'))
69
+      let i = i - 1
70
+    endwhile
71
+
72
+    " third, delete those lines plus the signature
73
+    exe ':'.i.','.j.'d'
74
+  endif
75
+endfunction
76
+
77
+function! Mail_Erase_Own_Sig()
78
+  let i = 0
79
+  while ((i <= line('$')) && (getline(i) !~ '^-- \=$'))
80
+    let i = i + 1
81
+  endwhile
82
+
83
+  " if found, then
84
+  if (i != line('$') + 1)
85
+    " first, look for our own signature, to avoid deleting it
86
+    let j = i
87
+    while (j < line('$') && (getline(j + 1) !~ '^-- $'))
88
+      let j = j + 1
89
+    endwhile
90
+
91
+    " second, search for the last non empty (non sig) line
92
+    while ((i > 0) && (getline(i - 1) =~ '^\(>\s*\)*$'))
93
+      let i = i - 1
94
+    endwhile
95
+
96
+    " third, delete those lines plus the signature
97
+    exe ':'.i.','.j.'d'
98
+  endif
99
+endfunction
100
+
101
+function! Mail_Beginning()
102
+  exe "normal gg"
103
+  if getline (line ('.')) =~ '^From: '
104
+    " if we use edit_headers in Mutt, then go after the headers
105
+    exe "normal /^$\<CR>"
106
+  endif
107
+endfunction
108
+
109
+call Mail_Erase_Own_Sig()
110
+call Mail_Erase_Sig()
111
+call Mail_Beginning()

+ 4
- 0
vim/.vim/filetype.vim Целия файл

@@ -0,0 +1,4 @@
1
+augroup filetypedetect
2
+  " Mail
3
+  autocmd BufRead,BufNewFile *astroid* setfiletype mail
4
+augroup END

+ 242
- 0
vim/.vim/plugin/querycommandcomplete.vim Целия файл

@@ -0,0 +1,242 @@
1
+" Query Command Complete
2
+" ======================
3
+"
4
+" Vim plugin to suggest completions with the results of an external
5
+" query command.
6
+"
7
+" The original intention is to use it as a mutt query_command wrapper
8
+" to complete addresses in the mail headers, but it can be adapted
9
+" to any other kind of functionality by modifying the exposed setting
10
+" parameters.
11
+"
12
+" Last Change: 2013 Jun 16
13
+" Author: Caio Romão (http://caioromao.com)
14
+" License: This file is placed in the public domain
15
+" Contributors:
16
+"   Brian Henderson https://github.com/bhenderson
17
+"   Mark Stillwell  https://github.com/marklee77
18
+"   Rui Abreu Ferreira http://ruiabreu.org
19
+"
20
+" Setup:
21
+"   This plugin exports the completion function QueryCommandComplete,
22
+"   which can be set as the complete function (or omni function) for
23
+"   any filetype. If you have a working mutt setup with query_command
24
+"   configured, the plugin works out of the box.
25
+"
26
+"   Example:
27
+"       let g:qcc_query_command='abook'
28
+"       au BufRead /tmp/mutt* setlocal omnifunc=QueryCommandComplete
29
+"
30
+" Settings:
31
+"   Note: Overriding settings on a buffer-basis is supported. So
32
+"         b:qcc_query_command takes precedence over g:qcc_query_command
33
+"
34
+"   g:qcc_query_command
35
+"       External command that queries for contacts
36
+"       If empty, QueryCommandComplete tries to guess what command to
37
+"       run by executing `mutt -Q query_command`.
38
+"
39
+"   g:qcc_line_separator
40
+"       Separator for each entry in the result from the query
41
+"       default: '\n'
42
+"
43
+"   g:qcc_field_separator
44
+"       Separator for the fields of an entry from the result
45
+"       default: '\t'
46
+"
47
+"   g:qcc_pattern
48
+"       Pattern used to match against the current line to decide
49
+"       whether to call the query command
50
+"       default: '^\(To\|Cc\|Bcc\|From\|Reply-To\):'
51
+"
52
+"   g:qcc_multiline
53
+"       Whether to try matching g:qcc_pattern against the current
54
+"       and any previous line
55
+"       default: 0
56
+"
57
+"   g:qcc_multiline_pattern
58
+"       Pattern to match against the current line when deciding
59
+"       wether to keep looking for a line that matches g:qcc_pattern
60
+"       This provides finer control over the recursion, which
61
+"       is useful if calling the completion on really big files.
62
+"       default: '.*'
63
+"
64
+"   g:qcc_format_word
65
+"       Format string to be used when building the word field
66
+"       of the completion (i.e.: the final result, what gets fed into
67
+"       the current line when you select an option)
68
+"       default: '${1} <${0}>' (as in: FirstName <email@domain.com>)
69
+"
70
+"   g:qcc_format_abbr
71
+"       Format string to be used when building the abbreviation
72
+"       for the completion menu (i.e.: the first row in the completion
73
+"       menu).
74
+"       default: '${1}'
75
+"
76
+"   g:qcc_format_menu
77
+"       Format string for the optional second column of the completion
78
+"       menu.
79
+"       default: '${2}'
80
+"
81
+
82
+
83
+if exists("g:loaded_QueryCommandComplete") || &cp
84
+  finish
85
+endif
86
+
87
+function! s:GetSetting(name)
88
+    let global_option = 'g:qcc_' . a:name
89
+    let local_option = 'b:qcc_' . a:name
90
+
91
+    let result = ''
92
+    if exists(local_option)
93
+        let result = {local_option}
94
+    elseif exists(global_option)
95
+        let result = {global_option}
96
+    endif
97
+
98
+    return result
99
+endfunction
100
+
101
+let g:loaded_QueryCommandComplete = 1
102
+let s:save_cpo = &cpo
103
+set cpo&vim
104
+
105
+function! s:DefaultIfUnset(name, default)
106
+    if !exists(a:name)
107
+        let {a:name} = a:default
108
+    endif
109
+endfunction
110
+
111
+call s:DefaultIfUnset('g:qcc_line_separator', '\n')
112
+call s:DefaultIfUnset('g:qcc_field_separator', '\t')
113
+call s:DefaultIfUnset('g:qcc_pattern', '^\(To\|Cc\|Bcc\|From\|Reply-To\):')
114
+call s:DefaultIfUnset('g:qcc_multiline', 0)
115
+call s:DefaultIfUnset('g:qcc_multiline_pattern', '.*')
116
+call s:DefaultIfUnset('g:qcc_format_word', '${1} <${0}>')
117
+call s:DefaultIfUnset('g:qcc_format_abbr', '${1}')
118
+call s:DefaultIfUnset('g:qcc_format_menu', '${2}')
119
+
120
+" Given a format string where the placeholders are in the format
121
+" '${index}' and index is a valid index the the given 'fields'
122
+" argument, this function returns a string with all placeholders
123
+" replaced by the corresponding data in the fields list.
124
+" FIXME I can't help but think there's a standard way to do this
125
+"       but I failed finding it. Please call me a dumbass if you
126
+"       know The Easy Way.
127
+function! s:ApplyFieldsToFormatString(fields, format)
128
+    let result = a:format
129
+
130
+    while 1
131
+        let placeholder = matchstr(result, '${[0-9]}')
132
+
133
+        if (empty(placeholder))
134
+            break
135
+        endif
136
+
137
+        let index = matchstr(placeholder, '[0-9]')
138
+
139
+        " If ${NUMBER} is not a valid index in a:fields,
140
+        " use '' as a fallback.
141
+        " FIXME Decide whether to warn/err/whatever here
142
+        let content = ''
143
+        if (len(a:fields) > index)
144
+            let content = a:fields[index]
145
+        endif
146
+
147
+        let result = substitute(result, placeholder, content, 'g')
148
+
149
+    endwhile
150
+
151
+    return result
152
+endfunction
153
+
154
+function! s:MakeCompletionEntry(fields)
155
+    let entry = {}
156
+    let entry.word = s:ApplyFieldsToFormatString(a:fields, s:GetSetting('format_word'))
157
+    let entry.abbr = s:ApplyFieldsToFormatString(a:fields, s:GetSetting('format_abbr'))
158
+    let entry.menu = s:ApplyFieldsToFormatString(a:fields, s:GetSetting('format_menu'))
159
+    let entry.icase = 1
160
+    return entry
161
+endfunction
162
+
163
+function! s:FindStartingIndex()
164
+    let cur_line = getline('.')
165
+
166
+    " locate the start of the word
167
+    let start = col('.') - 1
168
+    while start > 0 && cur_line[start - 1] =~ '[^:,]'
169
+        let start -= 1
170
+    endwhile
171
+
172
+    " lstrip()
173
+    while cur_line[start] =~ '[ ]'
174
+        let start += 1
175
+    endwhile
176
+
177
+    return start
178
+endfunction
179
+
180
+function! s:GenerateCompletions(findstart, base)
181
+    if a:findstart
182
+        return s:FindStartingIndex()
183
+    endif
184
+
185
+    let results = []
186
+    let cmd = s:GetSetting('query_command')
187
+    if cmd !~ '%s'
188
+        let cmd .= ' %s'
189
+    endif
190
+    let cmd = substitute(cmd, '%s', shellescape(a:base), '')
191
+    let lines = split(system(cmd), g:qcc_line_separator)
192
+
193
+    for my_line in lines
194
+        let fields = split(my_line, g:qcc_field_separator)
195
+
196
+        let entry = s:MakeCompletionEntry(fields)
197
+
198
+        call add(results, entry)
199
+    endfor
200
+
201
+    return results
202
+endfunction
203
+
204
+function! s:ShouldGenerateCompletions(line_number)
205
+    let current_line = getline(a:line_number)
206
+
207
+    if current_line =~ g:qcc_pattern
208
+        return 1
209
+    endif
210
+
211
+    if ! g:qcc_multiline || a:line_number <= 1 || current_line !~ g:qcc_multiline_pattern
212
+        return 0
213
+    endif
214
+
215
+    return s:ShouldGenerateCompletions(a:line_number - 1)
216
+endfunction
217
+
218
+function! s:CheckSettings()
219
+    " Try to use mutt's query_command by default if nothing is set
220
+    if empty(s:GetSetting('query_command'))
221
+        let s:querycmd = system('mutt -Q query_command 2>/dev/null')
222
+        let s:querycmd = substitute(s:querycmd, '^query_command="\(.*\)"\n', '\1','')
223
+
224
+        if len(s:querycmd)
225
+            let g:qcc_query_command = s:querycmd
226
+            let g:qcc_multiline = 1
227
+            autocmd FileType mail setlocal omnifunc=QueryCommandComplete
228
+        else
229
+            echoerr "QueryCommandComplete: g:qcc_query_command not set!"
230
+            return 0
231
+        endif
232
+    endif
233
+    return 1
234
+endfunction
235
+
236
+function! QueryCommandComplete(findstart, base)
237
+    if s:CheckSettings() && s:ShouldGenerateCompletions(line('.'))
238
+        return s:GenerateCompletions(a:findstart, a:base)
239
+    endif
240
+endfunction
241
+
242
+let &cpo = s:save_cpo

+ 33
- 0
vim/.vimrc Целия файл

@@ -0,0 +1,33 @@
1
+syn on
2
+" Enable Ctrl+Backspace deleting the last word
3
+:imap <C-BS> <C-W>
4
+
5
+set nocompatible  " no vi compatible, seems to be good 
6
+set expandtab     " covert TAB to spaces
7
+set shiftwidth=2  " width of tabs
8
+set softtabstop=2 " width of tabs
9
+
10
+" Ctrl copy/cut paste behaviour
11
+vmap <C-c> "+yi
12
+vmap <C-x> "+c
13
+vmap <C-v> c<ESC>"+p
14
+imap <C-v> <C-r><C-o>+
15
+
16
+" Reformat shortcuts
17
+nmap  <F1>  gqap    " re-format the current paragraph correctly
18
+nmap  <F2>  gqqj    " format a line which is too long, and go to the next line
19
+nmap  <F3>  kgqj    " merge the previous line with the current one, with a correct formatting
20
+map!  <F1>  <ESC>gqapi
21
+map!  <F2>  <ESC>gqqji
22
+map!  <F3>  <ESC>kgqji
23
+
24
+" Arrow left moves up line when at position 0
25
+set whichwrap+=<,>,[,]
26
+
27
+
28
+" ASTROID
29
+autocmd BufRead /home/max/.cache/astroid/* :source ~/.vim/advanced.vim
30
+autocmd BufRead /home/max/.cache/astroid/* :source ~/.vim/astroid.vim
31
+
32
+" Thunderbird
33
+autocmd BufRead /tmp/*.eml :source ~/.vim/advanced.vim

Loading…
Отказ
Запис