From 7096adce11b93787170c09b79a6170d97b4a977c Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 29 Jul 2024 00:03:58 +0200 Subject: Replace fn with λ and how cmds are imported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fnl/plugins/grug-far.fnl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'fnl/plugins/grug-far.fnl') diff --git a/fnl/plugins/grug-far.fnl b/fnl/plugins/grug-far.fnl index ed6eae1..44da9b1 100644 --- a/fnl/plugins/grug-far.fnl +++ b/fnl/plugins/grug-far.fnl @@ -5,7 +5,7 @@ :command "nnoremap q :close"}] [:FileType {:pattern [:grug-far] :command "setlocal spell!"}]]) -(fn replace [?cword ?file] +(λ replace [?cword ?file] (let [grug (require :grug-far)] (var opts {:prefills {}}) (when ?cword @@ -14,31 +14,31 @@ (set opts.prefills.flags ?file)) (grug.grug_far opts))) -(fn visual-replace [] +(λ visual-replace [] (let [grug (require :grug-far)] (grug.with_visual_selection {:prefills {:flags (vim.fn.expand "%")}}))) -(fn config [] - (let [cmds (require :util.cmds) +(λ config [] + (let [{: create-auto-cmds} (require :util.cmds) grug (require :grug-far)] - (cmds.create-auto-cmds auto-cmds) + (create-auto-cmds auto-cmds) (grug.setup))) (local keys [{1 : 2 :GrugFar :desc "Find and Replace"} {1 : - 2 (fn [] + 2 (λ [] (replace (vim.fn.expand :))) :desc "Find and replace word under cursor"} {1 : - 2 (fn [] + 2 (λ [] (replace nil (vim.fn.expand "%"))) :desc "Find and replace in file"} {1 : - 2 (fn [] + 2 (λ [] (replace (vim.fn.expand :) (vim.fn.expand "%"))) :desc "Find and replace cword in file"} {1 : - 2 (fn [] + 2 (λ [] (visual-replace)) :desc "Find and Replace" :mode [:v]}]) -- cgit v1.2.3-70-g09d2