162 lines
2.5 KiB
Lua
162 lines
2.5 KiB
Lua
--
|
|
-- IDE-like features
|
|
--
|
|
|
|
-- Load required tools
|
|
local pk_use = require 'packer'.use
|
|
local ct = require 'conftool'
|
|
|
|
|
|
--
|
|
-- Tree Sitter
|
|
--
|
|
pk_use {
|
|
'nvim-treesitter/nvim-treesitter',
|
|
run = ':TSUpdate',
|
|
config = function()
|
|
require('nvim-treesitter.configs').setup{
|
|
ensure_installed = {
|
|
"bash",
|
|
"bibtex",
|
|
"c",
|
|
"cpp",
|
|
"css",
|
|
"go",
|
|
"html",
|
|
"javascript",
|
|
"json",
|
|
"latex",
|
|
"python",
|
|
"typescript",
|
|
"vim",
|
|
},
|
|
sync_install = false,
|
|
highlight = {
|
|
enable = true,
|
|
}
|
|
}
|
|
end
|
|
}
|
|
|
|
--
|
|
-- Autocompletion
|
|
--
|
|
pk_use {
|
|
'ms-jpq/coq_nvim',
|
|
branch = 'coq',
|
|
config = function()
|
|
vim.cmd([[autocmd VimEnter * COQnow]])
|
|
end
|
|
}
|
|
pk_use {
|
|
'ms-jpq/coq.artifacts',
|
|
branch = 'artifacts'
|
|
}
|
|
|
|
--
|
|
-- Language Configurations
|
|
--
|
|
pk_use 'ap/vim-css-color'
|
|
-- close tags in html languages
|
|
pk_use {
|
|
'alvan/closetag.vim',
|
|
ft = {"html", "vue"}
|
|
}
|
|
pk_use {
|
|
'fatih/vim-go',
|
|
ft = 'go'
|
|
}
|
|
pk_use {
|
|
'lervag/vimtex',
|
|
ft = 'tex',
|
|
config = function()
|
|
local defs = require 'defaults'
|
|
vim.g.vimtex_view_general_viewer = defs.external_pdfviewer
|
|
vim.g.vimtex_compiler_latexmk_engines = { _ = '-xelatex'}
|
|
vim.g.vimtex_compiler_progname = 'nvim'
|
|
end
|
|
}
|
|
|
|
|
|
--
|
|
-- Language Server
|
|
--
|
|
|
|
-- Basic commands
|
|
pk_use 'nanotee/nvim-lsp-basics'
|
|
|
|
-- Language Server Installer
|
|
pk_use {
|
|
'williamboman/mason.nvim',
|
|
config = function()
|
|
require('mason').setup()
|
|
end
|
|
}
|
|
pk_use {
|
|
'williamboman/mason-lspconfig.nvim',
|
|
requires = {
|
|
'williamboman/mason.nvim',
|
|
'ms-jpq/coq_nvim'
|
|
},
|
|
config = function()
|
|
local masonlsp = require 'mason-lspconfig'
|
|
masonlsp.setup {
|
|
ensure_installed = {
|
|
"sumneko_lua",
|
|
"gopls",
|
|
"vimls"
|
|
}
|
|
}
|
|
masonlsp.setup_handlers {
|
|
function(server_name)
|
|
require('lspconfig')[server_name].setup(require('coq').lsp_ensure_capabilities {
|
|
on_attach = function(client, bufnr)
|
|
local basics = require('lsp_basics')
|
|
basics.make_lsp_commands(client, bufnr)
|
|
basics.make_lsp_mappings(client, bufnr)
|
|
end
|
|
})
|
|
end
|
|
}
|
|
end
|
|
}
|
|
|
|
pk_use {'neovim/nvim-lspconfig'}
|
|
|
|
--
|
|
-- Show code diagnostics in a separate buffer window
|
|
--
|
|
pk_use {
|
|
'folke/trouble.nvim',
|
|
config = function()
|
|
require('trouble').setup {
|
|
icons = false,
|
|
fold_open = "v",
|
|
fold_closed = ">",
|
|
signs = {
|
|
error = "E:",
|
|
warning = "W:",
|
|
hint = "H:",
|
|
information = "I:"
|
|
},
|
|
use_diagnostic_signs = false
|
|
}
|
|
|
|
require('conftool').map('n', '<C-S-`>', ':TroubleToggle<CR>')
|
|
end
|
|
}
|
|
|
|
--
|
|
-- Debugger Adapter Protocol
|
|
--
|
|
--[[
|
|
pk_use {
|
|
'mfussenegger/nvim-dap',
|
|
config = function()
|
|
local dap = require('dap')
|
|
|
|
end
|
|
}
|
|
--]]
|
|
|