From 3c69b08ce58475f6ab8e7a7a460803d3c7a8905a Mon Sep 17 00:00:00 2001 From: Dustin Swan Date: Sat, 28 Jun 2014 15:32:30 -0500 Subject: [PATCH] A bunch of notmuch config, adding jrnl config, adding some vim plugins. --- afew/config | 72 +----------------------------------------------- jrnl_config | 16 +++++++++++ notmuch-post-new | 24 ++++++++++++---- offlineimap.py | 33 ++++++++++++++-------- symlinks.sh | 1 + vimrc | 6 +++- 6 files changed, 64 insertions(+), 88 deletions(-) create mode 100644 jrnl_config diff --git a/afew/config b/afew/config index 47a0153..fd7fcf7 100644 --- a/afew/config +++ b/afew/config @@ -2,76 +2,7 @@ #[ClassifyingFilter] [KillThreadsFilter] [ListMailsFilter] -[ArchiveSentMailsFilter] # Looks for mails sent from my addresses, adds sent tag - -#[FolderNameFilter] -#folder_blacklist = iocom/INBOX gmail/INBOX gmail/[Gmail].Important gmail/[Gmail].Starred -#folder_transforms = Archive:archive Drafts:drafts Sent:sent Trash:trash Builder:builder Info:info Netmon:netmon Spam:spam "gmail/Kara Hetz":"Kara Hetz" "All Mail":archive "gmail/[Gmail].Drafts":drafts "gmail/[Gmail].Sent Mail":sent "Spam":spam "Important":important "gmail/[Gmail].Trash":trash -#folder_explicit_list = gmail/ -#folder_transforms = Archive:archive Drafts:drafts Sent:sent Trash:trash Builder:builder Info:info Netmon:netmon Spam:spam "gmail/Kara Hetz":"Kara Hetz" "All Mail":archive "gmail/[Gmail].Drafts":drafts "gmail/[Gmail].Sent Mail":sent "Spam":spam "Important":important "gmail/[Gmail].Trash":trash -# This is getting nasty. Let's just use filters - -[Filter.1] -message = Gmail -query = folder:gmail -tags = +gmail - -[Filter.2] -message = IOCOM -query = folder:iocom -tags = +iocom - -[Filter.4] # Need this filter before the All Mail one.. I think -message = Gmail Inbox -query = folder:gmail/INBOX -tags = -new;+inbox - -[Filter.8] -message = Drafts -query = folder:iocom/INBOX.Drafts OR folder:gmail/drafts -tags = -new;+drafts - -[Filter.10] -message = Sent -query = folder:iocom/INBOX.Sent OR folder:gmail/sent -tags = -new;+sent - -[Filter.12] -message = Spam -query = folder:iocom/INBOX.spam OR folder:gmail/spam -tags = -new;+spam - -[Filter.14] -message = Trash -query = folder:iocom/INBOX.Trash OR folder:gmail/trash -tags = -new;+trash - -[Filter.15] -message = Archived -query = folder:iocom/INBOX.Archive OR folder:gmail/archive -tags = -new;-inbox - -# IOCOM specific folders - -[Filter.16] -message = Builder -query = folder:iocom/INBOX.builder -tags = +builder;-spam;-new - -[Filter.18] -message = Netmon -query = folder:iocom/INBOX.netmon -tags = +netmon;-spam;-new - -# IOCOM tags, no corresponding folder - -[Filter.20] -message = Bugzilla -query = from:bugzilla-daemon@bugzilla.insors.net -tags = +bugzilla - -# Gmail specific folders (what Gmail calls tags) TODO - +[ArchiveSentMailsFilter] [InboxFilter] [MailMover] @@ -82,5 +13,4 @@ iocom/INBOX/ = 'NOT tag:inbox':iocom/INBOX.Archive/ iocom/INBOX.Archive/ = 'tag:inbox':iocom/INBOX/ gmail/INBOX/ = 'NOT tag:inbox':gmail/archive/ - # TODO All folders <-> tags diff --git a/jrnl_config b/jrnl_config new file mode 100644 index 0000000..771ceb4 --- /dev/null +++ b/jrnl_config @@ -0,0 +1,16 @@ +{ + "default_hour": 9, + "linewrap": 79, + "encrypt": false, + "default_minute": 0, + "tagsymbols": "@", + "editor": "vim -c Goyo -c startinsert", + "timeformat": "%Y-%m-%d %H:%M", + "highlight": true, + "journals": { + "default": { + "journal": "/Users/dustinswan/Dropbox/journal.txt", + "encrypt": true + } + } +} diff --git a/notmuch-post-new b/notmuch-post-new index c93da4e..8dd7399 100755 --- a/notmuch-post-new +++ b/notmuch-post-new @@ -1,10 +1,24 @@ #!/bin/sh -# For mail my other MUAs has moved +# IOCOM +notmuch tag +iocom +inbox -- tag:new AND folder:iocom/INBOX +notmuch tag +iocom +netmon -inbox -spam -- tag:new AND folder:iocom/INBOX.netmon +notmuch tag +iocom +builder -spam -- tag:new AND folder:iocom/INBOX.builder +notmuch tag +iocom +info -- tag:new AND folder:iocom/INBOX.info +notmuch tag +iocom +bugzilla -- tag:new AND from:bugzilla-daemon@bugzilla.insors.net +notmuch tag +iocom +draft -- tag:new AND folder:iocom/INBOX.Drafts +notmuch tag +iocom +sent -- tag:new AND folder:iocom/INBOX.Sent +notmuch tag +iocom +spam -- tag:new AND folder:iocom/INBOX.Spam +notmuch tag +iocom +trash -- tag:new AND folder:iocom/INBOX.Trash +notmuch tag +iocom -inbox -- folder:iocom/INBOX.Archive AND tag:inbox -# Look for archived mail that have inbox. Remove inbox. -notmuch tag -inbox -- folder:INBOX.Archive tag:inbox -notmuch tag -inbox -- tag:inbox AND tag:gmail NOT folder:gmail/INBOX +# Gmail +notmuch tag +gmail +inbox -- tag:new AND folder:gmail/INBOX +notmuch tag +gmail +draft -- tag:new AND folder:gmail/drafts +notmuch tag +gmail +sent -- tag:new AND folder:gmail/sent +notmuch tag +gmail +spam -- tag:new AND folder:gmail/spam +notmuch tag +gmail +trash -- tag:new AND folder:gmail/trash +notmuch tag +gmail -inbox -- tag:inbox AND tag:gmail NOT folder:gmail/INBOX +# TODO gmail tags -# Initial tagging for new mail afew --tag --new diff --git a/offlineimap.py b/offlineimap.py index ddb2120..962aef5 100644 --- a/offlineimap.py +++ b/offlineimap.py @@ -1,18 +1,29 @@ -import subprocess +#import subprocess import os +import gnupg + +home = os.environ['HOME'] +gpg = gnupg.GPG(gnupghome=home+"/.gnupg", use_agent=True) def gmail_password(): path = os.environ['HOME'] + "/.gmail-password.gpg" - args = ["gpg", "-d", path] - try: - return subprocess.check_output(args).rstrip() - except subprocess.CalledProcessError: - return "".strip() + #args = ["gpg", "-d", path] + f = open(path, 'rb') + decrypted = gpg.decrypt_file(f) + return decrypted.data.strip() + + #try: + #return subprocess.check_output(args).rstrip() + #except subprocess.CalledProcessError: + #return "".strip() def iocom_password(): path = os.environ['HOME'] + "/.iocom-password.gpg" - args = ["gpg", "-d", path] - try: - return subprocess.check_output(args).rstrip() - except subprocess.CalledProcessError: - return "".strip() + f = open(path, 'rb') + decrypted = gpg.decrypt_file(f) + return decrypted.data.strip() + #args = ["gpg", "-d", path] + #try: + #return subprocess.check_output(args).rstrip() + #except subprocess.CalledProcessError: + #return "".strip() diff --git a/symlinks.sh b/symlinks.sh index 0d56a9a..dddd172 100644 --- a/symlinks.sh +++ b/symlinks.sh @@ -13,6 +13,7 @@ rm ~/.vimperatorrc; ln -s ~/dotfiles/vimperatorrc ~/.vimperatorrc rm -rf ~/.config/khal; mkdir -p ~/.config/khal; ln -s ~/dotfiles/khal.conf ~/.config/khal/khal.conf rm -rf ~/.vdirsyncer; mkdir ~/.vdirsyncer; ln -s ~/dotfiles/vdirsyncer/config ~/.vdirsyncer/config rm ~/.zshrc; ln -s ~/dotfiles/zshrc ~/.zshrc +rm ~/.jrnl_config; ln -s ~/dotfiles/jrnl_config ~/.jrnl_config # Mail stuff #rm ~/.mbsyncrc; ln -s ~/dotfiles/mbsyncrc ~/.mbsyncrc diff --git a/vimrc b/vimrc index b2ea6bc..c8136e4 100644 --- a/vimrc +++ b/vimrc @@ -63,6 +63,9 @@ Plugin 'airblade/vim-gitgutter' Plugin 'gcmt/wildfire.vim' Plugin 'lambdatoast/elm.vim' Plugin 'AndrewRadev/splitjoin.vim' +Plugin 'kien/rainbow_parentheses.vim' +Plugin 'nathanaelkane/vim-indent-guides' +Plugin 'junegunn/goyo.vim' "let $GIT_SSL_NO_VERIFY = 'true' call vundle#end() @@ -169,9 +172,9 @@ python del powerline_setup "let g:airline#extensions#tabline#enabled=1 " Colors -set background=dark " colorscheme default colorscheme hybrid +set background=dark " Tagbar nnoremap t :TagbarToggle @@ -277,3 +280,4 @@ autocmd FileType javascript,css inoremap ,; :call cosco#commaOrSem " Browser :let g:netrw_browsex_viewer = "browser" +