250 lines
4.3 KiB
Lua
250 lines
4.3 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",
|
|
"http",
|
|
"javascript",
|
|
"json",
|
|
"latex",
|
|
"lua",
|
|
"python",
|
|
"typescript",
|
|
"tsx",
|
|
"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", "typescriptreact" }
|
|
}
|
|
|
|
-- pk_use {
|
|
-- 'fatih/vim-go',
|
|
-- ft = 'go'
|
|
-- }
|
|
|
|
pk_use {
|
|
'udalov/kotlin-vim',
|
|
ft = 'kotlin'
|
|
}
|
|
|
|
pk_use 'bellinitte/uxntal.vim'
|
|
|
|
--
|
|
-- 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 = {
|
|
min_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 = {
|
|
'neovim/nvim-lspconfig',
|
|
'williamboman/mason.nvim',
|
|
'ms-jpq/coq_nvim',
|
|
'stevearc/aerial.nvim'
|
|
},
|
|
config = function()
|
|
local masonlsp = require 'mason-lspconfig'
|
|
--[[
|
|
masonlsp.setup {
|
|
ensure_installed = {
|
|
"bashls",
|
|
"clangd",
|
|
"html",
|
|
"jsonls",
|
|
"lua_ls",
|
|
"pyright",
|
|
"texlab",
|
|
"tsserver"
|
|
},
|
|
}
|
|
--]]
|
|
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
|
|
}]]
|
|
|
|
--
|
|
-- Markdown Live Preview
|
|
--
|
|
pk_use {
|
|
"iamcco/markdown-preview.nvim",
|
|
ft = 'markdown',
|
|
run = function()
|
|
vim.fn["mkdp#util#install"]()
|
|
end,
|
|
config = function()
|
|
vim.g.mkdp_theme = 'light'
|
|
end
|
|
}
|
|
|
|
-- Debugger Adapter Protocol
|
|
--[[
|
|
pk_use {
|
|
'mfussenegger/nvim-dap',
|
|
config = function()
|
|
local dap = require('dap')
|
|
|
|
end
|
|
}
|
|
--]]
|
|
|
|
--
|
|
-- Misc
|
|
--
|
|
pk_use {
|
|
"rest-nvim/rest.nvim",
|
|
requires = { "nvim-lua/plenary.nvim" },
|
|
config = function()
|
|
|
|
-- commands
|
|
local ct = require('conftool')
|
|
ct.defcmd('RestNvim', 'lua require(\'rest-nvim\').run()<CR>')
|
|
ct.defcmd('RestNvimPreview', 'lua require(\'rest-nvim\').run(true)<CR>')
|
|
ct.defcmd('RestNvimLast', 'lua require(\'rest-nvim\').last()<CR>')
|
|
|
|
ct.map('n', '<Leader>r', '<Plug>RestNvim<CR>')
|
|
ct.map('n', '<Leader>R', '<Plug>RestNvimLast<CR>')
|
|
ct.map('n', '<Leader><A-r>', '<Plug>RestNvimPreview<CR>')
|
|
|
|
require("rest-nvim").setup({
|
|
-- Open request results in a horizontal split
|
|
result_split_horizontal = true,
|
|
-- Keep the http file buffer above|left when split horizontal|vertical
|
|
result_split_in_place = true,
|
|
result = {
|
|
show_curl_command = false,
|
|
}
|
|
})
|
|
end
|
|
}
|