示例#1
0
 def get_buffer_paths(self):
     projects = get_projects()
     multiple_projects = len(projects) > 1
     for b in vim.buffers:
         if buffer_with_file(b):
             fpath = b.name
             spath = strip_project_path(fpath, projects, multiple_projects)
             path, name = os.path.split(spath)
             yield (name, spath, '__buffer__',
                    '* ' + path, fpath)
示例#2
0
 def get_buffer_paths(self):
     projects = get_projects()
     multiple_projects = len(projects) > 1
     for b in vim.buffers:
         if buffer_with_file(b):
             fpath = b.name
             spath = strip_project_path(fpath, projects, multiple_projects)
             path, name = os.path.split(spath)
             yield (name, spath, '__buffer__',
                    '* ' + path, fpath)
示例#3
0
def escape():
    if len(vim.windows) < 2:
        return

    cur = vfunc.winnr()

    for n, w in reversed(list(enumerate(vim.windows, 1))):
        if not buffer_with_file(w.buffer):
            if not '[Command Line]' in w.buffer.name:
                focus_window(n)
            vim.command('q')
            if n != cur:
                if cur > n:
                    cur -= 1

                focus_window(cur)

            return
示例#4
0
文件: plugin.py 项目: baverman/vial
def escape():
    if len(vim.windows) < 2:
        return

    cur = vfunc.winnr()

    for n, w in reversed(list(enumerate(vim.windows, 1))):
        if not buffer_with_file(w.buffer):
            if not '[Command Line]'in w.buffer.name:
                focus_window(n)
            vim.command('q')
            if n != cur:
                if cur > n:
                    cur -= 1

                focus_window(cur)

            return