Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage via omnifunc #72

Open
lcmen opened this issue Nov 25, 2023 · 0 comments
Open

Usage via omnifunc #72

lcmen opened this issue Nov 25, 2023 · 0 comments

Comments

@lcmen
Copy link

lcmen commented Nov 25, 2023

Hey!
Thank you for writing this plugin. I would like to use it with Neovim without any additional autocomplete plugins.

I've copied the configuration from the readme but I can't this plugin work with built-in autocomplete. I have a following on_attach function that connects omnifunc with lsp.omnifunc for the buffer:

local on_attach = function(client, bufnr)
    local map = vim.api.nvim_buf_set_keymap
    local ion = vim.api.nvim_buf_set_option
    local opts = { noremap = true }

    ion(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
    ion(bufnr, 'formatexpr', 'v:lua.vim.lsp.formatexpr()')

    -- Configure keybindings for LSP
    map(bufnr, 'n', 'C-y', '<Cmd>lua vim.lsp.buf.code_action()<CR>', opts)
    map(bufnr, 'n', 'g0', '<Cmd>lua vim.lsp.buf.document_symbol()<CR>', opts)
    map(bufnr, 'n', 'gf', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
    map(bufnr, 'n', 'gi', '<Cmd>lua vim.lsp.buf.implementation()<CR>', opts)
    map(bufnr, 'n', 'gt', '<Cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
    map(bufnr, 'n', 'gr', '<Cmd>lua vim.lsp.buf.references()<CR>', opts)
    map(bufnr, 'n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
end

Now, if I type valid emmet syntax in the HTML file (e.g. h1.center), and hit CTRL+x, CTRL+o, I see a following message in status line:

^X mode (^]^D^E^F^O^K^L^N^O^Ps^U^V^Y) Pattern not found

In the :LspLog I also see a following line (not sure if this is related):

[WARN][2023-11-25 18:55:55] ...lsp/handlers.lua:137	"The language server emmet_ls triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless"

How can I force emmet to convert snippet to a proper HTML structure?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant