Closed seece closed 9 years ago
vim has a glob
function. Maybe something like this (not tested)
let g:org_agenda_files = glob("/home/user/Documents/*.org")
Thanks for the reply. I tried changing the config to the following, where user
is my username.
let g:org_agenda_files = [glob("/home/user/Documents/*.org")]
Now I get the following error message when issuing <localleader>cat
Error detected while processing :
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/pvaananen/.vim/bundle/orgmode/ftplugin/orgmode/plugins/Agenda.py", line 187, in
list_all_todos
agenda_documents = cls._get_agendadocuments()
File "/home/pvaananen/.vim/bundle/orgmode/ftplugin/orgmode/plugins/Agenda.py", line 83, in _
get_agendadocuments
vim.command((u'badd %s' % agenda_file).encode(u'utf-8'))
vim.error: Vim:E492: Not an editor command: /home/pvaananen/Documents/test_document.org
/home/pvaananen/Documents/test.org
I don't think you need the []. This should be fine:
let g:org_agenda_files = glob("/home/user/Documents/*.org")
glob
already returns a list. In vim juts type the following to get a list of all your org files:
:echo glob("/home/user/Documents/*.org")
Seems like glob
returns a string with each item separated by a linefeed. The plugin doesn't understand this, but I managed to get it working by splitting the string into lines by hand in my configuration file:
let g:org_agenda_files = split(glob("/home/user/Documents/*.org"), "\n")
One could handle this also in _get_agendadocuments
of Agenda.py
with a simple heuristic:
if len(agenda_files) == 1 and "\n" in agenda_files:
agenda_files = agenda_files.split("\n")
Glad it works for you!
When opening TODO agenda view with
<localleader>cat
I run into a "Too many file names" error.My
org_agenda_files
filter includes a wilcard, but it should match only a couple of actual.org
files