finished setting up vimspector

This commit is contained in:
Andy Teijelo 2022-10-16 14:18:21 -04:00
parent cc14667dc8
commit 1b5fdb9724
9 changed files with 86 additions and 26 deletions

View file

@ -1,9 +1,11 @@
-- keep these above
require "user.options" require "user.options"
require "user.keymaps" require "user.keymaps"
require "user.plugins" require "user.plugins"
--require "user.alpha"
require "user.autocommands" require "user.autocommands"
require "user.colorscheme" require "user.colorscheme"
require "user.exrc"
require "user.cmp" require "user.cmp"
require "user.telescope" require "user.telescope"
require "user.gitsigns" require "user.gitsigns"
@ -18,6 +20,9 @@ require "user.project"
require "user.impatient" require "user.impatient"
require "user.illuminate" require "user.illuminate"
require "user.indentline" require "user.indentline"
require "user.alpha"
require "user.lsp" require "user.lsp"
require "user.dap" --require "user.dap"
require "user.exrc"
--require "user.rust-tools"
require "user.vimspector"

View file

@ -1,10 +1,16 @@
--require("catppuccin").setup() --require("catppuccin").setup()
--vim.cmd [[colorscheme catppuccin]] --vim.cmd [[colorscheme catppuccin]]
--TokyonNight
--local colorscheme = "tokyonight-night" --local colorscheme = "tokyonight-night"
--Catppuccin
vim.g.catppuccin_flavour = "mocha" -- latte, frappe, macchiato, mocha vim.g.catppuccin_flavour = "mocha" -- latte, frappe, macchiato, mocha
local colorscheme = "catppuccin" local colorscheme = "catppuccin"
--DarkPlus
--local colorscheme = "darkplus"
local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
if not status_ok then if not status_ok then
return return

View file

@ -35,7 +35,7 @@ dapui.setup {
}, },
} }
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" }) vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" })
dap.listeners.after.event_initialized["dapui_config"] = function() dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open() dapui.open()
@ -48,3 +48,16 @@ end
dap.listeners.before.event_exited["dapui_config"] = function() dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close() dapui.close()
end end
local codelldb_path = "/usr/lib/codelldb/adapter/codelldb"
local liblldb_path = "/usr/lib/codelldb/adapter/libcodelldb.so"
dap.adapters.codelldb = {
type = 'server',
host = '127.0.0.1',
port = "13000",
executable = {
command = codelldb_path,
args = {"--liblldb", liblldb_path, "--port", "13000"},
}
}

View file

@ -45,6 +45,7 @@ keymap("n", "<leader>h", "<cmd>nohlsearch<CR>", opts)
-- Close buffers -- Close buffers
keymap("n", "<S-q>", "<cmd>Bdelete<CR>", opts) keymap("n", "<S-q>", "<cmd>Bdelete<CR>", opts)
keymap("n", "<S-q>", "<cmd>Bdelete!<CR>", opts)
-- Better paste -- Better paste
keymap("v", "p", '"_dP', opts) keymap("v", "p", '"_dP', opts)
@ -76,13 +77,30 @@ keymap("n", "<leader>fb", ":Telescope buffers<CR>", opts)
keymap("n", "<leader>/", "<cmd>lua require('Comment.api').toggle_current_linewise()<CR>", opts) keymap("n", "<leader>/", "<cmd>lua require('Comment.api').toggle_current_linewise()<CR>", opts)
keymap("x", "<leader>/", '<ESC><CMD>lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())<CR>') keymap("x", "<leader>/", '<ESC><CMD>lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())<CR>')
-- DAP ---- DAP
keymap("n", "<leader>db", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", opts) --keymap("n", "<F9>", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", opts)
keymap("n", "<leader>dc", "<cmd>lua require'dap'.continue()<cr>", opts) --keymap("n", "<F5>", "<cmd>lua require'dap'.continue()<cr>", opts)
keymap("n", "<leader>di", "<cmd>lua require'dap'.step_into()<cr>", opts) --keymap("n", "<F10>", "<cmd>lua require'dap'.step_over()<cr>", opts)
keymap("n", "<leader>do", "<cmd>lua require'dap'.step_over()<cr>", opts) --keymap("n", "<F11>", "<cmd>lua require'dap'.step_into()<cr>", opts)
keymap("n", "<leader>dO", "<cmd>lua require'dap'.step_out()<cr>", opts) --keymap("n", "<F23>", "<cmd>lua require'dap'.step_out()<cr>", opts)
keymap("n", "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", opts) --keymap("n", "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", opts)
keymap("n", "<leader>dl", "<cmd>lua require'dap'.run_last()<cr>", opts) --keymap("n", "<leader>dl", "<cmd>lua require'dap'.run_last()<cr>", opts)
keymap("n", "<leader>du", "<cmd>lua require'dapui'.toggle()<cr>", opts) --keymap("n", "<leader>du", "<cmd>lua require'dapui'.toggle()<cr>", opts)
keymap("n", "<leader>dt", "<cmd>lua require'dap'.terminate()<cr>", opts) --keymap("n", "<F17>", "<cmd>lua require'dap'.terminate()<cr>", opts)
-- Vimspector
keymap("n", "<F9>", "<Plug>VimspectorToggleBreakpoint", opts)
keymap("n", "<F5>", "<plug>VimspectorContinue", opts)
keymap("n", "<F10>", "<Plug>VimspectorStepOver", opts)
keymap("n", "<F11>", "<Plug>VimspectorStepInto", opts)
keymap("n", "<F23>", "<Plug>VimspectorStepOut", opts)
keymap("n", "<F17>", "<cmd>VimspectorReset<cr>", opts) -- Shift+F5
keymap("n", "<F41>", "<Plug>VimspectorRestart", opts) -- Ctrl+Shift+F5
keymap("n", "<leader>di", "<Plug>VimspectorBalloonEval", opts)
--keymap("n", "<leader>dl", "<cmd>lua require'dap'.run_last()<cr>", opts)
--keymap("n", "<leader>du", "<cmd>lua require'dapui'.toggle()<cr>", opts)
--keymap("n", "<F17>", "<cmd>lua require'dap'.terminate()<cr>", opts)
keymap("n", "<leader>bf", vim.lsp.buf.format, opts) -- Shift+F5
keymap("v", "<leader>bf", vim.lsp.buf.format, opts) -- Shift+F5

