From 4095694799ff9e055d83b1511d8e0d0c933504b7 Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 3 Nov 2025 01:08:24 +0000 Subject: [PATCH] mbp --- .DS_Store | Bin 6148 -> 6148 bytes init.lua | 79 +++++++++++++------------- lazy-lock.json | 20 ++++--- lua/custom/plugins/dropbar.lua | 13 +++++ lua/custom/plugins/hover.lua | 37 ++++++++++++ lua/custom/plugins/nvim-tree.lua | 16 ++++++ lua/kickstart/plugins/indent_line.lua | 13 ++++- 7 files changed, 130 insertions(+), 48 deletions(-) create mode 100644 lua/custom/plugins/dropbar.lua create mode 100644 lua/custom/plugins/hover.lua create mode 100644 lua/custom/plugins/nvim-tree.lua diff --git a/.DS_Store b/.DS_Store index 728fd2f70146371794243fbb6432cb02d9981bec..709dee0766c607a0b10b0fc68bad72d9bd7f6492 100644 GIT binary patch delta 305 zcmZoMXfc=|#>B!kF;Q%yo+6{j#(>?7iv?Ji7)2)YFiFK$-DF^3U}4Z>NN31oD9O!t zaY@R_PXdZ@JmdW46YPK75mi0~uY5sZN0NXHGjJb^|tZ4E)=3qv~jfqnkH?wo_ ea{vQmGb77)=E?jbjvR~(3``)knB)qF;Q%yo+6{b#(>?7i~^H+Sfpa*Rx&U!urTN`q%&kPl;q~SxFqG| zCjrGcX8jLbv`+50BdUA~UipFy!{Frn+ybB;1_t4V$;~WNCQoN=WpZPhEXNki#IRwr jAcqLcW_AvK4xn>@obSw&`9&N#K*||`?${h5vW6J|LvbpE diff --git a/init.lua b/init.lua index c39e5485..3682449d 100644 --- a/init.lua +++ b/init.lua @@ -171,6 +171,9 @@ vim.keymap.set('n', '', 'nohlsearch') -- Save file vim.keymap.set('n', 'w', 'w', { desc = 'Save file' }) +-- Duplicate line (without affecting yank register) +vim.keymap.set('n', 'd', ':t.', { desc = 'Duplicate line' }) + -- Diagnostic keymaps vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) @@ -231,6 +234,41 @@ map('n', '', ':m .-2==', { desc = 'Move line up (Cmd)' }) map('v', '', ":m '>+1gv=gv", { desc = 'Move selection down (Cmd)' }) map('v', '', ":m '<-2gv=gv", { desc = 'Move selection up (Cmd)' }) +-- Jump to last terminal buffer and enter insert mode +map('n', 'tt', function() + local term_bufs = vim.tbl_filter(function(buf) + return vim.bo[buf].buftype == 'terminal' + end, vim.api.nvim_list_bufs()) + + if #term_bufs > 0 then + vim.cmd('buffer ' .. term_bufs[#term_bufs]) + vim.cmd('startinsert') + end +end, { desc = 'Jump to last terminal buffer' }) + +-- Zig debug print variable +map('n', 'pf', function() + -- Get the word under cursor + local word = vim.fn.expand('') + + -- Get current line number + local line = vim.fn.line('.') + + -- Get current indentation + local indent = vim.fn.indent(line) + local indent_str = string.rep(' ', indent) + + -- Create the debug print line + local debug_line = indent_str .. 'std.debug.print("' .. word .. ': {}\\n", .{' .. word .. '});' + + -- Insert line below and position cursor + vim.fn.append(line, debug_line) + + -- Move cursor to the inserted line, at the position after the opening quote + vim.fn.cursor(line + 1, indent + 19 + #word) + vim.cmd('startinsert') +end, { desc = 'Zig debug print variable' }) + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -245,6 +283,9 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) +-- Make indent guides match comment color +vim.api.nvim_set_hl(0, 'IblIndent', { fg = '#161a1f' }) -- RGB 22, 26, 31 + -- [[ Install `lazy.nvim` plugin manager ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' @@ -271,44 +312,6 @@ vim.opt.rtp:prepend(lazypath) require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically - --NOTE: nvim-tree - FQ - { - 'nvim-tree/nvim-tree.lua', - dependencies = { - 'nvim-tree/nvim-web-devicons', -- optional, for file icons - }, - version = '*', - lazy = false, - config = function() - require('nvim-tree').setup { - sync_root_with_cwd = true, - respect_buf_cwd = true, - } - -- Optional: Keybinding to toggle nvim-tree - vim.keymap.set('n', 'e', ':NvimTreeToggle', { desc = 'Toggle File Explorer (nvim-tree)' }) - end, - }, - -- NOTE: FQ dropbar - { - 'Bekaboo/dropbar.nvim', - -- optional, but required for fuzzy finder support - dependencies = { - 'nvim-telescope/telescope-fzf-native.nvim', - build = 'make', - }, - config = function() - local dropbar_api = require 'dropbar.api' - vim.keymap.set('n', ';', dropbar_api.pick, { desc = 'Pick symbols in winbar' }) - vim.keymap.set('n', '[;', dropbar_api.goto_context_start, { desc = 'Go to start of current context' }) - vim.keymap.set('n', '];', dropbar_api.select_next_context, { desc = 'Select next context' }) - end, - }, - -- --NOTE: Kanso Theme - FQ - -- { - -- 'webhooked/kanso.nvim', - -- lazy = false, - -- priority = 1000, - -- }, -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following -- keys can be used to configure plugin behavior/loading/etc. diff --git a/lazy-lock.json b/lazy-lock.json index 177b8302..886c24a6 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -6,19 +6,21 @@ "dropbar.nvim": { "branch": "master", "commit": "b695c346fd180d504c1d135435cbcfba08ad3946" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, - "gitsigns.nvim": { "branch": "main", "commit": "88205953bd748322b49b26e1dfb0389932520dc9" }, + "gitsigns.nvim": { "branch": "main", "commit": "1ee5c1fd068c81f9dd06483e639c2aa4587dc197" }, + "hover.nvim": { "branch": "main", "commit": "3b49066e09e03e63be6d6f43ae2b8bcd58301f63" }, + "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "kanso.nvim": { "branch": "main", "commit": "62e9c5d669567d086474b2b6863e0724c71c6c99" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "marks.nvim": { "branch": "master", "commit": "f353e8c08c50f39e99a9ed474172df7eddd89b72" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "be159e939543777bbfe9e1fe5389984c4570afce" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "93a9ff9b34c91c0cb0f7de8d5f7e4abce51d8903" }, - "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, - "mini.nvim": { "branch": "main", "commit": "3f5d06a6f710966cb93baaadc4897eeb6d6210e5" }, - "nvim-lspconfig": { "branch": "master", "commit": "9276b82935bf6b951d08c864eb5ac3f85d6b743b" }, - "nvim-tree.lua": { "branch": "master", "commit": "6b5b36659688767fb9f133bb83024ab1466fe5cd" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "6bdb14f230de0904229ec367b410fb817e59b072" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, + "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, + "mini.nvim": { "branch": "main", "commit": "4eaa8f4034535c372f6ca04b2772897048296dab" }, + "nvim-lspconfig": { "branch": "master", "commit": "ac98db2f9f06a56498ec890a96928774eae412c3" }, + "nvim-tree.lua": { "branch": "master", "commit": "321bc61580fd066b76861c32de3319c3a6d089e7" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, + "nvim-web-devicons": { "branch": "master", "commit": "b8221e42cf7287c4dcde81f232f58d7b947c210d" }, "persistence.nvim": { "branch": "main", "commit": "51eef57272742b773468949f6bd0503ec3f83874" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "precognition.nvim": { "branch": "main", "commit": "2aae2687207029b3611a0e19a289f9e1c7efbe16" }, @@ -27,5 +29,5 @@ "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, - "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } + "which-key.nvim": { "branch": "main", "commit": "b4177e3eaf15fe5eb8357ebac2286d488be1ed00" } } diff --git a/lua/custom/plugins/dropbar.lua b/lua/custom/plugins/dropbar.lua new file mode 100644 index 00000000..b16e1269 --- /dev/null +++ b/lua/custom/plugins/dropbar.lua @@ -0,0 +1,13 @@ +return { + 'Bekaboo/dropbar.nvim', + dependencies = { + 'nvim-telescope/telescope-fzf-native.nvim', + build = 'make', + }, + config = function() + local dropbar_api = require 'dropbar.api' + vim.keymap.set('n', ';', dropbar_api.pick, { desc = 'Pick symbols in winbar' }) + vim.keymap.set('n', '[;', dropbar_api.goto_context_start, { desc = 'Go to start of current context' }) + vim.keymap.set('n', '];', dropbar_api.select_next_context, { desc = 'Select next context' }) + end, +} diff --git a/lua/custom/plugins/hover.lua b/lua/custom/plugins/hover.lua new file mode 100644 index 00000000..ac81fc22 --- /dev/null +++ b/lua/custom/plugins/hover.lua @@ -0,0 +1,37 @@ +return { + 'lewis6991/hover.nvim', + config = function() + require('hover').setup { + init = function() + -- Require providers + require 'hover.providers.lsp' + require 'hover.providers.diagnostic' + require 'hover.providers.man' + require 'hover.providers.dictionary' + end, + preview_opts = { + border = 'rounded', + }, + preview_window = false, + title = true, + mouse_providers = { + 'LSP', + }, + mouse_delay = 1000, + } + + -- Setup keymaps + vim.keymap.set('n', 'K', require('hover').hover, { desc = 'hover.nvim' }) + vim.keymap.set('n', 'gK', require('hover').hover_select, { desc = 'hover.nvim (select)' }) + vim.keymap.set('n', '', function() + require('hover').hover_switch 'previous' + end, { desc = 'hover.nvim (previous source)' }) + vim.keymap.set('n', '', function() + require('hover').hover_switch 'next' + end, { desc = 'hover.nvim (next source)' }) + + -- Mouse support + vim.keymap.set('n', '', require('hover').hover_mouse, { desc = 'hover.nvim (mouse)' }) + vim.o.mousemoveevent = true + end, +} diff --git a/lua/custom/plugins/nvim-tree.lua b/lua/custom/plugins/nvim-tree.lua new file mode 100644 index 00000000..9ffe95f0 --- /dev/null +++ b/lua/custom/plugins/nvim-tree.lua @@ -0,0 +1,16 @@ +return { + 'nvim-tree/nvim-tree.lua', + dependencies = { + 'nvim-tree/nvim-web-devicons', -- optional, for file icons + }, + version = '*', + lazy = false, + config = function() + require('nvim-tree').setup { + sync_root_with_cwd = true, + respect_buf_cwd = true, + } + -- Keybinding to toggle nvim-tree + vim.keymap.set('n', 'e', ':NvimTreeToggle', { desc = 'Toggle File Explorer (nvim-tree)' }) + end, +} diff --git a/lua/kickstart/plugins/indent_line.lua b/lua/kickstart/plugins/indent_line.lua index ed7f2693..983274e7 100644 --- a/lua/kickstart/plugins/indent_line.lua +++ b/lua/kickstart/plugins/indent_line.lua @@ -4,6 +4,17 @@ return { -- Enable `lukas-reineke/indent-blankline.nvim` -- See `:help ibl` main = 'ibl', - opts = {}, + dependencies = { 'nvim-treesitter/nvim-treesitter' }, + opts = { + indent = { + char = '▏', -- Thinner character (alternatives: '│', '┊', '┆', '¦', '|', '⁞') + smart_indent_cap = true, + }, + scope = { + enabled = false, -- Disable scope highlighting + show_start = false, + show_end = false, + }, + }, }, }