188 lines
3.0 KiB
Lua
188 lines
3.0 KiB
Lua
--
|
|
-- IDE-like features
|
|
--
|
|
|
|
-- Load required tools
|
|
local pk_use = require 'packer'.use
|
|
|
|
--
|
|
-- 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 -s]])
|
|
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 {
|
|
'udalov/kotlin-vim',
|
|
ft = 'kotlin'
|
|
}
|
|
|
|
--
|
|
-- Language Server
|
|
--
|
|
|
|
-- Basic commands
|
|
pk_use 'nanotee/nvim-lsp-basics'
|
|
|
|
-- Show Code Outline/Symbols tree window
|
|
pk_use {
|
|
'stevearc/aerial.nvim',
|
|
config = function()
|
|
require('conftool').map('n', '<Leader>e', ':AerialToggle<LF>')
|
|
require('aerial').setup({
|
|
backends = {'lsp', 'markdown', 'man'},
|
|
layout = {
|
|
max_width = 25
|
|
}
|
|
})
|
|
end
|
|
}
|
|
|
|
-- Language Server Installer
|
|
pk_use {
|
|
'williamboman/mason.nvim',
|
|
config = function()
|
|
require('mason').setup {
|
|
ui = {
|
|
icons = {
|
|
package_installed = "i",
|
|
package_pending = "p",
|
|
package_uninstalled = "u"
|
|
}
|
|
}
|
|
}
|
|
end
|
|
}
|
|
pk_use {
|
|
'williamboman/mason-lspconfig.nvim',
|
|
requires = {
|
|
'williamboman/mason.nvim',
|
|
'ms-jpq/coq_nvim',
|
|
'stevearc/aerial.nvim'
|
|
},
|
|
config = function()
|
|
local masonlsp = require 'mason-lspconfig'
|
|
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',
|
|
config = function()
|
|
-- disable inline error messages
|
|
vim.diagnostic.config({virtual_text = false})
|
|
end
|
|
}
|
|
|
|
-- Show code diagnostics in a separate buffer window
|
|
pk_use {
|
|
'folke/trouble.nvim',
|
|
config = function()
|
|
require('trouble').setup {
|
|
height = 6,
|
|
icons = false,
|
|
fold_open = "v",
|
|
fold_closed = ">",
|
|
signs = {
|
|
error = "E:",
|
|
warning = "W:",
|
|
hint = "H:",
|
|
information = "I:"
|
|
},
|
|
use_diagnostic_signs = false
|
|
}
|
|
|
|
require('conftool').map('n', '<Leader>t', ':TroubleToggle<CR>')
|
|
end
|
|
}
|
|
|
|
--
|
|
-- Latex Live Preview
|
|
--
|
|
pk_use {
|
|
'xuhdev/vim-latex-live-preview',
|
|
ft = 'tex',
|
|
setup = function()
|
|
vim.g.livepreview_previewer = require('defs').external_pdfviewer
|
|
vim.g.livepreview_engine = "xelatex"
|
|
end
|
|
}
|
|
|
|
|
|
-- Debugger Adapter Protocol
|
|
--[[
|
|
pk_use {
|
|
'mfussenegger/nvim-dap',
|
|
config = function()
|
|
local dap = require('dap')
|
|
|
|
end
|
|
}
|
|
--]]
|
|
|