jbyuki / venn.nvim

Draw ASCII diagrams in Neovim
MIT License
919 stars 20 forks source link

Newbie issues with configuring #15

Closed moondialectix closed 2 years ago

moondialectix commented 2 years ago

Hey, sorry for the issue, can't invoke VBox and when I start up nvim I get these error messages from the config file

Error detected while processing /home/moondialectix/.config/nvim/init.vim: line 8: E492: Not an editor command: -- venn.nvim: enable or disable keymappings line 9: E121: Undefined variable: _G line 10: E492: Not an editor command: local venn_enabled = vim.inspect(vim.b.venn_ena bled) line 11: E121: Undefined variable: venn_enabled E15: Invalid expression: venn_enabled == "nil" then line 26: E580: :endif without :if: end line 27: E492: Not an editor command: -- toggle keymappings for venn using v "nvim_set_keymap('n'," [New File] Cannot open file "nvim_set_keymap('n'," "'v'," [New File] "":lua" [New File]
"Toggle_venn()"," [New File] "{" [New File]
Cannot open file "{" "noremap" [New File] Cannot open file "noremap" "=" [New File] Cannot open file "=" "true})" [New File] Cannot open file "true})" line 28: E480: No match: api

moondialectix commented 2 years ago

a few of these errors are obviously just about the comments, but the rest ii have no idea what to do with

jbyuki commented 2 years ago

Hi,

It seems the errors are showing because init.vim is Vimscript but the configuration is in Lua. Try putting the configuration code inside delimiters like this:

lua << END
  ...
END

I hope this solves the issues.

moondialectix commented 2 years ago

thank you so much! That solved the errors, but I still can't invoke VBox. I saw the other issue that was resolved, my question is: where should I put:

vnoremap g :VBox

relative to the rest of the text copied from the readme

jbyuki commented 2 years ago

If you've just copy-pasted the config from the README, you should be able to invoke VBox using the key f. I'll repeat the usage steps just for convenience:

  1. :set ve=all to freely move the cursor.
  2. Select a box using <C-V> or Ctrl + V, then move the cursor to make a box
  3. Press f, this should draw the box.

You can always change the keybindings to your liking, by modying the nvim_buf_set_keymap call arguments.

moondialectix commented 2 years ago

this works! thanks man, sorry for the bother

jbyuki commented 2 years ago

Sorry, I wasn't really clear on my last instructions, but if it works, great!