diff options
Diffstat (limited to '.config/nvim')
| -rw-r--r-- | .config/nvim/lazy-lock.json | 24 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/cmp.lua | 56 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/cutlass.lua | 75 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/telescope.lua | 32 |
4 files changed, 139 insertions, 48 deletions
diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 34a93f4..b2bb81a 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, | 2 | "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, |
| 3 | "LuaSnip": { "branch": "master", "commit": "c4d6298347f7707e9757351b2ee03d0c00da5c20" }, | 3 | "LuaSnip": { "branch": "master", "commit": "c4d6298347f7707e9757351b2ee03d0c00da5c20" }, |
| 4 | "barbar.nvim": { "branch": "master", "commit": "8cca17ea0ced3ba564e5da972a25600edafe7d7b" }, | 4 | "barbar.nvim": { "branch": "master", "commit": "8cca17ea0ced3ba564e5da972a25600edafe7d7b" }, |
| 5 | "catppuccin": { "branch": "main", "commit": "490078b1593c6609e6a50ad5001e7902ea601824" }, | 5 | "catppuccin": { "branch": "main", "commit": "e2d6ce295eb537c92b567ec5d31f120de46e8d13" }, |
| 6 | "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, | 6 | "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, |
| 7 | "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, | 7 | "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, |
| 8 | "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, | 8 | "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, |
| @@ -12,27 +12,28 @@ | |||
| 12 | "dial.nvim": { "branch": "master", "commit": "c6657df5453a6cbe4e8356e1675e9652cadc332f" }, | 12 | "dial.nvim": { "branch": "master", "commit": "c6657df5453a6cbe4e8356e1675e9652cadc332f" }, |
| 13 | "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, | 13 | "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, |
| 14 | "friendly-snippets": { "branch": "main", "commit": "377d45475b49e37460a902d6d569d2093d4037d0" }, | 14 | "friendly-snippets": { "branch": "main", "commit": "377d45475b49e37460a902d6d569d2093d4037d0" }, |
| 15 | "gitsigns.nvim": { "branch": "main", "commit": "5a2b1205841bc06ffb15719b14d54987e17b22ae" }, | 15 | "gitsigns.nvim": { "branch": "main", "commit": "749267aaa863c30d721c9913699c5d94e0c07dd3" }, |
| 16 | "indent-blankline.nvim": { "branch": "master", "commit": "4541d690816cb99a7fc248f1486aa87f3abce91c" }, | 16 | "indent-blankline.nvim": { "branch": "master", "commit": "4541d690816cb99a7fc248f1486aa87f3abce91c" }, |
| 17 | "lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" }, | 17 | "lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" }, |
| 18 | "leap.nvim": { "branch": "main", "commit": "5efe985cf68fac3b6a6dfe7a75fbfaca8db2af9c" }, | 18 | "leap.nvim": { "branch": "main", "commit": "5efe985cf68fac3b6a6dfe7a75fbfaca8db2af9c" }, |
| 19 | "ltex-extra.nvim": { "branch": "master", "commit": "9bed99b2b8488cc2daf66c76d2e0cf051ee80d13" }, | 19 | "ltex-extra.nvim": { "branch": "master", "commit": "9bed99b2b8488cc2daf66c76d2e0cf051ee80d13" }, |
| 20 | "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, | 20 | "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, |
| 21 | "mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" }, | 21 | "mason-lspconfig.nvim": { "branch": "main", "commit": "2997f467881ac4faa6f8c5e7065e3a672297c8ad" }, |
| 22 | "mason.nvim": { "branch": "main", "commit": "b5bb138312dbd3f7729197ca659cbe5221d36a03" }, | 22 | "mason.nvim": { "branch": "main", "commit": "a51c2d063c5377ee9e58c5f9cda7c7436787be72" }, |
| 23 | "neodev.nvim": { "branch": "main", "commit": "47dacc6d8f74936f7719351b025421df740c789b" }, | 23 | "neodev.nvim": { "branch": "main", "commit": "e9bc652e22f9cd1892630bf019db363ac403ee39" }, |
| 24 | "nvim-autopairs": { "branch": "master", "commit": "ae5b41ce880a6d850055e262d6dfebd362bb276e" }, | 24 | "nvim-autopairs": { "branch": "master", "commit": "ae5b41ce880a6d850055e262d6dfebd362bb276e" }, |
| 25 | "nvim-cmp": { "branch": "main", "commit": "51f1e11a89ec701221877532ee1a23557d291dd5" }, | 25 | "nvim-cmp": { "branch": "main", "commit": "51f1e11a89ec701221877532ee1a23557d291dd5" }, |
| 26 | "nvim-lspconfig": { "branch": "master", "commit": "0d29cad8de3b2c654315203fc1fe12fde722a18a" }, | 26 | "nvim-lspconfig": { "branch": "master", "commit": "67f151e84daddc86cc65f5d935e592f76b9f4496" }, |
| 27 | "nvim-surround": { "branch": "main", "commit": "0d6882635817a2677749a330127d12ac30a4f3c8" }, | 27 | "nvim-surround": { "branch": "main", "commit": "0d6882635817a2677749a330127d12ac30a4f3c8" }, |
| 28 | "nvim-tree.lua": { "branch": "master", "commit": "18c7a3119839adc4599d838726deae662859c8b2" }, | 28 | "nvim-tree.lua": { "branch": "master", "commit": "920868dba13466586897a8f40220eca6b2caac41" }, |
| 29 | "nvim-treesitter": { "branch": "master", "commit": "add1864bbf2d3b8e789ec6b4715bb5a4073e3b60" }, | 29 | "nvim-treesitter": { "branch": "master", "commit": "7c935d6bd5ecb36e7c6cf6678e1eaa38b85111f3" }, |
| 30 | "nvim-treesitter-textobjects": { "branch": "master", "commit": "56272167a6dead91c47c02dbdbfe1ae5643c59f5" }, | 30 | "nvim-treesitter-textobjects": { "branch": "master", "commit": "56272167a6dead91c47c02dbdbfe1ae5643c59f5" }, |
| 31 | "nvim-ufo": { "branch": "main", "commit": "aebd36bf5447862671356fcd5d4a8708ce6c9470" }, | 31 | "nvim-ufo": { "branch": "main", "commit": "aebd36bf5447862671356fcd5d4a8708ce6c9470" }, |
| 32 | "nvim-web-devicons": { "branch": "master", "commit": "cfc8824cc1db316a276b36517f093baccb8e799a" }, | 32 | "nvim-web-devicons": { "branch": "master", "commit": "cfc8824cc1db316a276b36517f093baccb8e799a" }, |
| 33 | "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, | 33 | "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, |
| 34 | "promise-async": { "branch": "main", "commit": "e94f35161b8c5d4a4ca3b6ff93dd073eb9214c0e" }, | 34 | "promise-async": { "branch": "main", "commit": "e94f35161b8c5d4a4ca3b6ff93dd073eb9214c0e" }, |
| 35 | "rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" }, | 35 | "rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" }, |
| 36 | "substitute.nvim": { "branch": "main", "commit": "89dbe55cccee36bcb5e2be8c2d92ff8716601734" }, | ||
| 36 | "tabular": { "branch": "master", "commit": "339091ac4dd1f17e225fe7d57b48aff55f99b23a" }, | 37 | "tabular": { "branch": "master", "commit": "339091ac4dd1f17e225fe7d57b48aff55f99b23a" }, |
| 37 | "targets.vim": { "branch": "master", "commit": "642d3a4ce306264b05ea3219920b13ea80931767" }, | 38 | "targets.vim": { "branch": "master", "commit": "642d3a4ce306264b05ea3219920b13ea80931767" }, |
| 38 | "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" }, | 39 | "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" }, |
| @@ -45,10 +46,9 @@ | |||
| 45 | "vim-illuminate": { "branch": "master", "commit": "76f28e858f1caae87bfa45fb4fd09e4b053fc45b" }, | 46 | "vim-illuminate": { "branch": "master", "commit": "76f28e858f1caae87bfa45fb4fd09e4b053fc45b" }, |
| 46 | "vim-move": { "branch": "master", "commit": "244a2908ffbca3d09529b3ec24c2c090f489f401" }, | 47 | "vim-move": { "branch": "master", "commit": "244a2908ffbca3d09529b3ec24c2c090f489f401" }, |
| 47 | "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, | 48 | "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, |
| 48 | "vim-subversive": { "branch": "master", "commit": "6286cda3f9222bfd490fe34a00a2d8cd4925adec" }, | ||
| 49 | "vim-unimpaired": { "branch": "master", "commit": "6d44a6dc2ec34607c41ec78acf81657248580bf1" }, | 49 | "vim-unimpaired": { "branch": "master", "commit": "6d44a6dc2ec34607c41ec78acf81657248580bf1" }, |
| 50 | "vim-yoink": { "branch": "master", "commit": "89ed6934679fdbc3c20f552b50b1f869f624cd22" }, | 50 | "vimtex": { "branch": "master", "commit": "534fd725f2475a9083b032e402c7e73b8a3fc6bb" }, |
| 51 | "vimtex": { "branch": "master", "commit": "e3d0bea39dbcb6e064db751b646c958342a3460f" }, | ||
| 52 | "vimwiki": { "branch": "dev", "commit": "f0fe154ede6b11e3db9b058b930005a056a3d1c6" }, | 51 | "vimwiki": { "branch": "dev", "commit": "f0fe154ede6b11e3db9b058b930005a056a3d1c6" }, |
| 53 | "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" } | 52 | "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }, |
| 53 | "yanky.nvim": { "branch": "main", "commit": "95c2f006ea6eaed2b2d8b8b4943b8fcf13faf03f" } | ||
| 54 | } \ No newline at end of file | 54 | } \ No newline at end of file |
diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua index 78ff9a9..828d7c2 100644 --- a/.config/nvim/lua/plugins/cmp.lua +++ b/.config/nvim/lua/plugins/cmp.lua | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | -- autocompletion | ||
| 2 | return { | 1 | return { |
| 3 | { | 2 | { |
| 4 | "hrsh7th/nvim-cmp", | 3 | "hrsh7th/nvim-cmp", |
| @@ -46,18 +45,35 @@ return { | |||
| 46 | TypeParameter = "", | 45 | TypeParameter = "", |
| 47 | } | 46 | } |
| 48 | 47 | ||
| 48 | ---@diagnostic disable-next-line: missing-fields | ||
| 49 | cmp.setup({ | 49 | cmp.setup({ |
| 50 | enabled = true, | 50 | enabled = function() |
| 51 | -- disable autocompletion in prompt | ||
| 52 | local buftype = vim.api.nvim_buf_get_option(0, "buftype") | ||
| 53 | if buftype == "prompt" then return false end | ||
| 54 | |||
| 55 | local context = require 'cmp.config.context' | ||
| 56 | -- disable autocompletion in comments | ||
| 57 | return not context.in_treesitter_capture("comment") and not context.in_syntax_group("Comment") | ||
| 58 | end, | ||
| 59 | ---@diagnostic disable-next-line: missing-fields | ||
| 60 | completion = { | ||
| 61 | completeopt = "menu,menuone,noselect", | ||
| 62 | }, | ||
| 63 | window = { | ||
| 64 | documentation = cmp.config.window.bordered(), | ||
| 65 | completion = cmp.config.window.bordered(), | ||
| 66 | }, | ||
| 51 | snippet = { | 67 | snippet = { |
| 52 | expand = function(args) | 68 | expand = function(args) |
| 53 | luasnip.lsp_expand(args.body) | 69 | luasnip.lsp_expand(args.body) |
| 54 | end, | 70 | end, |
| 55 | }, | 71 | }, |
| 56 | mapping = cmp.mapping.preset.insert({ | 72 | mapping = cmp.mapping.preset.insert({ |
| 73 | ["<C-f>"] = cmp.mapping.scroll_docs(-4), | ||
| 74 | ["<C-d>"] = cmp.mapping.scroll_docs(4), | ||
| 57 | ["<C-k>"] = cmp.mapping.select_prev_item(), | 75 | ["<C-k>"] = cmp.mapping.select_prev_item(), |
| 58 | ["<C-j>"] = cmp.mapping.select_next_item(), | 76 | ["<C-j>"] = cmp.mapping.select_next_item(), |
| 59 | ["<C-d>"] = cmp.mapping.scroll_docs(-4), | ||
| 60 | ["<C-f>"] = cmp.mapping.scroll_docs(4), | ||
| 61 | ["<CR>"] = cmp.mapping.confirm({ | 77 | ["<CR>"] = cmp.mapping.confirm({ |
| 62 | behavior = cmp.ConfirmBehavior.Replace, | 78 | behavior = cmp.ConfirmBehavior.Replace, |
| 63 | select = false, | 79 | select = false, |
| @@ -81,6 +97,7 @@ return { | |||
| 81 | end | 97 | end |
| 82 | end, { "i", "s" }), | 98 | end, { "i", "s" }), |
| 83 | }), | 99 | }), |
| 100 | ---@diagnostic disable-next-line: missing-fields | ||
| 84 | formatting = { | 101 | formatting = { |
| 85 | fields = { "kind", "abbr", "menu" }, | 102 | fields = { "kind", "abbr", "menu" }, |
| 86 | format = function(entry, vim_item) | 103 | format = function(entry, vim_item) |
| @@ -103,12 +120,41 @@ return { | |||
| 103 | }, | 120 | }, |
| 104 | }) | 121 | }) |
| 105 | 122 | ||
| 106 | -- If you want insert `(` after select function or method item | 123 | -- insert `(` after select function or method item |
| 107 | local cmp_autopairs = require('nvim-autopairs.completion.cmp') | 124 | local cmp_autopairs = require('nvim-autopairs.completion.cmp') |
| 108 | cmp.event:on( | 125 | cmp.event:on( |
| 109 | 'confirm_done', | 126 | 'confirm_done', |
| 110 | cmp_autopairs.on_confirm_done() | 127 | cmp_autopairs.on_confirm_done() |
| 111 | ) | 128 | ) |
| 129 | |||
| 130 | ---@diagnostic disable-next-line: missing-fields | ||
| 131 | cmp.setup.filetype('gitcommit', { | ||
| 132 | sources = cmp.config.sources({ | ||
| 133 | { name = 'git' }, | ||
| 134 | }, { | ||
| 135 | { name = 'buffer' }, | ||
| 136 | }) | ||
| 137 | }) | ||
| 138 | |||
| 139 | -- use buffer source for `/` . | ||
| 140 | ---@diagnostic disable-next-line: missing-fields | ||
| 141 | cmp.setup.cmdline('/', { | ||
| 142 | mapping = cmp.mapping.preset.cmdline(), | ||
| 143 | sources = { | ||
| 144 | { name = 'buffer' } | ||
| 145 | } | ||
| 146 | }) | ||
| 147 | |||
| 148 | -- use cmdline & path source for ':' . | ||
| 149 | ---@diagnostic disable-next-line: missing-fields | ||
| 150 | cmp.setup.cmdline(':', { | ||
| 151 | mapping = cmp.mapping.preset.cmdline(), | ||
| 152 | sources = cmp.config.sources({ | ||
| 153 | { name = 'path' } | ||
| 154 | }, { | ||
| 155 | { name = 'cmdline' } | ||
| 156 | }) | ||
| 157 | }) | ||
| 112 | end, | 158 | end, |
| 113 | }, | 159 | }, |
| 114 | } | 160 | } |
diff --git a/.config/nvim/lua/plugins/cutlass.lua b/.config/nvim/lua/plugins/cutlass.lua index 0b8ef52..b9332a9 100644 --- a/.config/nvim/lua/plugins/cutlass.lua +++ b/.config/nvim/lua/plugins/cutlass.lua | |||
| @@ -3,26 +3,36 @@ return { | |||
| 3 | 'svermeulen/vim-cutlass', | 3 | 'svermeulen/vim-cutlass', |
| 4 | }, | 4 | }, |
| 5 | { | 5 | { |
| 6 | 'svermeulen/vim-subversive', | 6 | 'gbprod/substitute.nvim', |
| 7 | config = function() | 7 | config = function() |
| 8 | local map = require("helpers.keys").map | 8 | local map = require("helpers.keys").map |
| 9 | 9 | ||
| 10 | -- substitute from yank | 10 | map("n", "s", require('substitute').operator, "substitute") |
| 11 | map('n', '<Leader>ys', '<plug>(SubversiveSubstitute)', "substitute from yank") | 11 | map("n", "ss", require('substitute').line, "substitute: linewise") |
| 12 | map('n', '<Leader>yss', '<plug>(SubversiveSubstituteLine)', "substitute from yank, line") | 12 | map("n", "S", require('substitute').eol, "substitute: eol") |
| 13 | map('n', '<Leader>yS', '<plug>(SubversiveSubstituteToEndOfLine)', "substitute from yank, eol") | 13 | map("x", "s", require('substitute').visual, "substitute: visual") |
| 14 | 14 | ||
| 15 | -- substitute over range | 15 | map("n", "<leader>s", require('substitute.range').operator, "substitute: over range") |
| 16 | map( { 'n', 'x' }, '<Leader>s', '<plug>(SubversiveSubstituteRange)', "start substitude over range") | 16 | map("x", "<leader>s", require('substitute.range').visual, "substitute: over visual") |
| 17 | map('n', '<Leader>ss', '<plug>(SubversiveSubstituteWordRange)', "start substitude over range") | 17 | map("n", "<leader>ss", require('substitute.range').word, "substitute: with word over range") |
| 18 | end | 18 | |
| 19 | map("n", "sx", require('substitute.exchange').operator, "exchange") | ||
| 20 | map("n", "sxx", require('substitute.exchange').line, "exchange line") | ||
| 21 | map("x", "sX", require('substitute.exchange').visual, "exchange visual") | ||
| 22 | map("n", "sxc", require('substitute.exchange').cancel, "exchange cancel") | ||
| 23 | |||
| 24 | require("substitute").setup({ | ||
| 25 | highlight_substituted_text = { | ||
| 26 | enabled = true, | ||
| 27 | timer = 300, | ||
| 28 | }, | ||
| 29 | }) | ||
| 30 | end, | ||
| 19 | }, | 31 | }, |
| 20 | { | 32 | { |
| 21 | 'svermeulen/vim-yoink', | 33 | "gbprod/yanky.nvim", |
| 22 | config = function() | 34 | config = function() |
| 23 | vim.g.yoinkIncludeDeleteOperations = 1 | 35 | -- fix Target STRING not available |
| 24 | |||
| 25 | -- fix the Target STRING not available | ||
| 26 | vim.g.clipboard = { | 36 | vim.g.clipboard = { |
| 27 | name = 'xsel_override', | 37 | name = 'xsel_override', |
| 28 | copy = { | 38 | copy = { |
| @@ -38,14 +48,41 @@ return { | |||
| 38 | 48 | ||
| 39 | local map = require("helpers.keys").map | 49 | local map = require("helpers.keys").map |
| 40 | 50 | ||
| 41 | -- yoink paste | 51 | map({ "n", "x" }, 'p', '<Plug>(YankyPutAfter)') |
| 42 | map('n', 'p', '<Plug>(YoinkPaste_p)') | 52 | map({ "n", "x" }, 'P', '<Plug>(YankyPutBefore)') |
| 43 | map('n', 'P', '<Plug>(YoinkPaste_P)') | 53 | |
| 54 | map("n", "<c-n>", "<Plug>(YankyCycleForward)") | ||
| 55 | map("n", "<c-p>", "<Plug>(YankyCycleBackward)") | ||
| 44 | 56 | ||
| 45 | -- iterate over yank list | 57 | local utils = require("yanky.utils") |
| 46 | map('n', '<c-n>', '<Plug>(YoinkPostPasteSwapBack)') | 58 | local mapping = require("yanky.telescope.mapping") |
| 47 | map('n', '<c-p>', '<Plug>(YoinkPostPasteSwapForward)') | 59 | |
| 60 | require("yanky").setup({ | ||
| 61 | ring = { | ||
| 62 | history_length = 100, | ||
| 63 | storage = "shada", | ||
| 64 | sync_with_numbered_registers = true, | ||
| 65 | cancel_event = "update", | ||
| 66 | ignore_registers = { "_" }, | ||
| 67 | }, | ||
| 68 | system_clipboard = { | ||
| 69 | sync_with_ring = true, | ||
| 70 | }, | ||
| 71 | picker = { | ||
| 72 | telescope = { | ||
| 73 | use_default_mappings = false, | ||
| 74 | mappings = { | ||
| 75 | default = mapping.set_register(utils.get_default_register()), | ||
| 76 | }, | ||
| 77 | }, | ||
| 78 | }, | ||
| 79 | highlight = { | ||
| 80 | on_put = true, | ||
| 81 | on_yank = true, | ||
| 82 | timer = 300, | ||
| 83 | }, | ||
| 48 | 84 | ||
| 85 | }) | ||
| 49 | end, | 86 | end, |
| 50 | } | 87 | } |
| 51 | } | 88 | } |
diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index ecea32b..be6fdd7 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | return { | 1 | return { |
| 2 | { | 2 | { |
| 3 | "nvim-telescope/telescope.nvim", | 3 | "nvim-telescope/telescope.nvim", |
| 4 | priority = 500, | ||
| 4 | dependencies = { | 5 | dependencies = { |
| 5 | "nvim-lua/plenary.nvim", | 6 | "nvim-lua/plenary.nvim", |
| 6 | { | 7 | { |
| @@ -8,38 +9,45 @@ return { | |||
| 8 | build = "make", | 9 | build = "make", |
| 9 | cond = vim.fn.executable("make") == 1 | 10 | cond = vim.fn.executable("make") == 1 |
| 10 | }, | 11 | }, |
| 12 | "gbprod/yanky.nvim", | ||
| 11 | }, | 13 | }, |
| 14 | lazy = false, | ||
| 12 | config = function() | 15 | config = function() |
| 13 | require('telescope').setup({ | 16 | require('telescope').setup({ |
| 17 | defaults = { | ||
| 18 | path_display = { "truncate" }, | ||
| 19 | }, | ||
| 14 | extensions = { | 20 | extensions = { |
| 15 | fzf = { | 21 | fzf = { |
| 16 | fuzzy = true, -- false will only do exact matching | 22 | fuzzy = true, -- false will only do exact matching |
| 17 | override_generic_sorter = true, | 23 | override_generic_sorter = true, |
| 18 | override_file_sorter = true, | 24 | override_file_sorter = true, |
| 19 | case_mode = "smart_case", | 25 | case_mode = "smart_case", |
| 20 | } | 26 | }, |
| 21 | } | 27 | }, |
| 22 | }) | 28 | }) |
| 23 | -- Enable telescope fzf native, if installed | 29 | -- Enable telescope fzf native, if installed |
| 24 | pcall(require("telescope").load_extension, "fzf") | 30 | pcall(require("telescope").load_extension, "fzf") |
| 25 | 31 | ||
| 26 | local map = require("helpers.keys").map | 32 | local map = require("helpers.keys").map |
| 27 | 33 | ||
| 28 | map("n", "<leader>fr", require("telescope.builtin").oldfiles, "recently opened") | 34 | map("n", "<leader>fr", require("telescope.builtin").oldfiles, "🔭: recently opened") |
| 29 | map("n", "<leader><space>", require("telescope.builtin").buffers, "open buffers") | 35 | map("n", "<leader><space>", require("telescope.builtin").buffers, "🔭: open buffers") |
| 30 | map("n", "<leader>/", function() | 36 | map("n", "<leader>/", function() |
| 31 | -- You can pass additional configuration to telescope to change theme, layout, etc. | 37 | -- you can pass additional configuration to telescope to change theme, layout, etc. |
| 32 | require("telescope.builtin").current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({ | 38 | require("telescope.builtin").current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({ |
| 33 | winblend = 10, | 39 | winblend = 10, |
| 34 | previewer = false, | 40 | previewer = false, |
| 35 | })) | 41 | })) |
| 36 | end, "search in current buffer") | 42 | end, "🔭: search in current buffer") |
| 37 | 43 | ||
| 38 | map("n", "<leader>sf", require("telescope.builtin").find_files, "files") | 44 | map("n", "<leader>sf", require("telescope.builtin").find_files, "🔭: find files") |
| 39 | map("n", "<leader>sh", require("telescope.builtin").help_tags, "help") | 45 | map("n", "<leader>sh", require("telescope.builtin").help_tags, "🔭: help") |
| 40 | map("n", "<leader>sw", require("telescope.builtin").grep_string, "current word") | 46 | map("n", "<leader>sw", require("telescope.builtin").grep_string, "🔭: current word") |
| 41 | map("n", "<leader>sg", require("telescope.builtin").live_grep, "grep") | 47 | map("n", "<leader>sg", require("telescope.builtin").live_grep, "🔭: live grep") |
| 42 | map("n", "<leader>sd", require("telescope.builtin").diagnostics, "diagnostics") | 48 | map("n", "<leader>sd", require("telescope.builtin").diagnostics, "🔭: diagnostics") |
| 49 | require("telescope").load_extension("yank_history") | ||
| 50 | map("n", "<leader>sp", require("telescope").extensions.yank_history.yank_history, "🔭: yank history") | ||
| 43 | end, | 51 | end, |
| 44 | }, | 52 | }, |
| 45 | } | 53 | } |
