diff --git a/nvim/.config/nvim/lua/vxclutch/lazy/appearance.lua b/nvim/.config/nvim/lua/vxclutch/lazy/appearance.lua index 9e1bfae..a3099bb 100644 --- a/nvim/.config/nvim/lua/vxclutch/lazy/appearance.lua +++ b/nvim/.config/nvim/lua/vxclutch/lazy/appearance.lua @@ -8,7 +8,23 @@ function ColorMyPencils(color) end return { - + { + "folke/paint.nvim", + config = function() + require("paint").setup { + highlights = { + { + -- filter can be a table of buffer options that should match, + -- or a function called with buf as param that should return true. + -- The example below will paint @something in comments with Constant + filter = { filetype = "ftl" }, + pattern = "%s*%-%-%-%s*(@%w+)", + hl = "Constant", + }, + }, + } + end, + }, { "erikbackman/brightburn.vim", }, diff --git a/nvim/.config/nvim/lua/vxclutch/lazy/mini.lua b/nvim/.config/nvim/lua/vxclutch/lazy/mini.lua deleted file mode 100644 index 1e99208..0000000 --- a/nvim/.config/nvim/lua/vxclutch/lazy/mini.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "echasnovski/mini.ai", -} diff --git a/nvim/.config/nvim/lua/vxclutch/lazy/oil.lua b/nvim/.config/nvim/lua/vxclutch/lazy/oil.lua index cefe091..ce5601a 100644 --- a/nvim/.config/nvim/lua/vxclutch/lazy/oil.lua +++ b/nvim/.config/nvim/lua/vxclutch/lazy/oil.lua @@ -6,6 +6,13 @@ return { default_file_explorer = true, delete_to_trash = true, skip_confirm_for_simple_edits = true, + use_default_keymaps = true, + keymaps = { + ["g?"] = { "actions.show_help", mode = "n" }, + [""] = "actions.select", + ["-"] = { "actions.parent", mode = "n" }, + ["g."] = { "actions.toggle_hidden", mode = "n" }, + }, view_options = { show_hidden = true, natural_order = true, @@ -15,7 +22,19 @@ return { }, } - -- File nav split + -- vim.api.nvim_create_autocmd("FileType", { + -- pattern = "oil", + -- callback = function() + -- vim.api.nvim_buf_set_keymap(0, "n", function() + -- local cursor_line = vim.api.nvim_get_current_line() + -- if string.sub(cursor_line, -1) == "/" then + -- vim.cmd("silent! cd " .. cursor_line) + -- end + -- end, { noremap = true, silent = true }) + -- end, + -- }) + + -- File navigation split with Oil vim.api.nvim_create_user_command("Pick", function() local origin_buf = vim.fn.bufnr() vim.cmd "new | Oil" diff --git a/nvim/.config/nvim/lua/vxclutch/lazy/telescope.lua b/nvim/.config/nvim/lua/vxclutch/lazy/telescope.lua index 50e498a..14538d2 100644 --- a/nvim/.config/nvim/lua/vxclutch/lazy/telescope.lua +++ b/nvim/.config/nvim/lua/vxclutch/lazy/telescope.lua @@ -1,27 +1,49 @@ return { "nvim-telescope/telescope.nvim", - tag = "0.1.5", - dependencies = { "nvim-lua/plenary.nvim", }, config = function() - require("telescope").setup {} + local data = assert(vim.fn.stdpath "data") --[[@as string]] + + require("telescope").setup { + extensions = { + wrap_results = true, + + fzf = {}, + history = { + path = vim.fs.joinpath(data, "telescope_history.sqlite3"), + limit = 100, + }, + ["ui-select"] = { + require("telescope.themes").get_dropdown {}, + }, + }, + } + + pcall(require("telescope").load_extension, "fzf") + pcall(require("telescope").load_extension, "smart_history") + pcall(require("telescope").load_extension, "ui-select") local builtin = require "telescope.builtin" - vim.keymap.set("n", "", builtin.find_files, {}) - vim.keymap.set("n", "", builtin.git_files, {}) - vim.keymap.set("n", "vh", builtin.help_tags, {}) - vim.keymap.set("n", "sg", function() - builtin.live_grep { - grep_open_files = true, - prompt_title = "Live Grep in Open Files", - } - end, { desc = "[S]earch [/] in Open Files" }) - vim.keymap.set("n", "sn", function() + + vim.keymap.set("n", "fd", builtin.find_files) + vim.keymap.set("n", "", builtin.git_files) + vim.keymap.set("n", "fh", builtin.help_tags) + vim.keymap.set("n", "fg", builtin.live_grep) + vim.keymap.set("n", "/", builtin.current_buffer_fuzzy_find) + + vim.keymap.set("n", "gw", builtin.grep_string) + + vim.keymap.set("n", "fa", function() + ---@diagnostic disable-next-line: param-type-mismatch + builtin.find_files { cwd = vim.fs.joinpath(vim.fn.stdpath "data", "lazy") } + end) + + vim.keymap.set("n", "fn", function() builtin.find_files { cwd = vim.fn.stdpath "config" } - end, { desc = "[S]earch [N]eovim files" }) + end) end, } diff --git a/nvim/.config/nvim/lua/vxclutch/remap.lua b/nvim/.config/nvim/lua/vxclutch/remap.lua index baa8087..e55bbb4 100644 --- a/nvim/.config/nvim/lua/vxclutch/remap.lua +++ b/nvim/.config/nvim/lua/vxclutch/remap.lua @@ -1,22 +1,22 @@ local set = vim.keymap.set -- remove search highlight -- -set("n", "", "nohlsearch") +set("n", "", ":nohlsearch") -- move lines -- set("v", "J", ":m '>+1gv=gv") set("v", "K", ":m '>-2gv=gv") -- file navigation -- -set("n", "-", "Oil", { noremap = true, silent = true, desc = "Open Oil" }) +set("n", "-", ":Oil", { noremap = true, silent = true, desc = "Open Oil" }) -- terminal -- set("n", "t", ":below termi", { noremap = true, silent = true, desc = "Open Terminal Split" }) set("t", "", "", { noremap = true, silent = true, desc = "Exit terminal and goto normal mode" }) -- Exec -set("n", "x", ".lua", { desc = "Execute the current line" }) -set("n", "x", "source %", { desc = "Execute the current file" }) +set("n", "x", ":.lua", { desc = "Execute the current line" }) +set("n", "x", ":source %", { desc = "Execute the current file" }) -- LSP set("n", "gd", vim.lsp.buf.definition, { noremap = true, silent = true, desc = "Go to definition" })