aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/nvim
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2023-01-27 13:40:01 -0600
committerToby Vincent <tobyv13@gmail.com>2023-01-27 13:40:01 -0600
commit60ea770d379d5b129feb92a3d4a50f7191af2c4c (patch)
treef38e571bc6cc79219dd4b95bb4ffa3e53fbd2adc /nvim
parentcf7fe1e1f754eb1e43221188c00c19638ef1fc0e (diff)
feat(nvim): add telescope-all-recent, telescope-undo, and neoclip
Diffstat (limited to 'nvim')
-rw-r--r--nvim/.config/nvim/lazy-lock.json9
-rw-r--r--nvim/.config/nvim/lua/tobyvin/plugins/telescope.lua126
-rw-r--r--nvim/.config/nvim/lua/tobyvin/plugins/undotree.lua20
-rw-r--r--nvim/.config/nvim/lua/tobyvin/plugins/yanky.lua33
4 files changed, 78 insertions, 110 deletions
diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json
index fac187b..3e0ba87 100644
--- a/nvim/.config/nvim/lazy-lock.json
+++ b/nvim/.config/nvim/lazy-lock.json
@@ -44,6 +44,7 @@
"nvim-dap-virtual-text": { "branch": "master", "commit": "2971ce3e89b1711cc26e27f73d3f854b559a77d4" },
"nvim-lspconfig": { "branch": "master", "commit": "f7ebb0fed4b952c77bb5827db030405f2d6cd4e7" },
"nvim-navic": { "branch": "master", "commit": "7a2b823152fe4de65ee7925b0e32d26ed73bc57c" },
+ "nvim-neoclip.lua": { "branch": "main", "commit": "5b9286a40ea2020352280caeb713515badb03d99" },
"nvim-notify": { "branch": "master", "commit": "b005821516f1f37801a73067afd1cef2dbc4dfe8" },
"nvim-texlabconfig": { "branch": "master", "commit": "2786bdcc37922c285a560e6f3a1cfad3f09d804c" },
"nvim-treesitter": { "branch": "master", "commit": "51d220e0bd8922caabcb3e5de936fc599a1bd210" },
@@ -60,14 +61,16 @@
"rust-tools.nvim": { "branch": "master", "commit": "df584e84393ef255f5b8cbd709677d6a3a5bf42f" },
"scope.nvim": { "branch": "main", "commit": "2db6d31de8e3a98d2b41c0f0d1f5dc299ee76875" },
"sessions": { "branch": "main", "commit": "0377fbd47f6a536f10f7ca4646136b4b9e595b5f" },
+ "sqlite.lua": { "branch": "master", "commit": "93ff5824682ecc874200e338fd8ca9ccd08508f8" },
+ "telescope-all-recent.nvim": { "branch": "main", "commit": "f26fad245d5a468fe7fd0b494fc983f707f2c4f3" },
"telescope-dap.nvim": { "branch": "master", "commit": "313d2ea12ae59a1ca51b62bf01fc941a983d9c9c" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "304508fb7bea78e3c0eeddd88c4837501e403ae8" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "fab3e2212e206f4f8b3bbaa656e129443c9b802e" },
"telescope-live-grep-args.nvim": { "branch": "master", "commit": "7de3baef1ec4fb77f7a8195fe87bebd513244b6a" },
+ "telescope-symbols.nvim": { "branch": "master", "commit": "f7d7c84873c95c7bd5682783dd66f84170231704" },
+ "telescope-undo.nvim": { "branch": "main", "commit": "f2ca7c914134c7e6eb9275ee09863141caa77a3f" },
"telescope.nvim": { "branch": "master", "commit": "1ba7278cf08da8048e7f589ef6b65a39fd3e4dbf" },
"todo-comments.nvim": { "branch": "main", "commit": "077c59586d9d0726b0696dc5680eb863f4e04bc5" },
"tokyonight.nvim": { "branch": "main", "commit": "def91651c41f6d1d43ebcb50763324d35331baee" },
- "undotree": { "branch": "main", "commit": "6cb7e65e03871d2567d2c44745d3de57d07ca1fd" },
- "virt-column.nvim": { "branch": "master", "commit": "36fa3be9cba9195081e934b4f9729021726c5889" },
- "yanky.nvim": { "branch": "main", "commit": "930493f645ea6b75df5c1007cb7d57767987981b" }
+ "virt-column.nvim": { "branch": "master", "commit": "36fa3be9cba9195081e934b4f9729021726c5889" }
} \ No newline at end of file
diff --git a/nvim/.config/nvim/lua/tobyvin/plugins/telescope.lua b/nvim/.config/nvim/lua/tobyvin/plugins/telescope.lua
index 11c5bd8..2e19016 100644
--- a/nvim/.config/nvim/lua/tobyvin/plugins/telescope.lua
+++ b/nvim/.config/nvim/lua/tobyvin/plugins/telescope.lua
@@ -3,10 +3,67 @@ local M = {
dependencies = {
"nvim-lua/plenary.nvim",
"BurntSushi/ripgrep",
- { "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
+ {
+ "nvim-telescope/telescope-fzf-native.nvim",
+ build = "make",
+ },
+ {
+ "prochri/telescope-all-recent.nvim",
+ dependencies = "kkharji/sqlite.lua",
+ config = true,
+ },
+ {
+ "AckslD/nvim-neoclip.lua",
+ config = true,
+ },
"nvim-telescope/telescope-file-browser.nvim",
"nvim-telescope/telescope-live-grep-args.nvim",
"nvim-telescope/telescope-dap.nvim",
+ "nvim-telescope/telescope-symbols.nvim",
+ "debugloop/telescope-undo.nvim",
+ },
+ opts = {
+ defaults = {
+ borderchars = { "─", "│", "─", "│", "┌", "┐", "┘", "└" },
+ file_ignore_patterns = { "^.git/" },
+ vimgrep_arguments = {
+ "rg",
+ "--color=never",
+ "--no-heading",
+ "--with-filename",
+ "--line-number",
+ "--column",
+ "--hidden",
+ "--smart-case",
+ "--trim",
+ },
+ cache_picker = {
+ num_pickers = 10,
+ },
+ },
+ pickers = {
+ find_files = {
+ find_command = {
+ "fd",
+ "--type",
+ "f",
+ "--hidden",
+ "--strip-cwd-prefix",
+ },
+ },
+ live_grep = {
+ theme = "ivy",
+ },
+ buffers = {
+ show_all_buffers = true,
+ sort_lastused = true,
+ },
+ },
+ extensions = {
+ live_grep_args = {
+ theme = "ivy",
+ },
+ },
},
}
@@ -34,7 +91,7 @@ function M.init()
vim.keymap.set("n", "<leader>fm", builtin.marks, { desc = "marks" })
vim.keymap.set("n", "<leader>fM", builtin.man_pages, { desc = "man pages" })
vim.keymap.set("n", "<leader>fo", builtin.oldfiles, { desc = "old files" })
- vim.keymap.set("n", "<leader>fp", builtin.pickers, { desc = "pickers" })
+ vim.keymap.set("n", "<leader>fP", builtin.pickers, { desc = "pickers" })
vim.keymap.set("n", "<leader>fr", builtin.resume, { desc = "resume" })
vim.keymap.set("n", "<leader>fR", builtin.reloader, { desc = "reloader" })
vim.keymap.set("n", "<leader>fs", builtin.spell_suggest, { desc = "spell suggest" })
@@ -57,61 +114,22 @@ function M.init()
vim.keymap.set("n", "<leader>fg", function()
require("telescope").extensions.live_grep_args.live_grep_args()
end, { desc = "live grep" })
-end
-
-function M.config()
- local telescope = require("telescope")
- local actions = require("telescope.actions")
+ vim.keymap.set("n", "<leader>fu", function()
+ require("telescope").extensions.undo.undo()
+ end, { desc = "undo" })
- telescope.setup({
- defaults = {
- borderchars = { "─", "│", "─", "│", "┌", "┐", "┘", "└" },
- mappings = {
- i = {
- ["<esc>"] = actions.close,
- ["<C-h>"] = actions.which_key,
- },
- },
- file_ignore_patterns = { "^.git/", "^target/" },
- vimgrep_arguments = {
- "rg",
- "--color=never",
- "--no-heading",
- "--with-filename",
- "--line-number",
- "--column",
- "--hidden",
- "--smart-case",
- "--trim",
- },
- history = {
- path = vim.fn.stdpath("data") .. "/databases/telescope_history.sqlite3",
- limit = 100,
- },
- cache_picker = {
- num_pickers = 10,
- },
- },
- pickers = {
- find_files = {
- find_command = { "fd", "--type", "f", "--hidden", "--strip-cwd-prefix" },
- },
- live_grep = { theme = "ivy" },
- buffers = {
- show_all_buffers = true,
- sort_lastused = true,
- },
- },
- extensions = {
- live_grep_args = {
- theme = "ivy",
- },
- },
- })
+ vim.keymap.set("n", "<leader>fp", function()
+ require("telescope").extensions.neoclip.default()
+ end, { desc = "clipboard" })
+end
- -- Extensions
- telescope.load_extension("fzf")
+function M.config(_, opts)
+ require("telescope").setup(opts)
+ require("telescope").load_extension("fzf")
+ require("telescope").load_extension("undo")
+ require("telescope").load_extension("neoclip")
+ require("telescope-all-recent")
end
return M
diff --git a/nvim/.config/nvim/lua/tobyvin/plugins/undotree.lua b/nvim/.config/nvim/lua/tobyvin/plugins/undotree.lua
deleted file mode 100644
index 47f24ef..0000000
--- a/nvim/.config/nvim/lua/tobyvin/plugins/undotree.lua
+++ /dev/null
@@ -1,20 +0,0 @@
-local M = {
- "jiaoshijie/undotree",
- dependencies = {
- "nvim-lua/plenary.nvim",
- },
- cmd = "UndoTree",
- opts = {
- window = {
- winblend = 0,
- },
- },
-}
-
-function M.init()
- vim.api.nvim_create_user_command("UndoTree", function()
- require("undotree").open()
- end, { desc = "toggle undotree" })
-end
-
-return M
diff --git a/nvim/.config/nvim/lua/tobyvin/plugins/yanky.lua b/nvim/.config/nvim/lua/tobyvin/plugins/yanky.lua
deleted file mode 100644
index a4ea8cc..0000000
--- a/nvim/.config/nvim/lua/tobyvin/plugins/yanky.lua
+++ /dev/null
@@ -1,33 +0,0 @@
-local M = {
- "gbprod/yanky.nvim",
- event = "TextYankPost",
-}
-
-function M.init()
- vim.keymap.set({ "n", "x" }, "<C-p>", function()
- require("yanky.picker").select_in_history()
- end, { desc = "yank history" })
-end
-
-function M.config()
- local yanky = require("yanky")
-
- yanky.setup({
- highlight = {
- on_put = false,
- on_yank = false,
- },
- picker = {
- select = {
- action = require("yanky.picker").actions.set_register(require("yanky.utils").get_default_register()), -- nil to use default put action
- },
- },
- preserve_cursor_position = {
- enabled = false,
- },
- })
-
- yanky.init_history()
-end
-
-return M