yuki-uthman / vimpad.nvim

codi for vimscript... not quite but almost...
13 stars 0 forks source link

loved the plugin, but not working for any language except vim (neovim) #3

Open daUnknownCoder opened 2 weeks ago

daUnknownCoder commented 2 weeks ago

This plugin is crazy good, i looked for a lua alternative but i didnt find one and wanna stick with this plugin...

but this isnt workin for any language except vim

and in vim too, im getting only print thing and no error thing or text from the call (tho it can be a lsp config lapse on my side):

my current config (using lazy.nvim tho):

return  {
    "yuki-uthman/vimpad.nvim",
    event = "LazyFile",
    init = function()
      vim.g.vimpad_refresh_on_save = 0
      vim.g.vimpad_prefix = "🧨"
      vim.g.vimpad_add_space = 1
      vim.g.vimpad_add_padding = 1
      vim.g.vimpad_style = "custom"
      vim.g.vimpad_prefix = ""
      vim.g.vimpad_suffix = "î‚´"
      vim.g.vimpad_style_error = "custom"
      vim.g.vimpad_prefix_error = ""
      vim.g.vimpad_suffix_error = "î‚´"
      vim.api.nvim_set_hl(0, "VimpadOutput", { fg = "bg", bg = "cyan" })
      vim.api.nvim_set_hl(0, "VimpadPrefix", { fg = "bg", bg = "cyan", reverse = true })
      vim.api.nvim_set_hl(0, "VimpadSuffix", { fg = "bg", bg = "cyan", reverse = true })
      vim.api.nvim_set_hl(0, "VimpadOutputError", { fg = "bg", bg = "red" })
      vim.api.nvim_set_hl(0, "VimpadPrefixError", { fg = "bg", bg = "red", reverse = true })
      vim.api.nvim_set_hl(0, "VimpadSuffixError", { fg = "bg", bg = "red", reverse = true })
    end,
}
i configured `vimls` exclusively to test this plugin (click me) ```lua -- ... local on_attach = function(client, bufnr) local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") local function opts(desc) return { desc = desc, noremap = true, silent = true } end buf_set_keymap("n", "gr", "Lspsaga finder ref", opts("LSP Finder [References] ")) buf_set_keymap("n", "gd", "Lspsaga finder def", opts("LSP Finder [Definition] ")) buf_set_keymap("n", "gI", "Lspsaga finder imp", opts("LSP Finder [Implementation] ")) buf_set_keymap("n", "gD", "Lspsaga finder tyd", opts("LSP Finder [Type Definition] ")) buf_set_keymap("n", "[d", "lua vim.diagnostic.goto_prev()", opts("Diagnostic Jump Prev")) buf_set_keymap("n", "]d", "lua vim.diagnostic.goto_next()", opts("Diagnostic Jump Next")) client.server_capabilities.document_formatting = true require("lsp_signature").on_attach({ bind = true, debug = true, floating_window = true, floating_window_above_cur_line = true, hint_enable = true, fix_pos = true, -- floating_window_above_first = true, log_path = vim.fn.expand("$HOME") .. "/tmp/sig.log", padding = " ", handler_opts = { border = "rounded", }, }) if client and client.server_capabilities.documentHighlightProvider then local highlight_augroup = vim.api.nvim_create_augroup("NeutronVimLSPHighlight", { clear = false }) vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { buffer = client.buf, group = highlight_augroup, callback = vim.lsp.buf.document_highlight, }) vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, { buffer = client.buf, group = highlight_augroup, callback = vim.lsp.buf.clear_references, }) vim.api.nvim_create_autocmd("LspDetach", { group = vim.api.nvim_create_augroup("NeutronVimLSPDetach", { clear = true }), callback = function(bufnr2) vim.lsp.buf.clear_references() vim.api.nvim_clear_autocmds({ group = "NeutronVimLSPHighlight", buffer = bufnr2.buf }) end, }) end vim.api.nvim_create_autocmd("CursorHold", { buffer = bufnr, callback = function() local diag_opts = { focusable = false, close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" }, border = "rounded", source = "always", prefix = " ", scope = "cursor", } vim.diagnostic.open_float(nil, diag_opts) end, }) end -- ... local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = vim.tbl_deep_extend("force", capabilities, cmp_nvim_lsp.default_capabilities()) -- ... lspconfig["vimls"].setup({ capabilities = capabilities, on_attach = on_attach, }) ```

how it looks like for vim: image image (note that this is the readme gif text) and i also did :call vimpad#on() which starts the plugin but i dont get it for errors, i also did :call vimpad#refresh() multiple times which doesnt work too

how it looks like for lua: image

note that i already have vimpad on over here...

how it looks like for python: image

note my lualine, all of them have their respective servers attached

anyway, thanks for your contribution for my nvim setup (youtube playlist :p)

yuki-uthman commented 1 week ago

Hello!

Thanks for the kind words.

Unfortunately this only works for vimscript cuz of the way it was designed. It was meant to be just for vimscript cuz the other plugin "codi" I was using did not work for vimscript. But it did work for many other language at the time. Maybe u can check it out! There is also nvim-luapad for lua.

daUnknownCoder commented 1 week ago

Hello!

Thanks for the kind words.

Unfortunately this only works for vimscript cuz of the way it was designed. It was meant to be just for vimscript cuz the other plugin "codi" I was using did not work for vimscript. But it did work for many other language at the time. Maybe u can check it out! There is also nvim-luapad for lua.

Yeah but it doesn't give the same feel like of this plugin

daUnknownCoder commented 1 week ago

I guess I'll have to fork this into a full lua rewrite