Better ansible support, dap
This commit is contained in:
parent
0c78f3ca77
commit
2803dcf4d5
17
lua/lsp.lua
17
lua/lsp.lua
@ -16,16 +16,21 @@ lsp_installer.on_server_ready(function(server)
|
|||||||
-- https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb
|
-- https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb
|
||||||
--
|
--
|
||||||
-- locate it with `find ~/ -name `
|
-- 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 codelldb_path = extension_path .. 'adapter/codelldb'
|
||||||
-- local liblldb_path = extension_path .. 'lldb/lib/'
|
-- local liblldb_path = extension_path .. 'lldb/lib/'
|
||||||
-- opts.dap = {
|
local rustopts = {
|
||||||
-- adapter = require('rust-tools.dap').get_codelldb_adapter(codelldb_path, liblldb_path)
|
server = vim.tbl_deep_extend("force", server:get_default_options(), opts, {}),
|
||||||
-- }
|
-- dap = {
|
||||||
require("rust-tools").setup{
|
-- 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()
|
server:attach_buffers()
|
||||||
else
|
else
|
||||||
-- I use ansible a lot, define exceptions for servers that can use
|
-- I use ansible a lot, define exceptions for servers that can use
|
||||||
|
@ -57,6 +57,7 @@ map("n", "<Leader>th", ":Telescope help_tags<CR>")
|
|||||||
map("n", "<Leader>to", ":Telescope oldfiles<CR>")
|
map("n", "<Leader>to", ":Telescope oldfiles<CR>")
|
||||||
map("n", "<Leader>tt", ":Telescope treesitter<CR>")
|
map("n", "<Leader>tt", ":Telescope treesitter<CR>")
|
||||||
map("n", "<leader>tc", ":Telescope neoclip default<CR>")
|
map("n", "<leader>tc", ":Telescope neoclip default<CR>")
|
||||||
|
map("n", "<leader>tr", ":Telescope registers<CR>")
|
||||||
|
|
||||||
|
|
||||||
-- Lsp
|
-- 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>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>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>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_prev()<CR>", lsp_opts)
|
||||||
map("n", "]", ":lua vim.lsp.diagnostic.goto_next()<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)
|
map("n", "<leader>lq", ":Telescope diagnostics bufnr=0<CR>", lsp_opts)
|
||||||
|
@ -174,6 +174,8 @@ return require("packer").startup({function()
|
|||||||
require("plugins/lspconfig")
|
require("plugins/lspconfig")
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
use {
|
use {
|
||||||
"williamboman/nvim-lsp-installer",
|
"williamboman/nvim-lsp-installer",
|
||||||
after = "nvim-lspconfig",
|
after = "nvim-lspconfig",
|
||||||
@ -184,8 +186,12 @@ return require("packer").startup({function()
|
|||||||
|
|
||||||
use {
|
use {
|
||||||
"simrat39/rust-tools.nvim",
|
"simrat39/rust-tools.nvim",
|
||||||
after = "nvim-lspconfig"
|
after = "nvim-lspconfig",
|
||||||
|
config = function()
|
||||||
|
require("rust-tools").setup({})
|
||||||
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
use {
|
use {
|
||||||
"rafamadriz/friendly-snippets",
|
"rafamadriz/friendly-snippets",
|
||||||
event = "InsertEnter"
|
event = "InsertEnter"
|
||||||
@ -195,7 +201,7 @@ return require("packer").startup({function()
|
|||||||
use {
|
use {
|
||||||
"ray-x/lsp_signature.nvim",
|
"ray-x/lsp_signature.nvim",
|
||||||
after = "friendly-snippets",
|
after = "friendly-snippets",
|
||||||
config = function ()
|
config = function()
|
||||||
require("lsp_signature").setup()
|
require("lsp_signature").setup()
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
@ -410,6 +416,20 @@ return require("packer").startup({function()
|
|||||||
"tpope/vim-surround"
|
"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
|
-- Bootstrap packer if not installed, sync packages
|
||||||
if packer_bootstrap then
|
if packer_bootstrap then
|
||||||
|
@ -1,22 +1,8 @@
|
|||||||
|
|
||||||
local present, dap = pcall(require, "dap")
|
local present, dap = pcall(require, "dap")
|
||||||
if not present then
|
if not present then
|
||||||
return
|
return
|
||||||
end
|
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
|
-- dap-ui configurations
|
||||||
require("dapui").setup({})
|
require("dapui").setup({})
|
||||||
|
|
||||||
|
@ -7,13 +7,14 @@ nvim_treesitter.setup {
|
|||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
additional_vim_regex_highlighting = true,
|
additional_vim_regex_highlighting = true,
|
||||||
|
disable = { "yaml" },
|
||||||
},
|
},
|
||||||
matchup = {
|
matchup = {
|
||||||
enable = true,
|
enable = true,
|
||||||
},
|
},
|
||||||
indent = {
|
-- indent = {
|
||||||
disable = { 'yaml' }
|
-- disable = { 'yaml' }
|
||||||
},
|
-- },
|
||||||
autotag = {
|
autotag = {
|
||||||
enable = true
|
enable = true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user