aboutsummaryrefslogtreecommitdiff
path: root/dot_config/nvim/lua
diff options
context:
space:
mode:
Diffstat (limited to 'dot_config/nvim/lua')
-rw-r--r--dot_config/nvim/lua/health.lua52
-rw-r--r--dot_config/nvim/lua/plugins/autocomplete.lua87
-rw-r--r--dot_config/nvim/lua/plugins/init.lua156
-rw-r--r--dot_config/nvim/lua/plugins/lint.lua80
-rw-r--r--dot_config/nvim/lua/plugins/lsp.lua205
-rw-r--r--dot_config/nvim/lua/plugins/mini.lua40
-rw-r--r--dot_config/nvim/lua/plugins/telescope.lua29
-rw-r--r--dot_config/nvim/lua/plugins/treesitter.lua28
-rw-r--r--dot_config/nvim/lua/util/plugin.lua13
9 files changed, 690 insertions, 0 deletions
diff --git a/dot_config/nvim/lua/health.lua b/dot_config/nvim/lua/health.lua
new file mode 100644
index 0000000..b59d086
--- /dev/null
+++ b/dot_config/nvim/lua/health.lua
@@ -0,0 +1,52 @@
+--[[
+--
+-- 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/dot_config/nvim/lua/plugins/autocomplete.lua b/dot_config/nvim/lua/plugins/autocomplete.lua
new file mode 100644
index 0000000..4f38b38
--- /dev/null
+++ b/dot_config/nvim/lua/plugins/autocomplete.lua
@@ -0,0 +1,87 @@
+return {
+ { -- Autocompletion
+ 'saghen/blink.cmp',
+ lazy = true,
+ -- 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 = {
+ -- All presets have the following mappings:
+ -- <tab>/<s-tab>: move to right/left of your snippet expansion
+ -- <c-space>: Open menu or open docs if already open
+ -- <c-n>/<c-p> or <up>/<down>: Select next/previous item
+ -- <c-e>: Hide menu
+ -- <c-k>: 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 `<c-space>` 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 = 'prefer_rust_with_warning' },
+
+ -- Shows a signature help window while you type arguments for a function
+ signature = { enabled = true },
+ },
+ },
+}
diff --git a/dot_config/nvim/lua/plugins/init.lua b/dot_config/nvim/lua/plugins/init.lua
new file mode 100644
index 0000000..be4b9e3
--- /dev/null
+++ b/dot_config/nvim/lua/plugins/init.lua
@@ -0,0 +1,156 @@
+return {
+ -- Detect tabstop and shiftwidth automatically
+ {
+ 'NMAC427/guess-indent.nvim',
+ event = 'VeryLazy',
+ },
+
+ -- Adds git related signs to the gutter, as well as utilities for managing changes
+ {
+ 'lewis6991/gitsigns.nvim',
+ event = 'VeryLazy',
+ opts = {
+ signs = {
+ add = { text = '+' },
+ change = { text = '~' },
+ delete = { text = '_' },
+ topdelete = { text = '‾' },
+ changedelete = { text = '~' },
+ },
+ },
+ },
+
+ -- Useful plugin to show you pending keybinds.
+ {
+ 'folke/which-key.nvim',
+ event = 'VeryLazy', -- 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 = '<Up> ',
+ Down = '<Down> ',
+ Left = '<Left> ',
+ Right = '<Right> ',
+ C = '<C-…> ',
+ M = '<M-…> ',
+ D = '<D-…> ',
+ S = '<S-…> ',
+ CR = '<CR> ',
+ Esc = '<Esc> ',
+ ScrollWheelDown = '<ScrollWheelDown> ',
+ ScrollWheelUp = '<ScrollWheelUp> ',
+ NL = '<NL> ',
+ BS = '<BS> ',
+ Space = '<Space> ',
+ Tab = '<Tab> ',
+ F1 = '<F1>',
+ F2 = '<F2>',
+ F3 = '<F3>',
+ F4 = '<F4>',
+ F5 = '<F5>',
+ F6 = '<F6>',
+ F7 = '<F7>',
+ F8 = '<F8>',
+ F9 = '<F9>',
+ F10 = '<F10>',
+ F11 = '<F11>',
+ F12 = '<F12>',
+ },
+ },
+
+ -- Document existing key chains
+ spec = {
+ { '<leader>s', group = '[S]earch' },
+ { '<leader>t', group = '[T]oggle' },
+ { '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
+ },
+ },
+ },
+ {
+ 'folke/trouble.nvim',
+ opts = {}, -- for default options, refer to the configuration section for custom setup.
+ cmd = 'Trouble',
+ keys = {
+ {
+ '<leader>xx',
+ '<cmd>Trouble diagnostics toggle<cr>',
+ desc = 'Diagnostics (Trouble)',
+ },
+ {
+ '<leader>xX',
+ '<cmd>Trouble diagnostics toggle filter.buf=0<cr>',
+ desc = 'Buffer Diagnostics (Trouble)',
+ },
+ {
+ '<leader>cs',
+ '<cmd>Trouble symbols toggle focus=false<cr>',
+ desc = 'Symbols (Trouble)',
+ },
+ {
+ '<leader>cl',
+ '<cmd>Trouble lsp toggle focus=false win.position=right<cr>',
+ desc = 'LSP Definitions / references / ... (Trouble)',
+ },
+ {
+ '<leader>xL',
+ '<cmd>Trouble loclist toggle<cr>',
+ desc = 'Location List (Trouble)',
+ },
+ {
+ '<leader>xQ',
+ '<cmd>Trouble qflist toggle<cr>',
+ desc = 'Quickfix List (Trouble)',
+ },
+ },
+ },
+ {
+ 'catppuccin/nvim',
+ name = 'catppuccin',
+ priority = 1000,
+ event = 'VeryLazy',
+ opts = {
+ flavour = 'latte',
+ transparent_background = false,
+ integrations = {
+ blink_cmp = true,
+ cmp = false,
+ fidget = true,
+ mason = true,
+ gitsigns = true,
+ treesitter = true,
+ notify = false,
+ which_key = false,
+ mini = {
+ enabled = true,
+ indentscope_color = '',
+ },
+ },
+ },
+ },
+ {
+ 'stevearc/oil.nvim',
+ ---@module 'oil'
+ ---@type oil.SetupOpts
+ opts = {},
+ -- Optional dependencies
+ dependencies = { { 'echasnovski/mini.icons', opts = {} } },
+ -- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
+ -- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
+ lazy = false,
+ },
+
+ -- Highlight todo, notes, etc in comments
+ { 'folke/todo-comments.nvim', event = 'VeryLazy', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
+
+ -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
+ -- Or use telescope!
+ -- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
+ -- you can continue same window with `<space>sr` which resumes last telescope search
+}
diff --git a/dot_config/nvim/lua/plugins/lint.lua b/dot_config/nvim/lua/plugins/lint.lua
new file mode 100644
index 0000000..7d337ac
--- /dev/null
+++ b/dot_config/nvim/lua/plugins/lint.lua
@@ -0,0 +1,80 @@
+return {
+ {
+ 'mfussenegger/nvim-lint',
+ event = { 'BufReadPre', 'BufNewFile' },
+ config = function()
+ require('lint').linters.mdl = {
+ cmd = 'mdl',
+ stdin = false,
+ args = { '-s', '~/.config/mdl/style.rb' },
+ stream = 'stdout',
+ ignore_exitcode = true,
+ parser = require('lint.parser').from_errorformat('%f:%l: %m', {
+ source = 'mdl',
+ severity = vim.diagnostic.severity.WARN,
+ }),
+ }
+ local lint = require 'lint'
+ lint.linters_by_ft = {
+ markdown = { 'mdl' },
+ }
+
+ -- 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()
+ -- Only run the linter in buffers that you can modify in order to
+ -- avoid superfluous noise, notably within the handy LSP pop-ups that
+ -- describe the hovered symbol using Markdown.
+ if vim.bo.modifiable then
+ lint.try_lint()
+ end
+ end,
+ })
+ end,
+ },
+
+ -- Autoformat
+ {
+ 'stevearc/conform.nvim',
+ event = { 'BufWritePre' },
+ cmd = { 'ConformInfo' },
+ keys = {
+ {
+ '<leader>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 },
+ },
+ },
+ },
+}
diff --git a/dot_config/nvim/lua/plugins/lsp.lua b/dot_config/nvim/lua/plugins/lsp.lua
new file mode 100644
index 0000000..4860c82
--- /dev/null
+++ b/dot_config/nvim/lua/plugins/lsp.lua
@@ -0,0 +1,205 @@
+return { -- 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',
+
+ event = 'LazyFile',
+
+ dependencies = {
+ -- Mason must be loaded before its dependents so we need to set it up here.
+ { 'mason-org/mason.nvim', opts = {} },
+
+ -- Useful status updates for LSP.
+ { 'j-hui/fidget.nvim', opts = {} },
+
+ -- Allows extra capabilities provided by blink.cmp
+ 'saghen/blink.cmp',
+ },
+ config = function()
+ vim.api.nvim_create_autocmd('LspAttach', {
+ group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
+ callback = function(event)
+ -- 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
+
+ local fzf = require 'fzf-lua'
+
+ -- 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', fzf.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', fzf.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 <C-t>.
+ map('grd', fzf.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', fzf.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', fzf.lsp_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', fzf.lsp_typedefs, '[G]oto [T]ype Definition')
+
+ -- 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(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(vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
+ map('<leader>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,
+ },
+ }
+
+ -- 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()
+
+ -- 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/
+ -- See `:help lspconfig-all` for a list of all the pre-configured LSPs
+ local servers = {
+ -- clangd = {},
+ -- gopls = {},
+ pyright = {},
+ 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' } },
+ },
+ },
+ },
+ vtsls = {},
+ bashls = {},
+ awk_ls = {},
+ }
+
+ servers.lua_ls.capabilities = vim.tbl_deep_extend('force', {}, capabilities, servers.lua_ls.capabilities or {})
+ vim.lsp.config('lua_ls', servers.lua_ls)
+ vim.lsp.enable 'lua_ls'
+
+ servers.pyright.capabilities = vim.tbl_deep_extend('force', {}, capabilities, servers.pyright.capabilities or {})
+ vim.lsp.config('pyright', servers.pyright)
+ vim.lsp.enable 'pyright'
+
+ servers.vtsls.capabilities = vim.tbl_deep_extend('force', {}, capabilities, servers.vtsls.capabilities or {})
+ vim.lsp.config('vtsls', servers.vtsls)
+ vim.lsp.enable 'vtsls'
+
+ servers.bashls.capabilities = vim.tbl_deep_extend('force', {}, capabilities, servers.bashls.capabilities or {})
+ vim.lsp.config('bashls', servers.bashls)
+ vim.lsp.enable 'bashls'
+
+ servers.awk_ls.capabilities = vim.tbl_deep_extend('force', {}, capabilities, servers.awk_ls.capabilities or {})
+ vim.lsp.config('awk_ls', servers.awk_ls)
+ vim.lsp.enable 'awk_ls'
+ end,
+ },
+}
diff --git a/dot_config/nvim/lua/plugins/mini.lua b/dot_config/nvim/lua/plugins/mini.lua
new file mode 100644
index 0000000..0cfb523
--- /dev/null
+++ b/dot_config/nvim/lua/plugins/mini.lua
@@ -0,0 +1,40 @@
+return {
+ { -- Collection of various small independent plugins/modules
+ 'echasnovski/mini.nvim',
+ event = 'VeryLazy',
+ 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,
+ },
+}
diff --git a/dot_config/nvim/lua/plugins/telescope.lua b/dot_config/nvim/lua/plugins/telescope.lua
new file mode 100644
index 0000000..2a92acd
--- /dev/null
+++ b/dot_config/nvim/lua/plugins/telescope.lua
@@ -0,0 +1,29 @@
+return {
+ {
+ 'ibhagwan/fzf-lua',
+ event = 'VeryLazy',
+ -- optional for icon support
+ dependencies = { 'nvim-tree/nvim-web-devicons' },
+ -- or if using mini.icons/mini.nvim
+ -- dependencies = { "echasnovski/mini.icons" },
+ opts = {},
+ config = function()
+ local fzf = require 'fzf-lua'
+ vim.keymap.set('n', '<leader>sh', fzf.helptags, { desc = '[S]earch [H]elp' })
+ vim.keymap.set('n', '<leader>sk', fzf.keymaps, { desc = '[S]earch [K]eymaps' })
+ vim.keymap.set('n', '<leader>sf', fzf.files, { desc = '[S]earch [F]iles' })
+ vim.keymap.set('n', '<leader>ss', fzf.builtin, { desc = '[S]earch [S]elect fzf' })
+ vim.keymap.set('n', '<leader>sw', fzf.grep_cword, { desc = '[S]earch current [W]ord' })
+ vim.keymap.set('n', '<leader>sg', fzf.live_grep_native, { desc = '[S]earch by [G]rep' })
+ vim.keymap.set('n', '<leader>sd', fzf.diagnostics_document, { desc = '[S]earch [D]iagnostics' })
+ vim.keymap.set('n', '<leader>sD', fzf.diagnostics_workspace, { desc = '[S]earch workspace [D]iagnostics' })
+ vim.keymap.set('n', '<leader>sr', fzf.resume, { desc = '[S]earch [R]esume' })
+ vim.keymap.set('n', '<leader>sl', fzf.lsp_finder, { desc = '[S]earch [L]SP' })
+ vim.keymap.set('n', '<leader>s.', fzf.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
+ vim.keymap.set('n', '<leader><leader>', fzf.buffers, { desc = '[ ] Find existing buffers' })
+ vim.keymap.set('n', '<leader>sn', function()
+ fzf.files { cwd = '~/.config/nvim' }
+ end, { desc = '[S]earch [N]eovim files' })
+ end,
+ },
+}
diff --git a/dot_config/nvim/lua/plugins/treesitter.lua b/dot_config/nvim/lua/plugins/treesitter.lua
new file mode 100644
index 0000000..e7044bc
--- /dev/null
+++ b/dot_config/nvim/lua/plugins/treesitter.lua
@@ -0,0 +1,28 @@
+return {
+ { -- Highlight, edit, and navigate code
+ 'nvim-treesitter/nvim-treesitter',
+ event = 'VeryLazy',
+ 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' },
+ -- 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
+ },
+}
diff --git a/dot_config/nvim/lua/util/plugin.lua b/dot_config/nvim/lua/util/plugin.lua
new file mode 100644
index 0000000..8bf6a94
--- /dev/null
+++ b/dot_config/nvim/lua/util/plugin.lua
@@ -0,0 +1,13 @@
+local M = {}
+
+M.lazy_file_events = { 'BufReadPost', 'BufNewFile', 'BufWritePre' }
+
+function M.lazy_file()
+ -- Add support for the LazyFile event
+ local Event = require 'lazy.core.handler.event'
+
+ Event.mappings.LazyFile = { id = 'LazyFile', event = M.lazy_file_events }
+ Event.mappings['User LazyFile'] = Event.mappings.LazyFile
+end
+
+return M