From 7c6f52de48d07d91d4549f002e42d22ddeb59065 Mon Sep 17 00:00:00 2001 From: Michael Thomson Date: Wed, 4 Sep 2024 10:00:39 -0400 Subject: [PATCH] mini.nvim --- modules/home-manager/neovim/nvim/init.lua | 2 - .../neovim/nvim/lua/plugins/autopairs.lua | 5 -- .../neovim/nvim/lua/plugins/comment.lua | 7 -- .../neovim/nvim/lua/plugins/mini.lua | 87 ++++++++++++------- .../neovim/nvim/lua/plugins/oil.lua | 6 -- .../neovim/nvim/lua/plugins/playtime.lua | 3 - .../neovim/nvim/lua/plugins/surround.lua | 10 --- .../neovim/nvim/lua/plugins/telekasten.lua | 28 ------ .../nvim/lua/plugins/telescope-fzf-native.lua | 4 - .../neovim/nvim/lua/plugins/telescope.lua | 29 ------- .../neovim/nvim/lua/plugins/vim-sleuth.lua | 3 - .../neovim/nvim/lua/plugins/webdevicons.lua | 1 - 12 files changed, 56 insertions(+), 129 deletions(-) delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/autopairs.lua delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/comment.lua delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/oil.lua delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/playtime.lua delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/surround.lua delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/telekasten.lua delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/telescope-fzf-native.lua delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/telescope.lua delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/vim-sleuth.lua delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/webdevicons.lua diff --git a/modules/home-manager/neovim/nvim/init.lua b/modules/home-manager/neovim/nvim/init.lua index 99377e3..ce95f71 100644 --- a/modules/home-manager/neovim/nvim/init.lua +++ b/modules/home-manager/neovim/nvim/init.lua @@ -94,8 +94,6 @@ vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") vim.keymap.set("n", "J", "mzJ`z") -vim.keymap.set("n", "fe", "Oil") - vim.keymap.set("i", "jk", "") vim.api.nvim_create_autocmd('TextYankPost', { diff --git a/modules/home-manager/neovim/nvim/lua/plugins/autopairs.lua b/modules/home-manager/neovim/nvim/lua/plugins/autopairs.lua deleted file mode 100644 index 3a794db..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/autopairs.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - 'windwp/nvim-autopairs', - event = "InsertEnter", - opts = {} -- this is equalent to setup({}) function -} diff --git a/modules/home-manager/neovim/nvim/lua/plugins/comment.lua b/modules/home-manager/neovim/nvim/lua/plugins/comment.lua deleted file mode 100644 index e6b597d..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/comment.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - 'numToStr/Comment.nvim', - opts = { - -- add any options here - }, - lazy = false, -} diff --git a/modules/home-manager/neovim/nvim/lua/plugins/mini.lua b/modules/home-manager/neovim/nvim/lua/plugins/mini.lua index bf7f26d..b7ee8b0 100644 --- a/modules/home-manager/neovim/nvim/lua/plugins/mini.lua +++ b/modules/home-manager/neovim/nvim/lua/plugins/mini.lua @@ -1,37 +1,62 @@ return { -- 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 [']quote - -- - ci' - [C]hange [I]nside [']quote - require('mini.ai').setup { n_lines = 500 } + 'echasnovski/mini.nvim', + config = function() + local keymap = vim.keymap.set - -- 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() + require('mini.ai').setup { n_lines = 500 } - -- 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 = true } + require('mini.surround').setup() - -- 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 + -- Simple and easy statusline. + local statusline = require 'mini.statusline' + statusline.setup { use_icons = true } + statusline.section_location = function() + return '%2l:%-2v' + end - -- ... and there is more! - -- Check out: https://github.com/echasnovski/mini.nvim - end, + require('mini.comment').setup() + + require('mini.icons').setup() + + require('mini.cursorword').setup() + + require('mini.extra').setup() + + files = require('mini.files') + files.setup() + keymap("n", "fe", files.open, { noremap = true, silent = true }) + + require('mini.git').setup() + + local hipatterns = require('mini.hipatterns') + hipatterns.setup({ + highlighters = { + -- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE' + fixme = { pattern = '%f[%w]()FIXME()%f[%W]', group = 'MiniHipatternsFixme' }, + hack = { pattern = '%f[%w]()HACK()%f[%W]', group = 'MiniHipatternsHack' }, + todo = { pattern = '%f[%w]()TODO()%f[%W]', group = 'MiniHipatternsTodo' }, + note = { pattern = '%f[%w]()NOTE()%f[%W]', group = 'MiniHipatternsNote' }, + + -- Highlight hex color strings (`#rrggbb`) using that color + hex_color = hipatterns.gen_highlighter.hex_color(), + }, + }) + + require('mini.move').setup() + + require('mini.notify').setup() + + require('mini.pairs').setup() + + local pick = require('mini.pick') + pick.setup() + keymap("n", "ff", pick.builtin.files, { noremap = true, silent = true }) + keymap("n", "fg", pick.builtin.grep_live, { noremap = true, silent = true }) + keymap("n", "fwg", function() + local wrd = vim.fn.expand("") + pick.builtin.grep_live({ pattern = wrd }) + end, { noremap = true, silent = true }) + + + end, } diff --git a/modules/home-manager/neovim/nvim/lua/plugins/oil.lua b/modules/home-manager/neovim/nvim/lua/plugins/oil.lua deleted file mode 100644 index 9daa9f4..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/oil.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - 'stevearc/oil.nvim', - opts = {}, - -- Optional dependencies - dependencies = { "nvim-tree/nvim-web-devicons" }, -} diff --git a/modules/home-manager/neovim/nvim/lua/plugins/playtime.lua b/modules/home-manager/neovim/nvim/lua/plugins/playtime.lua deleted file mode 100644 index 10566ee..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/playtime.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - 'rktjmp/playtime.nvim' -} diff --git a/modules/home-manager/neovim/nvim/lua/plugins/surround.lua b/modules/home-manager/neovim/nvim/lua/plugins/surround.lua deleted file mode 100644 index 3df14c8..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/surround.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - "kylechui/nvim-surround", - version = "*", -- Use for stability; omit to use `main` branch for the latest features - event = "VeryLazy", - config = function() - require("nvim-surround").setup({ - -- Configuration here, or leave empty to use defaults - }) - end -} diff --git a/modules/home-manager/neovim/nvim/lua/plugins/telekasten.lua b/modules/home-manager/neovim/nvim/lua/plugins/telekasten.lua deleted file mode 100644 index 1944673..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/telekasten.lua +++ /dev/null @@ -1,28 +0,0 @@ -return { - 'renerocksai/telekasten.nvim', - dependencies = { - 'nvim-telescope/telescope.nvim', - 'nvim-telekasten/calendar-vim' - }, - config = function() - require("telekasten").setup({ - home = vim.fn.expand("~/zettelkasten"), - }) - - -- Launch panel if nothing is typed after z - vim.keymap.set("n", "z", "Telekasten panel") - - -- Most used functions - vim.keymap.set("n", "zf", "Telekasten find_notes") - vim.keymap.set("n", "zg", "Telekasten search_notes") - vim.keymap.set("n", "zd", "Telekasten goto_today") - vim.keymap.set("n", "zz", "Telekasten follow_link") - vim.keymap.set("n", "zn", "Telekasten new_note") - vim.keymap.set("n", "zc", "Telekasten show_calendar") - vim.keymap.set("n", "zb", "Telekasten show_backlinks") - vim.keymap.set("n", "zI", "Telekasten insert_img_link") - - -- Call insert link automatically when we start typing a link - vim.keymap.set("i", "[[", "Telekasten insert_link") - end, -} diff --git a/modules/home-manager/neovim/nvim/lua/plugins/telescope-fzf-native.lua b/modules/home-manager/neovim/nvim/lua/plugins/telescope-fzf-native.lua deleted file mode 100644 index 35fc72b..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/telescope-fzf-native.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - 'nvim-telescope/telescope-fzf-native.nvim', - build = 'make' -} diff --git a/modules/home-manager/neovim/nvim/lua/plugins/telescope.lua b/modules/home-manager/neovim/nvim/lua/plugins/telescope.lua deleted file mode 100644 index 0a5f7af..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/telescope.lua +++ /dev/null @@ -1,29 +0,0 @@ -return { - { - 'nvim-telescope/telescope-ui-select.nvim' - }, - { - 'nvim-telescope/telescope.nvim', - dependencies = {'nvim-lua/plenary.nvim'}, - lazy = false, - keys = { - { "ff", "Telescope find_files" }, - { "fb", "Telescope buffers" }, - { "fo", "Telescope oldfiles" }, - { "fg", "Telescope live_grep" }, - { "fc", "Telescope commands" } - }, - config = function() - require("telescope").setup { - extensions = { - ["ui-select"] = { - require("telescope.themes").get_dropdown { - } - } - } - } - -- require('telescope').load_extension('fzf') - require("telescope").load_extension("ui-select") - end - } -} diff --git a/modules/home-manager/neovim/nvim/lua/plugins/vim-sleuth.lua b/modules/home-manager/neovim/nvim/lua/plugins/vim-sleuth.lua deleted file mode 100644 index 684e3f6..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/vim-sleuth.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - 'tpope/vim-sleuth' -} diff --git a/modules/home-manager/neovim/nvim/lua/plugins/webdevicons.lua b/modules/home-manager/neovim/nvim/lua/plugins/webdevicons.lua deleted file mode 100644 index 6fc7b01..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/webdevicons.lua +++ /dev/null @@ -1 +0,0 @@ -return { 'nvim-tree/nvim-web-devicons' }