davidgranstrom / scnvim

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

[BUG] scnvim foobar #213

Closed clfest closed 1 year ago

clfest commented 1 year ago

Describe the bug

I am using a Raspberry Pi 400 for SuperCollider, my intent is to use scnvim for an IDE, folowing madskjeldgaard. I have no experience using Lua, but it seems the way to go. I get a system that has apparently loaded the plugin (:checkhealth scnvim) but when I :e test.scd and :SCNvimStart, I get a :E492 Not an editor command: SCNvimStart.

    Thank You For Your Attention

Expected behavior

I expect it to go into SCNvim IDE as with the Qt IDE I'm more familiar with.

Steps to reproduce

this is the particulars of my system

Raspberry 400 Raspbian 11 neovim v0.7.2 packer v? svnvim v?

files:

init.lua:

--[[ init.lua ]]

-- LEADER -- These keybindings need to be defined before the first / -- is called; otherwise, it will default to "\" vim.g.mapleader = "," vim.g.localleader = "\"

-- IMPORTS require('vars') -- Variables require('opts') -- Options -- require('keys') -- Keymaps require('plugins') -- Plugins

nvim/plugins.lua

return require('packer').startup(function() use 'wbthomason/packer.nvim'

use { 'davidgranstrom/scnvim', config = function() require('scnvim').setup( { mapping = { [''] = scnvim.map.send_line({'i', 'n'}), [''] = { scnvim.map.send_block({'i', 'n'}), scnvim.map.send_selection('x'), }, [''] = scnvim.map.postwin_toggle('n'), [''] = scnvim.map.postwin_toggle('i'), [''] = scnvim.map.postwin_clear({'n', 'i'}), [''] = scnvim.map.show_signature({'n', 'i'}), [''] = scnvim.map.hard_stop({'n', 'x', 'i'}), ['st'] = scnvim.map(scnvim.start), ['sk'] = scnvim.map(scnvim.recompile), }, editor = { highlight = { color = 'IncSearch', type = 'fade', }, }, documentation = { cmd = '/opt/homebrew/bin/pandoc', }, postwin = { float = { enabled = true, }, }, } ) end }

end)

end files

Do:

Start Neovim 0.7.2, :e test.scd, :SCNvimStart

Additional context

Information

Features: +acl +iconv +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

davidgranstrom commented 1 year ago

@clfest Thanks for the report. I noticed that the scnvim configuration you provided is out of date. Please try again with the example config found here.

clfest commented 1 year ago

Somebody suggested that I inquire:

:set ft?

to which it responded:

->filetype=supercollider

so it looks to my (naive) eye like it's partially installed. Being new to the Neovim environment and Lua, I don't where to start to debug it.

                              --Thanks For Your Attention
davidgranstrom commented 1 year ago

The file type detection is separate from the rest of the plugin implementation so that could be a false positive in this case (but it does indicate that the plugin is correctly installed).

The first step in order to debug this would be to use the example configuration I linked in my earlier reply. After that you can check for possible errors by typing :messages. If you don't see any errors then the output of :checkhealth scnvim would be interesting to see.

clfest commented 1 year ago

(from bash) nvim test.scd (->) (now in Neovim) :SCNvimStart (pink screen comes up, sclang compiles) :messages (nothing) :checkhealth scnvim

scnvim: require("scnvim.health").check()

scnvim

scnvim documentation

scnvim extensions

So apparently it's installed. Thank you. I was hoping not to learn vimscript for the time being as well. Is there a way I could modify my lua/plugins.lua to function correctly, and thus avoid .vim files completely (for now)? I am new to Lua, and it's a little much to debug scripts written in it.

                                         Thank You For Your Attention
davidgranstrom commented 1 year ago

Ok, sounds like its working!

There's no need to use vimscript to configure scnvim. You can safely remove the lua << EOF marker pair from the example config and use it in your packer config function as you previously posted.