Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
  • 8 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
Commits on Sep 15, 2012
@bhenderson bhenderson Fix examples typo. 6ed8e43
@bhenderson bhenderson Make query command default to mutt setting. 80dd4e4
@bhenderson bhenderson Set omnifunc default for mail file types. b3d64ba
@bhenderson bhenderson Update README. 549f4ae
Commits on Sep 17, 2012
@bhenderson bhenderson Make setting of omnifunc conditional. Change strlen to len. 74873cf
@caio Merge remote-tracking branch 'bhenderson/master' into from_bhenderson
* bhenderson/master:
  Make setting of omnifunc conditional. Change strlen to len.
  Update README.
  Set omnifunc default for mail file types.
  Make query command default to mutt setting.
  Fix examples typo.
7d47f3e
@caio Only set omnifunc when no configuration present
While I agree that by default we could try to guess the settings
automatically, I want configuration to be explicit when anything
is set manually. A little bit of magic is acceptable though :)
692607d
@caio Merge branch 'from_bhenderson'
* from_bhenderson:
  Only set omnifunc when no configuration present
  Make setting of omnifunc conditional. Change strlen to len.
  Update README.
  Set omnifunc default for mail file types.
  Make query command default to mutt setting.
  Fix examples typo.
6a406a9
Showing with 13 additions and 2 deletions.
  1. +1 −0 README
  2. +12 −2 plugin/querycommandcomplete.vim
View
1 README
@@ -25,6 +25,7 @@ Setup:
Settings:
g:qcc_query_command
External command that queries for contacts
+ default: `mutt -Q query_command`
g:qcc_line_separator
Separator for each entry in the result from the query
View
14 plugin/querycommandcomplete.vim
@@ -25,6 +25,7 @@
" Settings:
" g:qcc_query_command
" External command that queries for contacts
+" default: `mutt -Q query_command`
"
" g:qcc_line_separator
" Separator for each entry in the result from the query
@@ -43,9 +44,18 @@ if exists("g:loaded_QueryCommandComplete") || &cp
finish
endif
+" use mutt query command as default
if !exists("g:qcc_query_command")
- echoerr "QueryCommandComplete: g:qcc_query_command not set!"
- finish
+ let s:querycmd = system('mutt -Q query_command 2>/dev/null')
+ let s:querycmd = substitute(s:querycmd, '^query_command=\"\(.*\) .%s.\"\n', '\1','')
+
+ if len(s:querycmd)
+ let g:qcc_query_command = s:querycmd
+ autocmd FileType mail setlocal omnifunc=QueryCommandComplete
+ else
+ echoerr "QueryCommandComplete: g:qcc_query_command not set!"
+ finish
+ endif
endif
let g:loaded_QueryCommandComplete = 1

No commit comments for this range

Something went wrong with that request. Please try again.