diff --git a/KEYBIND_ANALYSIS.md b/KEYBIND_ANALYSIS.md index 0bd1b49e..baebc632 100644 --- a/KEYBIND_ANALYSIS.md +++ b/KEYBIND_ANALYSIS.md @@ -3,7 +3,7 @@ ## Current Active Keybindings (Modular Config) ### Leader Key -- **Leader**: `` +- **Leader**: `` (Fixed: was missing from config!) ### Core Navigation & Editing - `` - Clear search highlights (in normal mode) @@ -170,6 +170,16 @@ Navigation between occurrences: - `` or `]]` - Next occurrence (if configured) - `` or `[[` - Previous occurrence (if configured) +### Visual Feedback +- **Yank Highlighting** - Text flashes when yanked/copied (automatic) +- **Cursor Line** - Current line is highlighted +- **Search Highlighting** - Search results are highlighted (clear with ``) + +### System Integration +- **Clipboard** - System clipboard integration enabled (yank/paste works with OS) +- **Mouse** - Full mouse support in all modes +- **Undo** - Persistent undo history across sessions + ### Which-Key Groups Groups that organize keybindings: - `c` - **[C]ode** operations diff --git a/lua/core/autocmds.lua b/lua/core/autocmds.lua index e69de29b..ec36a675 100644 --- a/lua/core/autocmds.lua +++ b/lua/core/autocmds.lua @@ -0,0 +1,13 @@ +-- [[ Basic Autocommands ]] +-- See `:help lua-guide-autocommands` + +-- Highlight when yanking (copying) text +-- Try it with `yap` in normal mode +-- See `:help vim.hl.on_yank()` +vim.api.nvim_create_autocmd('TextYankPost', { + desc = 'Highlight when yanking (copying) text', + group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }), + callback = function() + vim.hl.on_yank() + end, +}) \ No newline at end of file diff --git a/lua/core/bootstrap.lua b/lua/core/bootstrap.lua index 7420e268..e21b1f46 100644 --- a/lua/core/bootstrap.lua +++ b/lua/core/bootstrap.lua @@ -1,6 +1,6 @@ -- Lazy.nvim installation local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' -if not vim.loop.fs_stat(lazypath) then +if not (vim.uv or vim.loop).fs_stat(lazypath) then vim.fn.system { 'git', 'clone', diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua index f32998b0..495d79f0 100644 --- a/lua/core/keymaps.lua +++ b/lua/core/keymaps.lua @@ -1,6 +1,18 @@ -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` +-- Clear search highlights with Escape in normal mode +vim.keymap.set('n', '', 'nohlsearch') + +-- Diagnostic keymaps +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) + +-- Exit terminal mode with double Escape +vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) + +-- NOTE: Window navigation is handled by nvim-tmux-navigator plugin +-- which provides seamless navigation between vim splits and tmux panes + -- LSP reload function local function reload_lsp() local clients = vim.lsp.get_clients() diff --git a/lua/core/options.lua b/lua/core/options.lua index b3b15566..169b8309 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -1,22 +1,68 @@ +-- Set as the leader key +-- See `:help mapleader` +-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' + -- Place custom vim options here -- Set based on your font installation vim.g.have_nerd_font = true --- Indentation settings -vim.o.smartindent = true -vim.o.autoindent = true -vim.o.expandtab = true -vim.o.tabstop = 2 -vim.o.shiftwidth = 2 -vim.o.softtabstop = 2 +-- [[ Essential Options from Kickstart ]] +-- These MUST be set since we're not loading kickstart's defaults --- Add any other custom vim.o or vim.g settings from your old config here --- For example, if you changed defaults for: --- vim.opt.number = true -- (Already default in kickstart) --- vim.opt.mouse = 'a' -- (Already default in kickstart) --- etc... Review the options section of your old init.lua and add any *changed* values here. --- The kickstart defaults are generally sensible, so you might not need many overrides. +-- Line numbers +vim.opt.number = true +vim.opt.relativenumber = true + +-- Mouse and interaction +vim.opt.mouse = 'a' -- Enable mouse mode +vim.opt.showmode = false -- Don't show mode since we have a statusline + +-- Clipboard - sync with system clipboard +vim.opt.clipboard = 'unnamedplus' + +-- Indentation settings +vim.opt.breakindent = true -- Enable break indent +vim.opt.smartindent = true +vim.opt.autoindent = true +vim.opt.expandtab = true +vim.opt.tabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.softtabstop = 2 + +-- Save undo history +vim.opt.undofile = true + +-- Search settings +vim.opt.ignorecase = true -- Case insensitive searching +vim.opt.smartcase = true -- Unless capital in search +vim.opt.hlsearch = true -- Highlight search results + +-- Keep signcolumn on by default +vim.opt.signcolumn = 'yes' + +-- Decrease update time +vim.opt.updatetime = 250 +vim.opt.timeoutlen = 300 -- Time to wait for mapped sequence + +-- Configure how new splits should be opened +vim.opt.splitright = true +vim.opt.splitbelow = true + +-- Sets how neovim will display certain whitespace characters +vim.opt.list = true +vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } + +-- Preview substitutions live +vim.opt.inccommand = 'split' + +-- Show which line your cursor is on +vim.opt.cursorline = true + +-- Minimal number of screen lines to keep above and below the cursor +vim.opt.scrolloff = 10 -- Function to check if running in a shared tmux session local function is_shared_tmux_session()