Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding some mutt stuff, and some git stuff for Vim, stolen from Steve.

  • Loading branch information...
commit af86535ad6545aec9c453cba2d97525885a33dae 1 parent d5662fe
@nicksergeant authored
View
16 mutt/offlineimap.py
@@ -0,0 +1,16 @@
+#!/usr/bin/python
+import re, subprocess
+def get_keychain_pass(account=None, server=None):
+ params = {
+ 'security': '/usr/bin/security',
+ 'command': 'find-internet-password',
+ 'account': account,
+ 'server': server,
+ 'keychain': '/Users/Nick/Library/Keychains/login.keychain',
+ }
+ command = "sudo -u Nick %(security)s -v %(command)s -g -a %(account)s -s %(server)s %(keychain)s" % params
+ output = subprocess.check_output(command, shell=True, stderr=subprocess.STDOUT)
+ outtext = [l for l in output.splitlines()
+ if l.startswith('password: ')][0]
+
+ return re.match(r'password: "(.*)"', outtext).group(1)
View
38 offlineimaprc
@@ -0,0 +1,38 @@
+[general]
+ui = TTY.TTYUI
+accounts = NickSergeant
+pythonfile=~/.mutt/offlineimap.py
+fsync = False
+
+[Account NickSergeant]
+localrepository = NickSergeant-Local
+remoterepository = NickSergeant-Remote
+status_backend = sqlite
+
+[Repository NickSergeant-Local]
+type = Maildir
+localfolders = ~/.mail/nick-nicksergeant.com
+nametrans = lambda folder: {'drafts': '[Gmail]/Drafts',
+ 'sent': '[Gmail]/Sent Mail',
+ 'flagged': '[Gmail]/Starred',
+ 'trash': '[Gmail]/Trash',
+ 'archive': '[Gmail]/All Mail',
+ }.get(folder, folder)
+
+[Repository NickSergeant-Remote]
+maxconnections = 1
+type = Gmail
+cert_fingerprint = f3043dd689a2e7dddfbef82703a6c65ea9b634c1
+remoteuser = nick@nicksergeant.com
+remotepasseval = get_keychain_pass(account="nick@nicksergeant.com", server="imap.gmail.com")
+realdelete = no
+nametrans = lambda folder: {'[Gmail]/Drafts': 'drafts',
+ '[Gmail]/Sent Mail': 'sent',
+ '[Gmail]/Starred': 'flagged',
+ '[Gmail]/Trash': 'trash',
+ '[Gmail]/All Mail': 'archive',
+ }.get(folder, folder)
+folderfilter = lambda folder: folder not in ['[Gmail]/Trash',
+ '[Gmail]/Important',
+ '[Gmail]/Spam',
+ ]
2  vim/bundle/vim-powerline
@@ -1 +1 @@
-Subproject commit 114f8e5c204f1cac9b2443065910fa182de39fb8
+Subproject commit 20ab08c9a8fe6cdfb7c303aa3063f211d72f8b2f
View
21 vimrc
@@ -112,11 +112,28 @@ nnoremap <Space> za
vnoremap <Space> za
" }}}
-" Git and Pastebin {{{
+" Fugitive and Hub {{{
+nnoremap <leader>g :Gbrowse<CR>
vnoremap <leader>g :Gbrowse<CR>
+nnoremap <leader>gd :Gdiff<cr>
+nnoremap <leader>gs :Gstatus<cr>
+nnoremap <leader>gw :Gwrite<cr>
+nnoremap <leader>ga :Gadd<cr>
+nnoremap <leader>gb :Gblame<cr>
+vnoremap <leader>gb :Gblame<cr>
+nnoremap <leader>gco :Gcheckout<cr>
+nnoremap <leader>gci :Gcommit<cr>
+nnoremap <leader>gm :Gmove<cr>
+nnoremap <leader>gr :Gremove<cr>
+nnoremap <leader>gl :Shell git gl -18<cr>:wincmd \|<cr>
vnoremap <leader>G :w !snipt post_and_get_url \| pbcopy && pbpaste \| xargs open<CR>
+augroup ft_fugitive
+ au!
+ au BufNewFile,BufRead .git/index setlocal nolist
+augroup END
+
" }}}
" HTML {{{
@@ -208,6 +225,8 @@ set listchars=tab:▸\ ,extends:❯,precedes:❮
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*.pyc,*.un~,*/migrations/*,*.swo,*.swp,*.sql,*.db,*/cache/*,*/.sass-cache/*
set wildignore+=*/.sass-cache/*
set shell=/bin/bash
+set splitbelow
+set splitright
" }}}
" Swap files death {{{
Please sign in to comment.
Something went wrong with that request. Please try again.