davidgranstrom / scnvim

Neovim frontend for SuperCollider.
GNU General Public License v3.0
197 stars 26 forks source link

[FR]: More documentation on how to use it: describe how you can run code #207

Closed felixniemeyer closed 1 year ago

felixniemeyer commented 1 year ago

Is your feature request related to a problem? Please describe. I am new to supercollider and scnvim at the same time. I'm a bit familiar with nvim and use it for my work with rust and TypScript for example. I'm using packer to integrate the plugin and I copied the config from the usage section to my init.vim. I can start the compiler with SCNvimStart and I get shown the logs in a new buffer.

However, there is no clue about how to execute a simple piece of code like 2 + 2.

Maybe I skipped it somwhere accidentally? The mappings from the usage section don't seem to work altogether.

Describe the solution you'd like I'd like to have one quick section about what you can do, once SCNvim is installed and configured. E.g.:

once everything is setup, you can start using SCNvim by

Describe alternatives you've considered I googled a lot and also asked about this on reddit.

Additional context image

davidgranstrom commented 1 year ago

@felixniemeyer Hi, thanks for the report! Would you mind to post the output of :checkhealth scnvim? This might help to determine the issue, the example configuration you posted is working here on my end.

felixniemeyer commented 1 year ago

yes, sure

scnvim: require("scnvim.health").check()
========================================================================
## scnvim
  - OK: nvim version 0.8.0
  - OK: sclang executable: /usr/bin/sclang
  - OK: scnvim classes are installed: /home/felix/.local/share/SuperCollider/Extensions/scide_scnvim
  - INFO: no keymaps defined

## scnvim documentation
  - INFO: using HelpBrowser for documentation

## scnvim extensions
felixniemeyer commented 1 year ago

What's the keyboard shortcut to run 2 + 2 and what about the connection to the server? Is a server even required for postln or basic arithmetic? Maybe I'm missing out on something obvious, because I'm new to supercollider.

davidgranstrom commented 1 year ago

The keymap is user defined, but if you are using the example configuration then C-e should work. The server is not needed to evaluate that expression.

But from your checkhealth output I noticed this line:

  - INFO: no keymaps defined

This indicates that no keymaps are set. Perhaps you are inadvertently overwriting them? Could you have multiple calls to scnvim.setup in your config perhaps?

felixniemeyer commented 1 year ago

Thanks, I did call scnvim.setup in my lua/plugins.lua, too.

use {
  'davidgranstrom/scnvim',
  config = function()
    require('scnvim').setup()
  end
}

I copied this from the install instructions. Maybe add a hint to the config section to remove the setup call from the use block, when putting the config in the vim.init.

I reduced the use statement to

  use {'davidgranstrom/scnvim'}  

and resynced the plugins using :PackerSync That did it and I can now evaluate lines with C-e just fine.

Thanks for your help!

image