Forráskód Böngészése

nixpkgs/neovim: enable mini.operators

Thomas Dy 2 hete
szülő
commit
936522a847

+ 22 - 0
.config/nixpkgs/neovim/config/lua/user/plugins/editing.lua

@@ -1,6 +1,7 @@
 local MiniAi = require('mini.ai')
 local MiniAlign = require('mini.align')
 local MiniComment = require('mini.comment')
+local MiniOperators = require('mini.operators')
 local MiniPairs = require('mini.pairs')
 local MiniSurround = require('mini.surround')
 
@@ -66,6 +67,27 @@ MiniPairs.setup({
   },
 })
 
+-- extra operators
+MiniOperators.setup({
+  -- disable evaluate mapping
+  evaluate = { prefix = '' },
+
+  -- custom mapping defined later
+  replace = { prefix = '' },
+
+  -- other mappings
+  -- gm - multiply
+  -- gs - sort
+  -- gx - exchange
+})
+
+MiniOperators.make_mappings('replace', {
+  textobject = 'cp',
+  line = 'cpp',
+  -- overrides default p mapping
+  selection = 'p',
+})
+
 local function toggle_end_char(char)
   local cursor = vim.api.nvim_win_get_cursor(0)
   local row = cursor[1] - 1