added coq + fixed diagnostics
This commit is contained in:
parent
fc6344e1ff
commit
7f9cdd2b11
|
|
@ -64,7 +64,7 @@ return require("packer").startup(
|
|||
use {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = ":TSUpdate",
|
||||
after = "nvim-compe",
|
||||
-- after = "nvim-compe",
|
||||
config = function()
|
||||
local npairs = require("nvim-autopairs")
|
||||
npairs.setup(
|
||||
|
|
@ -74,13 +74,6 @@ return require("packer").startup(
|
|||
}
|
||||
)
|
||||
|
||||
require("nvim-autopairs.completion.compe").setup(
|
||||
{
|
||||
map_cr = true, -- map <CR> on insert mode
|
||||
map_complete = true, -- it will auto insert `(` after select function or method item
|
||||
auto_select = false -- auto select first item
|
||||
}
|
||||
)
|
||||
require "nvim-treesitter.configs".setup {
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
|
|
@ -125,12 +118,12 @@ return require("packer").startup(
|
|||
"jose-elias-alvarez/null-ls.nvim"
|
||||
}
|
||||
}
|
||||
use {
|
||||
--[[ use {
|
||||
"hrsh7th/nvim-compe",
|
||||
config = function()
|
||||
require "plugins/compe"
|
||||
end
|
||||
}
|
||||
} ]]
|
||||
use {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
config = function()
|
||||
|
|
@ -199,23 +192,22 @@ return require("packer").startup(
|
|||
}
|
||||
use "jbyuki/venn.nvim"
|
||||
use "editorconfig/editorconfig-vim"
|
||||
use(
|
||||
{
|
||||
"jameshiew/nvim-magic",
|
||||
config = function()
|
||||
require("nvim-magic").setup(
|
||||
{
|
||||
use_default_keymap = false
|
||||
}
|
||||
)
|
||||
end,
|
||||
tag = "v0.2.1", -- recommended to pin to a tag and update manually as there may be breaking changes
|
||||
requires = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim"
|
||||
}
|
||||
use {
|
||||
"jameshiew/nvim-magic",
|
||||
config = function()
|
||||
require("nvim-magic").setup(
|
||||
{
|
||||
use_default_keymap = false
|
||||
}
|
||||
)
|
||||
end,
|
||||
tag = "v0.2.1", -- recommended to pin to a tag and update manually as there may be breaking changes
|
||||
requires = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim"
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
use {
|
||||
"mfussenegger/nvim-jdtls",
|
||||
config = function()
|
||||
|
|
@ -230,5 +222,15 @@ return require("packer").startup(
|
|||
end,
|
||||
requires = {"mfussenegger/nvim-dap"}
|
||||
}
|
||||
use {
|
||||
"ms-jpq/coq_nvim",
|
||||
branch = "coq",
|
||||
config = function()
|
||||
require "plugins/coq"
|
||||
end,
|
||||
setup = function()
|
||||
vim.cmd("let g:coq_settings = { 'auto_start': v:true, 'keymaps': {'manual_completion': '<c-f>'} }")
|
||||
end
|
||||
}
|
||||
end
|
||||
)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,82 @@
|
|||
local remap = vim.api.nvim_set_keymap
|
||||
local npairs = require("nvim-autopairs")
|
||||
|
||||
npairs.setup({map_bs = false})
|
||||
|
||||
vim.g.coq_settings = {
|
||||
keymap = {recommended = false, manual_complete = "<c-f>"},
|
||||
display = {
|
||||
preview = {
|
||||
positions = {
|
||||
east = 1,
|
||||
north = 2,
|
||||
south = 3,
|
||||
west = 4
|
||||
}
|
||||
},
|
||||
icons = {
|
||||
mappings = {
|
||||
Text = "",
|
||||
Method = "",
|
||||
Function = "",
|
||||
Constructor = "",
|
||||
Field = "ﰠ",
|
||||
Variable = "",
|
||||
Class = "ﴯ",
|
||||
Interface = "",
|
||||
Module = "",
|
||||
Property = "ﰠ",
|
||||
Unit = "塞",
|
||||
Value = "",
|
||||
Enum = "",
|
||||
Keyword = "",
|
||||
Snippet = "",
|
||||
Color = "",
|
||||
File = "",
|
||||
Reference = "",
|
||||
Folder = "",
|
||||
EnumMember = "",
|
||||
Constant = "",
|
||||
Struct = "פּ",
|
||||
Event = "",
|
||||
Operator = "",
|
||||
TypeParameter = "",
|
||||
Character = "",
|
||||
Number = "",
|
||||
Parameter = "",
|
||||
String = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-- 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})
|
||||
|
|
@ -8,19 +8,19 @@ vim.lsp.handlers["textDocument/documentSymbol"] = require "lsputil.symbols".docu
|
|||
vim.lsp.handlers["workspace/symbol"] = require "lsputil.symbols".workspace_handler
|
||||
|
||||
vim.fn.sign_define(
|
||||
"LspDiagnosticsSignError",
|
||||
"DiagnosticSignError",
|
||||
{texthl = "LspDiagnosticsSignError", text = "", numhl = "LspDiagnosticsSignError"}
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"LspDiagnosticsSignWarning",
|
||||
"DiagnosticSignWarning",
|
||||
{texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"}
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"LspDiagnosticsSignHint",
|
||||
"DiagnosticSignHint",
|
||||
{texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"}
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"LspDiagnosticsSignInformation",
|
||||
"DiagnosticSignInformation",
|
||||
{texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"}
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue