Better ansible support, dap

This commit is contained in:
Price Hiller 2022-01-03 11:42:25 -06:00
parent 0c78f3ca77
commit 2803dcf4d5
5 changed files with 39 additions and 25 deletions

View File

@ -16,16 +16,21 @@ lsp_installer.on_server_ready(function(server)
-- https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb
--
-- locate it with `find ~/ -name `
-- local extension_path = os.getenv("HOME") .. ".vscode/extensions/vadimcn.vscode-lldb-1.6.10/"
-- local extension_path = "/Users/pricehiller/.vscode/extensions/vadimcn.vscode-lldb-1.6.10/"
-- local codelldb_path = extension_path .. 'adapter/codelldb'
-- local liblldb_path = extension_path .. 'lldb/lib/'
-- opts.dap = {
-- adapter = require('rust-tools.dap').get_codelldb_adapter(codelldb_path, liblldb_path)
-- }
require("rust-tools").setup{
local rustopts = {
server = vim.tbl_deep_extend("force", server:get_default_options(), opts, {}),
-- dap = {
-- adapter = require('rust-tools.dap').get_codelldb_adapter(
-- codelldb_path, liblldb_path)
-- },
tools = {
server = vim.tbl_deep_extend("force", server:get_default_options(), opts),
hover_actions = { auto_focus = true }
}
}
require("rust-tools").setup(rustopts)
server:attach_buffers()
else
-- I use ansible a lot, define exceptions for servers that can use

View File

@ -57,6 +57,7 @@ map("n", "<Leader>th", ":Telescope help_tags<CR>")
map("n", "<Leader>to", ":Telescope oldfiles<CR>")
map("n", "<Leader>tt", ":Telescope treesitter<CR>")
map("n", "<leader>tc", ":Telescope neoclip default<CR>")
map("n", "<leader>tr", ":Telescope registers<CR>")
-- Lsp
@ -73,6 +74,7 @@ map("n", "<leader>lT", ":lua vim.lsp.buf.type_definition()<CR>", lsp_opts)
map("n", "<leader>ln", ":lua vim.lsp.buf.rename()<CR>", lsp_opts)
map("n", "<leader>lc", ":lua vim.lsp.buf.code_action()<CR>", lsp_opts)
map("n", "<leader>lr", ":lua vim.lsp.buf.references()<CR>", lsp_opts)
map("n", "<leader>lf", ":lua vim.lsp.buf.formatting()<CR>", lsp_opts)
map("n", "[", ":lua vim.lsp.diagnostic.goto_prev()<CR>", lsp_opts)
map("n", "]", ":lua vim.lsp.diagnostic.goto_next()<CR>", lsp_opts)
map("n", "<leader>lq", ":Telescope diagnostics bufnr=0<CR>", lsp_opts)

View File

@ -174,6 +174,8 @@ return require("packer").startup({function()
require("plugins/lspconfig")
end
}
use {
"williamboman/nvim-lsp-installer",
after = "nvim-lspconfig",
@ -184,8 +186,12 @@ return require("packer").startup({function()
use {
"simrat39/rust-tools.nvim",
after = "nvim-lspconfig"
after = "nvim-lspconfig",
config = function()
require("rust-tools").setup({})
end
}
use {
"rafamadriz/friendly-snippets",
event = "InsertEnter"
@ -195,7 +201,7 @@ return require("packer").startup({function()
use {
"ray-x/lsp_signature.nvim",
after = "friendly-snippets",
config = function ()
config = function()
require("lsp_signature").setup()
end
}
@ -410,6 +416,20 @@ return require("packer").startup({function()
"tpope/vim-surround"
}
use {
"pearofducks/ansible-vim",
config = function()
-- vim.g.ansible_unindent_after_newline = 1
vim.g.ansible_attribute_highlight = "ob"
-- vim.g.ansible_template_syntaxes = { "*.rb.j2": "ruby"
-- "*.bash.j2": "bash",
-- "*.sh.j2": "sh",
-- "*.py.j2": "python3"
-- }
end
}
-- Bootstrap packer if not installed, sync packages
if packer_bootstrap then

View File

@ -1,22 +1,8 @@
local present, dap = pcall(require, "dap")
if not present then
return
end
-- dap-install configurations
local dap_install = require("dap-install")
dap_install.setup {
installation_path = vim.fn.stdpath("data") .. "/dapinstall/",
}
local dap_install = require("dap-install")
local dbg_list = require("dap-install.api.debuggers").get_installed_debuggers()
for _, debugger in ipairs(dbg_list) do
dap_install.config(debugger)
end
-- dap-ui configurations
require("dapui").setup({})

View File

@ -7,13 +7,14 @@ nvim_treesitter.setup {
highlight = {
enable = true,
additional_vim_regex_highlighting = true,
disable = { "yaml" },
},
matchup = {
enable = true,
},
indent = {
disable = { 'yaml' }
},
-- indent = {
-- disable = { 'yaml' }
-- },
autotag = {
enable = true
}