75 lines
2.4 KiB
Lua
75 lines
2.4 KiB
Lua
local hooks = require "core.hooks"
|
|
|
|
vim.g.mapleader = " "
|
|
|
|
hooks.add("install_plugins", function(use)
|
|
use {
|
|
"neovim/nvim-lspconfig",
|
|
"williamboman/nvim-lsp-installer",
|
|
config = function()
|
|
local lsp_installer = require("nvim-lsp-installer")
|
|
require("packer").loader("coq_nvim coq.artifacts")
|
|
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
|
|
|
lsp_installer.on_server_ready(function(server)
|
|
local opts = {}
|
|
server:setup(require("coq")().lsp_ensure_capabilities(opts))
|
|
-- server:setup(opts)
|
|
vim.cmd [[ do User LspAttachBuffers ]]
|
|
vim.cmd(":COQnow")
|
|
end)
|
|
end,
|
|
}
|
|
use {
|
|
"karb94/neoscroll.nvim",
|
|
opt = true,
|
|
config = function()
|
|
require("neoscroll").setup()
|
|
end,
|
|
|
|
setup = function()
|
|
require("core.utils").packer_lazy_load "neoscroll.nvim"
|
|
end,
|
|
}
|
|
use {
|
|
"ms-jpq/coq_nvim",
|
|
branch="coq"
|
|
}
|
|
use {
|
|
"ms-jpq/coq.artifacts",
|
|
branch="artifacts"
|
|
}
|
|
use {
|
|
"ms-jpq/coq.thirdparty",
|
|
branch="3p"
|
|
}
|
|
use {
|
|
"gennaro-tedesco/nvim-peekup"
|
|
}
|
|
end)
|
|
|
|
|
|
|
|
hooks.add("setup_mappings", function(map)
|
|
|
|
-- LSP MAPPINGS --
|
|
local lsp_opts = { noremap=true }
|
|
map('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', lsp_opts)
|
|
map('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', lsp_opts)
|
|
map('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', lsp_opts)
|
|
map('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', lsp_opts)
|
|
map('n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', lsp_opts)
|
|
map('n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', lsp_opts)
|
|
map('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', lsp_opts)
|
|
map('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', lsp_opts)
|
|
map('n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', lsp_opts)
|
|
map('n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', lsp_opts)
|
|
map('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', lsp_opts)
|
|
map('n', '<space>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', lsp_opts)
|
|
map('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', lsp_opts)
|
|
map('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', lsp_opts)
|
|
map('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', lsp_opts)
|
|
map('n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', lsp_opts)
|
|
|
|
end)
|