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