diff --git a/.gitignore b/.gitignore index a52bd495579..72408fd06ea 100644 --- a/.gitignore +++ b/.gitignore @@ -5,10 +5,8 @@ nvim spell/ -# In your personal fork, you likely want to comment this, since it's recommended to track -# nvim-pack-lock.json in version control - see :help vim.pack-lockfile -# For the official `nvim-lua/kickstart.nvim` git repository, we leave it ignored to avoid unneeded -# merge conflicts. -nvim-pack-lock.json +# Tracked in this personal fork (recommended - see :help vim.pack-lockfile). +# Only the official `nvim-lua/kickstart.nvim` repo ignores it, to avoid unneeded merge conflicts. +# nvim-pack-lock.json .DS_Store diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000000..a1869bb32e1 --- /dev/null +++ b/flake.nix @@ -0,0 +1,14 @@ +{ + description = "Neovim config"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs }: { + # This exposes your repo as a plain source tree + lib = { + path = self; + }; + }; +} diff --git a/init.lua b/init.lua index 99763667213..93e01c81929 100644 --- a/init.lua +++ b/init.lua @@ -99,7 +99,7 @@ do 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.o` @@ -110,7 +110,7 @@ do vim.o.number = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! - -- vim.o.relativenumber = true + vim.o.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.o.mouse = 'a' @@ -305,6 +305,11 @@ do return end + if name == 'CopilotChat.nvim' and vim.fn.executable 'make' == 1 then + run_build(name, { 'make', 'tiktoken' }, ev.data.path) + return + end + if name == 'LuaSnip' then if vim.fn.has 'win32' ~= 1 and vim.fn.executable 'make' == 1 then run_build(name, { 'make', 'install_jsregexp' }, ev.data.path) end return @@ -319,8 +324,8 @@ do }) end ----Because most plugins are hosted on GitHub, you can use the helper ----function to have less repetition in the following sections. +--- Because most plugins are hosted on GitHub, you can use the helper +--- function to have less repetition in the following sections. ---@param repo string ---@return string local function gh(repo) return 'https://github.com/' .. repo end @@ -423,18 +428,21 @@ do -- change the command under that to load whatever the name of that colorscheme is. -- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - vim.pack.add { gh 'folke/tokyonight.nvim' } - ---@diagnostic disable-next-line: missing-fields - require('tokyonight').setup { - styles = { - comments = { italic = false }, -- Disable italics in comments - }, - } - - -- 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' + -- + -- NOTE: Colorscheme is managed in lua/custom/plugins/theme.lua instead, so the + -- default tokyonight install/setup/colorscheme below is disabled. + -- vim.pack.add { gh 'folke/tokyonight.nvim' } + -- ---@diagnostic disable-next-line: missing-fields + -- require('tokyonight').setup { + -- styles = { + -- comments = { italic = false }, -- Disable italics in comments + -- }, + -- } + -- + -- -- 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' -- Highlight todo, notes, etc in comments vim.pack.add { gh 'folke/todo-comments.nvim' } @@ -519,7 +527,7 @@ do -- Telescope picker. This is really useful to discover what Telescope can -- do as well as how to actually do it! - ---@type (string|vim.pack.Spec)[] + ---@type (string | vim.pack.Spec)[] local telescope_plugins = { gh 'nvim-lua/plenary.nvim', gh 'nvim-telescope/telescope.nvim', @@ -532,17 +540,9 @@ do -- See `:help telescope` and `:help telescope.setup()` require('telescope').setup { - -- You can put your default mappings / updates / etc. in here - -- All the info you're looking for is in `:help telescope.setup()` - -- - -- defaults = { - -- mappings = { - -- i = { [''] = 'to_fuzzy_refine' }, - -- }, - -- }, - -- pickers = {} + defaults = require('telescope.themes').get_ivy(), extensions = { - ['ui-select'] = { require('telescope.themes').get_dropdown() }, + ['ui-select'] = { require('telescope.themes').get_ivy() }, }, } @@ -581,7 +581,7 @@ do -- Jump to the definition of the word under your cursor. -- This is where a variable was first declared, or where a function is defined, etc. -- To jump back, press . - vim.keymap.set('n', 'grd', builtin.lsp_definitions, { buffer = buf, desc = '[G]oto [D]efinition' }) + vim.keymap.set('n', 'gd', builtin.lsp_definitions, { buffer = buf, desc = '[G]oto [D]efinition' }) -- Fuzzy find all the symbols in your current document. -- Symbols are things like variables, functions, types, etc. @@ -677,9 +677,10 @@ do vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) end - -- Rename the variable under your cursor. + map('K', vim.lsp.buf.hover, 'Hover Documentation') + -- Most Language Servers support renaming across files, etc. - map('grn', vim.lsp.buf.rename, '[R]e[n]ame') + map('rn', vim.lsp.buf.rename, '[R]e[n]ame') -- 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. @@ -746,6 +747,23 @@ do stylua = {}, -- Used to format Lua code + kotlin_lsp = {}, + + yamlls = { + filetypes = { 'yaml', 'yaml.docker-compose' }, + }, + + helm_ls = { + filetypes = { 'helm' }, + settings = { + ['helm-ls'] = { + yamlls = { + path = 'yaml-language-server', + }, + }, + }, + }, + -- Special Lua Config, as recommended by neovim help docs lua_ls = { on_init = function(client) @@ -803,15 +821,24 @@ do -- You can press `g?` for help in this menu. local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { - -- You can add other tools here that you want Mason to install + 'ts_ls', + 'biome', + 'docker_compose_language_service', + 'dockerls', + 'graphql', + 'jsonls', + 'eslint', + 'bashls', }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } for name, server in pairs(servers) do vim.lsp.config(name, server) - vim.lsp.enable(name) end + + -- Enable all servers (both those with custom config and those with defaults) + vim.lsp.enable(ensure_installed) end -- ============================================================ @@ -954,8 +981,12 @@ do ---@param buf integer ---@param language string local function treesitter_try_attach(buf, language) + -- Check if the buffer is valid (might not be after install completes) + if not vim.api.nvim_buf_is_valid(buf) then return end + -- Check if a parser exists and load it if not vim.treesitter.language.add(language) then return end + -- Enable syntax highlighting and other treesitter features vim.treesitter.start(buf, language) @@ -1010,16 +1041,17 @@ do -- Here are some example plugins that I've included in the Kickstart repository. -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- - -- require 'kickstart.plugins.debug' + require 'kickstart.plugins.debug' -- require 'kickstart.plugins.indent_line' - -- require 'kickstart.plugins.lint' - -- require 'kickstart.plugins.autopairs' + require 'kickstart.plugins.lint' + require 'kickstart.plugins.autopairs' + -- neo-tree is configured in lua/custom/plugins/neo-tree-config.lua instead -- require 'kickstart.plugins.neo-tree' -- NOTE: You can add your own plugins, configuration, etc. in `lua/custom/plugins/*.lua`. -- -- For independent modules, uncomment the convenience loader: - -- require 'custom.plugins' + require 'custom.plugins' -- -- `custom.plugins` automatically loads files from that directory, but their -- order is unspecified. If plugins depend on each other, keep them in the same @@ -1031,5 +1063,7 @@ do -- require 'custom.plugins.git' end +require 'custom.setup' + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/instructions.md b/instructions.md new file mode 100644 index 00000000000..cf58d9bab16 --- /dev/null +++ b/instructions.md @@ -0,0 +1,112 @@ +# Managing plugins (vim.pack) + +This config uses Neovim's built-in `vim.pack`, not `lazy.nvim`. There's no +`:Lazy` dashboard — updates go through `:lua vim.pack.update(...)`, which opens +an interactive confirmation buffer instead of a floating UI. + +Every plugin here — core kickstart ones and custom ones alike — is added the +same way: bare `src`, no version pin, tracked via `nvim-pack-lock.json` like +everything else. Nothing moves until you deliberately run +`vim.pack.update(...)`, whether that's one plugin by name or everything at +once. `version` only shows up on a spec where it's a genuine branch/tag +selection (e.g. `neo-tree.nvim` defaults to `main`, but the stable line is the +separate `v3.x` branch — same idea as `nvim-treesitter`'s `version = 'main'` +in `init.lua`), never as a freeze mechanism. + +- **Core kickstart plugins** — added in `init.lua` and + `lua/kickstart/plugins/*.lua`, as upstream ships them. +- **Custom plugins** — every `vim.pack.add()` call for them lives in one + place, `lua/custom/plugins/init.lua`. The individual files (`claude.lua`, + `comment.lua`, etc.) only contain `require(...).setup{}` and keymaps — they + don't call `vim.pack.add` themselves. This is deliberate: those files load + in an unspecified order (see the auto-discovery loop comment in `init.lua`), + so the `add()` calls have to happen earlier, in the one file guaranteed to + run first. + +## Everyday commands + +Check what's installed (name, current rev, path, spec): +```vim +:lua =vim.pack.get() +``` + +Preview + apply updates for everything (opens confirmation buffer, downloads first): +```vim +:lua vim.pack.update() +``` + +Update just one plugin (name from `vim.pack.get()`, not the file name): +```vim +:lua vim.pack.update({ 'Comment.nvim' }) +``` + +Preview without downloading (e.g. after only editing a `version` field): +```vim +:lua vim.pack.update({ 'Comment.nvim' }, { offline = true }) +``` + +Skip the confirmation buffer and apply immediately: +```vim +:lua vim.pack.update({ 'Comment.nvim' }, { force = true }) +``` + +### In the confirmation buffer + +- `]]` / `[[` — jump between plugin sections +- `gO` — outline of all plugins in the buffer +- `K` on a pending change — hover for changelog/details +- `gra` on a plugin — code actions: update / skip / delete it +- `:write` — apply everything shown; `:quit` — discard + +## Switching a plugin's version/source, or freezing it + +1. Edit its spec (in `init.lua` or `lua/custom/plugins/init.lua`) — set + `version` to a commit, tag, branch, or a range like + `vim.version.range('1.*')` if you want a ceiling; set it to an exact commit + to freeze it in place. +2. Relaunch nvim (or `:restart`). This only updates the *target* in + `nvim-pack-lock.json`, not the plugin on disk yet. +3. `:lua vim.pack.update({ 'PluginName' })`, review the diff, `:write` to apply + (or `:quit` to discard — then revert your edit too, or it'll nag again). + +## Reverting a bad update + +```sh +git checkout HEAD -- nvim-pack-lock.json # nvim-pack-lock.json is tracked in git +``` +```vim +:restart +:lua vim.pack.update({ 'PluginName' }, { offline = true, target = 'lockfile' }) +``` +Review and confirm. + +## Removing a plugin + +Delete its entry from the `vim.pack.add {}` block in +`lua/custom/plugins/init.lua`, delete its own file under +`lua/custom/plugins/` (the `require(...).setup{}`/keymaps), then: +```vim +:lua vim.pack.del({ 'PluginName' }) +``` + +## Where things live + +- Lockfile: `nvim-pack-lock.json` (tracked in this repo — un-ignored on + purpose, see `.gitignore`). +- Update history: `nvim-pack.log` under `:lua print(vim.fn.stdpath('log'))`. +- Plugin checkouts (plain git repos): `~/.local/share/nvim/site/pack/core/opt//` +- Docs: `:help vim.pack`, `:help vim.pack-examples`, `:help vim.pack-lockfile` + +## Custom plugin list + +Lives in `lua/custom/plugins/init.lua`, in one `vim.pack.add {}` block at the +top of the file — that's the single source of truth for which custom plugins +exist and how each is specced, so there's no separate table here to go stale. + +## Optional: a fancier UI + +[pack.nvim](https://github.com/igmrrf/pack.nvim) wraps `vim.pack` in a +floating dashboard closer to what `lazy.nvim`'s `:Lazy` gave you. As of writing +it's very new (single maintainer, a handful of stars) and would sit in the +critical path of every plugin loading, so it hasn't been added here — the +built-in confirmation buffer above covers most of the same workflow already. diff --git a/lua/custom/plugins/claude.lua b/lua/custom/plugins/claude.lua new file mode 100644 index 00000000000..3ca4c8a522d --- /dev/null +++ b/lua/custom/plugins/claude.lua @@ -0,0 +1,22 @@ +-- installed via lua/custom/plugins/init.lua +require('claudecode').setup { + terminal_cmd = vim.fn.system('which claude'):gsub('\n', ''), +} + +require('which-key').add { { 'a', group = 'AI/Claude Code' } } + +vim.keymap.set({ 'n', 'x' }, '', 'ClaudeCodeFocus', { desc = 'Toggle Claude' }) +vim.keymap.set('n', 'ac', 'ClaudeCode', { desc = 'Toggle Claude' }) +vim.keymap.set('n', 'af', 'ClaudeCodeFocus', { desc = 'Focus Claude' }) +vim.keymap.set('n', 'ar', 'ClaudeCode --resume', { desc = 'Resume Claude' }) +vim.keymap.set('n', 'aC', 'ClaudeCode --continue', { desc = 'Continue Claude' }) +vim.keymap.set('n', 'am', 'ClaudeCodeSelectModel', { desc = 'Select Claude model' }) +vim.keymap.set('n', 'ab', 'ClaudeCodeAdd %', { desc = 'Add current buffer' }) +vim.keymap.set('v', 'as', 'ClaudeCodeSend', { desc = 'Send to Claude' }) +vim.keymap.set('n', 'aa', 'ClaudeCodeDiffAccept', { desc = 'Accept diff' }) +vim.keymap.set('n', 'ad', 'ClaudeCodeDiffDeny', { desc = 'Deny diff' }) + +vim.api.nvim_create_autocmd('FileType', { + pattern = { 'NvimTree', 'neo-tree', 'oil', 'minifiles', 'netrw' }, + callback = function(ev) vim.keymap.set('n', 'as', 'ClaudeCodeTreeAdd', { buffer = ev.buf, desc = 'Add file' }) end, +}) diff --git a/lua/custom/plugins/comment.lua b/lua/custom/plugins/comment.lua new file mode 100644 index 00000000000..05cf622ab9f --- /dev/null +++ b/lua/custom/plugins/comment.lua @@ -0,0 +1,5 @@ +-- installed via lua/custom/plugins/init.lua +require('Comment').setup() + +vim.keymap.set('n', '/', function() require('Comment.api').toggle.linewise.current() end, { desc = 'comment toggle' }) +vim.keymap.set('v', '/', "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", { desc = 'comment toggle' }) diff --git a/lua/custom/plugins/copilot-chat.lua b/lua/custom/plugins/copilot-chat.lua new file mode 100644 index 00000000000..3a8b84ef149 --- /dev/null +++ b/lua/custom/plugins/copilot-chat.lua @@ -0,0 +1,7 @@ +-- installed via lua/custom/plugins/init.lua +vim.keymap.set('n', 'ch', 'CopilotChatToggle', { noremap = true, silent = true }) + +require('CopilotChat').setup { + -- See Configuration section for options + model = 'claude-sonnet-4.6', +} diff --git a/lua/custom/plugins/copilot.lua b/lua/custom/plugins/copilot.lua new file mode 100644 index 00000000000..75e0241ed15 --- /dev/null +++ b/lua/custom/plugins/copilot.lua @@ -0,0 +1,18 @@ +-- installed via lua/custom/plugins/init.lua +require('copilot').setup { + suggestion = { + enabled = true, + auto_trigger = true, + keymap = { + accept = '', + }, + }, + panel = { + enabled = true, + auto_refresh = true, + }, + filetypes = { + ['*'] = true, + typescript = true, + }, +} diff --git a/lua/custom/plugins/debug-custom.lua b/lua/custom/plugins/debug-custom.lua new file mode 100644 index 00000000000..3941af59e07 --- /dev/null +++ b/lua/custom/plugins/debug-custom.lua @@ -0,0 +1 @@ +return {} \ No newline at end of file diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 27290873a3f..112da8e7100 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -3,6 +3,38 @@ -- -- See the kickstart.nvim README for more information +-- Every custom plugin's vim.pack.add() call lives here, same as core kickstart +-- plugins: bare src, no version pin, tracked via nvim-pack-lock.json like +-- everything else. `version` is only set below where a plugin's default +-- branch isn't the one we actually want (e.g. neo-tree.nvim defaults to +-- `main`, but the stable line is the separate `v3.x` branch) - that's a +-- branch selection, not a freeze, same as nvim-treesitter's `version = 'main'` +-- in init.lua. +-- +-- This has to happen before the auto-discovery loop below, since that loop's +-- file order is unspecified - a plugin file's require()/setup() call would be +-- able to run before its own vim.pack.add() otherwise. Individual plugin +-- files below just do require(...).setup{} and keymaps. +-- +-- barbar.nvim reads this global as soon as it's added below, so it has to be +-- set here rather than in tabs.lua (which now runs after this point). +vim.g.barbar_auto_setup = false + +vim.pack.add { + 'https://github.com/coder/claudecode.nvim', + 'https://github.com/numToStr/Comment.nvim', + 'https://github.com/CopilotC-Nvim/CopilotChat.nvim', + 'https://github.com/zbirenbaum/copilot.lua', + 'https://github.com/MeanderingProgrammer/render-markdown.nvim', + { src = 'https://github.com/nvim-neo-tree/neo-tree.nvim', version = 'v3.x' }, + 'https://github.com/MunifTanjim/nui.nvim', + 'https://github.com/tpope/vim-sleuth', + 'https://github.com/folke/snacks.nvim', + 'https://github.com/romgrk/barbar.nvim', + 'https://github.com/ellisonleao/gruvbox.nvim', + 'https://github.com/oskarnurm/koda.nvim', +} + -- Iterate over all Lua files in the plugins directory and load them. -- `vim.fs.dir()` iteration order is unspecified and must not be relied upon. local plugins_dir = vim.fs.joinpath(vim.fn.stdpath 'config', 'lua', 'custom', 'plugins') diff --git a/lua/custom/plugins/markdown-render.lua b/lua/custom/plugins/markdown-render.lua new file mode 100644 index 00000000000..cd275e95418 --- /dev/null +++ b/lua/custom/plugins/markdown-render.lua @@ -0,0 +1,44 @@ +-- installed via lua/custom/plugins/init.lua +---@module 'render-markdown' +---@type render.md.UserConfig +require('render-markdown').setup { + file_types = { 'markdown' }, + render_modes = true, + heading = { + enabled = true, + render_modes = false, + atx = true, + setext = true, + sign = true, + icons = { '󰲡 ', '󰲣 ', '󰲥 ', '󰲧 ', '󰲩 ', '󰲫 ' }, + position = 'overlay', + signs = { '󰫎 ' }, + width = 'full', + left_margin = 0, + left_pad = 0, + right_pad = 0, + min_width = 0, + border = true, + border_virtual = true, + border_prefix = false, + above = '▄', + below = '▀', + backgrounds = { + 'RenderMarkdownH1Bg', + 'RenderMarkdownH2Bg', + 'RenderMarkdownH3Bg', + 'RenderMarkdownH4Bg', + 'RenderMarkdownH5Bg', + 'RenderMarkdownH6Bg', + }, + foregrounds = { + 'RenderMarkdownH1', + 'RenderMarkdownH2', + 'RenderMarkdownH3', + 'RenderMarkdownH4', + 'RenderMarkdownH5', + 'RenderMarkdownH6', + }, + custom = {}, + }, +} diff --git a/lua/custom/plugins/neo-tree-config.lua b/lua/custom/plugins/neo-tree-config.lua new file mode 100644 index 00000000000..b3d436f697f --- /dev/null +++ b/lua/custom/plugins/neo-tree-config.lua @@ -0,0 +1,34 @@ +-- installed via lua/custom/plugins/init.lua +-- (nvim-tree/nvim-web-devicons dependency is covered by mini.icons' devicons compat shim) +local toggle_tree = function() + vim.cmd 'Neotree toggle' + vim.opt.relativenumber = true -- Use relative line numbers +end + +vim.keymap.set('n', 'e', toggle_tree, { desc = 'Open NeoTree' }) +vim.keymap.set('n', 'n', function() vim.cmd 'Neotree focus' end, { desc = 'Focus NeoTree' }) +vim.keymap.set('n', '\\', 'Neotree reveal', { desc = 'NeoTree reveal', silent = true }) + +require('neo-tree').setup { + default_component_configs = { + indent = { + with_expanders = true, + }, + }, + filesystem = { + window = { + position = 'left', + mappings = { + ['\\'] = 'close_window', + }, + }, + follow_current_file = { + enabled = true, + }, + group_empty_dirs = true, + }, + source_selector = { + winbar = true, + statusline = false, + }, +} diff --git a/lua/custom/plugins/sleuth.lua b/lua/custom/plugins/sleuth.lua new file mode 100644 index 00000000000..429d1a9ebba --- /dev/null +++ b/lua/custom/plugins/sleuth.lua @@ -0,0 +1,2 @@ +-- Detects tabstop/shiftwidth automatically, no config needed. +-- Installed via lua/custom/plugins/init.lua diff --git a/lua/custom/plugins/snacks.lua b/lua/custom/plugins/snacks.lua new file mode 100644 index 00000000000..47f50f206b9 --- /dev/null +++ b/lua/custom/plugins/snacks.lua @@ -0,0 +1,72 @@ +-- installed via lua/custom/plugins/init.lua +---@type snacks.Config +require('snacks').setup { + bigfile = { enabled = true }, + dashboard = { + enabled = true, + preset = {}, + sections = { + { section = 'header' }, + { + pane = 1, + section = 'terminal', + cmd = 'command -v fortune >/dev/null && command -v cowsay >/dev/null && fortune | cowsay || echo Moo', + height = 10, + padding = 1, + }, + { section = 'keys', gap = 1, padding = 1 }, + { + pane = 2, + icon = ' ', + desc = 'Browse Repo', + padding = 1, + key = 'b', + action = function() + Snacks.gitbrowse() + end, + }, + function() + local in_git = Snacks.git.get_root() ~= nil + local has_remote = in_git and vim.fn.system 'git remote' ~= '' + local cmds = { + { + icon = ' ', + title = 'Git Status', + cmd = 'git --no-pager diff --stat -B -M -C || echo "Nothing to report"', + height = 10, + enabled = in_git, + }, + } + return vim.tbl_map(function(cmd) + return vim.tbl_extend('force', { + pane = 2, + section = 'terminal', + padding = 1, + ttl = 5 * 60, + indent = 3, + }, cmd) + end, cmds) + end, + -- ponytail: dropped { section = 'startup' } — it hard-requires 'lazy.stats', + -- which no longer exists now that we're on vim.pack instead of lazy.nvim + }, + }, + explorer = { enabled = false }, + indent = { enabled = true }, + input = { enabled = true }, + picker = { enabled = true }, + notifier = { + enabled = true, + -- snacks replaces vim.notify, so nothing reaches :messages; mirror it there. + -- filter runs once per notification; always returns true so nothing is hidden. + filter = function(notif) + vim.api.nvim_echo({ { notif.msg } }, true, {}) + return true + end, + }, + quickfile = { enabled = true }, + scope = { enabled = true }, + scroll = { enabled = true }, + statuscolumn = { enabled = true }, + words = { enabled = true }, +} diff --git a/lua/custom/plugins/tabs.lua b/lua/custom/plugins/tabs.lua new file mode 100644 index 00000000000..7ce39f6dfd4 --- /dev/null +++ b/lua/custom/plugins/tabs.lua @@ -0,0 +1,11 @@ +-- installed via lua/custom/plugins/init.lua (vim.g.barbar_auto_setup is also +-- set there, since it must be set before barbar.nvim's plugin/ files load) +vim.keymap.set('n', '', 'BufferNext', { noremap = true, silent = true }) +vim.keymap.set('n', '', 'BufferPrevious', { noremap = true, silent = true }) +vim.keymap.set('n', 'xx', 'BufferClose', { noremap = true, silent = true }) +vim.keymap.set('n', 'xl', 'BufferCloseBuffersRight', { noremap = true, silent = true }) +vim.keymap.set('n', 'xh', 'BufferCloseBuffersLeft', { noremap = true, silent = true }) + +require('barbar').setup { + animation = true, +} diff --git a/lua/custom/plugins/theme.lua b/lua/custom/plugins/theme.lua new file mode 100644 index 00000000000..5a7c40de14c --- /dev/null +++ b/lua/custom/plugins/theme.lua @@ -0,0 +1,13 @@ +-- installed via lua/custom/plugins/init.lua +local variable = '#e07a78' + +require('koda').setup { + colors = { keyword = '#f5c542', func = '#7fbfe0' }, + -- koda has no palette key for variables + on_highlights = function(hl) + for _, g in ipairs { '@variable', '@variable.parameter', '@variable.member' } do + hl[g] = { fg = variable } + end + end, +} +vim.cmd.colorscheme 'koda-dark' diff --git a/lua/custom/setup.lua b/lua/custom/setup.lua new file mode 100644 index 00000000000..a916557f950 --- /dev/null +++ b/lua/custom/setup.lua @@ -0,0 +1,39 @@ +if vim.fn.executable 'tree-sitter' == 0 then + vim.schedule(function() vim.notify('tree-sitter-cli not found! Run: npm install -g tree-sitter-cli', vim.log.levels.WARN) end) +end + +vim.filetype.add { + pattern = { + ['.*/templates/.*%.yaml'] = 'helm', + ['.*/templates/.*%.tpl'] = 'helm', + ['helmfile.*%.yaml'] = 'helm', + }, +} + +-- Kotlin debugging support, layered onto kickstart's nvim-dap setup +-- (lua/kickstart/plugins/debug.lua) without editing that file. custom.setup is +-- required after kickstart.plugins.debug in init.lua, so nvim-dap is already loaded. +local ok, registry = pcall(require, 'mason-registry') +if ok then + pcall(function() + if not registry.is_installed 'kotlin-debug-adapter' then + registry.get_package('kotlin-debug-adapter'):install() + end + end) +end + +local dap = require 'dap' +dap.adapters.kotlin = { + type = 'executable', + command = 'kotlin-debug-adapter', +} +dap.configurations.kotlin = { + { + type = 'kotlin', + request = 'attach', + name = 'Attach to Kotlin Process', + projectRoot = vim.fn.getcwd, + hostName = 'localhost', + port = 5005, + }, +} diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index db5448c2cfc..2e8b9e55cb7 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -70,16 +70,16 @@ dapui.setup { } -- Change breakpoint icons --- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' }) --- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' }) --- local breakpoint_icons = vim.g.have_nerd_font --- and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' } --- or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' } --- for type, icon in pairs(breakpoint_icons) do --- local tp = 'Dap' .. type --- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak' --- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl }) --- end +vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' }) +vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' }) +local breakpoint_icons = vim.g.have_nerd_font + and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' } + or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' } +for type, icon in pairs(breakpoint_icons) do + local tp = 'Dap' .. type + local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak' + vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl }) +end dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.before.event_terminated['dapui_config'] = dapui.close diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json new file mode 100644 index 00000000000..53ee70d5819 --- /dev/null +++ b/nvim-pack-lock.json @@ -0,0 +1,160 @@ +{ + "plugins": { + "Comment.nvim": { + "rev": "e30b7f2008e52442154b66f7c519bfd2f1e32acb", + "src": "https://github.com/numToStr/Comment.nvim" + }, + "CopilotChat.nvim": { + "rev": "004ced055d8db59561cfcddc5f141ccd8d5a033b", + "src": "https://github.com/CopilotC-Nvim/CopilotChat.nvim" + }, + "LuaSnip": { + "rev": "642b0c595e11608b4c18219e93b88d7637af27bc", + "src": "https://github.com/L3MON4D3/LuaSnip", + "version": "2.0.0 - 3.0.0" + }, + "barbar.nvim": { + "rev": "53b5a2f34b68875898f0531032fbf090e3952ad7", + "src": "https://github.com/romgrk/barbar.nvim" + }, + "blink.cmp": { + "rev": "78336bc89ee5365633bcf754d93df01678b5c08f", + "src": "https://github.com/saghen/blink.cmp", + "version": "1.0.0 - 2.0.0" + }, + "claudecode.nvim": { + "rev": "2390c6e45c4789072c293ac69de051d169668b29", + "src": "https://github.com/coder/claudecode.nvim" + }, + "conform.nvim": { + "rev": "016802de402556da54c36bd7359b441266b01cdd", + "src": "https://github.com/stevearc/conform.nvim" + }, + "copilot.lua": { + "rev": "901a6c564abb45c7703401ecc6416bb0d15afd37", + "src": "https://github.com/zbirenbaum/copilot.lua" + }, + "fidget.nvim": { + "rev": "9e0201673e08e997e7cf52afca5565c70bd117f3", + "src": "https://github.com/j-hui/fidget.nvim" + }, + "gitsigns.nvim": { + "rev": "5be654f2232c10ddcad19c1607a67b6b4b78fc29", + "src": "https://github.com/lewis6991/gitsigns.nvim" + }, + "gruvbox.nvim": { + "rev": "154eb5ff5b96d0641307113fa385eaf0d36d9796", + "src": "https://github.com/ellisonleao/gruvbox.nvim" + }, + "guess-indent.nvim": { + "rev": "84a4987ff36798c2fc1169cbaff67960aed9776f", + "src": "https://github.com/NMAC427/guess-indent.nvim" + }, + "koda.nvim": { + "rev": "25a5c98ca2f6bb0b69f5e2654a78f0d7c7e0721d", + "src": "https://github.com/oskarnurm/koda.nvim" + }, + "mason-lspconfig.nvim": { + "rev": "5d32a9b8de9f90466797a740edb0fb4b3c27e423", + "src": "https://github.com/mason-org/mason-lspconfig.nvim" + }, + "mason-nvim-dap.nvim": { + "rev": "9a10e096703966335bd5c46c8c875d5b0690dade", + "src": "https://github.com/jay-babu/mason-nvim-dap.nvim" + }, + "mason-tool-installer.nvim": { + "rev": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc", + "src": "https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim" + }, + "mason.nvim": { + "rev": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d", + "src": "https://github.com/mason-org/mason.nvim" + }, + "mini.nvim": { + "rev": "25f25d3e6661d942323e56711096de1850d814ec", + "src": "https://github.com/nvim-mini/mini.nvim" + }, + "neo-tree.nvim": { + "rev": "f3f3bf73414e400cf9fc13fda50f00404a8f8ab1", + "src": "https://github.com/nvim-neo-tree/neo-tree.nvim", + "version": "'v3.x'" + }, + "nui.nvim": { + "rev": "10fc361835c856ba4233ef5ea135b919bf3dce97", + "src": "https://github.com/MunifTanjim/nui.nvim" + }, + "nvim-autopairs": { + "rev": "430522f95fe4fb7c511ec64f8c1a90cc6a66c05c", + "src": "https://github.com/windwp/nvim-autopairs" + }, + "nvim-dap": { + "rev": "c9a0738e45f1bd41d792a126941348dce661cf9b", + "src": "https://github.com/mfussenegger/nvim-dap" + }, + "nvim-dap-go": { + "rev": "b4421153ead5d726603b02743ea40cf26a51ed5f", + "src": "https://github.com/leoluz/nvim-dap-go" + }, + "nvim-dap-ui": { + "rev": "cc9dd33aade7f20bae414d0cba163bc60d4d4b43", + "src": "https://github.com/rcarriga/nvim-dap-ui" + }, + "nvim-lint": { + "rev": "3d55c8f67c6ae5c15e1042571e107c7a3d5c5f4e", + "src": "https://github.com/mfussenegger/nvim-lint" + }, + "nvim-lspconfig": { + "rev": "19576de1c1b6d1b5e231ea6ef9cba9a811c322bb", + "src": "https://github.com/neovim/nvim-lspconfig" + }, + "nvim-nio": { + "rev": "edcc181a875301dd21840189aa2f2f9ad69fc172", + "src": "https://github.com/nvim-neotest/nvim-nio" + }, + "nvim-treesitter": { + "rev": "5cb0114e6242625db56dd6440e945ed1ece10bc7", + "src": "https://github.com/nvim-treesitter/nvim-treesitter", + "version": "'main'" + }, + "oxocarbon.nvim": { + "rev": "cd6523a0836d6e8ee823d343149fd06c7b71fdde", + "src": "https://github.com/nyoom-engineering/oxocarbon.nvim" + }, + "plenary.nvim": { + "rev": "74b06c6c75e4eeb3108ec01852001636d85a932b", + "src": "https://github.com/nvim-lua/plenary.nvim" + }, + "render-markdown.nvim": { + "rev": "4663eb3ecd538bd5062628fb6d95bbe6bdca78f6", + "src": "https://github.com/MeanderingProgrammer/render-markdown.nvim" + }, + "snacks.nvim": { + "rev": "882c996cf28183f4d63640de0b4c02ec886d01f2", + "src": "https://github.com/folke/snacks.nvim" + }, + "telescope-fzf-native.nvim": { + "rev": "b25b749b9db64d375d782094e2b9dce53ad53a40", + "src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim" + }, + "telescope-ui-select.nvim": { + "rev": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2", + "src": "https://github.com/nvim-telescope/telescope-ui-select.nvim" + }, + "telescope.nvim": { + "rev": "40aedd8a68c78a656a10a8d62d80c54af59420fb", + "src": "https://github.com/nvim-telescope/telescope.nvim" + }, + "todo-comments.nvim": { + "rev": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668", + "src": "https://github.com/folke/todo-comments.nvim" + }, + "vim-sleuth": { + "rev": "be69bff86754b1aa5adcbb527d7fcd1635a84080", + "src": "https://github.com/tpope/vim-sleuth" + }, + "which-key.nvim": { + "rev": "3aab2147e74890957785941f0c1ad87d0a44c15a", + "src": "https://github.com/folke/which-key.nvim" + } + } +}