summary refs log tree commit diff
path: root/.vim/lua/internal/misc.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.vim/lua/internal/misc.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/.vim/lua/internal/misc.lua b/.vim/lua/internal/misc.lua
index a3045f4..b7d1a06 100644
--- a/.vim/lua/internal/misc.lua
+++ b/.vim/lua/internal/misc.lua
@@ -204,4 +204,27 @@ function M.link_preview()
   )
 end
 
+function M.setup(opts)
+  if opts.sortline then
+    vim.api.nvim_create_user_command('SortLine', M.sort_lines,
+      { desc = 'sort line', range = '%', preview = M.sort_lines })
+  end
+  if opts.grep then
+    vim.api.nvim_create_user_command('Grep', function(o) M.live_grep(table.concat(o.fargs)) end,
+      {
+        desc = 'live grep (rg)',
+        nargs = '*',
+        complete = 'dir',
+      })
+  end
+  if opts.find then
+    vim.api.nvim_create_user_command('Find', function(o) M.find_files(table.concat(o.fargs)) end,
+      {
+        desc = 'find files (fd)',
+        nargs = '*',
+        complete = 'dir',
+      })
+  end
+end
+
 return M