summary refs log tree commit diff
path: root/.vim/lua
diff options
context:
space:
mode:
Diffstat (limited to '.vim/lua')
-rw-r--r--.vim/lua/misc.lua3
-rw-r--r--.vim/lua/plugins.lua11
2 files changed, 12 insertions, 2 deletions
diff --git a/.vim/lua/misc.lua b/.vim/lua/misc.lua
index 7d4fa31..37ef854 100644
--- a/.vim/lua/misc.lua
+++ b/.vim/lua/misc.lua
@@ -40,8 +40,7 @@ function M.open_under_cursor(cmd, detect_cmd)
     if cmd:sub(1, 1) == ":" then
       vim.cmd(cmd:sub(2) .. ' ' .. txt)
     else
-      local c
-      c = vim.loop.spawn(cmd, { args = {txt} }, function() c:close() end)
+      vim.loop.spawn(cmd, {args = {txt}})
     end
   end)
 end
diff --git a/.vim/lua/plugins.lua b/.vim/lua/plugins.lua
index c451a30..eb62b1e 100644
--- a/.vim/lua/plugins.lua
+++ b/.vim/lua/plugins.lua
@@ -202,6 +202,17 @@ require('packer').startup({function()
         hash_padding = 4,
         sort_order = 'directories_first',
       }
+      vim.api.nvim_create_autocmd('FileType', {
+        pattern = 'dirbuf',
+        callback = function()
+          vim.keymap.set('n', 'gT', function()
+            vim.loop.spawn('swaymsg', {args = {'exec', '--', 'foot', '-D', vim.fn.expand('%')}})
+            -- vim.fn.system('swaymsg exec -- foot -D ' .. vim.fn.expand('%'))
+          end, { buffer = 0 })
+          wk_register { ['gT'] = {'Open in foot'} }
+        end,
+        group = vim.api.nvim_create_augroup('DirBufEnter', {}),
+      })
     end} -- }}}
 
   use {'ggandor/leap.nvim', -- {{{