summaryrefslogtreecommitdiff
path: root/fnl/plugins/grug-far.fnl
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2025-04-13 22:40:13 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2025-04-13 22:40:13 +0200
commit5a10209e89a5993ad66ae4335fc029068b2ad855 (patch)
tree69e59c14e64505d4e967eb379b7722aab95d50ce /fnl/plugins/grug-far.fnl
parent608b3b2beb9ad5867f288641eedd9543b92053ce (diff)
Diffstat (limited to 'fnl/plugins/grug-far.fnl')
-rw-r--r--fnl/plugins/grug-far.fnl26
1 files changed, 13 insertions, 13 deletions
diff --git a/fnl/plugins/grug-far.fnl b/fnl/plugins/grug-far.fnl
index 44da9b1..fdcf897 100644
--- a/fnl/plugins/grug-far.fnl
+++ b/fnl/plugins/grug-far.fnl
@@ -11,12 +11,12 @@
(when ?cword
(set opts.prefills.search ?cword))
(when ?file
- (set opts.prefills.flags ?file))
- (grug.grug_far opts)))
+ (set opts.prefills.paths ?file))
+ (grug.open opts)))
(λ visual-replace []
(let [grug (require :grug-far)]
- (grug.with_visual_selection {:prefills {:flags (vim.fn.expand "%")}})))
+ (grug.with_visual_selection {:prefills {:paths (vim.fn.expand "%")}})))
(λ config []
(let [{: create-auto-cmds} (require :util.cmds)
@@ -24,23 +24,23 @@
(create-auto-cmds auto-cmds)
(grug.setup)))
-(local keys [{1 :<m-r> 2 :<cmd>GrugFar<cr> :desc "Find and Replace"}
- {1 :<m-w>
- 2 (λ []
- (replace (vim.fn.expand :<cword>)))
- :desc "Find and replace word under cursor"}
- {1 :<m-x>
+(local keys [{1 :<m-w> 2 :<cmd>GrugFar<cr> :desc "Find and Replace"}
+ {1 :<m-s-w>
2 (λ []
(replace nil (vim.fn.expand "%")))
:desc "Find and replace in file"}
- {1 :<m-a>
+ {1 :<m-r>
2 (λ []
- (replace (vim.fn.expand :<cword>) (vim.fn.expand "%")))
- :desc "Find and replace cword in file"}
+ (replace (vim.fn.expand :<cword>)))
+ :desc "Find and replace word under cursor"}
{1 :<m-r>
2 (λ []
(visual-replace))
:desc "Find and Replace"
- :mode [:v]}])
+ :mode [:v]}
+ {1 :<m-s-r>
+ 2 (λ []
+ (replace (vim.fn.expand :<cword>) (vim.fn.expand "%")))
+ :desc "Find and replace cword in file"}])
{1 :MagicDuck/grug-far.nvim : keys : config}