From e3bd8537e29367b004291ce07b88455b0472fe93 Mon Sep 17 00:00:00 2001 From: Natercio Moniz Date: Mon, 11 Aug 2025 09:14:07 +0100 Subject: [PATCH] changed to astronvim --- README.md | 35 +- doc/kickstart.txt | 24 - init.lua | 723 +------------------------- lua/community.lua | 12 + lua/custom/plugins/avante.lua | 64 --- lua/custom/plugins/diffview.lua | 4 - lua/custom/plugins/init.lua | 5 - lua/custom/plugins/neoscroll.lua | 46 -- lua/keymaps.lua | 59 --- lua/kickstart/health.lua | 52 -- lua/kickstart/plugins/autopairs.lua | 16 - lua/kickstart/plugins/debug.lua | 111 ---- lua/kickstart/plugins/gitsigns.lua | 65 --- lua/kickstart/plugins/indent_line.lua | 9 - lua/kickstart/plugins/lint.lua | 55 -- lua/kickstart/plugins/neo-tree.lua | 411 --------------- lua/lazy_setup.lua | 32 ++ lua/opts.lua | 78 --- lua/plugins/astrocore.lua | 83 +++ lua/plugins/astrolsp.lua | 103 ++++ lua/plugins/astroui.lua | 37 ++ lua/plugins/mason.lua | 27 + lua/plugins/none-ls.lua | 24 + lua/plugins/nvim-dap.lua | 11 + lua/plugins/treesitter.lua | 21 + lua/plugins/user.lua | 77 +++ lua/polish.lua | 5 + neovim.yml | 6 + selene.toml | 8 + 29 files changed, 499 insertions(+), 1704 deletions(-) delete mode 100644 doc/kickstart.txt create mode 100644 lua/community.lua delete mode 100644 lua/custom/plugins/avante.lua delete mode 100644 lua/custom/plugins/diffview.lua delete mode 100644 lua/custom/plugins/init.lua delete mode 100644 lua/custom/plugins/neoscroll.lua delete mode 100644 lua/keymaps.lua delete mode 100644 lua/kickstart/health.lua delete mode 100644 lua/kickstart/plugins/autopairs.lua delete mode 100644 lua/kickstart/plugins/debug.lua delete mode 100644 lua/kickstart/plugins/gitsigns.lua delete mode 100644 lua/kickstart/plugins/indent_line.lua delete mode 100644 lua/kickstart/plugins/lint.lua delete mode 100644 lua/kickstart/plugins/neo-tree.lua create mode 100644 lua/lazy_setup.lua delete mode 100644 lua/opts.lua create mode 100644 lua/plugins/astrocore.lua create mode 100644 lua/plugins/astrolsp.lua create mode 100644 lua/plugins/astroui.lua create mode 100644 lua/plugins/mason.lua create mode 100644 lua/plugins/none-ls.lua create mode 100644 lua/plugins/nvim-dap.lua create mode 100644 lua/plugins/treesitter.lua create mode 100644 lua/plugins/user.lua create mode 100644 lua/polish.lua create mode 100644 neovim.yml create mode 100644 selene.toml diff --git a/README.md b/README.md index 45ef1f4..71d48de 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,34 @@ -# Neovim config +# AstroNvim Template -This is my fork of kickstart.nvim! +**NOTE:** This is for AstroNvim v5+ + +A template for getting started with [AstroNvim](https://github.com/AstroNvim/AstroNvim) + +## ๐Ÿ› ๏ธ Installation + +#### Make a backup of your current nvim and shared folder + +```shell +mv ~/.config/nvim ~/.config/nvim.bak +mv ~/.local/share/nvim ~/.local/share/nvim.bak +mv ~/.local/state/nvim ~/.local/state/nvim.bak +mv ~/.cache/nvim ~/.cache/nvim.bak +``` + +#### Create a new user repository from this template + +Press the "Use this template" button above to create a new repository to store your user configuration. + +You can also just clone this repository directly if you do not want to track your user configuration in GitHub. + +#### Clone the repository + +```shell +git clone https://github.com// ~/.config/nvim +``` + +#### Start Neovim + +```shell +nvim +``` diff --git a/doc/kickstart.txt b/doc/kickstart.txt deleted file mode 100644 index cb87ac3..0000000 --- a/doc/kickstart.txt +++ /dev/null @@ -1,24 +0,0 @@ -================================================================================ -INTRODUCTION *kickstart.nvim* - -Kickstart.nvim is a project to help you get started on your neovim journey. - - *kickstart-is-not* -It is not: -- Complete framework for every plugin under the sun -- Place to add every plugin that could ever be useful - - *kickstart-is* -It is: -- Somewhere that has a good start for the most common "IDE" type features: - - autocompletion - - goto-definition - - find references - - fuzzy finding - - and hinting at what more can be done :) -- A place to _kickstart_ your journey. - - You should fork this project and use/modify it so that it matches your - style and preferences. If you don't want to do that, there are probably - other projects that would fit much better for you (and that's great!)! - - vim:tw=78:ts=8:ft=help:norl: diff --git a/init.lua b/init.lua index 3888e27..424e48d 100644 --- a/init.lua +++ b/init.lua @@ -1,710 +1,27 @@ -require 'opts' +-- This file simply bootstraps the installation of Lazy.nvim and then calls other files for execution +-- This file doesn't necessarily need to be touched, BE CAUTIOUS editing this file and proceed at your own risk. +local lazypath = vim.env.LAZY or vim.fn.stdpath "data" .. "/lazy/lazy.nvim" -require 'keymaps' - --- [[ 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('kickstart-highlight-yank', { clear = true }), - callback = function() - vim.hl.on_yank() - end, -}) - --- [[ 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' -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = 'https://github.com/folke/lazy.nvim.git' - local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } +if not (vim.env.LAZY or (vim.uv or vim.loop).fs_stat(lazypath)) then + -- stylua: ignore + local result = vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) if vim.v.shell_error ~= 0 then - error('Error cloning lazy.nvim:\n' .. out) + -- stylua: ignore + vim.api.nvim_echo({ { ("Error cloning lazy.nvim:\n%s\n"):format(result), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {}) + vim.fn.getchar() + vim.cmd.quit() end end ----@type vim.Option -local rtp = vim.opt.rtp -rtp:prepend(lazypath) +vim.opt.rtp:prepend(lazypath) --- [[ Configure and install plugins ]] --- --- To check the current status of your plugins, run --- :Lazy --- --- You can press `?` in this menu for help. Use `:q` to close the window --- --- To update plugins you can run --- :Lazy update --- -require('lazy').setup({ - 'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically +-- validate that lazy is available +if not pcall(require, "lazy") then + -- stylua: ignore + vim.api.nvim_echo({ { ("Unable to load lazy from: %s\n"):format(lazypath), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {}) + vim.fn.getchar() + vim.cmd.quit() +end - { -- Useful plugin to show you pending keybinds. - 'folke/which-key.nvim', - event = 'VimEnter', -- Sets the loading event to 'VimEnter' - opts = { - -- delay between pressing a key and opening which-key (milliseconds) - -- this setting is independent of vim.o.timeoutlen - delay = 0, - icons = { - -- set icon mappings to true if you have a Nerd Font - mappings = vim.g.have_nerd_font, - -- If you are using a Nerd Font: set icons.keys to an empty table which will use the - -- default which-key.nvim defined Nerd Font icons, otherwise define a string table - keys = vim.g.have_nerd_font and {} or { - Up = ' ', - Down = ' ', - Left = ' ', - Right = ' ', - C = ' ', - M = ' ', - D = ' ', - S = ' ', - CR = ' ', - Esc = ' ', - ScrollWheelDown = ' ', - ScrollWheelUp = ' ', - NL = ' ', - BS = ' ', - Space = ' ', - Tab = ' ', - F1 = '', - F2 = '', - F3 = '', - F4 = '', - F5 = '', - F6 = '', - F7 = '', - F8 = '', - F9 = '', - F10 = '', - F11 = '', - F12 = '', - }, - }, - - -- Document existing key chains - spec = { - { 's', group = '[S]earch' }, - { 't', group = '[T]oggle' }, - { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, - }, - }, - }, - - { -- Fuzzy Finder (files, lsp, etc) - 'nvim-telescope/telescope.nvim', - event = 'VimEnter', - dependencies = { - 'nvim-lua/plenary.nvim', - { -- If encountering errors, see telescope-fzf-native README for installation instructions - 'nvim-telescope/telescope-fzf-native.nvim', - - -- `build` is used to run some command when the plugin is installed/updated. - -- This is only run then, not every time Neovim starts up. - build = 'make', - - -- `cond` is a condition used to determine whether this plugin should be - -- installed and loaded. - cond = function() - return vim.fn.executable 'make' == 1 - end, - }, - { 'nvim-telescope/telescope-ui-select.nvim' }, - - -- Useful for getting pretty icons, but requires a Nerd Font. - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, - }, - config = function() - -- Telescope is a fuzzy finder that comes with a lot of different things that - -- it can fuzzy find! It's more than just a "file finder", it can search - -- many different aspects of Neovim, your workspace, LSP, and more! - -- - -- The easiest way to use Telescope, is to start by doing something like: - -- :Telescope help_tags - -- - -- After running this command, a window will open up and you're able to - -- type in the prompt window. You'll see a list of `help_tags` options and - -- a corresponding preview of the help. - -- - -- Two important keymaps to use while in Telescope are: - -- - Insert mode: - -- - Normal mode: ? - -- - -- This opens a window that shows you all of the keymaps for the current - -- Telescope picker. This is really useful to discover what Telescope can - -- do as well as how to actually do it! - - -- [[ Configure Telescope ]] - -- 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 = {} - extensions = { - ['ui-select'] = { - require('telescope.themes').get_dropdown(), - }, - }, - } - - -- Enable Telescope extensions if they are installed - pcall(require('telescope').load_extension, 'fzf') - pcall(require('telescope').load_extension, 'ui-select') - - -- See `:help telescope.builtin` - local builtin = require 'telescope.builtin' - 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' }) - vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) - vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) - vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) - vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) - vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) - vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) - vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) - - -- Slightly advanced example of overriding default behavior and theme - vim.keymap.set('n', '/', function() - -- You can pass additional configuration to Telescope to change the theme, layout, etc. - builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { - winblend = 10, - previewer = false, - }) - end, { desc = '[/] Fuzzily search in current buffer' }) - - -- It's also possible to pass additional configuration options. - -- See `:help telescope.builtin.live_grep()` for information about particular keys - vim.keymap.set('n', 's/', function() - builtin.live_grep { - grep_open_files = true, - prompt_title = 'Live Grep in Open Files', - } - end, { desc = '[S]earch [/] in Open Files' }) - - -- Shortcut for searching your Neovim configuration files - vim.keymap.set('n', 'sn', function() - builtin.find_files { cwd = vim.fn.stdpath 'config' } - end, { desc = '[S]earch [N]eovim files' }) - end, - }, - - -- LSP Plugins - { - -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins - -- used for completion, annotations and signatures of Neovim apis - 'folke/lazydev.nvim', - ft = 'lua', - opts = { - library = { - -- Load luvit types when the `vim.uv` word is found - { path = '${3rd}/luv/library', words = { 'vim%.uv' } }, - }, - }, - }, - { - -- Main LSP Configuration - 'neovim/nvim-lspconfig', - dependencies = { - -- Automatically install LSPs and related tools to stdpath for Neovim - -- Mason must be loaded before its dependents so we need to set it up here. - -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})` - { 'mason-org/mason.nvim', opts = {} }, - 'mason-org/mason-lspconfig.nvim', - 'WhoIsSethDaniel/mason-tool-installer.nvim', - - -- Useful status updates for LSP. - { 'j-hui/fidget.nvim', opts = {} }, - - -- Allows extra capabilities provided by blink.cmp - 'saghen/blink.cmp', - }, - config = function() - -- 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 - -- function will be executed to configure the current buffer - vim.api.nvim_create_autocmd('LspAttach', { - group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), - callback = function(event) - -- NOTE: Remember that Lua is a real programming language, and as such it is possible - -- to define small helper and utility functions so you don't have to repeat yourself. - -- - -- In this case, we create a function that lets us more easily define mappings specific - -- for LSP related items. It sets the mode, buffer and description for us each time. - local map = function(keys, func, desc, mode) - mode = mode or 'n' - vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) - end - - -- Rename the variable under your cursor. - -- Most Language Servers support renaming across files, etc. - map('grn', 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. - map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' }) - - -- Find references for the word under your cursor. - map('grr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - - -- Jump to the implementation of the word under your cursor. - -- Useful when your language has ways of declaring types without an actual implementation. - map('gri', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') - - -- 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 . - map('grd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') - - -- WARN: This is not Goto Definition, this is Goto Declaration. - -- For example, in C this would take you to the header. - map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') - - -- Fuzzy find all the symbols in your current document. - -- Symbols are things like variables, functions, types, etc. - map('gO', require('telescope.builtin').lsp_document_symbols, 'Open Document Symbols') - - -- Fuzzy find all the symbols in your current workspace. - -- Similar to document symbols, except searches over your entire project. - map('gW', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Open Workspace Symbols') - - -- Jump to the type of the word under your cursor. - -- Useful when you're not sure what type a variable is and you want to see - -- the definition of its *type*, not where it was *defined*. - map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition') - - -- 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 - ---@param bufnr? integer some lsp support methods only in specific files - ---@return boolean - local function client_supports_method(client, method, bufnr) - if vim.fn.has 'nvim-0.11' == 1 then - return client:supports_method(method, bufnr) - else - return client.supports_method(method, { bufnr = bufnr }) - end - 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 - -- - -- When you move your cursor, the highlights will be cleared (the second autocommand). - local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then - local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) - vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { - buffer = event.buf, - group = highlight_augroup, - callback = vim.lsp.buf.document_highlight, - }) - - vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { - buffer = event.buf, - group = highlight_augroup, - callback = vim.lsp.buf.clear_references, - }) - - vim.api.nvim_create_autocmd('LspDetach', { - group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }), - callback = function(event2) - vim.lsp.buf.clear_references() - vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf } - 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, - }) - - -- Diagnostic Config - -- See :help vim.diagnostic.Opts - vim.diagnostic.config { - severity_sort = true, - float = { border = 'rounded', source = 'if_many' }, - underline = { severity = vim.diagnostic.severity.ERROR }, - signs = vim.g.have_nerd_font and { - text = { - [vim.diagnostic.severity.ERROR] = '๓ฐ…š ', - [vim.diagnostic.severity.WARN] = '๓ฐ€ช ', - [vim.diagnostic.severity.INFO] = '๓ฐ‹ฝ ', - [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, - }, - } - - -- LSP servers and clients are able to communicate to each other what features they support. - -- By default, Neovim doesn't support everything that is in the LSP specification. - -- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities. - -- So, we create new capabilities with blink.cmp, and then broadcast that to the servers. - local capabilities = require('blink.cmp').get_lsp_capabilities() - - -- Enable the following language servers - -- Add any additional override configuration in the following tables. Available keys are: - -- - cmd (table): Override the default command used to start the server - -- - filetypes (table): Override the default list of associated filetypes for the server - -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. - -- - settings (table): Override the default settings passed when initializing the server. - -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ - local servers = { - -- clangd = {}, - gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, - -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs - -- - -- Some languages (like typescript) have entire language plugins that can be useful: - -- https://github.com/pmizio/typescript-tools.nvim - -- - -- But for many setups, the LSP (`ts_ls`) will work just fine - ts_ls = {}, - - lua_ls = { - -- cmd = { ... }, - -- filetypes = { ... }, - -- capabilities = {}, - settings = { - Lua = { - completion = { - callSnippet = 'Replace', - }, - -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings - -- diagnostics = { disable = { 'missing-fields' } }, - }, - }, - }, - } - - local ensure_installed = vim.tbl_keys(servers or {}) - vim.list_extend(ensure_installed, { - 'stylua', -- Used to format Lua code - }) - require('mason-tool-installer').setup { ensure_installed = ensure_installed } - - require('mason-lspconfig').setup { - ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer) - automatic_installation = false, - handlers = { - function(server_name) - local server = servers[server_name] or {} - -- This handles overriding only values explicitly passed - -- 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) - end, - }, - } - end, - }, - - { -- Autoformat - 'stevearc/conform.nvim', - event = { 'BufWritePre' }, - cmd = { 'ConformInfo' }, - keys = { - { - 'f', - function() - require('conform').format { async = true, lsp_format = 'fallback' } - end, - mode = '', - desc = '[F]ormat buffer', - }, - }, - opts = { - notify_on_error = false, - format_on_save = function(bufnr) - -- Disable "format_on_save lsp_fallback" for languages that don't - -- have a well standardized coding style. You can add additional - -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } - if disable_filetypes[vim.bo[bufnr].filetype] then - return nil - else - return { - timeout_ms = 500, - lsp_format = 'fallback', - } - end - end, - formatters_by_ft = { - lua = { 'stylua' }, - -- Conform can also run multiple formatters sequentially - -- 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 }, - }, - }, - }, - - { -- Autocompletion - 'saghen/blink.cmp', - event = 'VimEnter', - version = '1.*', - dependencies = { - -- Snippet Engine - { - 'L3MON4D3/LuaSnip', - version = '2.*', - build = (function() - -- Build Step is needed for regex support in snippets. - -- This step is not supported in many windows environments. - -- Remove the below condition to re-enable on windows. - if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then - return - end - return 'make install_jsregexp' - end)(), - dependencies = { - -- `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, - -- }, - }, - opts = {}, - }, - 'folke/lazydev.nvim', - }, - --- @module 'blink.cmp' - --- @type blink.cmp.Config - opts = { - keymap = { - -- 'default' (recommended) for mappings similar to built-in completions - -- to accept ([y]es) the completion. - -- This will auto-import if your LSP supports it. - -- This will expand snippets if the LSP sent a snippet. - -- 'super-tab' for tab to accept - -- 'enter' for enter to accept - -- 'none' for no mappings - -- - -- For an understanding of why the 'default' preset is recommended, - -- you will need to read `:help ins-completion` - -- - -- No, but seriously. Please read `:help ins-completion`, it is really good! - -- - -- All presets have the following mappings: - -- /: move to right/left of your snippet expansion - -- : Open menu or open docs if already open - -- / or /: Select next/previous item - -- : Hide menu - -- : Toggle signature help - -- - -- See :h blink-cmp-config-keymap for defining your own keymap - preset = 'default', - - -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: - -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps - }, - - appearance = { - -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' - -- Adjusts spacing to ensure icons are aligned - nerd_font_variant = 'mono', - }, - - completion = { - -- By default, you may press `` to show the documentation. - -- Optionally, set `auto_show = true` to show the documentation after a delay. - documentation = { auto_show = false, auto_show_delay_ms = 500 }, - }, - - sources = { - default = { 'lsp', 'path', 'snippets', 'lazydev' }, - providers = { - lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 }, - }, - }, - - snippets = { preset = 'luasnip' }, - - -- Blink.cmp includes an optional, recommended rust fuzzy matcher, - -- which automatically downloads a prebuilt binary when enabled. - -- - -- By default, we use the Lua implementation instead, but you may enable - -- the rust implementation via `'prefer_rust_with_warning'` - -- - -- See :h blink-cmp-config-fuzzy for more information - fuzzy = { implementation = 'lua' }, - - -- Shows a signature help window while you type arguments for a function - signature = { enabled = true }, - }, - }, - - { -- 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. - -- - -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - 'folke/tokyonight.nvim', - 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 - }, - } - - -- 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' - end, - }, - - -- Highlight todo, notes, etc in comments - { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, - - { -- Collection of various small independent plugins/modules - 'echasnovski/mini.nvim', - config = function() - -- Better Around/Inside textobjects - -- - -- Examples: - -- - 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 } - - -- Add/delete/replace surroundings (brackets, quotes, etc.) - -- - -- - 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() - - -- 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 - - -- ... and there is more! - -- Check out: https://github.com/echasnovski/mini.nvim - end, - }, - { -- Highlight, edit, and navigate code - 'nvim-treesitter/nvim-treesitter', - build = ':TSUpdate', - 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', 'go', 'graphql' }, - -- Autoinstall languages that are not installed - auto_install = true, - highlight = { - enable = true, - -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. - -- If you are experiencing weird indenting issues, add the language to - -- the list of additional_vim_regex_highlighting and disabled languages for indent. - additional_vim_regex_highlighting = { 'ruby' }, - }, - indent = { enable = true, disable = { 'ruby' } }, - }, - -- There are additional nvim-treesitter modules that you can use to interact - -- with nvim-treesitter. You should go explore a few and see what interests you: - -- - -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` - -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context - -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects - }, - - -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the - -- init.lua. If you want these files, they are in the repository, so you can just download them and - -- place them in the correct locations. - - -- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart - -- - -- 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.indent_line', - -- require 'kickstart.plugins.lint', - require 'kickstart.plugins.autopairs', - require 'kickstart.plugins.neo-tree', - require 'kickstart.plugins.gitsigns', - - -- 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. - -- - -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` - { import = 'custom.plugins' }, -}, { - ui = { - -- If you are using a Nerd Font: set icons to an empty table which will use the - -- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table - icons = vim.g.have_nerd_font and {} or { - cmd = 'โŒ˜', - config = '๐Ÿ› ', - event = '๐Ÿ“…', - ft = '๐Ÿ“‚', - init = 'โš™', - keys = '๐Ÿ—', - plugin = '๐Ÿ”Œ', - runtime = '๐Ÿ’ป', - require = '๐ŸŒ™', - source = '๐Ÿ“„', - start = '๐Ÿš€', - task = '๐Ÿ“Œ', - lazy = '๐Ÿ’ค ', - }, - }, -}) - --- The line beneath this is called `modeline`. See `:help modeline` --- vim: ts=2 sts=2 sw=2 et +require "lazy_setup" +require "polish" diff --git a/lua/community.lua b/lua/community.lua new file mode 100644 index 0000000..c842899 --- /dev/null +++ b/lua/community.lua @@ -0,0 +1,12 @@ +if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE + +-- AstroCommunity: import any community modules here +-- We import this file in `lazy_setup.lua` before the `plugins/` folder. +-- This guarantees that the specs are processed before any user plugins. + +---@type LazySpec +return { + "AstroNvim/astrocommunity", + { import = "astrocommunity.pack.lua" }, + -- import/override with your plugins folder +} diff --git a/lua/custom/plugins/avante.lua b/lua/custom/plugins/avante.lua deleted file mode 100644 index 79a4e30..0000000 --- a/lua/custom/plugins/avante.lua +++ /dev/null @@ -1,64 +0,0 @@ -return { - 'yetone/avante.nvim', - build = function() - return 'make' - end, - event = 'VeryLazy', - version = false, -- Never set this value to "*"! Never! - ---@module 'avante' - ---@type avante.Config - opts = { - -- add any opts here - -- for example - provider = 'claude', - providers = { - claude = { - endpoint = 'https://api.anthropic.com', - model = 'claude-sonnet-4-20250514', - timeout = 15000, -- Timeout in milliseconds - extra_request_body = { - temperature = 0.75, - max_tokens = 20480, - }, - }, - }, - }, - dependencies = { - 'nvim-lua/plenary.nvim', - 'MunifTanjim/nui.nvim', - --- The below dependencies are optional, - 'echasnovski/mini.pick', -- for file_selector provider mini.pick - 'nvim-telescope/telescope.nvim', -- for file_selector provider telescope - 'hrsh7th/nvim-cmp', -- autocompletion for avante commands and mentions - 'ibhagwan/fzf-lua', -- for file_selector provider fzf - 'stevearc/dressing.nvim', -- for input provider dressing - 'folke/snacks.nvim', -- for input provider snacks - 'nvim-tree/nvim-web-devicons', -- or echasnovski/mini.icons - 'zbirenbaum/copilot.lua', -- for providers='copilot' - --{ - -- -- support for image pasting - -- 'HakonHarnes/img-clip.nvim', - -- event = 'VeryLazy', - -- opts = { - -- -- recommended settings - -- default = { - -- embed_image_as_base64 = false, - -- prompt_for_file_name = false, - -- drag_and_drop = { - -- insert_mode = true, - -- }, - -- -- required for Windows users - -- use_absolute_path = true, - -- }, - -- }, - --}, - { - -- Make sure to set this up properly if you have lazy=true - 'MeanderingProgrammer/render-markdown.nvim', - opts = { - file_types = { 'markdown', 'Avante' }, - }, - ft = { 'markdown', 'Avante' }, - }, - }, -} diff --git a/lua/custom/plugins/diffview.lua b/lua/custom/plugins/diffview.lua deleted file mode 100644 index 1e08a7d..0000000 --- a/lua/custom/plugins/diffview.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - 'sindrets/diffview.nvim', - cmd = { 'DiffviewOpen', 'DiffviewClose', 'DiffviewToggleFiles', 'DiffviewFocusFiles' }, -} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua deleted file mode 100644 index be0eb9d..0000000 --- a/lua/custom/plugins/init.lua +++ /dev/null @@ -1,5 +0,0 @@ --- You can add your own plugins here or in other files in this directory! --- I promise not to create any merge conflicts in this directory :) --- --- See the kickstart.nvim README for more information -return {} diff --git a/lua/custom/plugins/neoscroll.lua b/lua/custom/plugins/neoscroll.lua deleted file mode 100644 index 9c4d147..0000000 --- a/lua/custom/plugins/neoscroll.lua +++ /dev/null @@ -1,46 +0,0 @@ -return { - 'karb94/neoscroll.nvim', - config = function() - local neoscroll = require 'neoscroll' - neoscroll.setup { - mappings = { - '', - '', - '', - '', - 'zt', - 'zz', - 'zb', - }, - easing = 'quadratic', - } - - local keymap = { - [''] = function() - neoscroll.ctrl_u { duration = 150 } - end, - [''] = function() - neoscroll.ctrl_d { duration = 150 } - end, - [''] = function() - neoscroll.ctrl_b { duration = 300 } - end, - [''] = function() - neoscroll.ctrl_f { duration = 300 } - end, - ['zt'] = function() - neoscroll.zt { half_win_duration = 150 } - end, - ['zz'] = function() - neoscroll.zz { half_win_duration = 150 } - end, - ['zb'] = function() - neoscroll.zb { half_win_duration = 150 } - end, - } - local modes = { 'n', 'v', 'x' } - for key, func in pairs(keymap) do - vim.keymap.set(modes, key, func) - end - end, -} diff --git a/lua/keymaps.lua b/lua/keymaps.lua deleted file mode 100644 index 5bebf4f..0000000 --- a/lua/keymaps.lua +++ /dev/null @@ -1,59 +0,0 @@ --- move lines up & down -vim.keymap.set('v', 'J', ":m '>+1gv=gv") -vim.keymap.set('v', 'K', ":m '<-2gv=gv") - --- move around centered -vim.keymap.set('n', '', 'zz') -vim.keymap.set('n', '', 'zz') -vim.keymap.set('n', 'n', 'nzzzv') -vim.keymap.set('n', 'N', 'Nzzzv') - --- copy & paste -vim.keymap.set('x', 'p', '"_dP') - -vim.keymap.set('n', 'y', '"+y') -vim.keymap.set('v', 'y', '"+y') -vim.keymap.set('n', 'Y', '"+Y') - -vim.keymap.set('n', 'd', '"_d') -vim.keymap.set('v', 'd', '"_d') - --- [[ Basic Keymaps ]] --- See `:help vim.keymap.set()` - --- Clear highlights on search when pressing in normal mode --- See `:help hlsearch` -vim.keymap.set('n', '', 'nohlsearch') - --- Diagnostic keymaps -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) - --- Keybinds to make split navigation easier. --- Use CTRL+ to switch between windows --- --- See `:help wincmd` for a list of all window commands -vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) - --- buffer management -vim.keymap.set('n', 'cc', ':bpspbnbd', { desc = '[C]lose [C]urrent buffer' }) -vim.keymap.set('n', 'ch', function() - local bufinfos = vim.fn.getbufinfo { buflisted = 1 } - local skipCount = 0 - local deleteCount = 0 - vim.tbl_map(function(bufinfo) - if bufinfo.changed == 1 then - skipCount = skipCount + 1 - elseif not bufinfo.windows or #bufinfo.windows == 0 then - deleteCount = deleteCount + 1 - vim.api.nvim_buf_delete(bufinfo.bufnr, { force = false, unload = false }) - end - print(('Deleted %d out of %d hidden buffers'):format(deleteCount, deleteCount + skipCount)) - end, bufinfos) -end, { desc = '[C]lose [H]idden buffers' }) - -vim.keymap.set('n', 'tt', function() - vim.diagnostic.open_float(nil, { focus = false }) -end, { desc = 'Toggle Trouble' }) diff --git a/lua/kickstart/health.lua b/lua/kickstart/health.lua deleted file mode 100644 index b59d086..0000000 --- a/lua/kickstart/health.lua +++ /dev/null @@ -1,52 +0,0 @@ ---[[ --- --- This file is not required for your own configuration, --- but helps people determine if their system is setup correctly. --- ---]] - -local check_version = function() - local verstr = tostring(vim.version()) - if not vim.version.ge then - vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) - return - end - - if vim.version.ge(vim.version(), '0.10-dev') then - vim.health.ok(string.format("Neovim version is: '%s'", verstr)) - else - vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) - end -end - -local check_external_reqs = function() - -- Basic utils: `git`, `make`, `unzip` - for _, exe in ipairs { 'git', 'make', 'unzip', 'rg' } do - local is_executable = vim.fn.executable(exe) == 1 - if is_executable then - vim.health.ok(string.format("Found executable: '%s'", exe)) - else - vim.health.warn(string.format("Could not find executable: '%s'", exe)) - end - end - - return true -end - -return { - check = function() - vim.health.start 'kickstart.nvim' - - vim.health.info [[NOTE: Not every warning is a 'must-fix' in `:checkhealth` - - Fix only warnings for plugins and languages you intend to use. - Mason will give warnings for languages that are not installed. - You do not need to install, unless you want to use those languages!]] - - local uv = vim.uv or vim.loop - vim.health.info('System Information: ' .. vim.inspect(uv.os_uname())) - - check_version() - check_external_reqs() - end, -} diff --git a/lua/kickstart/plugins/autopairs.lua b/lua/kickstart/plugins/autopairs.lua deleted file mode 100644 index 87a7e5f..0000000 --- a/lua/kickstart/plugins/autopairs.lua +++ /dev/null @@ -1,16 +0,0 @@ --- autopairs --- https://github.com/windwp/nvim-autopairs - -return { - 'windwp/nvim-autopairs', - event = 'InsertEnter', - -- Optional dependency - dependencies = { 'hrsh7th/nvim-cmp' }, - config = function() - require('nvim-autopairs').setup {} - -- If you want to automatically add `(` after selecting a function or method - local cmp_autopairs = require 'nvim-autopairs.completion.cmp' - local cmp = require 'cmp' - cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) - end, -} diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua deleted file mode 100644 index ea2df3f..0000000 --- a/lua/kickstart/plugins/debug.lua +++ /dev/null @@ -1,111 +0,0 @@ -return { - 'mfussenegger/nvim-dap', - dependencies = { - 'rcarriga/nvim-dap-ui', - 'nvim-neotest/nvim-nio', - 'williamboman/mason.nvim', - 'jay-babu/mason-nvim-dap.nvim', - 'leoluz/nvim-dap-go', - }, - keys = function(_, keys) - local dap = require 'dap' - local dapui = require 'dapui' - local dapgo = require 'dap-go' - - return { - -- Basic debugging keymaps, feel free to change to your liking! - { '', dap.continue, desc = 'Debug: Start/Continue' }, - { '', dap.step_into, desc = 'Debug: Step Into' }, - { '', dap.step_over, desc = 'Debug: Step Over' }, - { '', dap.step_out, desc = 'Debug: Step Out' }, - { - '', - function() - dap.terminate(nil, nil, nil) - end, - desc = 'Debug: Terminate', - }, - { 'b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' }, - { - 'B', - function() - dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end, - desc = 'Debug: Set Breakpoint', - }, - -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. - { 'td', dapui.toggle, desc = 'Debug: [T]oggle [D]AP ui.' }, - { 'rl', dap.run_last, desc = 'Debug: [R]un [l]ast' }, - { 'rt', dapgo.debug_test, desc = 'Debug: [R]un [t]est' }, - unpack(keys), - } - end, - - config = function() - local dap = require 'dap' - local dapui = require 'dapui' - - require('mason-nvim-dap').setup { - -- Makes a best effort to setup the various debuggers with - -- reasonable debug configurations - automatic_installation = true, - - -- You can provide additional configuration to the handlers, - -- see mason-nvim-dap README for more information - handlers = {}, - - -- You'll need to check that you have the required things installed - -- online, please don't ask me how to install them :) - ensure_installed = { - -- Update this to ensure that you have the debuggers for the langs you want - 'delve', - }, - } - - -- Dap UI setup - -- For more information, see |:help nvim-dap-ui| - dapui.setup { - -- Set icons to characters that are more likely to work in every terminal. - -- Feel free to remove or use ones that you like more! :) - -- Don't feel like these are good choices. - icons = { - expanded = 'โ–พ', - collapsed = 'โ–ธ', - current_frame = '*', - }, - - controls = { - icons = { - pause = 'โธ', - play = 'โ–ถ', - step_into = 'โŽ', - step_over = 'โญ', - step_out = 'โฎ', - step_back = 'b', - run_last = 'โ–ถโ–ถ', - terminate = 'โน', - disconnect = 'โ', - }, - }, - } - - vim.fn.sign_define('DapBreakpoint', { text = '๐Ÿ”ด', texthl = '', linehl = '', numhl = '' }) - vim.fn.sign_define('DapBreakpointCondition', { text = '๐ŸŸ ', texthl = '', linehl = '', numhl = '' }) - vim.fn.sign_define('DapBreakpointRejected', { text = 'โšช', texthl = '', linehl = '', numhl = '' }) - vim.fn.sign_define('DapLogPoint', { text = '๐Ÿ”ต', texthl = '', linehl = '', numhl = '' }) - vim.fn.sign_define('DapStopped', { text = '๐Ÿ‘‰', texthl = '', linehl = '', numhl = '' }) - - dap.listeners.after.event_initialized['dapui_config'] = dapui.open - dap.listeners.before.event_terminated['dapui_config'] = dapui.close - dap.listeners.before.event_exited['dapui_config'] = dapui.close - - -- Install golang specific config - require('dap-go').setup { - delve = { - -- On Windows delve must be run attached or it crashes. - -- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring - detached = vim.fn.has 'win32' == 0, - }, - } - end, -} diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/kickstart/plugins/gitsigns.lua deleted file mode 100644 index c8084c2..0000000 --- a/lua/kickstart/plugins/gitsigns.lua +++ /dev/null @@ -1,65 +0,0 @@ -return { - { - 'lewis6991/gitsigns.nvim', - opts = { - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = 'โ€พ' }, - changedelete = { text = '~' }, - }, - - on_attach = function(bufnr) - local gitsigns = require 'gitsigns' - - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end - - -- Navigation - map('n', ']c', function() - if vim.wo.diff then - vim.cmd.normal { ']c', bang = true } - else - gitsigns.nav_hunk 'next' - end - end, { desc = 'Jump to next git [c]hange' }) - - map('n', '[c', function() - if vim.wo.diff then - vim.cmd.normal { '[c', bang = true } - else - gitsigns.nav_hunk 'prev' - end - end, { desc = 'Jump to previous git [c]hange' }) - - -- Actions - -- visual mode - map('v', 'hs', function() - gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'stage git hunk' }) - map('v', 'hr', function() - gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'reset git hunk' }) - -- normal mode - map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) - map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) - map('n', 'hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) - map('n', 'hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' }) - map('n', 'hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) - map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) - map('n', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) - map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) - map('n', 'hD', function() - gitsigns.diffthis '@' - end, { desc = 'git [D]iff against last commit' }) - -- Toggles - map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) - map('n', 'tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' }) - end, - }, - }, -} diff --git a/lua/kickstart/plugins/indent_line.lua b/lua/kickstart/plugins/indent_line.lua deleted file mode 100644 index ed7f269..0000000 --- a/lua/kickstart/plugins/indent_line.lua +++ /dev/null @@ -1,9 +0,0 @@ -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 = {}, - }, -} diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua deleted file mode 100644 index ca9bc23..0000000 --- a/lua/kickstart/plugins/lint.lua +++ /dev/null @@ -1,55 +0,0 @@ -return { - - { -- Linting - 'mfussenegger/nvim-lint', - event = { 'BufReadPre', 'BufNewFile' }, - config = function() - local lint = require 'lint' - lint.linters_by_ft = { - markdown = { 'markdownlint' }, - } - - -- To allow other plugins to add linters to require('lint').linters_by_ft, - -- instead set linters_by_ft like this: - -- lint.linters_by_ft = lint.linters_by_ft or {} - -- lint.linters_by_ft['markdown'] = { 'markdownlint' } - -- - -- However, note that this will enable a set of default linters, - -- which will cause errors unless these tools are available: - -- { - -- clojure = { "clj-kondo" }, - -- dockerfile = { "hadolint" }, - -- inko = { "inko" }, - -- janet = { "janet" }, - -- json = { "jsonlint" }, - -- markdown = { "vale" }, - -- rst = { "vale" }, - -- ruby = { "ruby" }, - -- terraform = { "tflint" }, - -- text = { "vale" } - -- } - -- - -- You can disable the default linters by setting their filetypes to nil: - -- lint.linters_by_ft['clojure'] = nil - -- lint.linters_by_ft['dockerfile'] = nil - -- lint.linters_by_ft['inko'] = nil - -- lint.linters_by_ft['janet'] = nil - -- lint.linters_by_ft['json'] = nil - -- lint.linters_by_ft['markdown'] = nil - -- lint.linters_by_ft['rst'] = nil - -- lint.linters_by_ft['ruby'] = nil - -- lint.linters_by_ft['terraform'] = nil - -- lint.linters_by_ft['text'] = nil - - -- Create autocommand which carries out the actual linting - -- on the specified events. - local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true }) - vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { - group = lint_augroup, - callback = function() - lint.try_lint() - end, - }) - end, - }, -} diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua deleted file mode 100644 index 46c73fa..0000000 --- a/lua/kickstart/plugins/neo-tree.lua +++ /dev/null @@ -1,411 +0,0 @@ -return { - -- If you want neo-tree's file operations to work with LSP (updating imports, etc.), you can use a plugin like - -- https://github.com/antosha417/nvim-lsp-file-operations: - -- { - -- "antosha417/nvim-lsp-file-operations", - -- dependencies = { - -- "nvim-lua/plenary.nvim", - -- "nvim-neo-tree/neo-tree.nvim", - -- }, - -- config = function() - -- require("lsp-file-operations").setup() - -- end, - -- }, - { - 'nvim-neo-tree/neo-tree.nvim', - branch = 'v3.x', - dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended - 'MunifTanjim/nui.nvim', - -- {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information - { - 's1n7ax/nvim-window-picker', -- for open_with_window_picker keymaps - version = '2.*', - config = function() - require('window-picker').setup { - filter_rules = { - include_current_win = false, - autoselect_one = true, - -- filter using buffer options - bo = { - -- if the file type is one of following, the window will be ignored - filetype = { 'neo-tree', 'neo-tree-popup', 'notify' }, - -- if the buffer type is one of following, the window will be ignored - buftype = { 'terminal', 'quickfix' }, - }, - }, - } - end, - }, - }, - lazy = false, - -----Instead of using `config`, you can use `opts` instead, if you'd like: - -----@module "neo-tree" - -----@type neotree.Config - --opts = {}, - config = function() - -- If you want icons for diagnostic errors, you'll need to define them somewhere. - -- In Neovim v0.10+, you can configure them in vim.diagnostic.config(), like: - -- - -- vim.diagnostic.config({ - -- signs = { - -- text = { - -- [vim.diagnostic.severity.ERROR] = '๏—', - -- [vim.diagnostic.severity.WARN] = '๏ฑ', - -- [vim.diagnostic.severity.INFO] = '๏š', - -- [vim.diagnostic.severity.HINT] = '๓ฐŒต', - -- }, - -- } - -- }) - -- - -- In older versions, you can define the signs manually: - -- vim.fn.sign_define("DiagnosticSignError", { text = "๏— ", texthl = "DiagnosticSignError" }) - -- vim.fn.sign_define("DiagnosticSignWarn", { text = "๏ฑ ", texthl = "DiagnosticSignWarn" }) - -- vim.fn.sign_define("DiagnosticSignInfo", { text = "๏š ", texthl = "DiagnosticSignInfo" }) - -- vim.fn.sign_define("DiagnosticSignHint", { text = "๓ฐŒต", texthl = "DiagnosticSignHint" }) - - require('neo-tree').setup { - close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab - popup_border_style = 'NC', -- or "" to use 'winborder' on Neovim v0.11+ - enable_git_status = true, - enable_diagnostics = true, - open_files_do_not_replace_types = { 'terminal', 'trouble', 'qf' }, -- when opening files, do not use windows containing these filetypes or buftypes - open_files_using_relative_paths = false, - sort_case_insensitive = false, -- used when sorting files and directories in the tree - sort_function = nil, -- use a custom function for sorting files and directories in the tree - -- sort_function = function (a,b) - -- if a.type == b.type then - -- return a.path > b.path - -- else - -- return a.type > b.type - -- end - -- end , -- this sorts files and directories descendantly - default_component_configs = { - container = { - enable_character_fade = true, - }, - indent = { - indent_size = 2, - padding = 1, -- extra padding on left hand side - -- indent guides - with_markers = true, - indent_marker = 'โ”‚', - last_indent_marker = 'โ””', - highlight = 'NeoTreeIndentMarker', - -- expander config, needed for nesting files - with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders - expander_collapsed = '๏‘ ', - expander_expanded = '๏‘ผ', - expander_highlight = 'NeoTreeExpander', - }, - icon = { - folder_closed = '๎—ฟ', - folder_open = '๎—พ', - folder_empty = '๓ฐœŒ', - provider = function(icon, node, state) -- default icon provider utilizes nvim-web-devicons if available - if node.type == 'file' or node.type == 'terminal' then - local success, web_devicons = pcall(require, 'nvim-web-devicons') - local name = node.type == 'terminal' and 'terminal' or node.name - if success then - local devicon, hl = web_devicons.get_icon(name) - icon.text = devicon or icon.text - icon.highlight = hl or icon.highlight - end - end - end, - -- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there - -- then these will never be used. - default = '*', - highlight = 'NeoTreeFileIcon', - }, - modified = { - symbol = '[+]', - highlight = 'NeoTreeModified', - }, - name = { - trailing_slash = false, - use_git_status_colors = true, - highlight = 'NeoTreeFileName', - }, - git_status = { - symbols = { - -- Change type - added = '', -- or "โœš", but this is redundant info if you use git_status_colors on the name - modified = '', -- or "๏‘„", but this is redundant info if you use git_status_colors on the name - deleted = 'โœ–', -- this can only be used in the git_status source - renamed = '๓ฐ•', -- this can only be used in the git_status source - -- Status type - untracked = '๏„จ', - ignored = '๏‘ด', - unstaged = '๓ฐ„ฑ', - staged = '๏†', - conflict = '๎œง', - }, - }, - -- If you don't want to use these columns, you can set `enabled = false` for each of them individually - file_size = { - enabled = true, - width = 12, -- width of the column - required_width = 64, -- min width of window required to show this column - }, - type = { - enabled = true, - width = 10, -- width of the column - required_width = 122, -- min width of window required to show this column - }, - last_modified = { - enabled = true, - width = 20, -- width of the column - required_width = 88, -- min width of window required to show this column - }, - created = { - enabled = true, - width = 20, -- width of the column - required_width = 110, -- min width of window required to show this column - }, - symlink_target = { - enabled = false, - }, - }, - -- A list of functions, each representing a global custom command - -- that will be available in all sources (if not overridden in `opts[source_name].commands`) - -- see `:h neo-tree-custom-commands-global` - commands = {}, - window = { - position = 'left', - width = 40, - mapping_options = { - noremap = true, - nowait = true, - }, - mappings = { - ['\\'] = 'close_window', - [''] = '', - ['<2-LeftMouse>'] = 'open', - [''] = 'open', - [''] = 'cancel', -- close preview or floating neo-tree window - ['P'] = { 'toggle_preview', config = { use_float = true, use_image_nvim = true } }, - -- Read `# Preview Mode` for more information - ['l'] = 'focus_preview', - ['S'] = 'open_split', - ['s'] = 'open_vsplit', - -- ["S"] = "split_with_window_picker", - -- ["s"] = "vsplit_with_window_picker", - ['t'] = 'open_tabnew', - -- [""] = "open_drop", - -- ["t"] = "open_tab_drop", - ['w'] = 'open_with_window_picker', - --["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing - ['C'] = 'close_node', - -- ['C'] = 'close_all_subnodes', - ['z'] = 'close_all_nodes', - --["Z"] = "expand_all_nodes", - ['Z'] = 'expand_all_subnodes', - ['a'] = { - 'add', - -- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details - -- some commands may take optional config options, see `:h neo-tree-mappings` for details - config = { - show_path = 'none', -- "none", "relative", "absolute" - }, - }, - ['A'] = 'add_directory', -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion. - ['d'] = 'delete', - ['r'] = 'rename', - ['b'] = 'rename_basename', - ['y'] = 'copy_to_clipboard', - ['x'] = 'cut_to_clipboard', - ['p'] = 'paste_from_clipboard', - --['c'] = 'copy', -- takes text input for destination, also accepts the optional config.show_path option like "add": - ['c'] = { - 'copy', - config = { - show_path = 'relative', -- "none", "relative", "absolute" - }, - }, - ['m'] = 'move', -- takes text input for destination, also accepts the optional config.show_path option like "add". - ['q'] = 'close_window', - ['R'] = 'refresh', - ['?'] = 'show_help', - ['<'] = 'prev_source', - ['>'] = 'next_source', - ['i'] = 'show_file_details', - -- ["i"] = { - -- "show_file_details", - -- -- format strings of the timestamps shown for date created and last modified (see `:h os.date()`) - -- -- both options accept a string or a function that takes in the date in seconds and returns a string to display - -- -- config = { - -- -- created_format = "%Y-%m-%d %I:%M %p", - -- -- modified_format = "relative", -- equivalent to the line below - -- -- modified_format = function(seconds) return require('neo-tree.utils').relative_date(seconds) end - -- -- } - -- }, - ['Y'] = function(state) - local node = state.tree:get_node() - local filepath = node:get_id() - local filename = node.name - - local results = { - filename, - vim.fn.fnamemodify(filepath, ':.'), - filepath, - } - - local i = vim.fn.inputlist { - 'Choose what to copy:', - '1. ' .. results[1], - '2. ' .. results[2], - '3. ' .. results[3], - } - - if i > 0 then - local result = results[i] - if not result then - return print('Invalid choice: ' .. i) - end - vim.fn.setreg('+', result) - end - end, - }, - }, - nesting_rules = {}, - filesystem = { - filtered_items = { - visible = true, -- when true, they will just be displayed differently than normal items - hide_dotfiles = true, - hide_gitignored = true, - hide_hidden = true, -- only works on Windows for hidden files/directories - hide_by_name = { - --"node_modules" - }, - hide_by_pattern = { -- uses glob style patterns - --"*.meta", - --"*/src/*/tsconfig.json", - }, - always_show = { -- remains visible even if other settings would normally hide it - '.gitignore', - }, - always_show_by_pattern = { -- uses glob style patterns - '.env*', - }, - never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show - '.DS_Store', - --"thumbs.db" - }, - never_show_by_pattern = { -- uses glob style patterns - --".null-ls_*", - }, - }, - follow_current_file = { - enabled = true, -- This will find and focus the file in the active buffer every time - -- -- the current file is changed while the tree is open. - leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal` - }, - group_empty_dirs = false, -- when true, empty folders will be grouped together - hijack_netrw_behavior = 'open_current', -- netrw disabled, opening a directory opens neo-tree - -- in whatever position is specified in window.position - -- "open_current", -- netrw disabled, opening a directory opens within the - -- window like netrw would, regardless of window.position - -- "disabled", -- netrw left alone, neo-tree does not handle opening dirs - use_libuv_file_watcher = false, -- This will use the OS level file watchers to detect changes - -- instead of relying on nvim autocmd events. - window = { - mappings = { - [''] = 'navigate_up', - ['.'] = 'set_root', - ['H'] = 'toggle_hidden', - ['/'] = 'fuzzy_finder', - ['D'] = 'fuzzy_finder_directory', - ['#'] = 'fuzzy_sorter', -- fuzzy sorting using the fzy algorithm - -- ["D"] = "fuzzy_sorter_directory", - ['f'] = 'filter_on_submit', - [''] = 'clear_filter', - ['[g'] = 'prev_git_modified', - [']g'] = 'next_git_modified', - ['o'] = { - 'show_help', - nowait = false, - config = { title = 'Order by', prefix_key = 'o' }, - }, - ['oc'] = { 'order_by_created', nowait = false }, - ['od'] = { 'order_by_diagnostics', nowait = false }, - ['og'] = { 'order_by_git_status', nowait = false }, - ['om'] = { 'order_by_modified', nowait = false }, - ['on'] = { 'order_by_name', nowait = false }, - ['os'] = { 'order_by_size', nowait = false }, - ['ot'] = { 'order_by_type', nowait = false }, - -- [''] = function(state) ... end, - }, - fuzzy_finder_mappings = { -- define keymaps for filter popup window in fuzzy_finder_mode - [''] = 'move_cursor_down', - [''] = 'move_cursor_down', - [''] = 'move_cursor_up', - [''] = 'move_cursor_up', - [''] = 'close', - -- [''] = function(state, scroll_padding) ... end, - }, - }, - - commands = {}, -- Add a custom command or override a global one using the same function name - }, - buffers = { - follow_current_file = { - enabled = true, -- This will find and focus the file in the active buffer every time - -- -- the current file is changed while the tree is open. - leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal` - }, - group_empty_dirs = true, -- when true, empty folders will be grouped together - show_unloaded = true, - window = { - mappings = { - ['d'] = 'buffer_delete', - ['bd'] = 'buffer_delete', - [''] = 'navigate_up', - ['.'] = 'set_root', - ['o'] = { - 'show_help', - nowait = false, - config = { title = 'Order by', prefix_key = 'o' }, - }, - ['oc'] = { 'order_by_created', nowait = false }, - ['od'] = { 'order_by_diagnostics', nowait = false }, - ['om'] = { 'order_by_modified', nowait = false }, - ['on'] = { 'order_by_name', nowait = false }, - ['os'] = { 'order_by_size', nowait = false }, - ['ot'] = { 'order_by_type', nowait = false }, - }, - }, - }, - git_status = { - window = { - position = 'float', - mappings = { - ['A'] = 'git_add_all', - ['gu'] = 'git_unstage_file', - ['gU'] = 'git_undo_last_commit', - ['ga'] = 'git_add_file', - ['gr'] = 'git_revert_file', - ['gc'] = 'git_commit', - ['gp'] = 'git_push', - ['gg'] = 'git_commit_and_push', - ['o'] = { - 'show_help', - nowait = false, - config = { title = 'Order by', prefix_key = 'o' }, - }, - ['oc'] = { 'order_by_created', nowait = false }, - ['od'] = { 'order_by_diagnostics', nowait = false }, - ['om'] = { 'order_by_modified', nowait = false }, - ['on'] = { 'order_by_name', nowait = false }, - ['os'] = { 'order_by_size', nowait = false }, - ['ot'] = { 'order_by_type', nowait = false }, - }, - }, - }, - } - - vim.keymap.set('n', '\\', 'Neotree reveal') - end, - }, -} diff --git a/lua/lazy_setup.lua b/lua/lazy_setup.lua new file mode 100644 index 0000000..4d9552f --- /dev/null +++ b/lua/lazy_setup.lua @@ -0,0 +1,32 @@ +require("lazy").setup({ + { + "AstroNvim/AstroNvim", + version = "^5", -- Remove version tracking to elect for nightly AstroNvim + import = "astronvim.plugins", + opts = { -- AstroNvim options must be set here with the `import` key + mapleader = " ", -- This ensures the leader key must be configured before Lazy is set up + maplocalleader = ",", -- This ensures the localleader key must be configured before Lazy is set up + icons_enabled = true, -- Set to false to disable icons (if no Nerd Font is available) + pin_plugins = nil, -- Default will pin plugins when tracking `version` of AstroNvim, set to true/false to override + update_notifications = true, -- Enable/disable notification about running `:Lazy update` twice to update pinned plugins + }, + }, + { import = "community" }, + { import = "plugins" }, +} --[[@as LazySpec]], { + -- Configure any other `lazy.nvim` configuration options here + install = { colorscheme = { "astrotheme", "habamax" } }, + ui = { backdrop = 100 }, + performance = { + rtp = { + -- disable some rtp plugins, add more to your liking + disabled_plugins = { + "gzip", + "netrwPlugin", + "tarPlugin", + "tohtml", + "zipPlugin", + }, + }, + }, +} --[[@as LazyConfig]]) diff --git a/lua/opts.lua b/lua/opts.lua deleted file mode 100644 index 3eaf3b4..0000000 --- a/lua/opts.lua +++ /dev/null @@ -1,78 +0,0 @@ --- 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 = ' ' - -vim.g.have_nerd_font = true - --- Line numbers -vim.opt.number = true -vim.opt.relativenumber = true - --- Don't show the mode, since it's already in the status line -vim.opt.showmode = false - --- Sync clipboard between OS and Neovim. --- Schedule the setting after `UiEnter` because it can increase startup-time. --- Remove this option if you want your OS clipboard to remain independent. --- See `:help 'clipboard'` -vim.schedule(function() - vim.o.clipboard = 'unnamedplus' -end) - -vim.opt.tabstop = 4 -vim.opt.softtabstop = 4 -vim.opt.shiftwidth = 4 -vim.opt.expandtab = true - -vim.o.breakindent = true - -vim.opt.wrap = false - --- 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 - -vim.opt.swapfile = false -vim.opt.backup = false -vim.opt.undodir = os.getenv 'HOME' .. '/.vim/undodir' -vim.opt.undofile = true - -vim.opt.hlsearch = true -vim.opt.incsearch = true - --- Case-insensitive searching UNLESS \C or one or more capital letters in the search term -vim.opt.ignorecase = true -vim.opt.smartcase = true - --- Keep signcolumn on by default -vim.opt.signcolumn = 'yes' - --- Decrease update time -vim.opt.updatetime = 250 - --- Decrease mapped sequence wait time --- Displays which-key popup sooner -vim.opt.timeoutlen = 300 - --- Configure how new splits should be opened -vim.opt.splitright = true -vim.opt.splitbelow = true - --- Preview substitutions live, as you type! -vim.opt.inccommand = 'split' --- Sets how neovim will display certain whitespace characters in the editor. --- See `:help 'list'5 --- and `:help 'listchars'` --- vim.opt.list = true --- vim.opt.listchars = { tab = 'ยป ', trail = 'ยท', nbsp = 'โฃ' } - --- 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) --- See `:help 'confirm'` -vim.o.confirm = true - ---vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]] diff --git a/lua/plugins/astrocore.lua b/lua/plugins/astrocore.lua new file mode 100644 index 0000000..987a6e7 --- /dev/null +++ b/lua/plugins/astrocore.lua @@ -0,0 +1,83 @@ +-- AstroCore provides a central place to modify mappings, vim options, autocommands, and more! +-- Configuration documentation can be found with `:h astrocore` +-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`) +-- as this provides autocomplete and documentation while editing + +---@type LazySpec +return { + "AstroNvim/astrocore", + ---@type AstroCoreOpts + opts = { + -- Configure core features of AstroNvim + features = { + large_buf = { size = 1024 * 256, lines = 10000 }, -- set global limits for large files for disabling features like treesitter + autopairs = true, -- enable autopairs at start + cmp = true, -- enable completion at start + diagnostics = { virtual_text = true, virtual_lines = false }, -- diagnostic settings on startup + highlighturl = true, -- highlight URLs at start + notifications = true, -- enable notifications at start + }, + -- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on + diagnostics = { + virtual_text = true, + underline = true, + }, + -- passed to `vim.filetype.add` + filetypes = { + -- see `:h vim.filetype.add` for usage + extension = { + foo = "fooscript", + }, + filename = { + [".foorc"] = "fooscript", + }, + pattern = { + [".*/etc/foo/.*"] = "fooscript", + }, + }, + -- vim options can be configured here + options = { + opt = { -- vim.opt. + relativenumber = true, -- sets vim.opt.relativenumber + number = true, -- sets vim.opt.number + spell = false, -- sets vim.opt.spell + signcolumn = "yes", -- sets vim.opt.signcolumn to yes + wrap = false, -- sets vim.opt.wrap + }, + g = { -- vim.g. + -- configure global vim variables (vim.g) + -- NOTE: `mapleader` and `maplocalleader` must be set in the AstroNvim opts or before `lazy.setup` + -- This can be found in the `lua/lazy_setup.lua` file + }, + }, + -- Mappings can be configured through AstroCore as well. + -- NOTE: keycodes follow the casing in the vimdocs. For example, `` must be capitalized + mappings = { + -- first key is the mode + n = { + -- second key is the lefthand side of the map + + -- navigate buffer tabs + ["]b"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" }, + ["[b"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" }, + + -- mappings seen under group name "Buffer" + ["bd"] = { + function() + require("astroui.status.heirline").buffer_picker( + function(bufnr) require("astrocore.buffer").close(bufnr) end + ) + end, + desc = "Close buffer from tabline", + }, + + -- tables with just a `desc` key will be registered with which-key if it's installed + -- this is useful for naming menus + -- ["b"] = { desc = "Buffers" }, + + -- setting a mapping to false will disable it + -- [""] = false, + }, + }, + }, +} diff --git a/lua/plugins/astrolsp.lua b/lua/plugins/astrolsp.lua new file mode 100644 index 0000000..0dc7cf5 --- /dev/null +++ b/lua/plugins/astrolsp.lua @@ -0,0 +1,103 @@ +-- AstroLSP allows you to customize the features in AstroNvim's LSP configuration engine +-- Configuration documentation can be found with `:h astrolsp` +-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`) +-- as this provides autocomplete and documentation while editing + +---@type LazySpec +return { + "AstroNvim/astrolsp", + ---@type AstroLSPOpts + opts = { + -- Configuration table of features provided by AstroLSP + features = { + codelens = true, -- enable/disable codelens refresh on start + inlay_hints = false, -- enable/disable inlay hints on start + semantic_tokens = true, -- enable/disable semantic token highlighting + }, + -- customize lsp formatting options + formatting = { + -- control auto formatting on save + format_on_save = { + enabled = true, -- enable or disable format on save globally + allow_filetypes = { -- enable format on save for specified filetypes only + -- "go", + }, + ignore_filetypes = { -- disable format on save for specified filetypes + -- "python", + }, + }, + disabled = { -- disable formatting capabilities for the listed language servers + -- disable lua_ls formatting capability if you want to use StyLua to format your lua code + -- "lua_ls", + }, + timeout_ms = 1000, -- default format timeout + -- filter = function(client) -- fully override the default formatting function + -- return true + -- end + }, + -- enable servers that you already have installed without mason + servers = { + -- "pyright" + }, + -- customize language server configuration options passed to `lspconfig` + ---@diagnostic disable: missing-fields + config = { + -- clangd = { capabilities = { offsetEncoding = "utf-8" } }, + }, + -- customize how language servers are attached + handlers = { + -- a function without a key is simply the default handler, functions take two parameters, the server name and the configured options table for that server + -- function(server, opts) require("lspconfig")[server].setup(opts) end + + -- the key is the server that is being setup with `lspconfig` + -- rust_analyzer = false, -- setting a handler to false will disable the set up of that language server + -- pyright = function(_, opts) require("lspconfig").pyright.setup(opts) end -- or a custom handler function can be passed + }, + -- Configure buffer local auto commands to add when attaching a language server + autocmds = { + -- first key is the `augroup` to add the auto commands to (:h augroup) + lsp_codelens_refresh = { + -- Optional condition to create/delete auto command group + -- can either be a string of a client capability or a function of `fun(client, bufnr): boolean` + -- condition will be resolved for each client on each execution and if it ever fails for all clients, + -- the auto commands will be deleted for that buffer + cond = "textDocument/codeLens", + -- cond = function(client, bufnr) return client.name == "lua_ls" end, + -- list of auto commands to set + { + -- events to trigger + event = { "InsertLeave", "BufEnter" }, + -- the rest of the autocmd options (:h nvim_create_autocmd) + desc = "Refresh codelens (buffer)", + callback = function(args) + if require("astrolsp").config.features.codelens then vim.lsp.codelens.refresh { bufnr = args.buf } end + end, + }, + }, + }, + -- mappings to be set up on attaching of a language server + mappings = { + n = { + -- a `cond` key can provided as the string of a server capability to be required to attach, or a function with `client` and `bufnr` parameters from the `on_attach` that returns a boolean + gD = { + function() vim.lsp.buf.declaration() end, + desc = "Declaration of current symbol", + cond = "textDocument/declaration", + }, + ["uY"] = { + function() require("astrolsp.toggles").buffer_semantic_tokens() end, + desc = "Toggle LSP semantic highlight (buffer)", + cond = function(client) + return client.supports_method "textDocument/semanticTokens/full" and vim.lsp.semantic_tokens ~= nil + end, + }, + }, + }, + -- A custom `on_attach` function to be run after the default `on_attach` function + -- takes two parameters `client` and `bufnr` (`:h lspconfig-setup`) + on_attach = function(client, bufnr) + -- this would disable semanticTokensProvider for all clients + -- client.server_capabilities.semanticTokensProvider = nil + end, + }, +} diff --git a/lua/plugins/astroui.lua b/lua/plugins/astroui.lua new file mode 100644 index 0000000..0b0f2ba --- /dev/null +++ b/lua/plugins/astroui.lua @@ -0,0 +1,37 @@ +-- AstroUI provides the basis for configuring the AstroNvim User Interface +-- Configuration documentation can be found with `:h astroui` +-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`) +-- as this provides autocomplete and documentation while editing + +---@type LazySpec +return { + "AstroNvim/astroui", + ---@type AstroUIOpts + opts = { + -- change colorscheme + colorscheme = "astrodark", + -- AstroUI allows you to easily modify highlight groups easily for any and all colorschemes + highlights = { + init = { -- this table overrides highlights in all themes + -- Normal = { bg = "#000000" }, + }, + astrodark = { -- a table of overrides/changes when applying the astrotheme theme + -- Normal = { bg = "#000000" }, + }, + }, + -- Icons can be configured throughout the interface + icons = { + -- configure the loading of the lsp in the status line + LSPLoading1 = "โ ‹", + LSPLoading2 = "โ ™", + LSPLoading3 = "โ น", + LSPLoading4 = "โ ธ", + LSPLoading5 = "โ ผ", + LSPLoading6 = "โ ด", + LSPLoading7 = "โ ฆ", + LSPLoading8 = "โ ง", + LSPLoading9 = "โ ‡", + LSPLoading10 = "โ ", + }, + }, +} diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua new file mode 100644 index 0000000..397a603 --- /dev/null +++ b/lua/plugins/mason.lua @@ -0,0 +1,27 @@ +---@type LazySpec +return { + -- use mason-tool-installer for automatically installing Mason packages + { + 'WhoIsSethDaniel/mason-tool-installer.nvim', + -- overrides `require("mason-tool-installer").setup(...)` + opts = { + -- Make sure to use the names found in `:Mason` + ensure_installed = { + -- install language servers + 'lua-language-server', + 'gopls', + + -- install formatters + 'stylua', + 'goimports', + + -- install debuggers + -- 'debugpy', + -- "delve", + + -- install any other package + 'tree-sitter-cli', + }, + }, + }, +} diff --git a/lua/plugins/none-ls.lua b/lua/plugins/none-ls.lua new file mode 100644 index 0000000..2b0ed18 --- /dev/null +++ b/lua/plugins/none-ls.lua @@ -0,0 +1,24 @@ +if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE + +-- Customize None-ls sources + +---@type LazySpec +return { + "nvimtools/none-ls.nvim", + opts = function(_, opts) + -- opts variable is the default configuration table for the setup function call + -- local null_ls = require "null-ls" + + -- Check supported formatters and linters + -- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/formatting + -- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics + + -- Only insert new sources, do not replace the existing ones + -- (If you wish to replace, use `opts.sources = {}` instead of the `list_insert_unique` function) + opts.sources = require("astrocore").list_insert_unique(opts.sources, { + -- Set a formatter + -- null_ls.builtins.formatting.stylua, + -- null_ls.builtins.formatting.prettier, + }) + end, +} diff --git a/lua/plugins/nvim-dap.lua b/lua/plugins/nvim-dap.lua new file mode 100644 index 0000000..3215a5b --- /dev/null +++ b/lua/plugins/nvim-dap.lua @@ -0,0 +1,11 @@ +return { + 'mfussenegger/nvim-dap', + dependencies = { + 'leoluz/nvim-dap-go', + }, + config = function() + local dapgo = require 'dap-go' + + dapgo.setup {} + end, +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..ba00e99 --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,21 @@ +-- Customize Treesitter + +---@type LazySpec +return { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "bash", + "diff", + "go", + "html", + "lua", + "luadoc", + "markdown", + "markdown_inline", + "query", + "vim", + "vimdoc", + }, + }, +} diff --git a/lua/plugins/user.lua b/lua/plugins/user.lua new file mode 100644 index 0000000..19ce8c0 --- /dev/null +++ b/lua/plugins/user.lua @@ -0,0 +1,77 @@ +-- You can also add or configure plugins by creating files in this `plugins/` folder +-- PLEASE REMOVE THE EXAMPLES YOU HAVE NO INTEREST IN BEFORE ENABLING THIS FILE +-- Here are some examples: + +---@type LazySpec +return { + + -- == Examples of Adding Plugins == + + { + 'ray-x/lsp_signature.nvim', + event = 'BufRead', + config = function() + require('lsp_signature').setup() + end, + }, + + -- == Examples of Overriding Plugins == + + -- customize dashboard options + { + 'folke/snacks.nvim', + opts = { + dashboard = { + preset = { + header = table.concat({ + ' โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ ', + 'โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ', + 'โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ', + 'โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ', + 'โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ ', + '', + 'โ–ˆโ–ˆโ–ˆโ€ โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€ โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€โ–ˆโ–ˆโ–ˆโ€ โ–ˆโ–ˆโ–ˆ', + 'โ–ˆโ–ˆโ–ˆโ–ˆโ€ โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€ โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€โ–ˆโ–ˆโ–ˆโ–ˆโ€ โ–ˆโ–ˆโ–ˆโ–ˆ', + 'โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€ โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€ โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€โ–ˆโ–ˆโ–ˆโ–ˆโ€โ–ˆโ–ˆ', + 'โ–ˆโ–ˆโ€โ€โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€โ€โ–ˆโ–ˆโ€ โ–ˆโ–ˆโ€โ€โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€โ€โ–ˆโ–ˆโ€โ€โ–ˆโ–ˆ', + 'โ–ˆโ–ˆโ€ โ€โ–ˆโ–ˆโ–ˆโ–ˆโ€ โ€โ–ˆโ–ˆโ–ˆโ–ˆโ€โ€ โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€ โ€โ€โ€ โ–ˆโ–ˆ', + }, '\n'), + }, + }, + }, + }, + + -- You can disable default plugins as follows: + -- { "max397574/better-escape.nvim", enabled = false }, + + -- You can also easily customize additional setup of plugins that is outside of the plugin's setup call + { + 'L3MON4D3/LuaSnip', + config = function(plugin, opts) + require 'astronvim.plugins.configs.luasnip' (plugin, opts) -- include the default astronvim config that calls the setup call + -- add more custom luasnip configuration such as filetype extend or custom snippets + local luasnip = require 'luasnip' + luasnip.filetype_extend('javascript', { 'javascriptreact' }) + end, + }, + + { + 'windwp/nvim-autopairs', + config = function(plugin, opts) + require 'astronvim.plugins.configs.nvim-autopairs' (plugin, opts) -- include the default astronvim config that calls the setup call + -- local npairs = require "nvim-autopairs" + -- local Rule = require "nvim-autopairs.rule" + + -- npairs.add_rules( + -- -- disable for .vim files, but it work for another filetypes + -- Rule("a", "a", "-vim") + -- ) + end, + }, + + { + 'folke/todo-comments.nvim', + dependencies = { 'nvim-lua/plenary.nvim' }, + opts = {}, + }, +} diff --git a/lua/polish.lua b/lua/polish.lua new file mode 100644 index 0000000..642719f --- /dev/null +++ b/lua/polish.lua @@ -0,0 +1,5 @@ +if true then return end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE + +-- This will run last in the setup process. +-- This is just pure lua so anything that doesn't +-- fit in the normal config locations above can go here diff --git a/neovim.yml b/neovim.yml new file mode 100644 index 0000000..b9235ab --- /dev/null +++ b/neovim.yml @@ -0,0 +1,6 @@ +--- +base: lua51 + +globals: + vim: + any: true diff --git a/selene.toml b/selene.toml new file mode 100644 index 0000000..e7005c3 --- /dev/null +++ b/selene.toml @@ -0,0 +1,8 @@ +std = "neovim" + +[rules] +global_usage = "allow" +if_same_then_else = "allow" +incorrect_standard_library_use = "allow" +mixed_table = "allow" +multiple_statements = "allow"