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 .
...
  • 4 commits
  • 24 files changed
  • 0 commit comments
  • 2 contributors
View
2 Makefile
@@ -53,7 +53,7 @@ vba.gz: ${PLUGIN}.vba.gz
test: check
check: tests/run_tests.py
- cd tests && python run_tests.py
+ cd tests && python2 run_tests.py
# generate documentation
docs: documentation
View
1 doc/orgguide.txt
@@ -1308,6 +1308,7 @@ LINKS *orgguide-links*
CHANGELOG *orgguide-changelog*
0.5.0-0
+- add three dots after folded text, like in orgmode
- improve highlighting of org-mode properties (closes issue #130)
- implement global visibility as it works in Emacs org-mode (closes issue #119)
- improve detection of speeddating plugin (closes issue #121)
View
2 ftplugin/org.vim
@@ -77,7 +77,7 @@ for p in vim.eval("&runtimepath").split(','):
sys.path.append(dname)
break
-from orgmode import ORGMODE
+from orgmode._vim import ORGMODE
ORGMODE.start()
EOF
View
376 ftplugin/orgmode/__init__.py
@@ -1,377 +1 @@
# -*- coding: utf-8 -*-
-
-"""
- VIM ORGMODE
- ~~~~~~~~~~~~
-
- TODO
-"""
-
-import imp
-import types
-
-import vim
-
-import orgmode.keybinding
-import orgmode.menu
-import orgmode.plugins
-import orgmode.settings
-from orgmode.exceptions import PluginError
-from orgmode.vimbuffer import VimBuffer
-from orgmode.liborgmode.agenda import AgendaManager
-
-
-REPEAT_EXISTS = bool(int(vim.eval('exists("*repeat#set()")')))
-TAGSPROPERTIES_EXISTS = False
-
-
-def realign_tags(f):
- u"""
- Update tag alignment, dependency to TagsProperties plugin!
- """
- def r(*args, **kwargs):
- global TAGSPROPERTIES_EXISTS
- res = f(*args, **kwargs)
-
- if not TAGSPROPERTIES_EXISTS and u'TagsProperties' in ORGMODE.plugins:
- TAGSPROPERTIES_EXISTS = True
-
- if TAGSPROPERTIES_EXISTS:
- ORGMODE.plugins[u'TagsProperties'].realign_tags()
-
- return res
- return r
-
-
-def repeat(f):
- u"""
- Integrate with the repeat plugin if available
-
- The decorated function must return the name of the <Plug> command to
- execute by the repeat plugin.
- """
- def r(*args, **kwargs):
- res = f(*args, **kwargs)
- if REPEAT_EXISTS and isinstance(res, basestring):
- vim.command((u'silent! call repeat#set("\\<Plug>%s")' % res)
- .encode(u'utf-8'))
- return res
- return r
-
-
-def apply_count(f):
- u"""
- Decorator which executes function v:count or v:prevount (not implemented,
- yet) times. The decorated function must return a value that evaluates to
- True otherwise the function is not repeated.
- """
- def r(*args, **kwargs):
- count = 0
- try:
- count = int(vim.eval(u'v:count'.encode('utf-8')))
-
- # visual count is not implemented yet
- #if not count:
- # count = int(vim.eval(u'v:prevcount'.encode(u'utf-8')))
- except Exception, e:
- pass
-
- res = f(*args, **kwargs)
- count -= 1
- while res and count > 0:
- f(*args, **kwargs)
- count -= 1
- return res
- return r
-
-
-def echo(message):
- u"""
- Print a regular message that will not be visible to the user when
- multiple lines are printed
- """
- for m in message.split(u'\n'):
- vim.command((u':echo "%s"' % m).encode(u'utf-8'))
-
-
-def echom(message):
- u"""
- Print a regular message that will be visible to the user, even when
- multiple lines are printed
- """
- # probably some escaping is needed here
- for m in message.split(u'\n'):
- vim.command((u':echomsg "%s"' % m).encode(u'utf-8'))
-
-
-def echoe(message):
- u"""
- Print an error message. This should only be used for serious errors!
- """
- # probably some escaping is needed here
- for m in message.split(u'\n'):
- vim.command((u':echoerr "%s"' % m).encode(u'utf-8'))
-
-
-def insert_at_cursor(text, move=True, start_insertmode=False):
- u"""Insert text at the position of the cursor.
-
- If move==True move the cursor with the inserted text.
- """
- d = ORGMODE.get_document(allow_dirty=True)
- line, col = vim.current.window.cursor
- _text = d._content[line - 1]
- d._content[line - 1] = _text[:col + 1] + text + _text[col + 1:]
- if move:
- vim.current.window.cursor = (line, col + len(text))
- if start_insertmode:
- vim.command(u'startinsert'.encode(u'utf-8'))
-
-
-def get_user_input(message):
- u"""Print the message and take input from the user.
- Return the input or None if there is no input.
- """
- vim.command(u'call inputsave()'.encode(u'utf-8'))
- vim.command((u"let user_input = input('" + message + u": ')")
- .encode(u'utf-8'))
- vim.command(u'call inputrestore()'.encode(u'utf-8'))
- try:
- return vim.eval(u'user_input'.encode(u'utf-8')).decode(u'utf-8')
- except:
- return None
-
-
-def get_bufnumber(bufname):
- """
- Return the number of the buffer for the given bufname if it exist;
- else None.
- """
- for b in vim.buffers:
- if b.name == bufname:
- return int(b.number)
-
-
-def get_bufname(bufnr):
- """
- Return the name of the buffer for the given bufnr if it exist; else None.
- """
- for b in vim.buffers:
- if b.number == bufnr:
- return b.name
-
-
-def indent_orgmode():
- u""" Set the indent value for the current line in the variable
- b:indent_level
-
- Vim prerequisites:
- :setlocal indentexpr=Method-which-calls-indent_orgmode
-
- :returns: None
- """
- line = int(vim.eval(u'v:lnum'.encode(u'utf-8')))
- d = ORGMODE.get_document()
- heading = d.current_heading(line - 1)
- if heading and line != heading.start_vim:
- vim.command((u'let b:indent_level = %d' % (heading.level + 1))
- .encode(u'utf-8'))
-
-
-def fold_text(allow_dirty=False):
- u""" Set the fold text
- :setlocal foldtext=Method-which-calls-foldtext
-
- :allow_dirty: Perform a query without (re)building the DOM if True
- :returns: None
- """
- line = int(vim.eval(u'v:foldstart'.encode(u'utf-8')))
- d = ORGMODE.get_document(allow_dirty=allow_dirty)
- heading = None
- if allow_dirty:
- heading = d.find_current_heading(line - 1)
- else:
- heading = d.current_heading(line - 1)
- if heading:
- str_heading = unicode(heading)
-
- # expand tabs
- ts = int(vim.eval(u'&ts'.encode('utf-8')))
- idx = str_heading.find(u'\t')
- if idx != -1:
- tabs, spaces = divmod(idx, ts)
- str_heading = str_heading.replace(u'\t', u' ' * (ts - spaces), 1)
- str_heading = str_heading.replace(u'\t', u' ' * ts)
-
- # Workaround for vim.command seems to break the completion menu
- vim.eval((u'SetOrgFoldtext("%s")' % (str_heading.replace(
- u'\\', u'\\\\').replace(u'"', u'\\"'), )).encode(u'utf-8'))
- #vim.command((u'let b:foldtext = "%s... "' % \
- # (str_heading.replace(u'\\', u'\\\\')
- # .replace(u'"', u'\\"'), )).encode('utf-8'))
-
-
-def fold_orgmode(allow_dirty=False):
- u""" Set the fold expression/value for the current line in the variable
- b:fold_expr
-
- Vim prerequisites:
- :setlocal foldmethod=expr
- :setlocal foldexpr=Method-which-calls-fold_orgmode
-
- :allow_dirty: Perform a query without (re)building the DOM if True
- :returns: None
- """
- line = int(vim.eval(u'v:lnum'.encode(u'utf-8')))
- d = ORGMODE.get_document(allow_dirty=allow_dirty)
- heading = None
- if allow_dirty:
- heading = d.find_current_heading(line - 1)
- else:
- heading = d.current_heading(line - 1)
- if heading:
- if line == heading.start_vim:
- vim.command((u'let b:fold_expr = ">%d"' % heading.level).encode(u'utf-8'))
- #elif line == heading.end_vim:
- # vim.command((u'let b:fold_expr = "<%d"' % heading.level).encode(u'utf-8'))
- # end_of_last_child_vim is a performance junky and is actually not needed
- #elif line == heading.end_of_last_child_vim:
- # vim.command((u'let b:fold_expr = "<%d"' % heading.level).encode(u'utf-8'))
- else:
- vim.command((u'let b:fold_expr = %d' % heading.level).encode(u'utf-8'))
-
-
-class OrgMode(object):
- u""" Vim Buffer """
-
- def __init__(self):
- object.__init__(self)
- self.debug = bool(int(orgmode.settings.get(u'org_debug', False)))
-
- self.orgmenu = orgmode.menu.Submenu(u'&Org')
- self._plugins = {}
- # list of vim buffer objects
- self._documents = {}
-
- # agenda manager
- self.agenda_manager = AgendaManager()
-
- def get_document(self, bufnr=0, allow_dirty=False):
- """ Retrieve instance of vim buffer document. This Document should be
- used for manipulating the vim buffer.
-
- :bufnr: Retrieve document with bufnr
- :allow_dirty: Allow the retrieved document to be dirty
-
- :returns: vim buffer instance
- """
- if bufnr == 0:
- bufnr = vim.current.buffer.number
-
- if bufnr in self._documents:
- if allow_dirty or self._documents[bufnr].is_insync:
- return self._documents[bufnr]
- self._documents[bufnr] = VimBuffer(bufnr).init_dom()
- return self._documents[bufnr]
-
- @property
- def plugins(self):
- return self._plugins.copy()
-
- @orgmode.keybinding.register_keybindings
- @orgmode.keybinding.register_commands
- @orgmode.menu.register_menu
- def register_plugin(self, plugin):
- if not isinstance(plugin, basestring):
- raise ValueError(u'Parameter plugin is not of type string')
-
- if plugin == u'|':
- self.orgmenu + orgmode.menu.Separator()
- self.orgmenu.children[-1].create()
- return
-
- if plugin in self._plugins:
- raise PluginError(u'Plugin %s has already been loaded')
-
- # a python module
- module = None
-
- # actual plugin class
- _class = None
-
- # locate module and initialize plugin class
- try:
- module = imp.find_module(plugin, orgmode.plugins.__path__)
- except ImportError, e:
- echom(u'Plugin not found: %s' % plugin)
- if self.debug:
- raise e
- return
-
- if not module:
- echom(u'Plugin not found: %s' % plugin)
- return
-
- try:
- module = imp.load_module(plugin, *module)
- if not hasattr(module, plugin):
- echoe(u'Unable to find plugin: %s' % plugin)
- if self.debug:
- raise PluginError(u'Unable to find class %s' % plugin)
- return
- _class = getattr(module, plugin)
- self._plugins[plugin] = _class()
- self._plugins[plugin].register()
- if self.debug:
- echo(u'Plugin registered: %s' % plugin)
- return self._plugins[plugin]
- except Exception, e:
- echoe(u'Unable to activate plugin: %s' % plugin)
- if self.debug:
- import traceback
- echoe(traceback.format_exc())
-
- def register_keybindings(self):
- @orgmode.keybinding.register_keybindings
- def dummy(plugin):
- return plugin
-
- for p in self.plugins.itervalues():
- dummy(p)
-
- def register_menu(self):
- self.orgmenu.create()
-
- def unregister_menu(self):
- vim.command(u'silent! aunmenu Org'.encode(u'utf-8'))
-
- def start(self):
- u""" Start orgmode and load all requested plugins
- """
- plugins = orgmode.settings.get(u"org_plugins")
-
- if not plugins:
- echom(u'orgmode: No plugins registered.')
-
- if isinstance(plugins, basestring):
- try:
- self.register_plugin(plugins)
- except Exception, e:
- import traceback
- traceback.print_exc()
- elif isinstance(plugins, types.ListType) or \
- isinstance(plugins, types.TupleType):
- for p in plugins:
- try:
- self.register_plugin(p)
- except Exception, e:
- echoe('Error in %s plugin:' % p)
- import traceback
- traceback.print_exc()
-
- return plugins
-
-
-ORGMODE = OrgMode()
-
-# vim: set noexpandtab:
View
377 ftplugin/orgmode/_vim.py
@@ -0,0 +1,377 @@
+# -*- coding: utf-8 -*-
+
+"""
+ VIM ORGMODE
+ ~~~~~~~~~~~~
+
+ TODO
+"""
+
+import imp
+import types
+
+import vim
+
+import orgmode.keybinding
+import orgmode.menu
+import orgmode.plugins
+import orgmode.settings
+from orgmode.exceptions import PluginError
+from orgmode.vimbuffer import VimBuffer
+from orgmode.liborgmode.agenda import AgendaManager
+
+
+REPEAT_EXISTS = bool(int(vim.eval('exists("*repeat#set()")')))
+TAGSPROPERTIES_EXISTS = False
+
+
+def realign_tags(f):
+ u"""
+ Update tag alignment, dependency to TagsProperties plugin!
+ """
+ def r(*args, **kwargs):
+ global TAGSPROPERTIES_EXISTS
+ res = f(*args, **kwargs)
+
+ if not TAGSPROPERTIES_EXISTS and u'TagsProperties' in ORGMODE.plugins:
+ TAGSPROPERTIES_EXISTS = True
+
+ if TAGSPROPERTIES_EXISTS:
+ ORGMODE.plugins[u'TagsProperties'].realign_tags()
+
+ return res
+ return r
+
+
+def repeat(f):
+ u"""
+ Integrate with the repeat plugin if available
+
+ The decorated function must return the name of the <Plug> command to
+ execute by the repeat plugin.
+ """
+ def r(*args, **kwargs):
+ res = f(*args, **kwargs)
+ if REPEAT_EXISTS and isinstance(res, basestring):
+ vim.command((u'silent! call repeat#set("\\<Plug>%s")' % res)
+ .encode(u'utf-8'))
+ return res
+ return r
+
+
+def apply_count(f):
+ u"""
+ Decorator which executes function v:count or v:prevount (not implemented,
+ yet) times. The decorated function must return a value that evaluates to
+ True otherwise the function is not repeated.
+ """
+ def r(*args, **kwargs):
+ count = 0
+ try:
+ count = int(vim.eval(u'v:count'.encode('utf-8')))
+
+ # visual count is not implemented yet
+ #if not count:
+ # count = int(vim.eval(u'v:prevcount'.encode(u'utf-8')))
+ except Exception, e:
+ pass
+
+ res = f(*args, **kwargs)
+ count -= 1
+ while res and count > 0:
+ f(*args, **kwargs)
+ count -= 1
+ return res
+ return r
+
+
+def echo(message):
+ u"""
+ Print a regular message that will not be visible to the user when
+ multiple lines are printed
+ """
+ for m in message.split(u'\n'):
+ vim.command((u':echo "%s"' % m).encode(u'utf-8'))
+
+
+def echom(message):
+ u"""
+ Print a regular message that will be visible to the user, even when
+ multiple lines are printed
+ """
+ # probably some escaping is needed here
+ for m in message.split(u'\n'):
+ vim.command((u':echomsg "%s"' % m).encode(u'utf-8'))
+
+
+def echoe(message):
+ u"""
+ Print an error message. This should only be used for serious errors!
+ """
+ # probably some escaping is needed here
+ for m in message.split(u'\n'):
+ vim.command((u':echoerr "%s"' % m).encode(u'utf-8'))
+
+
+def insert_at_cursor(text, move=True, start_insertmode=False):
+ u"""Insert text at the position of the cursor.
+
+ If move==True move the cursor with the inserted text.
+ """
+ d = ORGMODE.get_document(allow_dirty=True)
+ line, col = vim.current.window.cursor
+ _text = d._content[line - 1]
+ d._content[line - 1] = _text[:col + 1] + text + _text[col + 1:]
+ if move:
+ vim.current.window.cursor = (line, col + len(text))
+ if start_insertmode:
+ vim.command(u'startinsert'.encode(u'utf-8'))
+
+
+def get_user_input(message):
+ u"""Print the message and take input from the user.
+ Return the input or None if there is no input.
+ """
+ vim.command(u'call inputsave()'.encode(u'utf-8'))
+ vim.command((u"let user_input = input('" + message + u": ')")
+ .encode(u'utf-8'))
+ vim.command(u'call inputrestore()'.encode(u'utf-8'))
+ try:
+ return vim.eval(u'user_input'.encode(u'utf-8')).decode(u'utf-8')
+ except:
+ return None
+
+
+def get_bufnumber(bufname):
+ """
+ Return the number of the buffer for the given bufname if it exist;
+ else None.
+ """
+ for b in vim.buffers:
+ if b.name == bufname:
+ return int(b.number)
+
+
+def get_bufname(bufnr):
+ """
+ Return the name of the buffer for the given bufnr if it exist; else None.
+ """
+ for b in vim.buffers:
+ if b.number == bufnr:
+ return b.name
+
+
+def indent_orgmode():
+ u""" Set the indent value for the current line in the variable
+ b:indent_level
+
+ Vim prerequisites:
+ :setlocal indentexpr=Method-which-calls-indent_orgmode
+
+ :returns: None
+ """
+ line = int(vim.eval(u'v:lnum'.encode(u'utf-8')))
+ d = ORGMODE.get_document()
+ heading = d.current_heading(line - 1)
+ if heading and line != heading.start_vim:
+ vim.command((u'let b:indent_level = %d' % (heading.level + 1))
+ .encode(u'utf-8'))
+
+
+def fold_text(allow_dirty=False):
+ u""" Set the fold text
+ :setlocal foldtext=Method-which-calls-foldtext
+
+ :allow_dirty: Perform a query without (re)building the DOM if True
+ :returns: None
+ """
+ line = int(vim.eval(u'v:foldstart'.encode(u'utf-8')))
+ d = ORGMODE.get_document(allow_dirty=allow_dirty)
+ heading = None
+ if allow_dirty:
+ heading = d.find_current_heading(line - 1)
+ else:
+ heading = d.current_heading(line - 1)
+ if heading:
+ str_heading = unicode(heading)
+
+ # expand tabs
+ ts = int(vim.eval(u'&ts'.encode('utf-8')))
+ idx = str_heading.find(u'\t')
+ if idx != -1:
+ tabs, spaces = divmod(idx, ts)
+ str_heading = str_heading.replace(u'\t', u' ' * (ts - spaces), 1)
+ str_heading = str_heading.replace(u'\t', u' ' * ts)
+
+ # Workaround for vim.command seems to break the completion menu
+ vim.eval((u'SetOrgFoldtext("%s...")' % (str_heading.replace(
+ u'\\', u'\\\\').replace(u'"', u'\\"'), )).encode(u'utf-8'))
+ #vim.command((u'let b:foldtext = "%s... "' % \
+ # (str_heading.replace(u'\\', u'\\\\')
+ # .replace(u'"', u'\\"'), )).encode('utf-8'))
+
+
+def fold_orgmode(allow_dirty=False):
+ u""" Set the fold expression/value for the current line in the variable
+ b:fold_expr
+
+ Vim prerequisites:
+ :setlocal foldmethod=expr
+ :setlocal foldexpr=Method-which-calls-fold_orgmode
+
+ :allow_dirty: Perform a query without (re)building the DOM if True
+ :returns: None
+ """
+ line = int(vim.eval(u'v:lnum'.encode(u'utf-8')))
+ d = ORGMODE.get_document(allow_dirty=allow_dirty)
+ heading = None
+ if allow_dirty:
+ heading = d.find_current_heading(line - 1)
+ else:
+ heading = d.current_heading(line - 1)
+ if heading:
+ if line == heading.start_vim:
+ vim.command((u'let b:fold_expr = ">%d"' % heading.level).encode(u'utf-8'))
+ #elif line == heading.end_vim:
+ # vim.command((u'let b:fold_expr = "<%d"' % heading.level).encode(u'utf-8'))
+ # end_of_last_child_vim is a performance junky and is actually not needed
+ #elif line == heading.end_of_last_child_vim:
+ # vim.command((u'let b:fold_expr = "<%d"' % heading.level).encode(u'utf-8'))
+ else:
+ vim.command((u'let b:fold_expr = %d' % heading.level).encode(u'utf-8'))
+
+
+class OrgMode(object):
+ u""" Vim Buffer """
+
+ def __init__(self):
+ object.__init__(self)
+ self.debug = bool(int(orgmode.settings.get(u'org_debug', False)))
+
+ self.orgmenu = orgmode.menu.Submenu(u'&Org')
+ self._plugins = {}
+ # list of vim buffer objects
+ self._documents = {}
+
+ # agenda manager
+ self.agenda_manager = AgendaManager()
+
+ def get_document(self, bufnr=0, allow_dirty=False):
+ """ Retrieve instance of vim buffer document. This Document should be
+ used for manipulating the vim buffer.
+
+ :bufnr: Retrieve document with bufnr
+ :allow_dirty: Allow the retrieved document to be dirty
+
+ :returns: vim buffer instance
+ """
+ if bufnr == 0:
+ bufnr = vim.current.buffer.number
+
+ if bufnr in self._documents:
+ if allow_dirty or self._documents[bufnr].is_insync:
+ return self._documents[bufnr]
+ self._documents[bufnr] = VimBuffer(bufnr).init_dom()
+ return self._documents[bufnr]
+
+ @property
+ def plugins(self):
+ return self._plugins.copy()
+
+ @orgmode.keybinding.register_keybindings
+ @orgmode.keybinding.register_commands
+ @orgmode.menu.register_menu
+ def register_plugin(self, plugin):
+ if not isinstance(plugin, basestring):
+ raise ValueError(u'Parameter plugin is not of type string')
+
+ if plugin == u'|':
+ self.orgmenu + orgmode.menu.Separator()
+ self.orgmenu.children[-1].create()
+ return
+
+ if plugin in self._plugins:
+ raise PluginError(u'Plugin %s has already been loaded')
+
+ # a python module
+ module = None
+
+ # actual plugin class
+ _class = None
+
+ # locate module and initialize plugin class
+ try:
+ module = imp.find_module(plugin, orgmode.plugins.__path__)
+ except ImportError, e:
+ echom(u'Plugin not found: %s' % plugin)
+ if self.debug:
+ raise e
+ return
+
+ if not module:
+ echom(u'Plugin not found: %s' % plugin)
+ return
+
+ try:
+ module = imp.load_module(plugin, *module)
+ if not hasattr(module, plugin):
+ echoe(u'Unable to find plugin: %s' % plugin)
+ if self.debug:
+ raise PluginError(u'Unable to find class %s' % plugin)
+ return
+ _class = getattr(module, plugin)
+ self._plugins[plugin] = _class()
+ self._plugins[plugin].register()
+ if self.debug:
+ echo(u'Plugin registered: %s' % plugin)
+ return self._plugins[plugin]
+ except Exception, e:
+ echoe(u'Unable to activate plugin: %s' % plugin)
+ if self.debug:
+ import traceback
+ echoe(traceback.format_exc())
+
+ def register_keybindings(self):
+ @orgmode.keybinding.register_keybindings
+ def dummy(plugin):
+ return plugin
+
+ for p in self.plugins.itervalues():
+ dummy(p)
+
+ def register_menu(self):
+ self.orgmenu.create()
+
+ def unregister_menu(self):
+ vim.command(u'silent! aunmenu Org'.encode(u'utf-8'))
+
+ def start(self):
+ u""" Start orgmode and load all requested plugins
+ """
+ plugins = orgmode.settings.get(u"org_plugins")
+
+ if not plugins:
+ echom(u'orgmode: No plugins registered.')
+
+ if isinstance(plugins, basestring):
+ try:
+ self.register_plugin(plugins)
+ except Exception, e:
+ import traceback
+ traceback.print_exc()
+ elif isinstance(plugins, types.ListType) or \
+ isinstance(plugins, types.TupleType):
+ for p in plugins:
+ try:
+ self.register_plugin(p)
+ except Exception, e:
+ echoe('Error in %s plugin:' % p)
+ import traceback
+ traceback.print_exc()
+
+ return plugins
+
+
+ORGMODE = OrgMode()
+
+# vim: set noexpandtab:
View
2 ftplugin/orgmode/keybinding.py
@@ -182,7 +182,7 @@ def silent(self):
return self._silent
def create(self):
- from orgmode import ORGMODE, echom
+ from orgmode._vim import ORGMODE, echom
cmd = self._mode
if cmd == MODE_ALL:
View
9 ftplugin/orgmode/plugins/Agenda.py
@@ -3,13 +3,12 @@
from datetime import date
import os
-from orgmode import ORGMODE, settings
-from orgmode import get_bufnumber
-from orgmode import get_bufname
-from orgmode import echoe
+import vim
+
+from orgmode._vim import ORGMODE, get_bufnumber, get_bufname, echoe
+from orgmode import settings
from orgmode.keybinding import Keybinding, Plug
from orgmode.menu import Submenu, ActionEntry
-import vim
class Agenda(object):
View
4 ftplugin/orgmode/plugins/Date.py
@@ -3,7 +3,9 @@
from datetime import timedelta, date, datetime
import vim
-from orgmode import ORGMODE, settings, echom, insert_at_cursor, get_user_input
+
+from orgmode._vim import ORGMODE, echom, insert_at_cursor, get_user_input
+from orgmode import settings
from orgmode.keybinding import Keybinding, Plug
from orgmode.menu import Submenu, ActionEntry
View
6 ftplugin/orgmode/plugins/EditStructure.py
@@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-
-from orgmode import ORGMODE, apply_count, repeat, realign_tags
+import vim
+
+from orgmode._vim import ORGMODE, apply_count, repeat, realign_tags
from orgmode import settings
from orgmode.exceptions import HeadingDomError
from orgmode.keybinding import Keybinding, Plug, MODE_INSERT, MODE_NORMAL
from orgmode.menu import Submenu, Separator, ActionEntry
from orgmode.liborgmode.base import Direction
from orgmode.liborgmode.headings import Heading
-import vim
-
class EditStructure(object):
u""" EditStructure plugin """
View
12 ftplugin/orgmode/plugins/Export.py
@@ -1,14 +1,14 @@
# -*- coding: utf-8 -*-
-from orgmode import ORGMODE, echoe, echo, echom
-from orgmode.menu import Submenu, ActionEntry
-from orgmode.keybinding import Keybinding, Plug, Command
-from orgmode import settings
-
-import vim
import os
import subprocess
+import vim
+
+from orgmode._vim import ORGMODE, echoe, echo, echom
+from orgmode.menu import Submenu, ActionEntry
+from orgmode.keybinding import Keybinding, Plug, Command
+from orgmode import settings
class Export(object):
u"""
View
9 ftplugin/orgmode/plugins/Hyperlinks.py
@@ -1,11 +1,12 @@
# -*- coding: utf-8 -*-
-from orgmode import echom, ORGMODE, realign_tags
-from orgmode.menu import Submenu, Separator, ActionEntry
-from orgmode.keybinding import Keybinding, Plug, Command
+import re
import vim
-import re
+
+from orgmode._vim import echom, ORGMODE, realign_tags
+from orgmode.menu import Submenu, Separator, ActionEntry
+from orgmode.keybinding import Keybinding, Plug, Command
class Hyperlinks(object):
u""" Hyperlinks plugin """
View
6 ftplugin/orgmode/plugins/LoggingWork.py
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
-from orgmode import echo, echom, echoe, ORGMODE, apply_count, repeat
+import vim
+
+from orgmode._vim import echo, echom, echoe, ORGMODE, apply_count, repeat
from orgmode.menu import Submenu, Separator, ActionEntry
from orgmode.keybinding import Keybinding, Plug, Command
-import vim
-
class LoggingWork(object):
u""" LoggingWork plugin """
View
6 ftplugin/orgmode/plugins/Misc.py
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
-from orgmode import ORGMODE, apply_count
+import vim
+
+from orgmode._vim import ORGMODE, apply_count
from orgmode.menu import Submenu
from orgmode.keybinding import Keybinding, Plug, MODE_VISUAL, MODE_OPERATOR
-import vim
-
class Misc(object):
u""" Miscellaneous functionality """
View
6 ftplugin/orgmode/plugins/Navigator.py
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
-from orgmode import echo, ORGMODE, apply_count
+import vim
+
+from orgmode._vim import echo, ORGMODE, apply_count
from orgmode.menu import Submenu, ActionEntry
from orgmode.keybinding import Keybinding, MODE_VISUAL, MODE_OPERATOR, Plug
from orgmode.liborgmode.documents import Direction
-import vim
-
class Navigator(object):
u""" Implement navigation in org-mode documents """
View
6 ftplugin/orgmode/plugins/ShowHide.py
@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-
+import vim
+
from orgmode.liborgmode.headings import Heading
+from orgmode._vim import ORGMODE, apply_count
from orgmode import settings
-from orgmode import ORGMODE, apply_count
from orgmode.menu import Submenu, ActionEntry
from orgmode.keybinding import Keybinding, Plug, MODE_NORMAL
-import vim
-
class ShowHide(object):
u""" Show Hide plugin """
View
6 ftplugin/orgmode/plugins/TagsProperties.py
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
-from orgmode import ORGMODE, repeat
+import vim
+
+from orgmode._vim import ORGMODE, repeat
from orgmode.menu import Submenu, ActionEntry
from orgmode.keybinding import Keybinding, Plug, Command
from orgmode import settings
-import vim
-
class TagsProperties(object):
u""" TagsProperties plugin """
View
8 ftplugin/orgmode/plugins/Todo.py
@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-
-from orgmode import echom, ORGMODE, apply_count, repeat, realign_tags, settings
+import vim
+
+from orgmode._vim import echom, ORGMODE, apply_count, repeat, realign_tags
+from orgmode import settings
from orgmode.liborgmode.base import Direction
from orgmode.menu import Submenu, ActionEntry
from orgmode.keybinding import Keybinding, Plug
-import vim
-
-
# temporary todo states for differnent orgmode buffers
ORGTODOSTATES = {}
View
8 ftplugin/orgmode/vimbuffer.py
@@ -22,10 +22,10 @@
import vim
-import settings
-from exceptions import BufferNotFound, BufferNotInSync
-from liborgmode.documents import Document, MultiPurposeList, Direction
-from liborgmode.headings import Heading
+from orgmode import settings
+from orgmode.exceptions import BufferNotFound, BufferNotInSync
+from orgmode.liborgmode.documents import Document, MultiPurposeList, Direction
+from orgmode.liborgmode.headings import Heading
class VimBuffer(Document):
View
10 indent/org.vim
@@ -15,7 +15,7 @@ setlocal autoindent
function! GetOrgIndent()
python << EOF
-from orgmode import indent_orgmode
+from orgmode._vim import indent_orgmode
indent_orgmode()
EOF
if exists('b:indent_level')
@@ -53,12 +53,12 @@ function! GetOrgFolding()
endif
endif
python << EOF
-from orgmode import fold_orgmode
+from orgmode._vim import fold_orgmode
fold_orgmode(allow_dirty=True)
EOF
else
python << EOF
-from orgmode import fold_orgmode
+from orgmode._vim import fold_orgmode
fold_orgmode()
EOF
endif
@@ -98,13 +98,13 @@ function! GetOrgFoldtext()
return b:org_foldtext_cache[v:foldstart]
endif
python << EOF
-from orgmode import fold_text
+from orgmode._vim import fold_text
fold_text(allow_dirty=True)
EOF
else
unlet! b:org_foldtext_cache
python << EOF
-from orgmode import fold_text
+from orgmode._vim import fold_text
fold_text()
EOF
endif
View
2 tests/test_plugin_edit_structure.py
@@ -6,7 +6,7 @@
import vim
-from orgmode import ORGMODE
+from orgmode._vim import ORGMODE
counter = 0
class EditStructureTestCase(unittest.TestCase):
View
2 tests/test_plugin_misc.py
@@ -7,7 +7,7 @@
import vim
-from orgmode import indent_orgmode, fold_orgmode, ORGMODE
+from orgmode._vim import indent_orgmode, fold_orgmode, ORGMODE
ORGMODE.debug = True
View
2 tests/test_plugin_navigator.py
@@ -6,7 +6,7 @@
import vim
-from orgmode import ORGMODE
+from orgmode._vim import ORGMODE
START = True
END = False
View
2 tests/test_plugin_show_hide.py
@@ -6,7 +6,7 @@
import vim
-from orgmode import ORGMODE
+from orgmode._vim import ORGMODE
counter = 0
class ShowHideTestCase(unittest.TestCase):
View
2 tests/test_plugin_tags_properties.py
@@ -7,7 +7,7 @@
import vim
-from orgmode import indent_orgmode, fold_orgmode, ORGMODE
+from orgmode._vim import indent_orgmode, fold_orgmode, ORGMODE
ORGMODE.debug = True

No commit comments for this range

Something went wrong with that request. Please try again.