View file

@ -23,7 +23,7 @@ M.setup = function()
end end
local config = { local config = {
virtual_text = false, -- disable virtual text virtual_text = true, -- disable virtual text
signs = { signs = {
active = signs, -- show signs active = signs, -- show signs
}, },

View file

@ -2,7 +2,7 @@ return {
settings = { settings = {
python = { python = {
analysis = { analysis = {
typeCheckingMode = "off", typeCheckingMode = "on",
}, },
}, },
}, },

View file

@ -6,8 +6,8 @@ return {
}, },
workspace = { workspace = {
library = { library = {
[vim.fn.expand "$VIMRUNTIME/lua"] = true, [vim.fn.expand "$VIMRUNTIME/lua"] = false,
[vim.fn.stdpath "config" .. "/lua"] = true, [vim.fn.stdpath "config" .. "/lua"] = false,
}, },
}, },
telemetry = { telemetry = {

View file

@ -93,16 +93,24 @@ return packer.startup(function(use)
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
commit = "8e763332b7bf7b3a426fd8707b7f5aa85823a5ac", commit = "8e763332b7bf7b3a426fd8707b7f5aa85823a5ac",
} }
use {
"nvim-treesitter/nvim-treesitter-context",
commit = "2f9f75d33158c0289c70cc1e0975af9d36ec16b2",
}
-- Git -- Git
use { "lewis6991/gitsigns.nvim", commit = "f98c85e7c3d65a51f45863a34feb4849c82f240f" } use { "lewis6991/gitsigns.nvim", commit = "f98c85e7c3d65a51f45863a34feb4849c82f240f" }
-- DAP ---- DAP
use { "mfussenegger/nvim-dap", commit = "014ebd53612cfd42ac8c131e6cec7c194572f21d" } --use { "mfussenegger/nvim-dap", commit = "014ebd53612cfd42ac8c131e6cec7c194572f21d" }
use { "rcarriga/nvim-dap-ui", commit = "d76d6594374fb54abf2d94d6a320f3fd6e9bb2f7" } --use { "rcarriga/nvim-dap-ui", commit = "d76d6594374fb54abf2d94d6a320f3fd6e9bb2f7" }
use { "ravenxrz/DAPInstall.nvim", commit = "8798b4c36d33723e7bba6ed6e2c202f84bb300de" } --use { "ravenxrz/DAPInstall.nvim", commit = "8798b4c36d33723e7bba6ed6e2c202f84bb300de" }
use { "MunifTanjim/exrc.nvim" } use { "MunifTanjim/exrc.nvim" }
use { "simrat39/rust-tools.nvim" }
-- VimSpector
use { "puremourning/vimspector" }
-- Automatically set up your configuration after cloning packer.nvim -- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins -- Put this at the end after all plugins

View file

@ -1,9 +1,10 @@
local status_ok, treesitter = pcall(require, "nvim-treesitter") local status_ok, _ = pcall(require, "nvim-treesitter")
if not status_ok then if not status_ok then
return return
end end
local status_ok, configs = pcall(require, "nvim-treesitter.configs") local configs
status_ok, configs = pcall(require, "nvim-treesitter.configs")
if not status_ok then if not status_ok then
return return
end end
@ -13,8 +14,8 @@ configs.setup({
-- ensure_installed = "all", -- one of "all" or a list of languages -- ensure_installed = "all", -- one of "all" or a list of languages
ignore_install = { "" }, -- List of parsers to ignore installing ignore_install = { "" }, -- List of parsers to ignore installing
sync_install = false, -- install languages synchronously (only applied to `ensure_installed`) sync_install = false, -- install languages synchronously (only applied to `ensure_installed`)
highlight = { highlight = {
enable = true, -- false will disable the whole extension enable = true, -- false will disable the whole extension
disable = { "css" }, -- list of language that will be disabled disable = { "css" }, -- list of language that will be disabled
}, },
@ -29,3 +30,12 @@ configs.setup({
}, },
}) })
local context
status_ok, context = pcall(require, "nvim-treesitter.context")
if not status_ok then
return
end
context.setup({})