diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000000..709dee0766c Binary files /dev/null and b/.DS_Store differ diff --git a/.github/.DS_Store b/.github/.DS_Store new file mode 100644 index 00000000000..de2f5c5a0cf Binary files /dev/null and b/.github/.DS_Store differ diff --git a/.gitignore b/.gitignore index 005b535b606..34477f08fdf 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ test.sh nvim spell/ -lazy-lock.json +# lazy-lock.json diff --git a/init.lua b/init.lua index 776c6873ff6..b9a01249d99 100644 --- a/init.lua +++ b/init.lua @@ -6,9 +6,9 @@ ======== .-----. ======== ======== .----------------------. | === | ======== ======== |.-""""""""""""""""""-.| |-----| ======== -======== || || | === | ======== ======== || KICKSTART.NVIM || |-----| ======== ======== || || | === | ======== +======== || || | === | ======== ======== || || |-----| ======== ======== ||:Tutor || |:::::| ======== ======== |'-..................-'| |____o| ======== @@ -91,7 +91,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` @@ -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' @@ -154,7 +154,7 @@ vim.opt.inccommand = 'split' vim.opt.cursorline = true -- Minimal number of screen lines to keep above and below the cursor. -vim.opt.scrolloff = 10 +vim.opt.scrolloff = 28 -- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`), -- instead raise a dialog asking if you wish to save the current file(s) @@ -168,6 +168,12 @@ vim.opt.confirm = true -- See `:help hlsearch` 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' }) @@ -180,10 +186,10 @@ vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagn vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) -- TIP: Disable arrow keys in normal mode --- vim.keymap.set('n', '', 'echo "Use h to move!!"') --- vim.keymap.set('n', '', 'echo "Use l to move!!"') --- vim.keymap.set('n', '', 'echo "Use k to move!!"') --- vim.keymap.set('n', '', 'echo "Use j to move!!"') +vim.keymap.set('n', '', 'echo "Use h to move!!"') +vim.keymap.set('n', '', 'echo "Use l to move!!"') +vim.keymap.set('n', '', 'echo "Use k to move!!"') +vim.keymap.set('n', '', 'echo "Use j to move!!"') -- Keybinds to make split navigation easier. -- Use CTRL+ to switch between windows @@ -200,6 +206,69 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the upper win -- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) -- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) +-- NOTE: Francis Custom block mover: +-- Alt J / K in visual mode to more a block up/down +-- Try to move lines up/down in normal and visual modes + +-- Helper function to safely map keys +local function map(mode, lhs, rhs, opts) + local options = { noremap = true, silent = true } + if opts then + options = vim.tbl_extend('force', options, opts) + end + vim.keymap.set(mode, lhs, rhs, options) +end + +-- Helper function to safely map keys +local function map(mode, lhs, rhs, opts) + local options = { noremap = true, silent = true } + if opts then + options = vim.tbl_extend('force', options, opts) + end + vim.keymap.set(mode, lhs, rhs, options) +end + +-- Move lines with Cmd+j / Cmd+k +map('n', '', ':m .+1==', { desc = 'Move line down (Cmd)' }) +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` @@ -214,6 +283,9 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) +-- Make indent guides match comment color +vim.api.nvim_set_hl(0, 'BlinkIndent', { fg = '#2a2f36' }) -- RGB 42, 47, 54 (lighter than before) + -- [[ 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' @@ -240,14 +312,12 @@ 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: 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. -- -- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded. -- - -- Alternatively, use `config = function() ... end` for full control over the configuration. -- If you prefer to call `setup` explicitly, use: -- { @@ -275,7 +345,17 @@ require('lazy').setup({ }, }, }, + -- NOTE: CLaude code Plugin + { + 'greggh/claude-code.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', -- Required for git operations + }, + config = function() + require('claude-code').setup() + end, + }, -- NOTE: Plugins can also be configured to run Lua code when they are loaded. -- -- This is often very useful to both group configuration, as well as handle @@ -289,7 +369,6 @@ require('lazy').setup({ -- -- Then, because we use the `opts` key (recommended), the configuration runs -- after the plugin has been loaded as `require(MODULE).setup(opts)`. - { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' @@ -342,7 +421,6 @@ require('lazy').setup({ }, }, }, - -- NOTE: Plugins can specify dependencies. -- -- The dependencies are proper plugin specifications as well - anything @@ -510,6 +588,18 @@ require('lazy').setup({ -- If you're wondering about lsp vs treesitter, you can check out the wonderfully -- and elegantly composed help section, `:help lsp-vs-treesitter` + -- LSP Hover and Signature Help Border (set before LspAttach) + vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { + border = 'rounded', + }) + vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, { + border = 'rounded', + }) + + -- Lighten LSP popup background + vim.api.nvim_set_hl(0, 'NormalFloat', { bg = '#15171c' }) + vim.api.nvim_set_hl(0, 'FloatBorder', { bg = '#15171c', fg = '#6a6a6a' }) + -- This function gets run when an LSP attaches to a particular buffer. -- That is to say, every time a new file is opened that is associated with -- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this @@ -564,6 +654,25 @@ require('lazy').setup({ -- the definition of its *type*, not where it was *defined*. map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition') + -- Follow file:// links in LSP hover popup + vim.keymap.set('n', 'gx', function() + local line = vim.api.nvim_get_current_line() + local url = line:match('file://([^)]+)') + if url then + local file = url:match('([^#]+)') + local lnum = url:match('#L(%d+)') + if file then + vim.cmd('edit ' .. vim.fn.fnameescape(file)) + if lnum then + vim.cmd('normal! ' .. lnum .. 'Gzz') + end + end + else + -- Fallback to default gx behavior + vim.ui.open(vim.fn.expand('')) + end + end, { buffer = event.buf, desc = 'LSP: Open file:// link' }) + -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) ---@param client vim.lsp.Client ---@param method vim.lsp.protocol.Method @@ -577,6 +686,16 @@ require('lazy').setup({ end end + -- Show diagnostics in floating window on cursor hold + local diagnostic_augroup = vim.api.nvim_create_augroup('kickstart-lsp-diagnostics', { clear = false }) + vim.api.nvim_create_autocmd('CursorHold', { + buffer = event.buf, + group = diagnostic_augroup, + callback = function() + vim.diagnostic.open_float(nil, { focus = false, scope = 'cursor' }) + end, + }) + -- The following two autocommands are used to highlight references of the -- word under your cursor when your cursor rests there for a little while. -- See `:help CursorHold` for information about when this is executed @@ -602,6 +721,7 @@ require('lazy').setup({ callback = function(event2) vim.lsp.buf.clear_references() vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf } + vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-diagnostics', buffer = event2.buf } end, }) end @@ -618,6 +738,15 @@ require('lazy').setup({ end, }) + -- Override diagnostic handler to prevent URI errors + local default_diagnostic_handler = vim.lsp.handlers['textDocument/publishDiagnostics'] + vim.lsp.handlers['textDocument/publishDiagnostics'] = function(err, result, ctx, config) + -- Filter out diagnostics with invalid URIs + if result and result.uri and type(result.uri) == 'string' and result.uri ~= '' then + return default_diagnostic_handler(err, result, ctx, config) + end + end + -- Diagnostic Config -- See :help vim.diagnostic.Opts vim.diagnostic.config { @@ -665,7 +794,36 @@ require('lazy').setup({ local servers = { -- clangd = {}, -- gopls = {}, - -- pyright = {}, + jsonls = {}, + zls = { + cmd = { 'zls' }, + settings = { + zig_exe_path = vim.fn.expand('~/.zvm/bin/zig'), + }, + }, + pyright = { + cmd = { 'pyright-langserver', '--stdio' }, + settings = { + python = { + pythonPath = '/Users/fq/.pyenv/versions/3.13.1/envs/rca/bin/python3', + analysis = { + extraPaths = { '/Users/fq/.pyenv/versions/3.13.1/envs/rca/lib/python3.13/site-packages' }, + autoSearchPaths = true, + useLibraryCodeForTypes = true, + diagnosticMode = 'workspace', + }, + }, + }, + }, + sourcekit = { + capabilities = { + workspace = { + didChangeWatchedFiles = { + dynamicRegistration = true, + }, + }, + }, + }, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- @@ -705,9 +863,15 @@ require('lazy').setup({ -- -- You can add other tools here that you want Mason to install -- for you, so that they are available from within Neovim. - local ensure_installed = vim.tbl_keys(servers or {}) + -- Filter out servers that aren't available through Mason + local mason_servers = vim.tbl_filter(function(server_name) + return server_name ~= 'sourcekit' and server_name ~= 'zls' -- sourcekit-lsp comes with Xcode, zls using custom version + end, vim.tbl_keys(servers or {})) + + local ensure_installed = mason_servers vim.list_extend(ensure_installed, { 'stylua', -- Used to format Lua code + 'pyright', -- Python LSP server }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } @@ -721,10 +885,24 @@ require('lazy').setup({ -- by the server configuration above. Useful when disabling -- certain features of an LSP (for example, turning off formatting for ts_ls) server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) - require('lspconfig')[server_name].setup(server) + + -- Use new vim.lsp.config API for Neovim 0.11+ + vim.lsp.config(server_name, server) + vim.lsp.enable(server_name) end, }, } + + -- Setup LSP servers that aren't managed by Mason + local non_mason_servers = { 'sourcekit', 'zls' } + for _, server_name in ipairs(non_mason_servers) do + local server = servers[server_name] or {} + server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) + + -- Use new vim.lsp.config API for Neovim 0.11+ + vim.lsp.config(server_name, server) + vim.lsp.enable(server_name) + end end, }, @@ -760,6 +938,7 @@ require('lazy').setup({ end, formatters_by_ft = { lua = { 'stylua' }, + json = { 'prettier' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- @@ -791,12 +970,12 @@ require('lazy').setup({ -- `friendly-snippets` contains a variety of premade snippets. -- See the README about individual language/framework/plugin snippets: -- https://github.com/rafamadriz/friendly-snippets - -- { - -- 'rafamadriz/friendly-snippets', - -- config = function() - -- require('luasnip.loaders.from_vscode').lazy_load() - -- end, - -- }, + { + 'rafamadriz/friendly-snippets', + config = function() + require('luasnip.loaders.from_vscode').lazy_load() + end, + }, }, opts = {}, }, @@ -848,10 +1027,12 @@ require('lazy').setup({ sources = { default = { 'lsp', 'path', 'snippets', 'lazydev' }, providers = { - lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 }, + lazydev = { + module = 'lazydev.integrations.blink', + score_offset = 100, + }, }, }, - snippets = { preset = 'luasnip' }, -- Blink.cmp includes an optional, recommended rust fuzzy matcher, @@ -873,20 +1054,50 @@ require('lazy').setup({ -- change the command in the config to whatever the name of that colorscheme is. -- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - 'folke/tokyonight.nvim', + -- 'folke/tokyonight.nvim', + + 'webhooked/kanso.nvim', + commit = '62e9c5d', priority = 1000, -- Make sure to load this before all the other start plugins. config = function() - ---@diagnostic disable-next-line: missing-fields - require('tokyonight').setup { - styles = { - comments = { italic = false }, -- Disable italics in comments + -- -@diagnostic disable-next-line: missing-fields + -- require('tokyonight').setup { + -- styles = { + -- comments = { italic = false }, -- Disable italics in comments + -- }, + -- } + -- Default options: + require('kanso').setup { + compile = false, -- enable compiling the colorscheme + undercurl = true, -- enable undercurls + commentStyle = { italic = true }, + functionStyle = {}, + keywordStyle = { italic = true }, + statementStyle = {}, + typeStyle = {}, + disableItalics = false, + transparent = false, -- do not set background color + dimInactive = false, -- dim inactive window `:h hl-NormalNC` + terminalColors = true, -- define vim.g.terminal_color_{0,17} + colors = { -- add/modify theme and palette colors + palette = {}, + theme = { zen = {}, pearl = {}, ink = {}, all = {} }, + }, + overrides = function(colors) -- add/modify highlights + return {} + end, + theme = 'zen', -- Load "zen" theme + background = { -- map the value of 'background' option to a theme + dark = 'zen', -- try "ink" or "zen"! + light = 'pearl', }, } - -- Load the colorscheme here. + -- -- 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-night' + vim.cmd.colorscheme 'kanso-zen' end, }, @@ -936,7 +1147,7 @@ require('lazy').setup({ main = 'nvim-treesitter.configs', -- Sets main module to use for opts -- [[ Configure Treesitter ]] See `:help nvim-treesitter` opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, + ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'python', 'query', 'vim', 'vimdoc' }, -- Autoinstall languages that are not installed auto_install = true, highlight = { @@ -966,7 +1177,7 @@ 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.neo-tree', @@ -976,12 +1187,13 @@ 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! -- In normal mode type `sh` then write `lazy.nvim-plugin` -- you can continue same window with `sr` which resumes last telescope search + }, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the @@ -1004,5 +1216,53 @@ require('lazy').setup({ }, }) +-- NOTE: Claude Code Plugin Config +require('claude-code').setup { + -- Terminal window settings + window = { + split_ratio = 0.3, -- Percentage of screen for the terminal window (height for horizontal, width for vertical splits) + position = 'vertical', -- Position of the window: "botright", "topleft", "vertical", "rightbelow vsplit", etc. + enter_insert = true, -- Whether to enter insert mode when opening Claude Code + hide_numbers = true, -- Hide line numbers in the terminal window + hide_signcolumn = true, -- Hide the sign column in the terminal window + }, + -- File refresh settings + refresh = { + enable = true, -- Enable file change detection + updatetime = 100, -- updatetime when Claude Code is active (milliseconds) + timer_interval = 1000, -- How often to check for file changes (milliseconds) + show_notifications = true, -- Show notification when files are reloaded + }, + -- Git project settings + git = { + use_git_root = true, -- Set CWD to git root when opening Claude Code (if in git project) + }, + -- Command settings + command = 'claude', -- Command used to launch Claude Code + -- Command variants + command_variants = { + -- Conversation management + continue = '--continue', -- Resume the most recent conversation + resume = '--resume', -- Display an interactive conversation picker + + -- Output options + verbose = '--verbose', -- Enable verbose logging with full turn-by-turn output + }, + -- Keymaps + keymaps = { + toggle = { + normal = '', -- Normal mode keymap for toggling Claude Code, false to disable + terminal = '', -- Terminal mode keymap for toggling Claude Code, false to disable + variants = { + continue = 'cC', -- Normal mode keymap for Claude Code with continue flag + verbose = 'cV', -- Normal mode keymap for Claude Code with verbose flag + }, + }, + window_navigation = true, -- Enable window navigation keymaps () + scrolling = true, -- Enable scrolling keymaps () for page up/down + }, +} + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et +vim.g.python3_host_prog = '/Users/fq/.pyenv/versions/3.13.1/envs/rca/bin/python3' diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 00000000000..6d07f98f19a --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,35 @@ +{ + "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, + "blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" }, + "blink.indent": { "branch": "main", "commit": "a66ac16464f22a813c755af283af423a38bbde65" }, + "claude-code.nvim": { "branch": "main", "commit": "c9a31e51069977edaad9560473b5d031fcc5d38b" }, + "conform.nvim": { "branch": "master", "commit": "fbcb4fa7f34bfea9be702ffff481a8e336ebf6ed" }, + "dropbar.nvim": { "branch": "master", "commit": "ce202248134e3949aac375fd66c28e5207785b10" }, + "fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "gitsigns.nvim": { "branch": "main", "commit": "1ee5c1fd068c81f9dd06483e639c2aa4587dc197" }, + "hover.nvim": { "branch": "main", "commit": "3b49066e09e03e63be6d6f43ae2b8bcd58301f63" }, + "kanso.nvim": { "branch": "main", "commit": "62e9c5d669567d086474b2b6863e0724c71c6c99" }, + "lazy.nvim": { "branch": "main", "commit": "1ea3c4085785f460fb0e46d2fe1ee895f5f9e7c1" }, + "lazydev.nvim": { "branch": "main", "commit": "e28ce52fc7ff79fcb76f0e79ee6fb6182fca90b9" }, + "marks.nvim": { "branch": "master", "commit": "f353e8c08c50f39e99a9ed474172df7eddd89b72" }, + "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" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "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": "b8221e42cf7287c4dcde81f232f58d7b947c210d" }, + "persistence.nvim": { "branch": "main", "commit": "51eef57272742b773468949f6bd0503ec3f83874" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "precognition.nvim": { "branch": "main", "commit": "2aae2687207029b3611a0e19a289f9e1c7efbe16" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, + "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, + "todo-comments.nvim": { "branch": "main", "commit": "19d461ddd543e938eb22505fb03fa878800270b6" }, + "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, + "vscode-diff.nvim": { "branch": "main", "commit": "94bba113413cb660397f219d4096775338ea08e1" }, + "which-key.nvim": { "branch": "main", "commit": "b4177e3eaf15fe5eb8357ebac2286d488be1ed00" } +} diff --git a/lua/.DS_Store b/lua/.DS_Store new file mode 100644 index 00000000000..9037292f7f6 Binary files /dev/null and b/lua/.DS_Store differ diff --git a/lua/custom/plugins/dropbar.lua b/lua/custom/plugins/dropbar.lua new file mode 100644 index 00000000000..b16e1269047 --- /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 00000000000..13343ba8cf5 --- /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/init.lua b/lua/custom/plugins/init.lua index be0eb9d8d7a..720ce5b6eb0 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,15 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} + +return { + { + 'esmuellert/vscode-diff.nvim', + dependencies = { + 'MunifTanjim/nui.nvim', + }, + config = function() + require('vscode-diff').setup() + end, + }, +} diff --git a/lua/custom/plugins/marks.lua b/lua/custom/plugins/marks.lua new file mode 100644 index 00000000000..50ae0d037f6 --- /dev/null +++ b/lua/custom/plugins/marks.lua @@ -0,0 +1,38 @@ +return { + 'chentoast/marks.nvim', + event = 'VeryLazy', + opts = { + -- whether to map keybinds or not. default true + default_mappings = true, + -- which builtin marks to show. default {} + builtin_marks = { '.', '<', '>', '^' }, + -- whether movements cycle back to the beginning/end of buffer. default true + cyclic = true, + -- whether the shada file is updated after modifying uppercase marks. default false + force_write_shada = false, + -- how often (in ms) to redraw signs/recompute mark positions + -- higher values will have better performance but may cause visual lag, + -- while lower values may cause performance penalties. default 150. + refresh_interval = 250, + -- sign priorities for each type of mark - builtin marks, uppercase marks, lowercase + -- marks, and bookmarks. + -- can be either a table with all/none of the keys, or a single number, in which case + -- the priority applies to all marks. + -- default 10. + sign_priority = { lower = 10, upper = 15, builtin = 8, bookmark = 20 }, + -- disables mark tracking for specific filetypes. default {} + excluded_filetypes = {}, + -- disables mark tracking for specific buftypes. default {} + excluded_buftypes = {}, + -- marks.nvim allows you to configure up to 10 bookmark groups, each with its own + -- sign/virttext. Bookmarks can be used to group together positions and quickly move + -- across multiple buffers. default sign is '!@#$%^&*()' (from 0 to 9), and + -- default virt_text is "". + bookmark_0 = { + sign = '⚑', + virt_text = 'hello world', + annotate = false, + }, + mappings = {}, + }, +} diff --git a/lua/custom/plugins/nvim-tree.lua b/lua/custom/plugins/nvim-tree.lua new file mode 100644 index 00000000000..9ffe95f095f --- /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/custom/plugins/persistence.lua b/lua/custom/plugins/persistence.lua new file mode 100644 index 00000000000..bf54c696394 --- /dev/null +++ b/lua/custom/plugins/persistence.lua @@ -0,0 +1,29 @@ +return { + 'folke/persistence.nvim', + event = 'BufReadPre', + opts = {}, + -- Optional keymaps for manual session control + keys = { + { + 'qs', + function() + require('persistence').load() + end, + desc = 'Restore Session', + }, + { + 'ql', + function() + require('persistence').load { last = true } + end, + desc = 'Restore Last Session', + }, + { + 'qd', + function() + require('persistence').stop() + end, + desc = "Don't Save Current Session", + }, + }, +} diff --git a/lua/custom/plugins/precognition.lua b/lua/custom/plugins/precognition.lua new file mode 100644 index 00000000000..2b6f63b8f11 --- /dev/null +++ b/lua/custom/plugins/precognition.lua @@ -0,0 +1,37 @@ +return { + 'tris203/precognition.nvim', + --event = "VeryLazy", + opts = { + startVisible = true, + -- showBlankVirtLine = true, + -- highlightColor = { link = "Comment" }, + -- hints = { + -- Caret = { text = "^", prio = 2 }, + -- Dollar = { text = "$", prio = 1 }, + -- MatchingPair = { text = "%", prio = 5 }, + -- Zero = { text = "0", prio = 1 }, + -- w = { text = "w", prio = 10 }, + -- b = { text = "b", prio = 9 }, + -- e = { text = "e", prio = 8 }, + -- W = { text = "W", prio = 7 }, + -- B = { text = "B", prio = 6 }, + -- E = { text = "E", prio = 5 }, + -- }, + -- gutterHints = { + -- G = { text = "G", prio = 10 }, + -- gg = { text = "gg", prio = 9 }, + -- PrevParagraph = { text = "{", prio = 8 }, + -- NextParagraph = { text = "}", prio = 8 }, + -- }, + -- disabled_fts = { + -- "startify", + -- }, + }, + keys = { + { + 'P', + 'Precognition toggle', + desc = 'Toggle Precognition', + }, + }, +} diff --git a/lua/kickstart/plugins/indent_line.lua b/lua/kickstart/plugins/indent_line.lua index ed7f269399f..040788810d6 100644 --- a/lua/kickstart/plugins/indent_line.lua +++ b/lua/kickstart/plugins/indent_line.lua @@ -1,9 +1,17 @@ return { { -- Add indentation guides even on blank lines - 'lukas-reineke/indent-blankline.nvim', - -- Enable `lukas-reineke/indent-blankline.nvim` - -- See `:help ibl` - main = 'ibl', - opts = {}, + 'saghen/blink.indent', + -- See: https://github.com/saghen/blink.indent + --- @module 'blink.indent' + --- @type blink.indent.Config + opts = { + static = { + enabled = true, -- Enable static indent guides + char = '▏', -- Thinner character (alternatives: '│', '┊', '┆', '¦', '|', '⁞') + }, + scope = { + enabled = false, -- Disable scope highlighting + }, + }, }, }