Guest User

Untitled

a guest
Nov 22nd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. from neovim import attach
  2.  
  3. nvim = attach('child', argv=["/bin/env","nvim","--embed"])
  4. buffer = nvim.current.buffer
  5. buffer[0] = 'visual mode'
  6. nvim.feedkeys("fmve")
  7. print("Current caret position: {}".format(nvim.windows[0].cursor))
  8. cmd ='getpos("'<")'
  9. print("Start of visual selection: {}".format(nvim.eval(cmd)))
  10.  
  11. Current caret position: [1,10]
  12. Start of visual selection: [0,0,0,0]
  13.  
  14. Start of visual selection: [1,8,1,11]
Add Comment
Please, Sign In to add comment