coq_nvim icon indicating copy to clipboard operation
coq_nvim copied to clipboard

Auto completion working only on 1 computer

Open l0wigh opened this issue 2 years ago • 1 comments

I made a configuration with

  • lspconfig
  • lspinstaller
  • coq_nvim
  • coq.artifacts

Here is my completion setup : https://github.com/l0wigh/LionVim/blob/master/lionvim/lua/completion.lua

It's working on the computer I used to make the configuration. But it seems to not be working on other ones.

I installed every dependancies required, git cloned my project and installed it. Used COQdeps. And then restarted nvim but I don't have any completion.

LSP is working, I have diagnostics, functions, ...

l0wigh avatar Oct 24 '21 16:10 l0wigh

local lsp_installer = require("nvim-lsp-installer")
local signs = { Error = " ", Warning = " ", Hint = " ", Information = " " }

for type, icon in pairs(signs) do
  local hl = "LspDiagnosticsSign" .. type
  vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end

lsp_installer.on_server_ready(function(server)
    local opts = {}
    server:setup(opts)
    vim.cmd [[ do User LspAttachBuffers ]]
end)

lsp_installer.settings {
    ui = {
        icons = {
            server_installed = "✓",
            server_pending = "➜",
            server_uninstalled = "✗"
        }
    }
}

require'nvim-treesitter.configs'.setup {
  highlight = {
    enable = true,              -- false will disable the whole extension
    additional_vim_regex_highlighting = false,
  },
}

vim.g.coq_settings = {
 	auto_start = "shut-up",
 	keymap = {
 		recommended = false,
 		jump_to_mark =  "<S-Tab>"
	}
}
 
require("coq")

local remap = vim.api.nvim_set_keymap
local npairs = require('nvim-autopairs')

npairs.setup({ map_bs = false })

-- these mappings are coq recommended mappings unrelated to nvim-autopairs
remap('i', '<esc>', [[pumvisible() ? "<c-e><esc>" : "<esc>"]], { expr = true, noremap = true })
remap('i', '<c-c>', [[pumvisible() ? "<c-e><c-c>" : "<c-c>"]], { expr = true, noremap = true })
remap('i', '<tab>', [[pumvisible() ? "<c-n>" : "<tab>"]], { expr = true, noremap = true })
remap('i', '<s-tab>', [[pumvisible() ? "<c-p>" : "<bs>"]], { expr = true, noremap = true })

-- skip it, if you use another global object
_G.MUtils= {}

MUtils.CR = function()
	if vim.fn.pumvisible() ~= 0 then
		if vim.fn.complete_info({ 'selected' }).selected ~= -1 then
			return npairs.esc('<c-y>')
		else
			return npairs.esc('<c-e>') .. npairs.autopairs_cr()
		end
	else
		return npairs.autopairs_cr()
	end
end
remap('i', '<cr>', 'v:lua.MUtils.CR()', { expr = true, noremap = true })

MUtils.BS = function()
	if vim.fn.pumvisible() ~= 0 and vim.fn.complete_info({ 'mode' }).mode == 'eval' then
		return npairs.esc('<c-e>') .. npairs.autopairs_bs()
	else
		return npairs.autopairs_bs()
	end
end

remap('i', '<bs>', 'v:lua.MUtils.BS()', { expr = true, noremap = true })

require "lsp_signature".setup({
	floating_window = false,
	floatin_window_above_cur_line = false,
	hint_enable = true,
	hint_prefix = "🦁 "
})

Since I changed my setup on github, here is what I had before switching to nvim-cmp until I have coq.nvim working

l0wigh avatar Oct 24 '21 20:10 l0wigh