Compare commits

..

23 Commits

Author SHA1 Message Date
08f3141e55 [LSP] Add sourcekit lsp for swift 2025-10-11 10:09:08 +02:00
9a3cad7676 [Keybinds] Add back old move keybind in insert mode (didn't conflict) 2025-10-10 15:11:51 +02:00
3c08b71cfe [Snippets] Add newly added snippets 2025-10-09 21:17:14 +02:00
b3e4c31aad [Keybinds] Improve 2025-10-09 14:49:21 +02:00
bf0c7e74ec [DAP] Improve 2025-10-09 14:28:14 +02:00
6a3d24579a [Telescope] Change display mode 2025-10-08 17:10:36 +02:00
97f5c451c7 [Telescope] Change matcher for recent files to fuzzy 2025-10-04 09:49:56 +02:00
ac7e7fc197 [Telescope] Actually fix it 2025-10-04 09:39:21 +02:00
2875a311cf [Telescope] Fix issue with frecency 2025-10-04 09:36:24 +02:00
4c5aaeec97 [Telescope] Add more plugins 2025-10-04 09:32:53 +02:00
5cd1cc63e5 [Telescope] Add frencency 2025-10-04 09:09:09 +02:00
3fdc493641 [None] Make prettier suck a bit less 2025-10-02 16:41:24 +02:00
211cdea5cd [Install] Improve script 2025-10-02 14:37:25 +02:00
1da6f1431e [LSP] move two plugins to more appropriate folders 2025-10-02 14:37:18 +02:00
21e93b2988 [Telescope] Fix overlapping binds 2025-09-26 14:53:53 +02:00
5eeee9f056 [Keybinds] Fix relative number keybind 2025-09-25 16:30:32 +02:00
1c20ea868f [TODO] Add telescope bind 2025-09-25 14:58:16 +02:00
a38dd3ff97 [TODO] Add todo comments plugin 2025-09-25 14:52:47 +02:00
8481801323 [NullLS] Move formatting for C here 2025-09-25 14:45:08 +02:00
b3ebc1328f [Telescope] Improve keybinds 2025-09-25 08:15:32 +02:00
d802bb28e7 [Clean] Make it also clean pager 2025-09-23 08:45:56 +02:00
efd2fc5a58 [Colors] Make a bit brighter 2025-09-23 08:41:21 +02:00
41e92f3aac [Pager] Add specific lazy conf 2025-09-16 17:24:51 +02:00
18 changed files with 320 additions and 89 deletions

23
lazy-conf-pager.lua Normal file
View File

@@ -0,0 +1,23 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
{ import = "plugins.nav" },
{ import = "plugins.style" },
{ import = "plugins.util" },
},
change_detection = {
notify = false, -- dont notify when plugins are changed
},
})

View File

@@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
git pull git pull
rm -rf ~/.local/share/nvim/ rm -rf ~/.local/share/nvim*/
rm -rf ~/.local/state/nvim/ rm -rf ~/.local/state/nvim*/
rm -rf ~/.cache/nvim/ rm -rf ~/.cache/nvim*/
# Re-Install configs to clean out lazy-lock and all other residue # Re-Install configs to clean out lazy-lock and all other residue
./nvim-install.sh ./nvim-install.sh

View File

