add other MUA related config files
This commit is contained in:
18
msmtp/.msmtprc
Normal file
18
msmtp/.msmtprc
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Set default values for all following accounts.
|
||||||
|
defaults
|
||||||
|
auth on
|
||||||
|
tls on
|
||||||
|
tls_starttls on
|
||||||
|
tls_certcheck on
|
||||||
|
tls_trust_file /etc/ssl/certs/ca-certificates.crt
|
||||||
|
logfile ~/.msmtp.log
|
||||||
|
|
||||||
|
# FSFE
|
||||||
|
account fsfe
|
||||||
|
host mail.fsfe.org
|
||||||
|
port 587
|
||||||
|
from max.mehl@fsfe.org
|
||||||
|
user max.mehl
|
||||||
|
passwordeval pass Mail/FSFE-SMTP
|
||||||
|
|
||||||
|
account default : fsfe
|
||||||
98
notmuch/.notmuch-config
Normal file
98
notmuch/.notmuch-config
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
# .notmuch-config - Configuration file for the notmuch mail system
|
||||||
|
#
|
||||||
|
# For more information about notmuch, see http://notmuchmail.org
|
||||||
|
|
||||||
|
# Database configuration
|
||||||
|
#
|
||||||
|
# The only value supported here is 'path' which should be the top-level
|
||||||
|
# directory where your mail currently exists and to where mail will be
|
||||||
|
# delivered in the future. Files should be individual email messages.
|
||||||
|
# Notmuch will store its database within a sub-directory of the path
|
||||||
|
# configured here named ".notmuch".
|
||||||
|
#
|
||||||
|
[database]
|
||||||
|
path=/home/max/Mails/FSFE
|
||||||
|
|
||||||
|
# User configuration
|
||||||
|
#
|
||||||
|
# Here is where you can let notmuch know how you would like to be
|
||||||
|
# addressed. Valid settings are
|
||||||
|
#
|
||||||
|
# name Your full name.
|
||||||
|
# primary_email Your primary email address.
|
||||||
|
# other_email A list (separated by ';') of other email addresses
|
||||||
|
# at which you receive email.
|
||||||
|
#
|
||||||
|
# Notmuch will use the various email addresses configured here when
|
||||||
|
# formatting replies. It will avoid including your own addresses in the
|
||||||
|
# recipient list of replies, and will set the From address based on the
|
||||||
|
# address to which the original email was addressed.
|
||||||
|
#
|
||||||
|
[user]
|
||||||
|
name=Max Mehl
|
||||||
|
primary_email=max.mehl@fsfe.org
|
||||||
|
other_email=fsfe@mehl.mx
|
||||||
|
|
||||||
|
# Configuration for "notmuch new"
|
||||||
|
#
|
||||||
|
# The following options are supported here:
|
||||||
|
#
|
||||||
|
# tags A list (separated by ';') of the tags that will be
|
||||||
|
# added to all messages incorporated by "notmuch new".
|
||||||
|
#
|
||||||
|
# ignore A list (separated by ';') of file and directory names
|
||||||
|
# that will not be searched for messages by "notmuch new".
|
||||||
|
#
|
||||||
|
# NOTE: *Every* file/directory that goes by one of those
|
||||||
|
# names will be ignored, independent of its depth/location
|
||||||
|
# in the mail store.
|
||||||
|
#
|
||||||
|
[new]
|
||||||
|
tags=unread
|
||||||
|
ignore=
|
||||||
|
|
||||||
|
# Search configuration
|
||||||
|
#
|
||||||
|
# The following option is supported here:
|
||||||
|
#
|
||||||
|
# exclude_tags
|
||||||
|
# A ;-separated list of tags that will be excluded from
|
||||||
|
# search results by default. Using an excluded tag in a
|
||||||
|
# query will override that exclusion.
|
||||||
|
#
|
||||||
|
[search]
|
||||||
|
exclude_tags=del;spam;ignore;mod;cvs;archive
|
||||||
|
|
||||||
|
# Maildir compatibility configuration
|
||||||
|
#
|
||||||
|
# The following option is supported here:
|
||||||
|
#
|
||||||
|
# synchronize_flags Valid values are true and false.
|
||||||
|
#
|
||||||
|
# If true, then the following maildir flags (in message filenames)
|
||||||
|
# will be synchronized with the corresponding notmuch tags:
|
||||||
|
#
|
||||||
|
# Flag Tag
|
||||||
|
# ---- -------
|
||||||
|
# D draft
|
||||||
|
# F flagged
|
||||||
|
# P passed
|
||||||
|
# R replied
|
||||||
|
# S unread (added when 'S' flag is not present)
|
||||||
|
#
|
||||||
|
# The "notmuch new" command will notice flag changes in filenames
|
||||||
|
# and update tags, while the "notmuch tag" and "notmuch restore"
|
||||||
|
# commands will notice tag changes and update flags in filenames
|
||||||
|
#
|
||||||
|
[maildir]
|
||||||
|
synchronize_flags=true
|
||||||
|
|
||||||
|
# Cryptography related configuration
|
||||||
|
#
|
||||||
|
# The following option is supported here:
|
||||||
|
#
|
||||||
|
# gpg_path
|
||||||
|
# binary name or full path to invoke gpg.
|
||||||
|
#
|
||||||
|
[crypto]
|
||||||
|
gpg_path=gpg
|
||||||
4
offlineimap/.gitignore
vendored
Normal file
4
offlineimap/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
.offlineimap/Account-FSFE
|
||||||
|
.offlineimap/Repository-FSFE-local
|
||||||
|
.offlineimap/Repository-FSFE-remote
|
||||||
|
.offlineimap/pid
|
||||||
5
offlineimap/.offlineimap/getpass.py
Executable file
5
offlineimap/.offlineimap/getpass.py
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#! /usr/bin/env python2
|
||||||
|
from subprocess import check_output
|
||||||
|
|
||||||
|
def get_pass(account):
|
||||||
|
return check_output("pass Mail/" + account, shell=True).splitlines()[0]
|
||||||
BIN
offlineimap/.offlineimap/getpass.pyc
Normal file
BIN
offlineimap/.offlineimap/getpass.pyc
Normal file
Binary file not shown.
24
offlineimap/.offlineimaprc
Normal file
24
offlineimap/.offlineimaprc
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
[general]
|
||||||
|
# List of accounts to be synced, separated by a comma.
|
||||||
|
accounts = FSFE
|
||||||
|
pythonfile = ~/.offlineimap/getpass.py
|
||||||
|
socktimeout = 30
|
||||||
|
|
||||||
|
|
||||||
|
[Account FSFE]
|
||||||
|
localrepository = FSFE-local
|
||||||
|
remoterepository = FSFE-remote
|
||||||
|
status_backend = sqlite
|
||||||
|
folderfilter = lambda folder: folder not in ['Trash']
|
||||||
|
|
||||||
|
[Repository FSFE-local]
|
||||||
|
type = Maildir
|
||||||
|
localfolders = ~/Mails/FSFE
|
||||||
|
|
||||||
|
[Repository FSFE-remote]
|
||||||
|
type = IMAP
|
||||||
|
remotehost = fomalhaut.uberspace.de
|
||||||
|
remoteuser = fsfe@mehl.mx
|
||||||
|
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
|
||||||
|
remotepasseval = get_pass("FSFE")
|
||||||
|
maxconnections = 2
|
||||||
1
pass/.password-store/.gpg-id
Normal file
1
pass/.password-store/.gpg-id
Normal file
@@ -0,0 +1 @@
|
|||||||
|
96FE8C4B
|
||||||
BIN
pass/.password-store/DAV/Baikal-mxmehl.gpg
Normal file
BIN
pass/.password-store/DAV/Baikal-mxmehl.gpg
Normal file
Binary file not shown.
BIN
pass/.password-store/Mail/FSFE-SMTP.gpg
Normal file
BIN
pass/.password-store/Mail/FSFE-SMTP.gpg
Normal file
Binary file not shown.
BIN
pass/.password-store/Mail/FSFE.gpg
Normal file
BIN
pass/.password-store/Mail/FSFE.gpg
Normal file
Binary file not shown.
BIN
pass/.password-store/Mail/PfadisWeb.gpg
Normal file
BIN
pass/.password-store/Mail/PfadisWeb.gpg
Normal file
Binary file not shown.
5
vim/.vim/advanced.vim
Normal file
5
vim/.vim/advanced.vim
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
set tw=72
|
||||||
|
set comments=s1:/mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-,fb:*
|
||||||
|
set ai! " auto indent
|
||||||
|
set fo+=tcqn " format options
|
||||||
|
|
||||||
111
vim/.vim/astroid.vim
Normal file
111
vim/.vim/astroid.vim
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
" Error message handling
|
||||||
|
set shortmess=s " less messages
|
||||||
|
set cmdheight=2
|
||||||
|
|
||||||
|
" Jump to To:, Cc:, Subject:
|
||||||
|
nmap <M-t> 2GA
|
||||||
|
map! <M-t> <ESC>2GA
|
||||||
|
nmap <M-c> 3GA
|
||||||
|
map! <M-c> <ESC>3GA
|
||||||
|
nmap <M-b> 4GA
|
||||||
|
map! <M-b> <ESC>4GA
|
||||||
|
|
||||||
|
" delete lines until end
|
||||||
|
nmap <C-d> dG1o
|
||||||
|
map! <C-d> <ESC>dG1o
|
||||||
|
|
||||||
|
" delete current line
|
||||||
|
nmap <C-s> ddi
|
||||||
|
map! <C-s> <ESC>ddi
|
||||||
|
|
||||||
|
" add empty line
|
||||||
|
nmap <C-a> 1o
|
||||||
|
map! <C-a> <ESC>1o
|
||||||
|
|
||||||
|
|
||||||
|
" Go to first empty line and start insert mode
|
||||||
|
execute "normal /^$/\n"
|
||||||
|
execute ":startinsert"
|
||||||
|
|
||||||
|
" add two empty lines after header (where we jumped to)
|
||||||
|
execute "call append(line('.')-1, '')"
|
||||||
|
execute "call append(line('.')-1, '')"
|
||||||
|
|
||||||
|
" Email auto completion for headers
|
||||||
|
let g:qcc_query_command='abook --datafile ~/DAV/CardDAV/mxmehl-fsfe.abook --mutt-query'
|
||||||
|
setlocal omnifunc=QueryCommandComplete
|
||||||
|
|
||||||
|
" Functions
|
||||||
|
|
||||||
|
" Set tw to 500 if in the first 4 lines, else 500
|
||||||
|
au CursorMovedI * call ModifyTextWidth() " execute when cursor has moved, use for all files
|
||||||
|
function! ModifyTextWidth()
|
||||||
|
let line=getline('.') " get the current line number of the cursor
|
||||||
|
if line('.') < 5 " if line number smaller than 5
|
||||||
|
setlocal textwidth=500 " use high tw setting
|
||||||
|
else
|
||||||
|
setlocal textwidth=72 " Otherwise use normal textwidth
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! Mail_Erase_Sig()
|
||||||
|
" search for the signature pattern (takes into account signature delimiters
|
||||||
|
" from broken mailers that forget the space after the two dashes)
|
||||||
|
let i = 0
|
||||||
|
while ((i <= line('$')) && (getline(i) !~ '^> *-- \=$'))
|
||||||
|
let i = i + 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
" if found, then
|
||||||
|
if (i != line('$') + 1)
|
||||||
|
" first, look for our own signature, to avoid deleting it
|
||||||
|
let j = i
|
||||||
|
while (j < line('$') && (getline(j + 1) !~ '^-- $'))
|
||||||
|
let j = j + 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
" second, search for the last non empty (non sig) line
|
||||||
|
while ((i > 0) && (getline(i - 1) =~ '^\(>\s*\)*$'))
|
||||||
|
let i = i - 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
" third, delete those lines plus the signature
|
||||||
|
exe ':'.i.','.j.'d'
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! Mail_Erase_Own_Sig()
|
||||||
|
let i = 0
|
||||||
|
while ((i <= line('$')) && (getline(i) !~ '^-- \=$'))
|
||||||
|
let i = i + 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
" if found, then
|
||||||
|
if (i != line('$') + 1)
|
||||||
|
" first, look for our own signature, to avoid deleting it
|
||||||
|
let j = i
|
||||||
|
while (j < line('$') && (getline(j + 1) !~ '^-- $'))
|
||||||
|
let j = j + 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
" second, search for the last non empty (non sig) line
|
||||||
|
while ((i > 0) && (getline(i - 1) =~ '^\(>\s*\)*$'))
|
||||||
|
let i = i - 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
" third, delete those lines plus the signature
|
||||||
|
exe ':'.i.','.j.'d'
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! Mail_Beginning()
|
||||||
|
exe "normal gg"
|
||||||
|
if getline (line ('.')) =~ '^From: '
|
||||||
|
" if we use edit_headers in Mutt, then go after the headers
|
||||||
|
exe "normal /^$\<CR>"
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call Mail_Erase_Own_Sig()
|
||||||
|
call Mail_Erase_Sig()
|
||||||
|
call Mail_Beginning()
|
||||||
4
vim/.vim/filetype.vim
Normal file
4
vim/.vim/filetype.vim
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
augroup filetypedetect
|
||||||
|
" Mail
|
||||||
|
autocmd BufRead,BufNewFile *astroid* setfiletype mail
|
||||||
|
augroup END
|
||||||
242
vim/.vim/plugin/querycommandcomplete.vim
Normal file
242
vim/.vim/plugin/querycommandcomplete.vim
Normal file
@@ -0,0 +1,242 @@
|
|||||||
|
" Query Command Complete
|
||||||
|
" ======================
|
||||||
|
"
|
||||||
|
" Vim plugin to suggest completions with the results of an external
|
||||||
|
" query command.
|
||||||
|
"
|
||||||
|
" The original intention is to use it as a mutt query_command wrapper
|
||||||
|
" to complete addresses in the mail headers, but it can be adapted
|
||||||
|
" to any other kind of functionality by modifying the exposed setting
|
||||||
|
" parameters.
|
||||||
|
"
|
||||||
|
" Last Change: 2013 Jun 16
|
||||||
|
" Author: Caio Romão (http://caioromao.com)
|
||||||
|
" License: This file is placed in the public domain
|
||||||
|
" Contributors:
|
||||||
|
" Brian Henderson https://github.com/bhenderson
|
||||||
|
" Mark Stillwell https://github.com/marklee77
|
||||||
|
" Rui Abreu Ferreira http://ruiabreu.org
|
||||||
|
"
|
||||||
|
" Setup:
|
||||||
|
" This plugin exports the completion function QueryCommandComplete,
|
||||||
|
" which can be set as the complete function (or omni function) for
|
||||||
|
" any filetype. If you have a working mutt setup with query_command
|
||||||
|
" configured, the plugin works out of the box.
|
||||||
|
"
|
||||||
|
" Example:
|
||||||
|
" let g:qcc_query_command='abook'
|
||||||
|
" au BufRead /tmp/mutt* setlocal omnifunc=QueryCommandComplete
|
||||||
|
"
|
||||||
|
" Settings:
|
||||||
|
" Note: Overriding settings on a buffer-basis is supported. So
|
||||||
|
" b:qcc_query_command takes precedence over g:qcc_query_command
|
||||||
|
"
|
||||||
|
" g:qcc_query_command
|
||||||
|
" External command that queries for contacts
|
||||||
|
" If empty, QueryCommandComplete tries to guess what command to
|
||||||
|
" run by executing `mutt -Q query_command`.
|
||||||
|
"
|
||||||
|
" g:qcc_line_separator
|
||||||
|
" Separator for each entry in the result from the query
|
||||||
|
" default: '\n'
|
||||||
|
"
|
||||||
|
" g:qcc_field_separator
|
||||||
|
" Separator for the fields of an entry from the result
|
||||||
|
" default: '\t'
|
||||||
|
"
|
||||||
|
" g:qcc_pattern
|
||||||
|
" Pattern used to match against the current line to decide
|
||||||
|
" whether to call the query command
|
||||||
|
" default: '^\(To\|Cc\|Bcc\|From\|Reply-To\):'
|
||||||
|
"
|
||||||
|
" g:qcc_multiline
|
||||||
|
" Whether to try matching g:qcc_pattern against the current
|
||||||
|
" and any previous line
|
||||||
|
" default: 0
|
||||||
|
"
|
||||||
|
" g:qcc_multiline_pattern
|
||||||
|
" Pattern to match against the current line when deciding
|
||||||
|
" wether to keep looking for a line that matches g:qcc_pattern
|
||||||
|
" This provides finer control over the recursion, which
|
||||||
|
" is useful if calling the completion on really big files.
|
||||||
|
" default: '.*'
|
||||||
|
"
|
||||||
|
" g:qcc_format_word
|
||||||
|
" Format string to be used when building the word field
|
||||||
|
" of the completion (i.e.: the final result, what gets fed into
|
||||||
|
" the current line when you select an option)
|
||||||
|
" default: '${1} <${0}>' (as in: FirstName <email@domain.com>)
|
||||||
|
"
|
||||||
|
" g:qcc_format_abbr
|
||||||
|
" Format string to be used when building the abbreviation
|
||||||
|
" for the completion menu (i.e.: the first row in the completion
|
||||||
|
" menu).
|
||||||
|
" default: '${1}'
|
||||||
|
"
|
||||||
|
" g:qcc_format_menu
|
||||||
|
" Format string for the optional second column of the completion
|
||||||
|
" menu.
|
||||||
|
" default: '${2}'
|
||||||
|
"
|
||||||
|
|
||||||
|
|
||||||
|
if exists("g:loaded_QueryCommandComplete") || &cp
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
function! s:GetSetting(name)
|
||||||
|
let global_option = 'g:qcc_' . a:name
|
||||||
|
let local_option = 'b:qcc_' . a:name
|
||||||
|
|
||||||
|
let result = ''
|
||||||
|
if exists(local_option)
|
||||||
|
let result = {local_option}
|
||||||
|
elseif exists(global_option)
|
||||||
|
let result = {global_option}
|
||||||
|
endif
|
||||||
|
|
||||||
|
return result
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let g:loaded_QueryCommandComplete = 1
|
||||||
|
let s:save_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
function! s:DefaultIfUnset(name, default)
|
||||||
|
if !exists(a:name)
|
||||||
|
let {a:name} = a:default
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call s:DefaultIfUnset('g:qcc_line_separator', '\n')
|
||||||
|
call s:DefaultIfUnset('g:qcc_field_separator', '\t')
|
||||||
|
call s:DefaultIfUnset('g:qcc_pattern', '^\(To\|Cc\|Bcc\|From\|Reply-To\):')
|
||||||
|
call s:DefaultIfUnset('g:qcc_multiline', 0)
|
||||||
|
call s:DefaultIfUnset('g:qcc_multiline_pattern', '.*')
|
||||||
|
call s:DefaultIfUnset('g:qcc_format_word', '${1} <${0}>')
|
||||||
|
call s:DefaultIfUnset('g:qcc_format_abbr', '${1}')
|
||||||
|
call s:DefaultIfUnset('g:qcc_format_menu', '${2}')
|
||||||
|
|
||||||
|
" Given a format string where the placeholders are in the format
|
||||||
|
" '${index}' and index is a valid index the the given 'fields'
|
||||||
|
" argument, this function returns a string with all placeholders
|
||||||
|
" replaced by the corresponding data in the fields list.
|
||||||
|
" FIXME I can't help but think there's a standard way to do this
|
||||||
|
" but I failed finding it. Please call me a dumbass if you
|
||||||
|
" know The Easy Way.
|
||||||
|
function! s:ApplyFieldsToFormatString(fields, format)
|
||||||
|
let result = a:format
|
||||||
|
|
||||||
|
while 1
|
||||||
|
let placeholder = matchstr(result, '${[0-9]}')
|
||||||
|
|
||||||
|
if (empty(placeholder))
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
|
||||||
|
let index = matchstr(placeholder, '[0-9]')
|
||||||
|
|
||||||
|
" If ${NUMBER} is not a valid index in a:fields,
|
||||||
|
" use '' as a fallback.
|
||||||
|
" FIXME Decide whether to warn/err/whatever here
|
||||||
|
let content = ''
|
||||||
|
if (len(a:fields) > index)
|
||||||
|
let content = a:fields[index]
|
||||||
|
endif
|
||||||
|
|
||||||
|
let result = substitute(result, placeholder, content, 'g')
|
||||||
|
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
return result
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:MakeCompletionEntry(fields)
|
||||||
|
let entry = {}
|
||||||
|
let entry.word = s:ApplyFieldsToFormatString(a:fields, s:GetSetting('format_word'))
|
||||||
|
let entry.abbr = s:ApplyFieldsToFormatString(a:fields, s:GetSetting('format_abbr'))
|
||||||
|
let entry.menu = s:ApplyFieldsToFormatString(a:fields, s:GetSetting('format_menu'))
|
||||||
|
let entry.icase = 1
|
||||||
|
return entry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:FindStartingIndex()
|
||||||
|
let cur_line = getline('.')
|
||||||
|
|
||||||
|
" locate the start of the word
|
||||||
|
let start = col('.') - 1
|
||||||
|
while start > 0 && cur_line[start - 1] =~ '[^:,]'
|
||||||
|
let start -= 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
" lstrip()
|
||||||
|
while cur_line[start] =~ '[ ]'
|
||||||
|
let start += 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
return start
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:GenerateCompletions(findstart, base)
|
||||||
|
if a:findstart
|
||||||
|
return s:FindStartingIndex()
|
||||||
|
endif
|
||||||
|
|
||||||
|
let results = []
|
||||||
|
let cmd = s:GetSetting('query_command')
|
||||||
|
if cmd !~ '%s'
|
||||||
|
let cmd .= ' %s'
|
||||||
|
endif
|
||||||
|
let cmd = substitute(cmd, '%s', shellescape(a:base), '')
|
||||||
|
let lines = split(system(cmd), g:qcc_line_separator)
|
||||||
|
|
||||||
|
for my_line in lines
|
||||||
|
let fields = split(my_line, g:qcc_field_separator)
|
||||||
|
|
||||||
|
let entry = s:MakeCompletionEntry(fields)
|
||||||
|
|
||||||
|
call add(results, entry)
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return results
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:ShouldGenerateCompletions(line_number)
|
||||||
|
let current_line = getline(a:line_number)
|
||||||
|
|
||||||
|
if current_line =~ g:qcc_pattern
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
if ! g:qcc_multiline || a:line_number <= 1 || current_line !~ g:qcc_multiline_pattern
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
return s:ShouldGenerateCompletions(a:line_number - 1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:CheckSettings()
|
||||||
|
" Try to use mutt's query_command by default if nothing is set
|
||||||
|
if empty(s:GetSetting('query_command'))
|
||||||
|
let s:querycmd = system('mutt -Q query_command 2>/dev/null')
|
||||||
|
let s:querycmd = substitute(s:querycmd, '^query_command="\(.*\)"\n', '\1','')
|
||||||
|
|
||||||
|
if len(s:querycmd)
|
||||||
|
let g:qcc_query_command = s:querycmd
|
||||||
|
let g:qcc_multiline = 1
|
||||||
|
autocmd FileType mail setlocal omnifunc=QueryCommandComplete
|
||||||
|
else
|
||||||
|
echoerr "QueryCommandComplete: g:qcc_query_command not set!"
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
return 1
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! QueryCommandComplete(findstart, base)
|
||||||
|
if s:CheckSettings() && s:ShouldGenerateCompletions(line('.'))
|
||||||
|
return s:GenerateCompletions(a:findstart, a:base)
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let &cpo = s:save_cpo
|
||||||
33
vim/.vimrc
Normal file
33
vim/.vimrc
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
syn on
|
||||||
|
" Enable Ctrl+Backspace deleting the last word
|
||||||
|
:imap <C-BS> <C-W>
|
||||||
|
|
||||||
|
set nocompatible " no vi compatible, seems to be good
|
||||||
|
set expandtab " covert TAB to spaces
|
||||||
|
set shiftwidth=2 " width of tabs
|
||||||
|
set softtabstop=2 " width of tabs
|
||||||
|
|
||||||
|
" Ctrl copy/cut paste behaviour
|
||||||
|
vmap <C-c> "+yi
|
||||||
|
vmap <C-x> "+c
|
||||||
|
vmap <C-v> c<ESC>"+p
|
||||||
|
imap <C-v> <C-r><C-o>+
|
||||||
|
|
||||||
|
" Reformat shortcuts
|
||||||
|
nmap <F1> gqap " re-format the current paragraph correctly
|
||||||
|
nmap <F2> gqqj " format a line which is too long, and go to the next line
|
||||||
|
nmap <F3> kgqj " merge the previous line with the current one, with a correct formatting
|
||||||
|
map! <F1> <ESC>gqapi
|
||||||
|
map! <F2> <ESC>gqqji
|
||||||
|
map! <F3> <ESC>kgqji
|
||||||
|
|
||||||
|
" Arrow left moves up line when at position 0
|
||||||
|
set whichwrap+=<,>,[,]
|
||||||
|
|
||||||
|
|
||||||
|
" ASTROID
|
||||||
|
autocmd BufRead /home/max/.cache/astroid/* :source ~/.vim/advanced.vim
|
||||||
|
autocmd BufRead /home/max/.cache/astroid/* :source ~/.vim/astroid.vim
|
||||||
|
|
||||||
|
" Thunderbird
|
||||||
|
autocmd BufRead /tmp/*.eml :source ~/.vim/advanced.vim
|
||||||
Reference in New Issue
Block a user