From 490c1cd33158bcccd65ad6fb4fde1b8bbf5c5b3a Mon Sep 17 00:00:00 2001 From: Garrett Dawson Date: Thu, 6 Apr 2023 21:25:07 -0600 Subject: [PATCH] kludge "Reveal" --- lua/custom/plugins/init.lua | 3 ++- lua/custom/plugins/reveal.lua | 31 +++++++++++++++++-------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 5fab7e7a..10e10a9a 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -8,7 +8,7 @@ return { { "nvim-tree/nvim-web-devicons", - opts = {} + lazy = true }, { @@ -84,6 +84,7 @@ return { local null_ls = require("null-ls") null_ls.setup({ sources = { + null_ls.builtins.formatting.lua_format, null_ls.builtins.formatting.prettierd, }, }) diff --git a/lua/custom/plugins/reveal.lua b/lua/custom/plugins/reveal.lua index 95a67294..b50cb8dc 100644 --- a/lua/custom/plugins/reveal.lua +++ b/lua/custom/plugins/reveal.lua @@ -1,20 +1,23 @@ -- RevealInFinder -- --------------------------------------------------------------------------- --- set this to leader-e vim.cmd([[ -function! s:RevealInFinder() - if filereadable(expand("%")) - let l:command = "open -R %" - elseif getftype(expand("%:p:h")) == "dir" - let l:command = "open %:p:h" - else - let l:command = "open ." - endif - execute ":silent! !" . l:command - redraw! -endfunction -command! Reveal call RevealInFinder() + function! s:RevealInFinder() + if filereadable(expand("%")) + let l:command = "xdg-open -R %" + elseif getftype(expand("%:p:h")) == "dir" + let l:command = "xdg-open %:p:h" + else + let l:command = "xdg-open ." + endif + execute ":silent! !" . l:command + redraw! + endfunction + + command! Reveal call RevealInFinder() ]]) -return {} +vim.keymap.set('n', 'R', ":Reveal", { noremap = true, desc = '[R]eveal with xdg-open' }) + +return { +}