summaryrefslogtreecommitdiffstats
path: root/.config/nvim/lua/plugins/cutlass.lua
diff options
context:
space:
mode:
authorYigit Sever2023-08-21 19:27:20 +0300
committerYigit Sever2023-08-21 19:27:20 +0300
commit49b0f23821690ac4b58aa4edf5f4608b43f1e8bf (patch)
tree8cea82a347a71f83dcd7a94ea45af4986c26422f /.config/nvim/lua/plugins/cutlass.lua
parent37638b4f5cc813466186d38fde551708ad0ecd3d (diff)
downloaddotfiles-49b0f23821690ac4b58aa4edf5f4608b43f1e8bf.tar.gz
dotfiles-49b0f23821690ac4b58aa4edf5f4608b43f1e8bf.tar.bz2
dotfiles-49b0f23821690ac4b58aa4edf5f4608b43f1e8bf.zip
nvim: change cutlass suite
and fix telescope + cmp issues
Diffstat (limited to '.config/nvim/lua/plugins/cutlass.lua')
-rw-r--r--.config/nvim/lua/plugins/cutlass.lua75
1 files changed, 56 insertions, 19 deletions
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}