Compare commits
25 Commits
30ac9005fc
...
main
Author | SHA1 | Date | |
---|---|---|---|
08f3141e55 | |||
9a3cad7676 | |||
3c08b71cfe | |||
b3e4c31aad | |||
bf0c7e74ec | |||
6a3d24579a | |||
97f5c451c7 | |||
ac7e7fc197 | |||
2875a311cf | |||
4c5aaeec97 | |||
5cd1cc63e5 | |||
3fdc493641 | |||
211cdea5cd | |||
1da6f1431e | |||
21e93b2988 | |||
5eeee9f056 | |||
1c20ea868f | |||
a38dd3ff97 | |||
8481801323 | |||
b3ebc1328f | |||
d802bb28e7 | |||
efd2fc5a58 | |||
41e92f3aac | |||
780253da94 | |||
029072dbd6 |
23
lazy-conf-pager.lua
Normal file
23
lazy-conf-pager.lua
Normal 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
|
||||||
|
},
|
||||||
|
})
|
@@ -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
|
||||||
|
@@ -1,3 +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/
|
||||||
|
mkdir ~/.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/
|
||||||
|
rm -rf ./lua/plugins/lsp
|
||||||
|
rm -rf ./lua/plugins/testing
|
||||||
|
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
|
||||||
|
@@ -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")
|
||||||
)
|
)
|
||||||
|
@@ -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" },
|
||||||
|
@@ -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")
|
||||||
|
@@ -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",
|
||||||
},
|
},
|
||||||
|
@@ -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,
|
||||||
|
8
nvim/lua/plugins/nav/telescope/frecency.lua
Normal file
8
nvim/lua/plugins/nav/telescope/frecency.lua
Normal 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,
|
||||||
|
}
|
@@ -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"
|
@@ -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
|
||||||
|
70
nvim/lua/plugins/style/todo-comments.lua
Normal file
70
nvim/lua/plugins/style/todo-comments.lua
Normal 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
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
@@ -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,
|
||||||
}
|
}
|
||||||
|
46
nvim/lua/plugins/testing/debuggers/gdb.lua
Normal file
46
nvim/lua/plugins/testing/debuggers/gdb.lua
Normal 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
|
48
nvim/lua/plugins/testing/debuggers/python.lua
Normal file
48
nvim/lua/plugins/testing/debuggers/python.lua
Normal 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
|
@@ -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": [
|
||||||
|
Reference in New Issue
Block a user