dotfiles/neovim/.config/nvim/lua/development.lua

96 lines
2.6 KiB
Lua

local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
require('lspconfig').pyright.setup{
capabilities = capabilities,
}
require('lspconfig').tsserver.setup {}
require('dap-python').setup('~/.local/share/virtualenvs/debugpy/bin/python')
require('dap-python').test_runner = 'pytest'
require("neotest").setup({
output = {
enabled = true,
open_on_run = "yes",
},
adapters = {
require("neotest-python")({
dap = { justMyCode = false },
args = {"--cov=src", "--cov-report=term-missing"},
runner = 'pytest',
}),
require("neotest-plenary"),
},
})
require("dapui").setup({
layouts = {
{
elements = {
-- Elements can be strings or table with id and size keys.
{ id = "scopes", size = 0.25 },
"breakpoints",
"watches",
},
size = 40, -- 40 columns
position = "right",
}
},
})
require("nvim-dap-virtual-text").setup()
require("coverage").setup({
commands = true, -- create commands
highlights = {
-- customize highlight groups created by the plugin
covered = { fg = "#C3E88D" }, -- supports style, fg, bg, sp (see :h highlight-gui)
uncovered = { fg = "#F07178" },
},
signs = {
-- use your own highlight groups or text markers
covered = { hl = "CoverageCovered", text = "" },
uncovered = { hl = "CoverageUncovered", text = "" },
},
summary = {
-- customize the summary pop-up
min_coverage = 80.0, -- minimum coverage threshold (used for highlighting)
},
lang = {
-- customize language specific settings
},
})
require("rest-nvim").setup({
-- Open request results in a horizontal split
result_split_horizontal = false,
-- Keep the http file buffer above|left when split horizontal|vertical
result_split_in_place = true,
-- Skip SSL verification, useful for unknown certificates
skip_ssl_verification = false,
-- Encode URL before making request
encode_url = true,
-- Highlight request on run
highlight = {
enabled = true,
timeout = 150,
},
result = {
-- toggle showing URL, HTTP info, headers at top the of result window
show_url = true,
show_http_info = true,
show_headers = true,
-- executables or functions for formatting response body [optional]
-- set them to false if you want to disable them
formatters = {
json = "jq",
html = function(body)
return vim.fn.system({"tidy", "-i", "-q", "-"}, body)
end
},
},
-- Jump to request line on run
jump_to_request = false,
env_file = '.env',
custom_dynamic_variables = {},
yank_dry_run = true,
})