From f3a4bc379e971fca482dfb2005215807d8f78b10 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 13 Mar 2025 18:25:36 -0700 Subject: [PATCH 01/16] Setup --- init.lua | 6 +++--- lua/custom/plugins/oil.lua | 22 ++++++++++++++++++++++ lua/custom/plugins/theme.lua | 1 + 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 lua/custom/plugins/oil.lua create mode 100644 lua/custom/plugins/theme.lua diff --git a/init.lua b/init.lua index 1427b6c7d5d..91dc6831500 100644 --- a/init.lua +++ b/init.lua @@ -102,7 +102,7 @@ vim.g.have_nerd_font = false vim.opt.number = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! --- vim.opt.relativenumber = true +vim.opt.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.opt.mouse = 'a' @@ -907,7 +907,7 @@ require('lazy').setup({ -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' + vim.cmd.colorscheme 'tokyonight-storm' end, }, @@ -997,7 +997,7 @@ require('lazy').setup({ -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua new file mode 100644 index 00000000000..7dbc67a9162 --- /dev/null +++ b/lua/custom/plugins/oil.lua @@ -0,0 +1,22 @@ +return { + 'stevearc/oil.nvim', + ---@module 'oil' + ---@type oil.SetupOpts + opts = { + + default_file_explorer = true, + delete_to_trash = true, + skip_confirm_for_simple_edits = true, + + view_options = { + show_hidden = true, + }, + }, + -- Optional dependencies + dependencies = { { 'echasnovski/mini.icons', opts = {} } }, + -- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations. + lazy = false, + init = function() + vim.keymap.set('n', '-', 'Oil', { desc = 'Open parent directory' }) + end, +} diff --git a/lua/custom/plugins/theme.lua b/lua/custom/plugins/theme.lua new file mode 100644 index 00000000000..a564707544f --- /dev/null +++ b/lua/custom/plugins/theme.lua @@ -0,0 +1 @@ +return {} From dd80ba8de6b1e5a0fd0e774b0e0e09f281883586 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 13 Mar 2025 18:31:19 -0700 Subject: [PATCH 02/16] add flash --- init.lua | 10 ---------- lua/custom/plugins/flash.lua | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 lua/custom/plugins/flash.lua diff --git a/init.lua b/init.lua index 91dc6831500..608984a6b87 100644 --- a/init.lua +++ b/init.lua @@ -604,16 +604,6 @@ require('lazy').setup({ end, }) end - - -- The following code creates a keymap to toggle inlay hints in your - -- code, if the language server you are using supports them - -- - -- This may be unwanted, since they displace some of your code - if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then - map('th', function() - vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) - end, '[T]oggle Inlay [H]ints') - end end, }) diff --git a/lua/custom/plugins/flash.lua b/lua/custom/plugins/flash.lua new file mode 100644 index 00000000000..4cdaca09869 --- /dev/null +++ b/lua/custom/plugins/flash.lua @@ -0,0 +1,10 @@ +return { + 'folke/flash.nvim', + event = 'VeryLazy', + ---@type Flash.Config + opts = {}, + -- stylua: ignore + keys = { + { "", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + }, +} From 848a2d64d8726d214c2019c4029c3ee4f3dd882d Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 14 Mar 2025 11:43:31 -0700 Subject: [PATCH 03/16] add floating terminal --- plugin/floaterminal.lua | 77 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 plugin/floaterminal.lua diff --git a/plugin/floaterminal.lua b/plugin/floaterminal.lua new file mode 100644 index 00000000000..f53a9dcad53 --- /dev/null +++ b/plugin/floaterminal.lua @@ -0,0 +1,77 @@ +local terminals = {} + +local function create_floating_window(opts) + local opts = opts or {} + + -- Get editor dimensions + local width = vim.o.columns + local height = vim.o.lines + + -- Default size (80% of editor width and centered) + local win_width = opts.width or math.ceil(width * 0.8) + local win_height = opts.height or math.ceil(height * 0.8) + + -- Position (centered) + local row = math.ceil((height - win_height) / 2) + local col = math.ceil((width - win_width) / 2) + + -- Create a new buffer + local buf = nil + if opts.buf and vim.api.nvim_buf_is_valid(opts.buf) then + buf = opts.buf + else + buf = vim.api.nvim_create_buf(false, true) + end + + -- Set window options + local win_opts = { + title = 'Terminal ' .. opts.name, + relative = 'editor', + width = win_width, + height = win_height, + row = row, + col = col, + style = 'minimal', + border = 'rounded', + } + + -- Open the floating window + local win = vim.api.nvim_open_win(buf, true, win_opts) + + return { buf = buf, win = win } +end + +local function toggle_terminal(name) + if not name or name == '' then + return + end + + -- Check if terminal exists for the given name + if terminals[name] and vim.api.nvim_buf_is_valid(terminals[name].buf) then + if vim.api.nvim_win_is_valid(terminals[name].win) then + -- If window exists, hide it + vim.api.nvim_win_hide(terminals[name].win) + return + else + -- Otherwise, reopen the floating terminal + terminals[name] = create_floating_window { buf = terminals[name].buf, name = name } + vim.cmd 'normal i' + return + end + end + + -- If it doesn't exist, create a new floating terminal + terminals[name] = create_floating_window { name = name } + vim.cmd.terminal() + vim.cmd 'normal i' +end + +local function handle_terminal_key() + vim.ui.input({ prompt = 'Enter terminal name: ' }, function(input) + if input then + toggle_terminal(input) + end + end) +end + +vim.keymap.set('n', 't', handle_terminal_key, { noremap = true, silent = true }) From fa30d688506bbf2ba106c187d528a51c6392a278 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 14 Mar 2025 14:07:14 -0700 Subject: [PATCH 04/16] add harpoon --- lua/custom/plugins/harpoon.lua | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 lua/custom/plugins/harpoon.lua diff --git a/lua/custom/plugins/harpoon.lua b/lua/custom/plugins/harpoon.lua new file mode 100644 index 00000000000..639b66f9f54 --- /dev/null +++ b/lua/custom/plugins/harpoon.lua @@ -0,0 +1,37 @@ +return { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + dependencies = { 'nvim-lua/plenary.nvim' }, + init = function() + local harpoon = require 'harpoon' + + harpoon:setup() + vim.keymap.set('n', 'a', function() + harpoon:list():add() + end) + vim.keymap.set('n', '', function() + harpoon.ui:toggle_quick_menu(harpoon:list()) + end) + + vim.keymap.set('n', '', function() + harpoon:list():select(1) + end) + vim.keymap.set('n', '', function() + harpoon:list():select(2) + end) + vim.keymap.set('n', '', function() + harpoon:list():select(3) + end) + vim.keymap.set('n', '', function() + harpoon:list():select(4) + end) + + -- Toggle previous & next buffers stored within Harpoon list + vim.keymap.set('n', '', function() + harpoon:list():prev() + end) + vim.keymap.set('n', '', function() + harpoon:list():next() + end) + end, +} From eaba7436df8dab690aa07b853b58d261320369c6 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 14 Mar 2025 20:16:59 -0700 Subject: [PATCH 05/16] defaults --- init.lua | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/init.lua b/init.lua index 608984a6b87..0b2ba9e54ee 100644 --- a/init.lua +++ b/init.lua @@ -331,11 +331,9 @@ require('lazy').setup({ -- Document existing key chains spec = { { 'c', group = '[C]ode', mode = { 'n', 'x' } }, - { 'd', group = '[D]ocument' }, { 'r', group = '[R]ename' }, { 's', group = '[S]earch' }, { 'w', group = '[W]orkspace' }, - { 't', group = '[T]oggle' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, }, }, @@ -557,7 +555,7 @@ require('lazy').setup({ -- Execute a code action, usually your cursor needs to be on top of an error -- or a suggestion from your LSP for this to activate. - map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' }) + -- map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' }) -- WARN: This is not Goto Definition, this is Goto Declaration. -- For example, in C this would take you to the header. @@ -818,9 +816,9 @@ require('lazy').setup({ -- No, but seriously. Please read `:help ins-completion`, it is really good! mapping = cmp.mapping.preset.insert { -- Select the [n]ext item - [''] = cmp.mapping.select_next_item(), + -- [''] = cmp.mapping.select_next_item(), -- Select the [p]revious item - [''] = cmp.mapping.select_prev_item(), + -- [''] = cmp.mapping.select_prev_item(), -- Scroll the documentation window [b]ack / [f]orward [''] = cmp.mapping.scroll_docs(-4), @@ -829,13 +827,13 @@ require('lazy').setup({ -- Accept ([y]es) the completion. -- This will auto-import if your LSP supports it. -- This will expand snippets if the LSP sent a snippet. - [''] = cmp.mapping.confirm { select = true }, + -- [''] = cmp.mapping.confirm { select = true }, -- If you prefer more traditional completion keymaps, -- you can uncomment the following lines - --[''] = cmp.mapping.confirm { select = true }, - --[''] = cmp.mapping.select_next_item(), - --[''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), -- Manually trigger a completion from nvim-cmp. -- Generally you don't need this, because nvim-cmp will display @@ -977,11 +975,11 @@ require('lazy').setup({ -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', + require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. From ca9bea87d85ba0fa03dfcd53011e237e4ed5e2b3 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 17 Mar 2025 08:30:22 -0700 Subject: [PATCH 06/16] updates --- init.lua | 26 ++++- lua/custom/plugins/flash.lua | 6 +- lua/custom/plugins/multi-select.lua | 3 + lua/custom/plugins/nvim-tmux-navigation.lua | 16 +++ plugin/floaterminal.lua | 29 ++++- plugin/multiselect.lua | 115 ++++++++++++++++++++ 6 files changed, 186 insertions(+), 9 deletions(-) create mode 100644 lua/custom/plugins/multi-select.lua create mode 100644 lua/custom/plugins/nvim-tmux-navigation.lua create mode 100644 plugin/multiselect.lua diff --git a/init.lua b/init.lua index 0b2ba9e54ee..638e8fa0a9c 100644 --- a/init.lua +++ b/init.lua @@ -161,6 +161,22 @@ vim.opt.scrolloff = 10 -- See `:help 'confirm'` vim.opt.confirm = true +vim.cmd 'set expandtab' +vim.cmd 'set tabstop=2' +vim.cmd 'set softtabstop=2' +vim.cmd 'set shiftwidth=2' +vim.g.mapleader = ' ' + +vim.opt.swapfile = false + +-- Navigate vim panes better +vim.keymap.set('n', '', ':wincmd k') +vim.keymap.set('n', '', ':wincmd j') +vim.keymap.set('n', '', ':wincmd h') +vim.keymap.set('n', '', ':wincmd l') + +vim.keymap.set('n', 'h', ':nohlsearch') +vim.wo.number = true -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -816,9 +832,9 @@ require('lazy').setup({ -- No, but seriously. Please read `:help ins-completion`, it is really good! mapping = cmp.mapping.preset.insert { -- Select the [n]ext item - -- [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_next_item(), -- Select the [p]revious item - -- [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.select_prev_item(), -- Scroll the documentation window [b]ack / [f]orward [''] = cmp.mapping.scroll_docs(-4), @@ -831,9 +847,9 @@ require('lazy').setup({ -- If you prefer more traditional completion keymaps, -- you can uncomment the following lines - [''] = cmp.mapping.confirm { select = true }, - [''] = cmp.mapping.select_next_item(), - [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.confirm { select = true }, + -- [''] = cmp.mapping.select_next_item(), + -- [''] = cmp.mapping.select_prev_item(), -- Manually trigger a completion from nvim-cmp. -- Generally you don't need this, because nvim-cmp will display diff --git a/lua/custom/plugins/flash.lua b/lua/custom/plugins/flash.lua index 4cdaca09869..49d14bccfea 100644 --- a/lua/custom/plugins/flash.lua +++ b/lua/custom/plugins/flash.lua @@ -2,7 +2,11 @@ return { 'folke/flash.nvim', event = 'VeryLazy', ---@type Flash.Config - opts = {}, + opts = { + jump = { + pos = 'end', + }, + }, -- stylua: ignore keys = { { "", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, diff --git a/lua/custom/plugins/multi-select.lua b/lua/custom/plugins/multi-select.lua new file mode 100644 index 00000000000..27111be2f90 --- /dev/null +++ b/lua/custom/plugins/multi-select.lua @@ -0,0 +1,3 @@ +return { + 'mg979/vim-visual-multi', +} diff --git a/lua/custom/plugins/nvim-tmux-navigation.lua b/lua/custom/plugins/nvim-tmux-navigation.lua new file mode 100644 index 00000000000..79d0a8977fd --- /dev/null +++ b/lua/custom/plugins/nvim-tmux-navigation.lua @@ -0,0 +1,16 @@ +return { + 'christoomey/vim-tmux-navigator', + cmd = { + 'TmuxNavigateDown', + 'TmuxNavigateUp', + 'TmuxNavigateRight', + 'TmuxNavigatePrevious', + 'TmuxNavigatorProcessList', + }, + keys = { + { '', 'TmuxNavigateDown' }, + { '', 'TmuxNavigateUp' }, + { '', 'TmuxNavigateRight' }, + { '', 'TmuxNavigatePrevious' }, + }, +} diff --git a/plugin/floaterminal.lua b/plugin/floaterminal.lua index f53a9dcad53..1c8432eabc6 100644 --- a/plugin/floaterminal.lua +++ b/plugin/floaterminal.lua @@ -66,12 +66,35 @@ local function toggle_terminal(name) vim.cmd 'normal i' end -local function handle_terminal_key() +local function list_active_terminals() + local terminal_names = {} + + -- Collect names of active terminals + for name, _ in pairs(terminals) do + table.insert(terminal_names, name) + end + + return terminal_names +end + +local function list_terminals() + local terminal_names = list_active_terminals() + print(vim.inspect(terminal_names)) + -- If there are active terminals, show them in a Telescope picker + if #terminal_names > 0 then + -- show picker with terminals + else + vim.notify('No active terminals found', vim.log.levels.INFO) + end +end + +-- Map the keys +vim.keymap.set('n', 't', function() vim.ui.input({ prompt = 'Enter terminal name: ' }, function(input) if input then toggle_terminal(input) end end) -end +end, { noremap = true, silent = true }) -vim.keymap.set('n', 't', handle_terminal_key, { noremap = true, silent = true }) +vim.keymap.set('n', 'lt', list_terminals, { noremap = true, silent = true }) diff --git a/plugin/multiselect.lua b/plugin/multiselect.lua new file mode 100644 index 00000000000..bb866b6f2ae --- /dev/null +++ b/plugin/multiselect.lua @@ -0,0 +1,115 @@ +-- Add this to your init.lua or create a file in your lua director-- Add this to your init.lua or create a file in your lua directory +-- and require it from your init.lua + +-- State variables +local selection_active = false +local selected_symbol = nil +local initial_pos = nil +local visual_mode_active = false + +-- Function to select the current symbol and handle iteration +function select_and_iterate_symbol() + -- Exit visual mode first if active to prevent issues + if visual_mode_active then + vim.cmd 'normal! ' + visual_mode_active = false + end + + -- If selection is not active, start a new selection + if not selection_active then + -- Get the current symbol under cursor (includes special characters) + local current_symbol = vim.fn.expand '' + + -- Check if there's actually a symbol under the cursor + if current_symbol == '' then + vim.api.nvim_echo({ { 'No symbol under cursor', 'ErrorMsg' } }, false, {}) + return + end + + -- Store the symbol for later use (exact match) + selected_symbol = current_symbol + + -- Store the initial position before moving + initial_pos = vim.fn.getpos '.' + + -- Set up a search pattern for the exact symbol + vim.fn.setreg('/', '\\V\\<' .. vim.fn.escape(selected_symbol, '\\') .. '\\>') + + -- Enter visual mode and select the current symbol + vim.cmd 'normal! viw' + visual_mode_active = true + + -- Set state to active + selection_active = true + + -- Echo instructions + vim.api.nvim_echo({ { 'Selected symbol: ' .. current_symbol .. '. Press Ctrl-R again to iterate, to edit all.', 'Normal' } }, false, {}) + else + -- Selection is active, find the next occurrence + + -- Search for the next occurrence (exact match with very nomagic mode \V) + local search_pattern = '\\V\\<' .. vim.fn.escape(selected_symbol, '\\') .. '\\>' + local found = vim.fn.search(search_pattern, 'W') + + if found == 0 then + -- If no more occurrences, wrap around to the beginning + vim.cmd 'normal! gg' + found = vim.fn.search(search_pattern, 'W') + + -- If still no occurrences or we've come full circle + if found == 0 or vim.fn.line '.' == vim.fn.line(initial_pos[2]) and vim.fn.col '.' == vim.fn.col(initial_pos[3]) then + vim.api.nvim_echo({ { 'No more occurrences found.', 'Normal' } }, false, {}) + -- Reset state + selection_active = false + selected_symbol = nil + initial_pos = nil + return + end + end + + -- Select the symbol + vim.cmd 'normal! viw' + visual_mode_active = true + end +end + +-- Function to edit all occurrences +function edit_all_occurrences() + -- If no symbol is selected, do nothing + if not selection_active then + vim.api.nvim_echo({ { 'No symbol selected. Use Ctrl-R first.', 'ErrorMsg' } }, false, {}) + return + end + + -- Exit visual mode + vim.cmd 'normal! ' + visual_mode_active = false + + -- Set up a command to find and replace with very nomagic mode for exact matching + local escaped_symbol = vim.fn.escape(selected_symbol, '/\\') + local cmd = ':%s/\\V\\<' .. escaped_symbol .. '\\>//gc' + + -- Use feedkeys with 'n' to avoid triggering mappings + vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(':' .. cmd, true, false, true), 'n', false) + + -- Reset state + selection_active = false + selected_symbol = nil + initial_pos = nil +end + +-- Reset function for cancellation +function reset_selection() + selection_active = false + selected_symbol = nil + initial_pos = nil + visual_mode_active = false + vim.cmd 'normal! ' + vim.api.nvim_echo({ { 'Symbol selection canceled', 'Normal' } }, false, {}) +end + +-- Set up key mappings +vim.api.nvim_set_keymap('n', '', [[lua select_and_iterate_symbol()]], { noremap = true, silent = true }) +vim.api.nvim_set_keymap('v', '', [[lua select_and_iterate_symbol()]], { noremap = true, silent = true }) +vim.api.nvim_set_keymap('v', '', [[lua edit_all_occurrences()]], { noremap = true, silent = true }) +vim.api.nvim_set_keymap('v', '', [[lua reset_selection()]], { noremap = true, silent = true }) From a95d34bfb6cd6cd3fb15c1767fbfedbd86890761 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 19 Mar 2025 12:56:43 -0700 Subject: [PATCH 07/16] fixup --- init.lua | 94 +--------------- lua/custom/plugins/flash.lua | 9 +- lua/custom/plugins/harpoon.lua | 70 ++++++------ lua/custom/plugins/nvim-tmux-navigation.lua | 2 + plugin/marks.lua | 33 ++++++ plugin/multiselect.lua | 115 -------------------- 6 files changed, 77 insertions(+), 246 deletions(-) create mode 100644 plugin/marks.lua delete mode 100644 plugin/multiselect.lua diff --git a/init.lua b/init.lua index 638e8fa0a9c..3a7f56a8d94 100644 --- a/init.lua +++ b/init.lua @@ -1,89 +1,3 @@ ---[[ - -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== -======== .-----. ======== -======== .----------------------. | === | ======== -======== |.-""""""""""""""""""-.| |-----| ======== -======== || || | === | ======== -======== || KICKSTART.NVIM || |-----| ======== -======== || || | === | ======== -======== || || |-----| ======== -======== ||:Tutor || |:::::| ======== -======== |'-..................-'| |____o| ======== -======== `"")----------------(""` ___________ ======== -======== /::::::::::| |::::::::::\ \ no mouse \ ======== -======== /:::========| |==hjkl==:::\ \ required \ ======== -======== '""""""""""""' '""""""""""""' '""""""""""' ======== -======== ======== -===================================================================== -===================================================================== - -What is Kickstart? - - Kickstart.nvim is *not* a distribution. - - Kickstart.nvim is a starting point for your own configuration. - The goal is that you can read every line of code, top-to-bottom, understand - what your configuration is doing, and modify it to suit your needs. - - Once you've done that, you can start exploring, configuring and tinkering to - make Neovim your own! That might mean leaving Kickstart just the way it is for a while - or immediately breaking it into modular pieces. It's up to you! - - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example which will only take 10-15 minutes: - - https://learnxinyminutes.com/docs/lua/ - - After understanding a bit more about Lua, you can use `:help lua-guide` as a - reference for how Neovim integrates Lua. - - :help lua-guide - - (or HTML version): https://neovim.io/doc/user/lua-guide.html - -Kickstart Guide: - - TODO: The very first thing you should do is to run the command `:Tutor` in Neovim. - - If you don't know what this means, type the following: - - - - : - - Tutor - - - - (If you already know the Neovim basics, you can skip this step.) - - Once you've completed that, you can continue working through **AND READING** the rest - of the kickstart init.lua. - - Next, run AND READ `:help`. - This will open up a help window with some basic information - about reading, navigating and searching the builtin help documentation. - - This should be the first place you go to look when you're stuck or confused - with something. It's one of my favorite Neovim features. - - MOST IMPORTANTLY, we provide a keymap "sh" to [s]earch the [h]elp documentation, - which is very useful when you're not exactly sure of what you're looking for. - - I have left several `:help X` comments throughout the init.lua - These are hints about where to find more information about the relevant settings, - plugins or Neovim features used in Kickstart. - - NOTE: Look for lines like this - - Throughout the file. These are for you, the reader, to help you understand what is happening. - Feel free to delete them once you know what you're doing, but they should serve as a guide - for when you are first encountering a few different constructs in your Neovim config. - -If you experience any errors while trying to install kickstart, run `:checkhealth` for more info. - -I hope you enjoy your Neovim journey, -- TJ - -P.S. You can delete this when you're done too. It's your config now! :) ---]] - -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) @@ -91,7 +5,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.opt` @@ -169,12 +83,6 @@ vim.g.mapleader = ' ' vim.opt.swapfile = false --- Navigate vim panes better -vim.keymap.set('n', '', ':wincmd k') -vim.keymap.set('n', '', ':wincmd j') -vim.keymap.set('n', '', ':wincmd h') -vim.keymap.set('n', '', ':wincmd l') - vim.keymap.set('n', 'h', ':nohlsearch') vim.wo.number = true -- [[ Basic Keymaps ]] diff --git a/lua/custom/plugins/flash.lua b/lua/custom/plugins/flash.lua index 49d14bccfea..061622496d8 100644 --- a/lua/custom/plugins/flash.lua +++ b/lua/custom/plugins/flash.lua @@ -3,12 +3,15 @@ return { event = 'VeryLazy', ---@type Flash.Config opts = { - jump = { - pos = 'end', + modes = { + char = { + enabled = false, + jump_labels = true, + }, }, }, -- stylua: ignore keys = { - { "", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "/", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, }, } diff --git a/lua/custom/plugins/harpoon.lua b/lua/custom/plugins/harpoon.lua index 639b66f9f54..1491c2d2cb9 100644 --- a/lua/custom/plugins/harpoon.lua +++ b/lua/custom/plugins/harpoon.lua @@ -1,37 +1,37 @@ return { - 'ThePrimeagen/harpoon', - branch = 'harpoon2', - dependencies = { 'nvim-lua/plenary.nvim' }, - init = function() - local harpoon = require 'harpoon' - - harpoon:setup() - vim.keymap.set('n', 'a', function() - harpoon:list():add() - end) - vim.keymap.set('n', '', function() - harpoon.ui:toggle_quick_menu(harpoon:list()) - end) - - vim.keymap.set('n', '', function() - harpoon:list():select(1) - end) - vim.keymap.set('n', '', function() - harpoon:list():select(2) - end) - vim.keymap.set('n', '', function() - harpoon:list():select(3) - end) - vim.keymap.set('n', '', function() - harpoon:list():select(4) - end) - - -- Toggle previous & next buffers stored within Harpoon list - vim.keymap.set('n', '', function() - harpoon:list():prev() - end) - vim.keymap.set('n', '', function() - harpoon:list():next() - end) - end, + -- 'ThePrimeagen/harpoon', + -- branch = 'harpoon2', + -- dependencies = { 'nvim-lua/plenary.nvim' }, + -- init = function() + -- local harpoon = require 'harpoon' + -- + -- harpoon:setup() + -- vim.keymap.set('n', 'a', function() + -- harpoon:list():add() + -- end) + -- vim.keymap.set('n', '', function() + -- harpoon.ui:toggle_quick_menu(harpoon:list()) + -- end) + -- + -- vim.keymap.set('n', '', function() + -- harpoon:list():select(1) + -- end) + -- vim.keymap.set('n', '', function() + -- harpoon:list():select(2) + -- end) + -- vim.keymap.set('n', '', function() + -- harpoon:list():select(3) + -- end) + -- vim.keymap.set('n', '', function() + -- harpoon:list():select(4) + -- end) + -- + -- -- Toggle previous & next buffers stored within Harpoon list + -- vim.keymap.set('n', '', function() + -- harpoon:list():prev() + -- end) + -- vim.keymap.set('n', '', function() + -- harpoon:list():next() + -- end) + -- end, } diff --git a/lua/custom/plugins/nvim-tmux-navigation.lua b/lua/custom/plugins/nvim-tmux-navigation.lua index 79d0a8977fd..26fb72ba14c 100644 --- a/lua/custom/plugins/nvim-tmux-navigation.lua +++ b/lua/custom/plugins/nvim-tmux-navigation.lua @@ -1,6 +1,7 @@ return { 'christoomey/vim-tmux-navigator', cmd = { + 'TmuxNavigateLeft', 'TmuxNavigateDown', 'TmuxNavigateUp', 'TmuxNavigateRight', @@ -8,6 +9,7 @@ return { 'TmuxNavigatorProcessList', }, keys = { + { '', 'TmuxNavigateLeft' }, { '', 'TmuxNavigateDown' }, { '', 'TmuxNavigateUp' }, { '', 'TmuxNavigateRight' }, diff --git a/plugin/marks.lua b/plugin/marks.lua new file mode 100644 index 00000000000..762ccfce0f9 --- /dev/null +++ b/plugin/marks.lua @@ -0,0 +1,33 @@ +-- Function to convert to uppercase and set a mark +vim.api.nvim_create_user_command('SetGlobalMark', function() + local ok, char = pcall(vim.fn.getcharstr) + if not ok then + return + end + + -- Convert lowercase to uppercase + if char:match '[a-z]' then + char = char:upper() + end + + vim.cmd('normal! m' .. char) +end, {}) + +-- Function to convert to uppercase and jump to a mark +vim.api.nvim_create_user_command('JumpToGlobalMark', function() + local ok, char = pcall(vim.fn.getcharstr) + if not ok then + return + end + + -- Convert lowercase to uppercase + if char:match '[a-z]' then + char = char:upper() + end + + vim.cmd("normal! '" .. char) +end, {}) + +-- Map your preferred key combinations to the functions +vim.keymap.set('n', '', ':SetGlobalMark', { noremap = true }) +vim.keymap.set('n', '', ':JumpToGlobalMark', { noremap = true }) diff --git a/plugin/multiselect.lua b/plugin/multiselect.lua deleted file mode 100644 index bb866b6f2ae..00000000000 --- a/plugin/multiselect.lua +++ /dev/null @@ -1,115 +0,0 @@ --- Add this to your init.lua or create a file in your lua director-- Add this to your init.lua or create a file in your lua directory --- and require it from your init.lua - --- State variables -local selection_active = false -local selected_symbol = nil -local initial_pos = nil -local visual_mode_active = false - --- Function to select the current symbol and handle iteration -function select_and_iterate_symbol() - -- Exit visual mode first if active to prevent issues - if visual_mode_active then - vim.cmd 'normal! ' - visual_mode_active = false - end - - -- If selection is not active, start a new selection - if not selection_active then - -- Get the current symbol under cursor (includes special characters) - local current_symbol = vim.fn.expand '' - - -- Check if there's actually a symbol under the cursor - if current_symbol == '' then - vim.api.nvim_echo({ { 'No symbol under cursor', 'ErrorMsg' } }, false, {}) - return - end - - -- Store the symbol for later use (exact match) - selected_symbol = current_symbol - - -- Store the initial position before moving - initial_pos = vim.fn.getpos '.' - - -- Set up a search pattern for the exact symbol - vim.fn.setreg('/', '\\V\\<' .. vim.fn.escape(selected_symbol, '\\') .. '\\>') - - -- Enter visual mode and select the current symbol - vim.cmd 'normal! viw' - visual_mode_active = true - - -- Set state to active - selection_active = true - - -- Echo instructions - vim.api.nvim_echo({ { 'Selected symbol: ' .. current_symbol .. '. Press Ctrl-R again to iterate, to edit all.', 'Normal' } }, false, {}) - else - -- Selection is active, find the next occurrence - - -- Search for the next occurrence (exact match with very nomagic mode \V) - local search_pattern = '\\V\\<' .. vim.fn.escape(selected_symbol, '\\') .. '\\>' - local found = vim.fn.search(search_pattern, 'W') - - if found == 0 then - -- If no more occurrences, wrap around to the beginning - vim.cmd 'normal! gg' - found = vim.fn.search(search_pattern, 'W') - - -- If still no occurrences or we've come full circle - if found == 0 or vim.fn.line '.' == vim.fn.line(initial_pos[2]) and vim.fn.col '.' == vim.fn.col(initial_pos[3]) then - vim.api.nvim_echo({ { 'No more occurrences found.', 'Normal' } }, false, {}) - -- Reset state - selection_active = false - selected_symbol = nil - initial_pos = nil - return - end - end - - -- Select the symbol - vim.cmd 'normal! viw' - visual_mode_active = true - end -end - --- Function to edit all occurrences -function edit_all_occurrences() - -- If no symbol is selected, do nothing - if not selection_active then - vim.api.nvim_echo({ { 'No symbol selected. Use Ctrl-R first.', 'ErrorMsg' } }, false, {}) - return - end - - -- Exit visual mode - vim.cmd 'normal! ' - visual_mode_active = false - - -- Set up a command to find and replace with very nomagic mode for exact matching - local escaped_symbol = vim.fn.escape(selected_symbol, '/\\') - local cmd = ':%s/\\V\\<' .. escaped_symbol .. '\\>//gc' - - -- Use feedkeys with 'n' to avoid triggering mappings - vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(':' .. cmd, true, false, true), 'n', false) - - -- Reset state - selection_active = false - selected_symbol = nil - initial_pos = nil -end - --- Reset function for cancellation -function reset_selection() - selection_active = false - selected_symbol = nil - initial_pos = nil - visual_mode_active = false - vim.cmd 'normal! ' - vim.api.nvim_echo({ { 'Symbol selection canceled', 'Normal' } }, false, {}) -end - --- Set up key mappings -vim.api.nvim_set_keymap('n', '', [[lua select_and_iterate_symbol()]], { noremap = true, silent = true }) -vim.api.nvim_set_keymap('v', '', [[lua select_and_iterate_symbol()]], { noremap = true, silent = true }) -vim.api.nvim_set_keymap('v', '', [[lua edit_all_occurrences()]], { noremap = true, silent = true }) -vim.api.nvim_set_keymap('v', '', [[lua reset_selection()]], { noremap = true, silent = true }) From a90fe4658d652384402679c9adacce1973769f28 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 19 Mar 2025 16:27:45 -0700 Subject: [PATCH 08/16] update flash --- lua/custom/plugins/flash.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/custom/plugins/flash.lua b/lua/custom/plugins/flash.lua index 061622496d8..db231886e39 100644 --- a/lua/custom/plugins/flash.lua +++ b/lua/custom/plugins/flash.lua @@ -4,6 +4,9 @@ return { ---@type Flash.Config opts = { modes = { + search = { + enabled = true, + }, char = { enabled = false, jump_labels = true, @@ -12,6 +15,5 @@ return { }, -- stylua: ignore keys = { - { "/", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, }, } From 22a9445c72486a09bd87d488d051aa69126b529c Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 19 Mar 2025 16:36:35 -0700 Subject: [PATCH 09/16] improve marks --- plugin/marks.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/marks.lua b/plugin/marks.lua index 762ccfce0f9..70c84bc8199 100644 --- a/plugin/marks.lua +++ b/plugin/marks.lua @@ -25,9 +25,9 @@ vim.api.nvim_create_user_command('JumpToGlobalMark', function() char = char:upper() end - vim.cmd("normal! '" .. char) + vim.cmd("silent! normal! '" .. char) end, {}) -- Map your preferred key combinations to the functions -vim.keymap.set('n', '', ':SetGlobalMark', { noremap = true }) -vim.keymap.set('n', '', ':JumpToGlobalMark', { noremap = true }) +vim.keymap.set('n', 'm', ':SetGlobalMark', { noremap = true, silent = true }) +vim.keymap.set('n', '', ':JumpToGlobalMark', { noremap = true, silent = true }) From 0ad482bc2032a6c05beeb665b54896f755ffe42a Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 19 Mar 2025 20:31:33 -0700 Subject: [PATCH 10/16] fix telescope --- init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init.lua b/init.lua index 3a7f56a8d94..9fed560e4a0 100644 --- a/init.lua +++ b/init.lua @@ -325,6 +325,11 @@ require('lazy').setup({ -- i = { [''] = 'to_fuzzy_refine' }, -- }, -- }, + defaults = { + path_display = { + shorten = 2, + }, + }, -- pickers = {} extensions = { ['ui-select'] = { From 6df31f28065f03c7af890b3ac6388ce2ccb3eb88 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 20 Mar 2025 08:48:36 -0700 Subject: [PATCH 11/16] floating oil --- lua/custom/plugins/oil.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua index 7dbc67a9162..9c44cacd9eb 100644 --- a/lua/custom/plugins/oil.lua +++ b/lua/custom/plugins/oil.lua @@ -8,6 +8,9 @@ return { delete_to_trash = true, skip_confirm_for_simple_edits = true, + float = { + max_width = 0.7, + }, view_options = { show_hidden = true, }, @@ -17,6 +20,6 @@ return { -- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations. lazy = false, init = function() - vim.keymap.set('n', '-', 'Oil', { desc = 'Open parent directory' }) + vim.keymap.set('n', '-', 'Oil --float', { desc = 'Open parent directory' }) end, } From b5ff20bd3cb992474916b72613fc06fb1514b161 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 20 Mar 2025 08:53:04 -0700 Subject: [PATCH 12/16] more tweaks --- lua/custom/plugins/flash.lua | 3 +++ lua/custom/plugins/oil.lua | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/custom/plugins/flash.lua b/lua/custom/plugins/flash.lua index db231886e39..d374c0a01a4 100644 --- a/lua/custom/plugins/flash.lua +++ b/lua/custom/plugins/flash.lua @@ -3,6 +3,9 @@ return { event = 'VeryLazy', ---@type Flash.Config opts = { + jump = { + pos = 'range', + }, modes = { search = { enabled = true, diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua index 9c44cacd9eb..7d41351eee1 100644 --- a/lua/custom/plugins/oil.lua +++ b/lua/custom/plugins/oil.lua @@ -9,7 +9,7 @@ return { skip_confirm_for_simple_edits = true, float = { - max_width = 0.7, + max_width = 0.8, }, view_options = { show_hidden = true, From 6a1a1589a2708449755d5039c2279e9b5197b686 Mon Sep 17 00:00:00 2001 From: andy Date: Sat, 29 Mar 2025 21:02:26 -0700 Subject: [PATCH 13/16] update harpoon --- init.lua | 3 ++ lua/custom/plugins/harpoon.lua | 70 +++++++++++++++--------------- lua/custom/plugins/lazygit.lua | 21 +++++++++ lua/custom/plugins/vim-be-good.lua | 3 ++ 4 files changed, 62 insertions(+), 35 deletions(-) create mode 100644 lua/custom/plugins/lazygit.lua create mode 100644 lua/custom/plugins/vim-be-good.lua diff --git a/init.lua b/init.lua index 9fed560e4a0..d61be61383e 100644 --- a/init.lua +++ b/init.lua @@ -118,6 +118,8 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +vim.keymap.set('n', '', 'zz') +vim.keymap.set('n', '', 'zz') -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -344,6 +346,7 @@ require('lazy').setup({ -- See `:help telescope.builtin` local builtin = require 'telescope.builtin' + vim.keymap.set('n', '', builtin.find_files) vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) diff --git a/lua/custom/plugins/harpoon.lua b/lua/custom/plugins/harpoon.lua index 1491c2d2cb9..be9bea3cc0d 100644 --- a/lua/custom/plugins/harpoon.lua +++ b/lua/custom/plugins/harpoon.lua @@ -1,37 +1,37 @@ return { - -- 'ThePrimeagen/harpoon', - -- branch = 'harpoon2', - -- dependencies = { 'nvim-lua/plenary.nvim' }, - -- init = function() - -- local harpoon = require 'harpoon' - -- - -- harpoon:setup() - -- vim.keymap.set('n', 'a', function() - -- harpoon:list():add() - -- end) - -- vim.keymap.set('n', '', function() - -- harpoon.ui:toggle_quick_menu(harpoon:list()) - -- end) - -- - -- vim.keymap.set('n', '', function() - -- harpoon:list():select(1) - -- end) - -- vim.keymap.set('n', '', function() - -- harpoon:list():select(2) - -- end) - -- vim.keymap.set('n', '', function() - -- harpoon:list():select(3) - -- end) - -- vim.keymap.set('n', '', function() - -- harpoon:list():select(4) - -- end) - -- - -- -- Toggle previous & next buffers stored within Harpoon list - -- vim.keymap.set('n', '', function() - -- harpoon:list():prev() - -- end) - -- vim.keymap.set('n', '', function() - -- harpoon:list():next() - -- end) - -- end, + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + dependencies = { 'nvim-lua/plenary.nvim' }, + init = function() + local harpoon = require 'harpoon' + + harpoon:setup() + vim.keymap.set('n', 'a', function() + harpoon:list():add() + end) + vim.keymap.set('n', '', function() + harpoon.ui:toggle_quick_menu(harpoon:list()) + end) + + vim.keymap.set('n', '', function() + harpoon:list():select(1) + end) + vim.keymap.set('n', '', function() + harpoon:list():select(2) + end) + vim.keymap.set('n', '', function() + harpoon:list():select(3) + end) + vim.keymap.set('n', '', function() + harpoon:list():select(4) + end) + + -- Toggle previous & next buffers stored within Harpoon list + vim.keymap.set('n', '', function() + harpoon:list():prev() + end) + vim.keymap.set('n', '', function() + harpoon:list():next() + end) + end, } diff --git a/lua/custom/plugins/lazygit.lua b/lua/custom/plugins/lazygit.lua new file mode 100644 index 00000000000..fe42cd23b6c --- /dev/null +++ b/lua/custom/plugins/lazygit.lua @@ -0,0 +1,21 @@ +-- nvim v0.8.0 +return { + 'kdheepak/lazygit.nvim', + lazy = true, + cmd = { + 'LazyGit', + 'LazyGitConfig', + 'LazyGitCurrentFile', + 'LazyGitFilter', + 'LazyGitFilterCurrentFile', + }, + -- optional for floating window border decoration + dependencies = { + 'nvim-lua/plenary.nvim', + }, + -- setting the keybinding for LazyGit with 'keys' is recommended in + -- order to load the plugin when the command is run for the first time + keys = { + { 'lg', 'LazyGit', desc = 'LazyGit' }, + }, +} diff --git a/lua/custom/plugins/vim-be-good.lua b/lua/custom/plugins/vim-be-good.lua new file mode 100644 index 00000000000..b1e2a54318f --- /dev/null +++ b/lua/custom/plugins/vim-be-good.lua @@ -0,0 +1,3 @@ +return { + 'ThePrimeagen/vim-be-good', +} From 20044c837d2cafdea9b0c0d395a9dbee0e76c455 Mon Sep 17 00:00:00 2001 From: andy Date: Sun, 13 Apr 2025 09:57:09 -0700 Subject: [PATCH 14/16] updates --- init.lua | 55 +++++++++++++++++----------------- lua/custom/plugins/lualine.lua | 47 +++++++++++++++++++++++++++++ lua/custom/plugins/oil.lua | 16 +++++++++- 3 files changed, 90 insertions(+), 28 deletions(-) create mode 100644 lua/custom/plugins/lualine.lua diff --git a/init.lua b/init.lua index d61be61383e..483cc2ef9a8 100644 --- a/init.lua +++ b/init.lua @@ -329,7 +329,7 @@ require('lazy').setup({ -- }, defaults = { path_display = { - shorten = 2, + shorten = 4, }, }, -- pickers = {} @@ -346,7 +346,7 @@ require('lazy').setup({ -- See `:help telescope.builtin` local builtin = require 'telescope.builtin' - vim.keymap.set('n', '', builtin.find_files) + vim.keymap.set('n', '', builtin.oldfiles) vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) @@ -551,19 +551,20 @@ require('lazy').setup({ [vim.diagnostic.severity.HINT] = '󰌶 ', }, } or {}, - virtual_text = { - source = 'if_many', - spacing = 2, - format = function(diagnostic) - local diagnostic_message = { - [vim.diagnostic.severity.ERROR] = diagnostic.message, - [vim.diagnostic.severity.WARN] = diagnostic.message, - [vim.diagnostic.severity.INFO] = diagnostic.message, - [vim.diagnostic.severity.HINT] = diagnostic.message, - } - return diagnostic_message[diagnostic.severity] - end, - }, + virtual_text = false, + -- virtual_text = { + -- source = 'if_many', + -- spacing = 2, + -- format = function(diagnostic) + -- local diagnostic_message = { + -- [vim.diagnostic.severity.ERROR] = diagnostic.message, + -- [vim.diagnostic.severity.WARN] = diagnostic.message, + -- [vim.diagnostic.severity.INFO] = diagnostic.message, + -- [vim.diagnostic.severity.HINT] = diagnostic.message, + -- } + -- return diagnostic_message[diagnostic.severity] + -- end, + -- }, } -- LSP servers and clients are able to communicate to each other what features they support. @@ -850,22 +851,22 @@ require('lazy').setup({ -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren -- - sd' - [S]urround [D]elete [']quotes -- - sr)' - [S]urround [R]eplace [)] ['] - require('mini.surround').setup() + -- require('mini.surround').setup() -- Simple and easy statusline. -- You could remove this setup call if you don't like it, -- and try some other statusline plugin - local statusline = require 'mini.statusline' - -- set use_icons to true if you have a Nerd Font - statusline.setup { use_icons = vim.g.have_nerd_font } - - -- You can configure sections in the statusline by overriding their - -- default behavior. For example, here we set the section for - -- cursor location to LINE:COLUMN - ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() - return '%2l:%-2v' - end + -- local statusline = require 'mini.statusline' + -- -- set use_icons to true if you have a Nerd Font + -- statusline.setup { use_icons = vim.g.have_nerd_font } + -- + -- -- You can configure sections in the statusline by overriding their + -- -- default behavior. For example, here we set the section for + -- -- cursor location to LINE:COLUMN + -- ---@diagnostic disable-next-line: duplicate-set-field + -- statusline.section_location = function() + -- return '%2l:%-2v' + -- end -- ... and there is more! -- Check out: https://github.com/echasnovski/mini.nvim diff --git a/lua/custom/plugins/lualine.lua b/lua/custom/plugins/lualine.lua new file mode 100644 index 00000000000..a27d56e75a2 --- /dev/null +++ b/lua/custom/plugins/lualine.lua @@ -0,0 +1,47 @@ +return { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + init = function() + require('lualine').setup { + options = { + icons_enabled = true, + theme = 'auto', + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + always_show_tabline = true, + globalstatus = false, + refresh = { + statusline = 100, + tabline = 100, + winbar = 100, + }, + }, + sections = { + lualine_a = { 'mode' }, + lualine_b = { 'branch', 'diff' }, + lualine_c = { 'local', 'filename' }, + lualine_x = {}, + lualine_y = {}, + lualine_z = {}, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { 'filename' }, + lualine_x = { 'location' }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {}, + } + end, +} diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua index 7d41351eee1..7cc73bddebc 100644 --- a/lua/custom/plugins/oil.lua +++ b/lua/custom/plugins/oil.lua @@ -9,10 +9,24 @@ return { skip_confirm_for_simple_edits = true, float = { - max_width = 0.8, + padding = 2, + max_width = 90, + max_height = 0, + }, + win_options = { + wrap = true, + winblend = 0, + }, + keymaps = { + [''] = false, + [''] = 'actions.close', }, view_options = { show_hidden = true, + natural_order = true, + is_always_hidden = function(name, _) + return name == '..' or name == '.git' + end, }, }, -- Optional dependencies From f70c9b31be775cb4c728deb1db44c5d331b72af6 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 14 Apr 2025 08:09:43 -0700 Subject: [PATCH 15/16] updates --- init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 483cc2ef9a8..b43623ff86d 100644 --- a/init.lua +++ b/init.lua @@ -687,7 +687,9 @@ require('lazy').setup({ -- python = { "isort", "black" }, -- -- You can use 'stop_after_first' to run the first available formatter from the list - -- javascript = { "prettierd", "prettier", stop_after_first = true }, + javascript = { 'prettierd', 'prettier', stop_after_first = true }, + typescriptreact = { 'prettierd', 'prettier', stop_after_first = true }, + javascriptreact = { 'prettierd', 'prettier', stop_after_first = true }, }, }, }, From 3ba2901cd431af7c90c159887f39fba41eb04cb4 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 27 Jan 2026 12:44:03 -0800 Subject: [PATCH 16/16] cleanup --- colors/poimandres-storm.lua | 133 ++++++++++++++++++++ init.lua | 5 +- lua/custom/plugins/copilot.lua | 3 + lua/custom/plugins/flash.lua | 2 +- lua/custom/plugins/harpoon.lua | 37 ------ lua/custom/plugins/lualine.lua | 2 +- lua/custom/plugins/multi-select.lua | 3 - lua/custom/plugins/nvim-tmux-navigation.lua | 18 --- lua/custom/plugins/vim-be-good.lua | 3 - plugin/floaterminal.lua | 100 --------------- 10 files changed, 142 insertions(+), 164 deletions(-) create mode 100644 colors/poimandres-storm.lua create mode 100644 lua/custom/plugins/copilot.lua delete mode 100644 lua/custom/plugins/harpoon.lua delete mode 100644 lua/custom/plugins/multi-select.lua delete mode 100644 lua/custom/plugins/nvim-tmux-navigation.lua delete mode 100644 lua/custom/plugins/vim-be-good.lua delete mode 100644 plugin/floaterminal.lua diff --git a/colors/poimandres-storm.lua b/colors/poimandres-storm.lua new file mode 100644 index 00000000000..155b65de6d3 --- /dev/null +++ b/colors/poimandres-storm.lua @@ -0,0 +1,133 @@ +-- Poimandres Storm (Neovim) +-- Based on Poimandres Storm by Oliver Cederborg + +vim.cmd 'highlight clear' +if vim.fn.exists 'syntax_on' then + vim.cmd 'syntax reset' +end + +vim.o.termguicolors = true +vim.g.colors_name = 'poimandres-storm' + +-- Expanded palette +local colors = { + -- Accents + yellow = '#FFFAC2', + + teal1 = '#5DE4C7', + teal2 = '#5FB3A1', + teal3 = '#42675A', + + blue1 = '#89DDFF', + blue2 = '#ADD7FF', + blue3 = '#91B4D5', + blue4 = '#7390AA', + + pink1 = '#FAE4FC', + pink2 = '#FCC5E9', + pink3 = '#D0679D', + + -- Neutrals + blueGray1 = '#A6ACCD', + blueGray2 = '#767C9D', + blueGray3 = '#506477', + + -- Background layers + bg = '#252B37', -- main editor + bg_alt = '#1B1E28', -- floats / panels + bg_dark = '#171922', -- deepest contrast + + -- Text + fg = '#E4F0FB', + white = '#FFFFFF', + + none = 'NONE', +} + +local function hi(group, opts) + vim.api.nvim_set_hl(0, group, opts) +end + +-- ====================== +-- Core UI +-- ====================== +hi('Normal', { fg = colors.fg, bg = colors.bg }) +hi('NormalFloat', { fg = colors.fg, bg = colors.bg_alt }) +hi('FloatBorder', { fg = colors.blueGray3, bg = colors.bg_alt }) + +hi('Cursor', { fg = colors.bg, bg = colors.blueGray1 }) +hi('CursorLine', { bg = colors.bg_alt }) +hi('CursorLineNr', { fg = colors.blue1, bold = true }) +hi('LineNr', { fg = colors.blueGray3 }) + +hi('Visual', { bg = colors.blueGray3 }) +hi('Search', { fg = colors.bg, bg = colors.yellow }) +hi('IncSearch', { fg = colors.bg, bg = colors.pink2 }) + +hi('StatusLine', { fg = colors.fg, bg = colors.bg_alt }) +hi('StatusLineNC', { fg = colors.blueGray2, bg = colors.bg_alt }) + +hi('WinSeparator', { fg = colors.bg_alt }) +hi('VertSplit', { fg = colors.bg_alt }) + +-- ====================== +-- Menus +-- ====================== +hi('Pmenu', { fg = colors.fg, bg = colors.bg_alt }) +hi('PmenuSel', { fg = colors.bg, bg = colors.blue1 }) +hi('PmenuSbar', { bg = colors.bg_dark }) +hi('PmenuThumb', { bg = colors.blueGray3 }) + +-- ====================== +-- Syntax +-- ====================== +hi('Comment', { fg = colors.blueGray3, italic = true }) + +hi('Constant', { fg = colors.pink2 }) +hi('String', { fg = colors.teal1 }) +hi('Character', { fg = colors.teal1 }) +hi('Number', { fg = colors.pink2 }) +hi('Boolean', { fg = colors.pink3 }) + +hi('Identifier', { fg = colors.blue1 }) +hi('Function', { fg = colors.blue1 }) + +hi('Statement', { fg = colors.pink3 }) +hi('Keyword', { fg = colors.pink3 }) +hi('Conditional', { fg = colors.pink3 }) +hi('Repeat', { fg = colors.pink3 }) +hi('Exception', { fg = colors.pink3 }) + +hi('Type', { fg = colors.yellow }) +hi('StorageClass', { fg = colors.yellow }) +hi('Structure', { fg = colors.yellow }) + +hi('Operator', { fg = colors.teal2 }) +hi('Delimiter', { fg = colors.blueGray2 }) + +-- ====================== +-- Diagnostics (LSP) +-- ====================== +hi('DiagnosticError', { fg = colors.pink3 }) +hi('DiagnosticWarn', { fg = colors.yellow }) +hi('DiagnosticInfo', { fg = colors.blue2 }) +hi('DiagnosticHint', { fg = colors.teal2 }) + +hi('DiagnosticVirtualTextError', { fg = colors.pink3, bg = colors.bg_dark }) +hi('DiagnosticVirtualTextWarn', { fg = colors.yellow, bg = colors.bg_dark }) +hi('DiagnosticVirtualTextInfo', { fg = colors.blue2, bg = colors.bg_dark }) +hi('DiagnosticVirtualTextHint', { fg = colors.teal2, bg = colors.bg_dark }) + +-- ====================== +-- Git / Diff +-- ====================== +hi('DiffAdd', { fg = colors.teal1 }) +hi('DiffChange', { fg = colors.yellow }) +hi('DiffDelete', { fg = colors.pink3 }) + +-- ====================== +-- Tabs +-- ====================== +hi('TabLine', { fg = colors.blueGray2, bg = colors.bg_alt }) +hi('TabLineSel', { fg = colors.fg, bg = colors.bg_alt, bold = true }) +hi('TabLineFill', { bg = colors.bg_alt }) diff --git a/init.lua b/init.lua index b43623ff86d..f4db9bf4f82 100644 --- a/init.lua +++ b/init.lua @@ -120,6 +120,8 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the upper win vim.keymap.set('n', '', 'zz') vim.keymap.set('n', '', 'zz') + +vim.keymap.set('n', '', '') -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -813,6 +815,7 @@ require('lazy').setup({ }, { -- You can easily change to a different colorscheme. + -- -- Change the name of the colorscheme plugin below, and then -- change the command in the config to whatever the name of that colorscheme is. -- @@ -846,7 +849,7 @@ require('lazy').setup({ -- - va) - [V]isually select [A]round [)]paren -- - yinq - [Y]ank [I]nside [N]ext [Q]uote -- - ci' - [C]hange [I]nside [']quote - require('mini.ai').setup { n_lines = 500 } + require('mini.ai').setup { n_lines = 1000 } -- Add/delete/replace surroundings (brackets, quotes, etc.) -- diff --git a/lua/custom/plugins/copilot.lua b/lua/custom/plugins/copilot.lua new file mode 100644 index 00000000000..1a804873741 --- /dev/null +++ b/lua/custom/plugins/copilot.lua @@ -0,0 +1,3 @@ +return { + 'github/copilot.vim', +} diff --git a/lua/custom/plugins/flash.lua b/lua/custom/plugins/flash.lua index d374c0a01a4..2bb27ca0834 100644 --- a/lua/custom/plugins/flash.lua +++ b/lua/custom/plugins/flash.lua @@ -12,7 +12,7 @@ return { }, char = { enabled = false, - jump_labels = true, + jump_labels = false, }, }, }, diff --git a/lua/custom/plugins/harpoon.lua b/lua/custom/plugins/harpoon.lua deleted file mode 100644 index be9bea3cc0d..00000000000 --- a/lua/custom/plugins/harpoon.lua +++ /dev/null @@ -1,37 +0,0 @@ -return { - 'ThePrimeagen/harpoon', - branch = 'harpoon2', - dependencies = { 'nvim-lua/plenary.nvim' }, - init = function() - local harpoon = require 'harpoon' - - harpoon:setup() - vim.keymap.set('n', 'a', function() - harpoon:list():add() - end) - vim.keymap.set('n', '', function() - harpoon.ui:toggle_quick_menu(harpoon:list()) - end) - - vim.keymap.set('n', '', function() - harpoon:list():select(1) - end) - vim.keymap.set('n', '', function() - harpoon:list():select(2) - end) - vim.keymap.set('n', '', function() - harpoon:list():select(3) - end) - vim.keymap.set('n', '', function() - harpoon:list():select(4) - end) - - -- Toggle previous & next buffers stored within Harpoon list - vim.keymap.set('n', '', function() - harpoon:list():prev() - end) - vim.keymap.set('n', '', function() - harpoon:list():next() - end) - end, -} diff --git a/lua/custom/plugins/lualine.lua b/lua/custom/plugins/lualine.lua index a27d56e75a2..ce6fd1975b0 100644 --- a/lua/custom/plugins/lualine.lua +++ b/lua/custom/plugins/lualine.lua @@ -25,7 +25,7 @@ return { sections = { lualine_a = { 'mode' }, lualine_b = { 'branch', 'diff' }, - lualine_c = { 'local', 'filename' }, + lualine_c = { 'filename' }, lualine_x = {}, lualine_y = {}, lualine_z = {}, diff --git a/lua/custom/plugins/multi-select.lua b/lua/custom/plugins/multi-select.lua deleted file mode 100644 index 27111be2f90..00000000000 --- a/lua/custom/plugins/multi-select.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - 'mg979/vim-visual-multi', -} diff --git a/lua/custom/plugins/nvim-tmux-navigation.lua b/lua/custom/plugins/nvim-tmux-navigation.lua deleted file mode 100644 index 26fb72ba14c..00000000000 --- a/lua/custom/plugins/nvim-tmux-navigation.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - 'christoomey/vim-tmux-navigator', - cmd = { - 'TmuxNavigateLeft', - 'TmuxNavigateDown', - 'TmuxNavigateUp', - 'TmuxNavigateRight', - 'TmuxNavigatePrevious', - 'TmuxNavigatorProcessList', - }, - keys = { - { '', 'TmuxNavigateLeft' }, - { '', 'TmuxNavigateDown' }, - { '', 'TmuxNavigateUp' }, - { '', 'TmuxNavigateRight' }, - { '', 'TmuxNavigatePrevious' }, - }, -} diff --git a/lua/custom/plugins/vim-be-good.lua b/lua/custom/plugins/vim-be-good.lua deleted file mode 100644 index b1e2a54318f..00000000000 --- a/lua/custom/plugins/vim-be-good.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - 'ThePrimeagen/vim-be-good', -} diff --git a/plugin/floaterminal.lua b/plugin/floaterminal.lua deleted file mode 100644 index 1c8432eabc6..00000000000 --- a/plugin/floaterminal.lua +++ /dev/null @@ -1,100 +0,0 @@ -local terminals = {} - -local function create_floating_window(opts) - local opts = opts or {} - - -- Get editor dimensions - local width = vim.o.columns - local height = vim.o.lines - - -- Default size (80% of editor width and centered) - local win_width = opts.width or math.ceil(width * 0.8) - local win_height = opts.height or math.ceil(height * 0.8) - - -- Position (centered) - local row = math.ceil((height - win_height) / 2) - local col = math.ceil((width - win_width) / 2) - - -- Create a new buffer - local buf = nil - if opts.buf and vim.api.nvim_buf_is_valid(opts.buf) then - buf = opts.buf - else - buf = vim.api.nvim_create_buf(false, true) - end - - -- Set window options - local win_opts = { - title = 'Terminal ' .. opts.name, - relative = 'editor', - width = win_width, - height = win_height, - row = row, - col = col, - style = 'minimal', - border = 'rounded', - } - - -- Open the floating window - local win = vim.api.nvim_open_win(buf, true, win_opts) - - return { buf = buf, win = win } -end - -local function toggle_terminal(name) - if not name or name == '' then - return - end - - -- Check if terminal exists for the given name - if terminals[name] and vim.api.nvim_buf_is_valid(terminals[name].buf) then - if vim.api.nvim_win_is_valid(terminals[name].win) then - -- If window exists, hide it - vim.api.nvim_win_hide(terminals[name].win) - return - else - -- Otherwise, reopen the floating terminal - terminals[name] = create_floating_window { buf = terminals[name].buf, name = name } - vim.cmd 'normal i' - return - end - end - - -- If it doesn't exist, create a new floating terminal - terminals[name] = create_floating_window { name = name } - vim.cmd.terminal() - vim.cmd 'normal i' -end - -local function list_active_terminals() - local terminal_names = {} - - -- Collect names of active terminals - for name, _ in pairs(terminals) do - table.insert(terminal_names, name) - end - - return terminal_names -end - -local function list_terminals() - local terminal_names = list_active_terminals() - print(vim.inspect(terminal_names)) - -- If there are active terminals, show them in a Telescope picker - if #terminal_names > 0 then - -- show picker with terminals - else - vim.notify('No active terminals found', vim.log.levels.INFO) - end -end - --- Map the keys -vim.keymap.set('n', 't', function() - vim.ui.input({ prompt = 'Enter terminal name: ' }, function(input) - if input then - toggle_terminal(input) - end - end) -end, { noremap = true, silent = true }) - -vim.keymap.set('n', 'lt', list_terminals, { noremap = true, silent = true })