Back to contents

Public python functions

_(s)

Mark string s as translatable

set(s, v)

Set setting s to value v, applying to all views of current buffer

setlocal(s, v)

Set setting s to value v, applying only to current view

get_setting(s)

Retrieve the value of setting s

bind(ks, cmd)

Bind vi keystroke or sequence ks to command cmd

def_menu(id = "/", *items)

Define menu with given id (default is top-level) and a list of items (objects returned by def_menu_item)

def_menu_item(id, label = None, method_name = None)

Define a menu item with given id. If label is None the item is a separator. method_name is the name of a vi command or an ex command if it begins with :

attach_submenu(item, submenu)

Attach a submenu to a menu item

filetype_hook(filetype, action)

Declare code to be run when loading a file of the given type. action may be a python function or a string beginning with : for an ex command

filename_hook(pattern, action)

Declare code to be run when loading a file whose name matches pattern. action may be a python function or a string beginning with : for an ex command

scheme_hook(scheme, action)

Declare code to be run when a certain colour scheme is applied. action may be a python function or a string beginning with : for an ex command

clear_filetype_hook(filetype, action = None)

Clear filetype hook for filetype and action. If action isn't given, clears all hooks matching the filetype

clear_filename_hook(pattern, action = None)

Clear filename hook for matching pattern and action. If action isn't given, clears all hooks matching pattern

clear_scheme_hook(scheme, action = None)

Clear scheme hook for scheme and action. If action isn't given, clears all hooks matching the scheme