diff options
author | Raymaekers Luca <luca@spacehb.net> | 2025-04-05 15:02:43 +0200 |
---|---|---|
committer | Raymaekers Luca <luca@spacehb.net> | 2025-04-05 15:20:16 +0200 |
commit | 19423cd7c17edae426c39e01683424089bc8c8c9 (patch) | |
tree | 52d9781a75fe7714392f7a931aece35b5126ede9 /after | |
parent | 7870db20ff0594474daf7cab957cd936d4c246c7 (diff) |
checkpoint
Diffstat (limited to 'after')
-rw-r--r-- | after/plugin/conform.lua | 53 | ||||
-rw-r--r-- | after/plugin/dap.lua | 75 | ||||
-rw-r--r-- | after/plugin/gitsigns.lua | 25 | ||||
-rw-r--r-- | after/plugin/harpoon.lua | 34 | ||||
-rw-r--r-- | after/plugin/mini.lua | 14 | ||||
-rw-r--r-- | after/plugin/telescope.lua | 14 | ||||
-rw-r--r-- | after/plugin/treesitter.lua | 2 |
7 files changed, 16 insertions, 201 deletions
diff --git a/after/plugin/conform.lua b/after/plugin/conform.lua deleted file mode 100644 index 643743f..0000000 --- a/after/plugin/conform.lua +++ /dev/null @@ -1,53 +0,0 @@ -local conform = require("conform") -conform.setup({ - formatters_by_ft = { - lua = { "stylua" }, - -- html = { "prettier" }, - go = { "goimports", "gofmt" }, - }, - format_on_save = { - -- These options will be passed to conform.format() - timeout_ms = 500, - lsp_format = "never", - }, -}) - --- conform.formatters["clang-format"] = { --- prepend_args = { --- "--style", --- "{" --- .. "IndentWidth: 4, " --- .. "AlignAfterOpenBracket: BlockIndent, " --- .. "AlignArrayOfStructures: Right, " --- .. "BreakBeforeBraces: Linux, " --- .. "PointerAlignment: Left," --- .. "AllowShortIfStatementsOnASingleLine: true, " --- .. "AllowShortLoopsOnASingleLine: true, " --- .. "AllowAllArgumentsOnNextLine: true, " --- .. "AllowShortCaseLabelsOnASingleLine: true, " --- .. "AlwaysBreakAfterReturnType: AllDefinitions, " --- .. "ColumnLimit: " --- .. vim.o.tw --- .. "}", --- }, --- } - --- -- ID of autocmd for CFormat --- vim.b.CFormatID = nil --- -- Enable formatting on save for C only when using the :CFormat command --- vim.api.nvim_create_user_command("CFormat", function() --- if vim.b.CFormatID == nil then --- vim.b.CFormatID = vim.api.nvim_create_autocmd("BufWritePre", { --- buffer = 0, --- callback = function() --- conform.format({ formatters = { "clang-format" } }) --- end, --- }) --- conform.format({ formatters = { "clang-format" } }) --- print("Auto formatting enabled.") --- else --- vim.api.nvim_del_autocmd(vim.b.CFormatID) --- print("Auto formatting disabled.") --- vim.b.CFormatID = nil --- end --- end, {}) diff --git a/after/plugin/dap.lua b/after/plugin/dap.lua deleted file mode 100644 index fd141bb..0000000 --- a/after/plugin/dap.lua +++ /dev/null @@ -1,75 +0,0 @@ -local dap = require("dap") -local dapui = require("dapui") -local widgets = require("dap.ui.widgets") -local map = vim.keymap.set - -dapui.setup() --- stylua: ignore start -map("n", " bu", function() dapui.toggle() end, { desc = "Toggle dap-ui" }) -map("n", " bb", function() dap.toggle_breakpoint() end, { desc = "Toggle breakpoint" }) -map("n", " bc", function() dap.continue() end, {desc="Continue"}) -map("n", " bs", function() dap.step_over() end, {desc="Step over"}) -map("n", " bi", function() dap.step_into() end, {desc="Step into"}) -map("n", " bo", function() dap.step_out() end, {desc="Step out"}) -map({ "n", "v" }, " bh", function() widgets.hover() end, {desc="Show hover"}) -map({ "n", "v" }, " bv", function() widgets.preview() end, {desc="Show preview"}) -map("n", " bf", function() widgets.centered_float(widgets.frames) end, {desc="Show frames"}) -map("n", " bp", function() widgets.centered_float(widgets.scopes) end, {desc="Show scopes"}) --- stylua: ignore end -map("n", " bl", function() - dap.set_breakpoint(nil, nil, vim.fn.input("Log point message: ")) -end, { desc = "Break point with log" }) - -dap.adapters.gdb = { - id = "gdb", - type = "executable", - command = "gdb", - args = { "--quiet", "--interpreter=dap" }, -} - -dap.configurations.c = { - { - name = "Run (GDB)", - type = "gdb", - request = "launch", - -- This requires special handling of 'run_last', see - -- https://github.com/mfussenegger/nvim-dap/issues/1025#issuecomment-1695852355 - program = function() - local path = vim.fn.input({ - prompt = "Path to executable: ", - default = vim.fn.getcwd() .. "/", - completion = "file", - }) - - return (path and path ~= "") and path or dap.ABORT - end, - }, - { - name = "Run with arguments (GDB)", - type = "gdb", - request = "launch", - -- This requires special handling of 'run_last', see - -- https://github.com/mfussenegger/nvim-dap/issues/1025#issuecomment-1695852355 - program = function() - local path = vim.fn.input({ - prompt = "Path to executable: ", - default = vim.fn.getcwd() .. "/", - completion = "file", - }) - - return (path and path ~= "") and path or dap.ABORT - end, - args = function() - local args_str = vim.fn.input({ - prompt = "Arguments: ", - }) - return vim.split(args_str, " +") - end, - }, - { - name = "Attach to process (GDB)", - type = "gdb", - request = "attach", - processId = require("dap.utils").pick_process, - }, -} diff --git a/after/plugin/gitsigns.lua b/after/plugin/gitsigns.lua deleted file mode 100644 index 46536b1..0000000 --- a/after/plugin/gitsigns.lua +++ /dev/null @@ -1,25 +0,0 @@ -local gitsigns = require("gitsigns") -gitsigns.setup({ - signs = { - add = { text = "▎" }, - change = { text = "▎" }, - delete = { text = "▎" }, - topdelete = { text = "▎" }, - changedelete = { text = "▎" }, - untracked = { text = "▎" }, - }, - numhl = false, - attach_to_untracked = true, - update_debounce = 0, - on_attach = function() - local map = vim.keymap.set - -- stylua: ignore start - map("n", "]g", gitsigns.next_hunk, { desc = "Next git hunk" }) - map("n", "[g", gitsigns.prev_hunk, { desc = "Previous git hunk" }) - map("n", " gd", gitsigns.toggle_deleted, { desc="Toggle deleted"}) - map("n", " gr", gitsigns.reset_hunk, { desc="Reset hunk"}) - map("n", " gs", gitsigns.stage_hunk, { desc="Stage hunk"}) - map("n", " gu", gitsigns.undo_stage_hunk, { desc="Undo stage hunk"}) - map("n", " gb", gitsigns.blame, { desc="Blame"}) - end, -}) diff --git a/after/plugin/harpoon.lua b/after/plugin/harpoon.lua deleted file mode 100644 index 999b957..0000000 --- a/after/plugin/harpoon.lua +++ /dev/null @@ -1,34 +0,0 @@ -local harpoon = require("harpoon") -local map = vim.keymap.set - --- REQUIRED -harpoon:setup() - -map("n", "<C-h>", function() - harpoon.ui:toggle_quick_menu(harpoon:list()) -end, { desc = "Harpoon pick menu" }) - -map("n", " ha", function() - harpoon:list():add() - print("Added to harpoon.") -end, { desc = "Harpoon add" }) -map("n", " h1", function() - harpoon:list():select(1) -end, { desc = "Harpoon 1" }) -map("n", " h2", function() - harpoon:list():select(2) -end, { desc = "Harpoon 2" }) -map("n", " h3", function() - harpoon:list():select(3) -end, { desc = "Harpoon 3" }) -map("n", " h4", function() - harpoon:list():select(4) -end, { desc = "Harpoon 4" }) - --- Toggle previous & next buffers stored within Harpoon list -map("n", " hp", function() - harpoon:list():prev() -end, { desc = "Harpoon previous" }) -map("n", " hn", function() - harpoon:list():next() -end, { desc = "Harpoon next" }) diff --git a/after/plugin/mini.lua b/after/plugin/mini.lua index 6a35641..2ef3eff 100644 --- a/after/plugin/mini.lua +++ b/after/plugin/mini.lua @@ -5,12 +5,12 @@ require("mini.statusline").setup({ require("mini.surround").setup({ silent = true, mappings = { - add = "gsa", -- Add surrounding in Normal and Visual modes - delete = "gsd", -- Delete surrounding - find = "gsf", -- Find surrounding (to the right) - find_left = "gsF", -- Find surrounding (to the left) - highlight = "gsh", -- Highlight surrounding - replace = "gsr", -- Replace surrounding - update_n_lines = "gsn", -- Update `n_lines` + add = "gsa", + delete = "gsd", + find = "gsf", + find_left = "gsF", + highlight = "gsh", + replace = "gsr", + update_n_lines = "gsn", }, }) diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua index c77e464..b481fa3 100644 --- a/after/plugin/telescope.lua +++ b/after/plugin/telescope.lua @@ -1,5 +1,8 @@ +local telescope = require("telescope") +local builtin = require("telescope.builtin") local map = vim.keymap.set -require("telescope").setup({ + +telescope.setup({ defaults = { path_display = { shorten = { @@ -23,17 +26,18 @@ require("telescope").setup({ }, }) -local builtin = require("telescope.builtin") map("n", " ff", builtin.find_files) -map("n", " bl", builtin.buffers) +map("n", " fb", builtin.buffers) map("n", " fp", builtin.git_files) map("n", " fw", builtin.live_grep) map("n", " fh", builtin.help_tags) +map("n", " fk", builtin.keymaps) +map("n", " fs", builtin.spell_suggest) -- symbols map("n", " fe", "<cmd>lua require'telescope.builtin'.symbols{ sources = {'emoji', 'gitmoji'} }<CR>") map("n", " fn", "<cmd>lua require'telescope.builtin'.symbols{ sources = {'nerd'} }<CR>") map("n", " fj", "<cmd>lua require'telescope.builtin'.symbols{ sources = {'julia'} }<CR>") +map("n", " ft", "<cmd>lua require'telescope.builtin'.treesitter{ symbols = {'function'} }<CR>") -require("telescope").load_extension("ui-select") -require("telescope").load_extension("fzf") +telescope.load_extension("fzf") diff --git a/after/plugin/treesitter.lua b/after/plugin/treesitter.lua index a0e8014..a625f4c 100644 --- a/after/plugin/treesitter.lua +++ b/after/plugin/treesitter.lua @@ -20,5 +20,3 @@ require("nvim-treesitter.configs").setup({ }, }, }) --- vim.api.nvim_buf_create_user_command --- vim.keymap.set("n", "") |