@@ -1,12 +1,29 @@
# ┌ ┐
# │ Configure nvim itself │
# └ ┘
rm -rf ~/.config/nvim rm -rf ~/.config/nvim
mkdir ~/.config/nvim mkdir ~/.config/nvim
cp -r ./nvim/* ~/.config/nvim/ cp -r ./nvim/* ~/.config/nvim/
# ┌ ┐
# │ Configure pager │
# └ ┘
rm -rf ~/.config/nvimpager/ rm -rf ~/.config/nvimpager/
mkdir ~/.config/nvimpager mkdir ~/.config/nvimpager
cp -r ./nvim/* ~/.config/nvimpager/ cp -r ./nvim/* ~/.config/nvimpager/
cp ./lazy-conf-pager.lua ~/.config/nvimpager/lua/lazy-conf.lua
# Remove unnecessary configs from pager
cd ~/.config/nvimpager/ cd ~/.config/nvimpager/
rm -rf ./lua/plugins/lsp rm -rf ./lua/plugins/lsp
rm -rf ./lua/plugins/testing rm -rf ./lua/plugins/testing
rm -rf ./ftplugin rm -rf ./ftplugin
# Remove specific plugins
rm -rf ./lua/plugins/nav/neotree.lua
rm -rf ./lua/plugins/nav/toggleterm.lua
rm -rf ./lua/plugins/style/startup.lua
rm -rf ./lua/plugins/util/colour-picker.lua
rm -rf ./lua/plugins/util/markdown-preview.lua
rm -rf ./lua/plugins/util/neogen.lua

View File

@@ -10,30 +10,16 @@ else
keymap.set("n", "<leader>W", ":lua require('utils').sudo_write()<CR>", opts("sudo write file")) keymap.set("n", "<leader>W", ":lua require('utils').sudo_write()<CR>", opts("sudo write file"))
end end
-- Handy VSCode Shortcuts
-- Move lines up and down -- Move lines up and down
vim.api.nvim_set_keymap("n", "<A-Up>", ":m .-2<CR>==", { noremap = true, silent = true }) vim.api.nvim_set_keymap("n", "<A-S-k>", "<Esc>:m .-2<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<A-Down>", ":m .+1<CR>==", { noremap = true, silent = true }) vim.api.nvim_set_keymap("n", "<A-S-j>", "<Esc>:m .+1<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<A-k>", "<Esc>:m .-2<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<A-j>", "<Esc>:m .+1<CR>", { noremap = true, silent = true })
-- Move lines in insert mode -- Move lines in insert mode
vim.api.nvim_set_keymap("i", "<A-Up>", "<Esc>:m .-2<CR>i", { noremap = true, silent = true })
vim.api.nvim_set_keymap("i", "<A-Down>", "<Esc>:m .+1<CR>i", { noremap = true, silent = true })
vim.api.nvim_set_keymap("i", "<A-k>", "<Esc>:m .-2<CR>i", { noremap = true, silent = true }) vim.api.nvim_set_keymap("i", "<A-k>", "<Esc>:m .-2<CR>i", { noremap = true, silent = true })
vim.api.nvim_set_keymap("i", "<A-j>", "<Esc>:m .+1<CR>i", { noremap = true, silent = true }) vim.api.nvim_set_keymap("i", "<A-j>", "<Esc>:m .+1<CR>i", { noremap = true, silent = true })
vim.api.nvim_set_keymap("i", "<A-S-k>", "<Esc>:m .-2<CR>i", { noremap = true, silent = true })
vim.api.nvim_set_keymap("i", "<A-S-j>", "<Esc>:m .+1<CR>i", { noremap = true, silent = true })
-- Copy lines up and down in normal mode
vim.api.nvim_set_keymap("n", "<C-A-S-Up>", ":t .-1<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<C-A-S-Down>", ":t .-1<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<C-A-S-k>", ":t .-1<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<C-A-S-j>", ":t .<CR>", { noremap = true, silent = true })
-- Copy lines up and down in insert mode
vim.api.nvim_set_keymap("i", "<C-A-S-Up>", "<Esc>:t.-1<CR>i", { noremap = true, silent = true })
vim.api.nvim_set_keymap("i", "<C-A-S-Down>", "<Esc>:t.<CR>i", { noremap = true, silent = true })
vim.api.nvim_set_keymap("i", "<C-A-S-k>", "<Esc>:t.-1<CR>i", { noremap = true, silent = true })
vim.api.nvim_set_keymap("i", "<C-A-S-j>", "<Esc>:t.<CR>i", { noremap = true, silent = true })
-- Keep selection in visual mode when indenting -- Keep selection in visual mode when indenting
vim.api.nvim_set_keymap("v", "<", "<gv", { noremap = true, silent = true }) vim.api.nvim_set_keymap("v", "<", "<gv", { noremap = true, silent = true })
@@ -61,10 +47,10 @@ keymap.set("n", "<leader><leader>m", ":MarkdownPreview<CR>", opts("Preview Markd
-- window navigation -- window navigation
keymap.set("n", "<A-h>", "<C-w>h", opts()) keymap.set("n", "<A-h>", "<C-w>h", opts())
keymap.set("n", "<A-S-j>", "<C-w>j", opts()) keymap.set("n", "<A-j>", "<C-w>j", opts())
keymap.set("n", "<A-S-k>", "<C-w>k", opts()) keymap.set("n", "<A-k>", "<C-w>k", opts())
keymap.set("n", "<A-l>", "<C-w>l", opts()) keymap.set("n", "<A-l>", "<C-w>l", opts())
keymap.set("n", "<C-k>", "<C-w>w", opts()) keymap.set("n", "<C-S-w>", "<C-w>w", opts())
-- window resize -- window resize
keymap.set("n", "<A-C-h>", ":vertical resize +2<CR>", opts("Resize horizontally right")) keymap.set("n", "<A-C-h>", ":vertical resize +2<CR>", opts("Resize horizontally right"))
@@ -141,6 +127,6 @@ keymap.set("n", "<leader>wk", ":WhichKey<CR>", opts("Toggle WhichKey"))
keymap.set( keymap.set(
"n", "n",
"<leader>.", "<leader>.",
":lua vim.wo.relativenumber = not vim.wo.relativenumber", ":lua vim.wo.relativenumber = not vim.wo.relativenumber<CR>",
opts("Toggle relative line numbers") opts("Toggle relative line numbers")
) )

View File

@@ -14,6 +14,7 @@ vim.opt.rtp:prepend(lazypath)
require("lazy").setup({ require("lazy").setup({
spec = { spec = {
{ import = "plugins.nav" }, { import = "plugins.nav" },
{ import = "plugins.nav.telescope" },
{ import = "plugins.lsp" }, { import = "plugins.lsp" },
{ import = "plugins.style" }, { import = "plugins.style" },
{ import = "plugins.util" }, { import = "plugins.util" },

View File

@@ -3,8 +3,7 @@
-- └ ┘ -- └ ┘
local lsp = vim.lsp local lsp = vim.lsp
local capabilities = require("lsp-options").capabilities local opts = require("lsp-options")
local on_attach = require("lsp-options").on_attach
lsp.config("clangd", { lsp.config("clangd", {
cmd = { cmd = {
@@ -13,16 +12,23 @@ lsp.config("clangd", {
"--clang-tidy", "--clang-tidy",
}, },
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto", "ino" }, filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto", "ino" },
capabilities = capabilities, capabilities = opts.capabilities,
on_attach = on_attach, on_attach = opts.on_attach_no_formatting,
}) })
lsp.config("cmake", { lsp.config("cmake", {
capabilities = capabilities, capabilities = opts.capabilities,
on_attach = on_attach, on_attach = opts.on_attach,
})
lsp.config("sourcekit", {
capabilities = opts.capabilities,
on_attach = opts.on_attach,
filetypes = { "swift" }
}) })
-- ── Enable configs ─────────────────────────────────────────────── -- ── Enable configs ───────────────────────────────────────────────
local enable = vim.lsp.enable local enable = vim.lsp.enable
enable("clangd") enable("clangd")
enable("cmake") enable("cmake")
enable("sourcekit")

View File

@@ -29,17 +29,18 @@ return {
"bashls", "bashls",
"clangd", "clangd",
"cmake", "cmake",
-- "cssls", "cssls",
"gopls", "gopls",
"html-lsp",
"hyprls", "hyprls",
"jdtls", "jdtls",
"latexindent", "latexindent",
"marksman", "marksman",
-- "lua_ls", "lua_ls",
-- "pyright", "pyright",
"rust_analyzer", "rust_analyzer",
"ruby_lsp", "ruby_lsp",
-- "ts_ls", "ts_ls",
"vue_ls", "vue_ls",
"verible", "verible",
}, },

View File

@@ -30,6 +30,8 @@ return {
"4", "4",
"--bracket-spacing", "--bracket-spacing",
"true", "true",
"--bracket-same-line",
"true",
"--arrow-parens", "--arrow-parens",
"avoid", "avoid",
"--jsx-single-quote", "--jsx-single-quote",
@@ -40,6 +42,8 @@ return {
"false", "false",
"--single-quote", "--single-quote",
"true", "true",
"--single-attribute-per-line",
"true",
"--bracket-same-line", "--bracket-same-line",
"true", "true",
"--vue-indent-script-and-style", "--vue-indent-script-and-style",
@@ -53,6 +57,7 @@ return {
require("none-ls.code_actions.eslint_d"), require("none-ls.code_actions.eslint_d"),
require("none-ls.formatting.eslint_d"), require("none-ls.formatting.eslint_d"),
null_ls.builtins.formatting.black, null_ls.builtins.formatting.black,
null_ls.builtins.formatting.clang_format
}, },
}) })
end, end,

View File

@@ -0,0 +1,8 @@
return {
"nvim-telescope/telescope-frecency.nvim",
-- install the latest stable version
version = "*",
config = function()
require("telescope").load_extension("frecency")
end,
}

View File

@@ -3,13 +3,21 @@ return {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
{
"nvim-telescope/telescope-live-grep-args.nvim",
-- This will not install any breaking changes.
-- For major updates, this must be adjusted manually.
version = "^1.0.0",
},
}, },
config = function() config = function()
local builtin = require("telescope.builtin") local builtin = require("telescope.builtin")
local actions = require("telescope.actions") local actions = require("telescope.actions")
local opts = { silent = true } local opts = { silent = true }
local telescope = require("telescope")
local lga_actions = require("telescope-live-grep-args.actions")
require("telescope").setup({ telescope.setup({
defaults = { defaults = {
mappings = { mappings = {
i = { i = {
@@ -17,16 +25,32 @@ return {
["<C-k>"] = actions.move_selection_previous, ["<C-k>"] = actions.move_selection_previous,
["<C-q>"] = actions.smart_add_to_qflist, ["<C-q>"] = actions.smart_add_to_qflist,
["<C-A-q>"] = actions.smart_send_to_qflist, ["<C-A-q>"] = actions.smart_send_to_qflist,
["<C-Space>"] = lga_actions.quote_prompt(),
}, },
}, },
path_display = { "truncate" },
},
extensions = {
frecency = {
db_safe_mode = false,
matcher = "fuzzy"
},
}, },
}) })
telescope.load_extension("live_grep_args")
opts.desc = "telescope find files" opts.desc = "telescope find files"
vim.keymap.set("n", "<leader>ff", builtin.find_files, opts) vim.keymap.set("n", "<leader>ff", builtin.find_files, opts)
opts.desc = "telescope live grep" opts.desc = "telescope live grep"
vim.keymap.set("n", "<leader>fg", builtin.live_grep, opts) vim.keymap.set("n", "<leader>flg", builtin.live_grep, opts)
opts.desc = "telescope live grep args"
local function start_live_grep_args()
telescope.extensions.live_grep_args.live_grep_args()
end
vim.keymap.set("n", "<leader>fg", start_live_grep_args, opts)
opts.desc = "telescope buffers" opts.desc = "telescope buffers"
vim.keymap.set("n", "<leader>fb", builtin.buffers, opts) vim.keymap.set("n", "<leader>fb", builtin.buffers, opts)
@@ -34,17 +58,40 @@ return {
opts.desc = "Show nvim functions" opts.desc = "Show nvim functions"
vim.keymap.set("n", "<leader>fh", builtin.help_tags, opts) vim.keymap.set("n", "<leader>fh", builtin.help_tags, opts)
opts.desc = "Telescope TODOs"
vim.keymap.set("n", "<leader>ft", ":TodoTelescope<CR>", opts)
-- Git
opts.desc = "Show git diff"
vim.keymap.set("n", "<leader>fld", builtin.git_status, opts)
opts.desc = "Show git commits"
vim.keymap.set("n", "<leader>flc", builtin.git_commits, opts)
opts.desc = "Show git files"
vim.keymap.set("n", "<leader>flf", builtin.git_files, opts)
-- Recent Commands -- Recent Commands
opts.desc = "Show recent commands" opts.desc = "Show recent commands"
vim.keymap.set("n", "<leader>frc", ":Telescope command_history<CR>", opts) vim.keymap.set("n", "<leader>foc", ":Telescope command_history<CR>", opts)
-- Recent Searches -- Recent Searches
opts.desc = "Show recent searches" opts.desc = "Show recent searches"
vim.keymap.set("n", "<leader>frs", ":Telescope search_history<CR>", opts) vim.keymap.set("n", "<leader>fos", ":Telescope search_history<CR>", opts)
-- Old Files -- Old Files
opts.desc = "Show recent files" opts.desc = "Show recent files"
vim.keymap.set("n", "<leader>frf", ":Telescope oldfiles<CR>", opts) vim.keymap.set("n", "<leader>fof", builtin.oldfiles, opts)
-- Frecency (Old files, but better)
local function run_frecency()
require("telescope").extensions.frecency.frecency({
workspace = "CWD",
})
end
opts.desc = "Show recent files (Frecency algorithm)"
vim.keymap.set("n", "<leader>fr", run_frecency, opts)
-- Quickfix Items -- Quickfix Items
opts.desc = "Show quickfix items" opts.desc = "Show quickfix items"

View File

@@ -21,7 +21,7 @@ return {
gray = Shade.new("#505050", 0.15, -0.15), gray = Shade.new("#505050", 0.15, -0.15),
white = Shade.new("#dee4df", 0.15, -0.15), white = Shade.new("#dee4df", 0.15, -0.15),
red = Shade.new("#ff6060", 0.15, -0.15), red = Shade.new("#ff6060", 0.15, -0.15),
darkred = Shade.new("#903030", 0.15, -0.15), darkred = Shade.new("#AA3030", 0.15, -0.15),
strongred = Shade.new("#bb0000", 0.15, -0.15), strongred = Shade.new("#bb0000", 0.15, -0.15),
orange = Shade.new("#ce8c14", 0.15, -0.15), orange = Shade.new("#ce8c14", 0.15, -0.15),
green = Shade.new("#a3d397", 0.10, -0.15), green = Shade.new("#a3d397", 0.10, -0.15),
@@ -36,7 +36,7 @@ return {
cyan = Shade.new("#7ac9ff", 0.15, -0.15), cyan = Shade.new("#7ac9ff", 0.15, -0.15),
lightblue = Shade.new("#5c77ff", 0.15, -0.15), lightblue = Shade.new("#5c77ff", 0.15, -0.15),
softblue = Shade.new("#10ddff", 0.15, -0.15), softblue = Shade.new("#10ddff", 0.15, -0.15),
brown = Shade.new("#553200", 0.15, -0.15), brown = Shade.new("#664010", 0.15, -0.15),
bg0 = "#0f1512", -- Dark bg (status line and float) bg0 = "#0f1512", -- Dark bg (status line and float)
bg1 = "#0f1512", -- Default bg bg1 = "#0f1512", -- Default bg

View File

@@ -0,0 +1,70 @@
return {
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
{
signs = true, -- show icons in the signs column
sign_priority = 8, -- sign priority
-- keywords recognized as todo comments
keywords = {
FIX = {
icon = "", -- icon used for the sign, and in search results
color = "error", -- can be a hex color, or a named color (see below)
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
-- signs = false, -- configure signs for some keywords individually
},
TODO = { icon = "", color = "info" },
HACK = { icon = "", color = "warning" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
TEST = { icon = "", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
},
gui_style = {
fg = "NONE", -- The gui style to use for the fg highlight group.
bg = "BOLD", -- The gui style to use for the bg highlight group.
},
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
-- highlighting of the line containing the todo comment
-- * before: highlights before the keyword (typically comment characters)
-- * keyword: highlights of the keyword
-- * after: highlights after the keyword (todo text)
highlight = {
multiline = true, -- enable multine todo comments
multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword
multiline_context = 10, -- extra lines that will be re-evaluated when changing a line
before = "", -- "fg" or "bg" or empty
keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg)
after = "fg", -- "fg" or "bg" or empty
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlighting (vim regex)
comments_only = true, -- uses treesitter to match keywords in comments only
max_line_len = 400, -- ignore lines longer than this
exclude = {}, -- list of file types to exclude highlighting
},
-- list of named colors where we try to extract the guifg from the
-- list of highlight groups or use the hex color if hl not found as a fallback
colors = {
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
info = { "DiagnosticInfo", "#2563EB" },
hint = { "DiagnosticHint", "#10B981" },
default = { "Identifier", "#7C3AED" },
test = { "Identifier", "#FF00FF" },
},
search = {
command = "rg",
args = {
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
},
-- regex that will be used to match keywords.
-- don't replace the (KEYWORDS) placeholder
pattern = [[\b(KEYWORDS):]], -- ripgrep regex
-- pattern = [[\b(KEYWORDS)\b]], -- match without the extra colon. You'll likely get false positives
},
},
},
}

View File

@@ -58,52 +58,7 @@ return {
{ text = "", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" } { text = "", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" }
) )
dap.configurations.python = { require("plugins.testing.debuggers.python")
{ require("plugins.testing.debuggers.gdb")
type = "python",
request = "launch",
name = "Launch file",
-- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options
program = "${file}", -- This configuration will launch the current file if used.
pythonPath = function()
local cwd = vim.fn.getcwd()
if vim.fn.executable(cwd .. "/venv/bin/python") == 1 then
return cwd .. "/venv/bin/python"
elseif vim.fn.executable(cwd .. "/.venv/bin/python") == 1 then
return cwd .. "/.venv/bin/python"
else
return "/usr/bin/python"
end
end,
},
}
dap.adapters.python = function(cb, config)
if config.request == "attach" then
---@diagnostic disable-next-line: undefined-field
local port = (config.connect or config).port
---@diagnostic disable-next-line: undefined-field
local host = (config.connect or config).host or "127.0.0.1"
cb({
type = "server",
port = assert(port, "`connect.port` is required for a python `attach` configuration"),
host = host,
options = {
source_filetype = "python",
},
})
else
cb({
type = "executable",
command = vim.fn.stdpath("data") .. "/mason/packages/debugpy/venv/bin/python",
args = { "-m", "debugpy.adapter" },
options = {
source_filetype = "python",
},
})
end
end
end, end,
} }

View File

@@ -0,0 +1,46 @@
local dap = require("dap")
dap.adapters.gdb = {
type = "executable",
command = "gdb",
args = { "--interpreter=dap", "--eval-command", "set print pretty on" },
}
dap.configurations.c = {
{
name = "Launch",
type = "gdb",
request = "launch",
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
args = {}, -- provide arguments if needed
cwd = "${workspaceFolder}",
stopAtBeginningOfMainSubprogram = false,
},
{
name = "Select and attach to process",
type = "gdb",
request = "attach",
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
pid = function()
local name = vim.fn.input("Executable name (filter): ")
return require("dap.utils").pick_process({ filter = name })
end,
cwd = "${workspaceFolder}",
},
{
name = "Attach to gdbserver :1234",
type = "gdb",
request = "attach",
target = "localhost:1234",
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
cwd = "${workspaceFolder}",
},
}
dap.configurations.cpp = dap.configurations.c
dap.configurations.rust = dap.configurations.c

View File

@@ -0,0 +1,48 @@
local dap = require("dap")
dap.configurations.python = {
{
type = "python",
request = "launch",
name = "Launch file",
-- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options
program = "${file}", -- This configuration will launch the current file if used.
pythonPath = function()
local cwd = vim.fn.getcwd()
if vim.fn.executable(cwd .. "/venv/bin/python") == 1 then
return cwd .. "/venv/bin/python"
elseif vim.fn.executable(cwd .. "/.venv/bin/python") == 1 then
return cwd .. "/.venv/bin/python"
else
return "/usr/bin/python"
end
end,
},
}
dap.adapters.python = function(cb, config)
if config.request == "attach" then
---@diagnostic disable-next-line: undefined-field
local port = (config.connect or config).port
---@diagnostic disable-next-line: undefined-field
local host = (config.connect or config).host or "127.0.0.1"
cb({
type = "server",
port = assert(port, "`connect.port` is required for a python `attach` configuration"),
host = host,
options = {
source_filetype = "python",
},
})
else
cb({
type = "executable",
command = vim.fn.stdpath("data") .. "/mason/packages/debugpy/venv/bin/python",
args = { "-m", "debugpy.adapter" },
options = {
source_filetype = "python",
},
})
end
end

View File

@@ -53,6 +53,15 @@
}, },
"Important Remarks": { "Important Remarks": {
"prefix": "remarks", "prefix": "remarks",
"body": [
"\\begin{remark}[]{$1}",
"\t$2",
"\\end{remark}"
],
"description": "Inserts a tcolorbox to provide remarks (green), but here numbered"
},
"Remark (numbered)": {
"prefix": "remark",
"body": [ "body": [
"\\begin{remarks}[]{$1}", "\\begin{remarks}[]{$1}",
"\t$2", "\t$2",
@@ -87,6 +96,15 @@
], ],
"description": "Inserts a tcolorbox to inform about restrictions" "description": "Inserts a tcolorbox to inform about restrictions"
}, },
"Intuition": {
"prefix": "restrictions",
"body": [
"\\begin{intuition}[]{$1}",
"\t$2",
"\\end{intuition}"
],
"description": "Tcolorbox to highlight sections about intuition"
},
"Limitations": { "Limitations": {
"prefix": "limitations", "prefix": "limitations",
"body": [ "body": [