]> git.rmz.io Git - dotfiles.git/commitdiff
nvim: replace replacewithregister and sort with mini.operators
authorSamir Benmendil <me@rmz.io>
Wed, 29 Oct 2025 22:10:24 +0000 (22:10 +0000)
committerSamir Benmendil <me@rmz.io>
Wed, 29 Oct 2025 22:10:24 +0000 (22:10 +0000)
This fixes the issue where gr* were now configured to do LSP stuff. I've
got LSP key on \r instead.

It might be worthwhile to reconsider that and use the official LSP
bindings, but atm griw is soo engrained in muscle memory that it was
frustrating for it to not do what was expected.

nvim/lazy-lock.json
nvim/lua/plugins/editor.lua
vim/vimrc

index 1dbef12f08229090738f516151018c8c04888652..698843c94e41363e25003aa888f5d6480039da9b 100644 (file)
@@ -32,6 +32,7 @@
   "mini.hipatterns": { "branch": "main", "commit": "5629d5fba132b4ab0b3f0039549308421f65ff45" },
   "mini.icons": { "branch": "main", "commit": "284798619aed9f4c1ac1b9417b9a5e3b4b85ef3a" },
   "mini.indentscope": { "branch": "main", "commit": "8ce41a77eed7f4121c83c67fda5e2e86af999e6d" },
+  "mini.operators": { "branch": "main", "commit": "1d0d1e1570e5bd22e6df3bcb068d0a2ac0d30710" },
   "mini.pairs": { "branch": "main", "commit": "b9aada8c0e59f2b938e98fbf4eae0799eba96ad9" },
   "mini.surround": { "branch": "main", "commit": "444e155147e2b5159dd28a65f9736254c16cb817" },
   "neogen": { "branch": "main", "commit": "d7f9461727751fb07f82011051338a9aba07581d" },
index 07e0a10ecd2adc7ee5ab6734fba1e45293d15ebe..f5bfd74a67b3b2b7349a1f0dbe303b77717c38a1 100644 (file)
@@ -94,6 +94,9 @@ return {
       }
     end,
   },
+  { "nvim-mini/mini.operators",  -- text edit operators
+    opts = {},
+  },
   { "folke/flash.nvim",
     -- Flash enhances the built-in search functionality by showing labels
     -- at the end of each match, letting you quickly jump to a specific
index a0bea2ad4632b42f6ba7f42b4dbdcfca49ac8597..8cf8255d8e5f13c6580a70b1e1072390f8c8f805 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -201,9 +201,15 @@ if !has("nvim")
   " staging
   Plug 'puremourning/vimspector' " replaced by lsp {{{2
     let g:vimspector_enable_mappings = 'HUMAN'
-  " }}}
   Plug 'vim-scripts/syntaxrange' " replaced by treesitter {{{2
-  " }}}
+  Plug 'vim-scripts/replacewithregister' " replaced by mini.operators {{{2
+  " sort operator replaced by mini.operaters {{{2
+  function! SortLinesOpFunc(...)
+    '[,']sort
+  endfunction
+  nnoremap <silent> gs :<C-U>set operatorfunc=SortLinesOpFunc<CR>g@
+  vnoremap <silent> gs :sort<cr>
+  " }}}2
 endif
 
 Plug 'alepez/vim-gtest'
@@ -248,7 +254,6 @@ Plug 'tpope/vim-speeddating'
 Plug 'tpope/vim-unimpaired'
 Plug 'tweekmonster/spellrotate.vim'
 " Plug 'vim-scripts/mediawiki.vim' " TODO: delete?
-Plug 'vim-scripts/replacewithregister' " FIXME: is overridden by lsp
 Plug 'wincent/loupe'
 
 " text objects
@@ -925,13 +930,6 @@ if !exists(":DiffOrig")
                   \ | wincmd p | diffthis
 endif
 
-" sort operator {{{2
-function! SortLinesOpFunc(...)
-  '[,']sort
-endfunction
-nnoremap <silent> gs :<C-U>set operatorfunc=SortLinesOpFunc<CR>g@
-vnoremap <silent> gs :sort<cr>
-
 " edit configs  {{{2
 " TODO: populate location list with both .vim and .lua files
 " TODO: create file if it doesn't exist in nvim or vim rtps