这个插件给coffeescripting(node.js)提供了一个rpc-pluginhost,以及一组由vimscript启发的指令。
Lib
Nvim = { # neovim-client API... # all functions can be called sync/async depending if you pass a callback }# Global objectscurrent.buffer == Nvim.getCurrentBuffer()current.window == ...current.tab == ...# buffers: listed buffers onlybuffers == Nvim.getBuffers().filter((b) -> b.listed)windows == Nvim.getWindows()tabs == Nvim.getTabpages()# Buffer properties:buffer.number: Read-onlybuffer.name: bufnamebuffer.lenght: buffer.lineCount()buffer.listed: buffer.getOption('buflisted')buffer.type: buffer.getOption('buftype')buffer.valid: buffer.isValid()# Option & Var accessbuffer[':VARNAME'] # => buffer.getVar('VARNAME')buffer['&OPTNAME'] # => buffer.getOption('OPTNAME')# same goes for window & tabpage# Cursorcursor # => [line, row]cursor[0] == cursor.line # truecursor[1] == cursor.row # truecursor = 2 # => position [2, 0]cursor = [10, 3] # => position [10, 3]cursor.row += 5 # => position [10, 8]cursor = current.buffer.length # => last linecursor += 10 # => Error# equivalent to: cursor = [10, 8] + 10# Functionscall.getcmdline() # => :call getcmdline()# => returns the function result# Otherecho()echohl()input('keys<esc>')execute('wincmd w')get('varname')set('option', 'value') OR set('option?')
评论