fix: Add Reveal back in
This commit is contained in:
parent
490c1cd331
commit
a5d2cf826c
4 changed files with 57 additions and 19 deletions
|
|
@ -74,9 +74,36 @@ return {
|
|||
dependencies = { "justinmk/vim-dirvish", },
|
||||
},
|
||||
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
cond = false,
|
||||
requires = "nvim-tree/nvim-web-devicons",
|
||||
config = function()
|
||||
require("trouble").setup {}
|
||||
vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>",
|
||||
{ silent = true, noremap = true }
|
||||
)
|
||||
vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>",
|
||||
{ silent = true, noremap = true }
|
||||
)
|
||||
vim.keymap.set("n", "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>",
|
||||
{ silent = true, noremap = true }
|
||||
)
|
||||
vim.keymap.set("n", "<leader>xl", "<cmd>TroubleToggle loclist<cr>",
|
||||
{ silent = true, noremap = true }
|
||||
)
|
||||
vim.keymap.set("n", "<leader>xq", "<cmd>TroubleToggle quickfix<cr>",
|
||||
{ silent = true, noremap = true }
|
||||
)
|
||||
vim.keymap.set("n", "gR", "<cmd>TroubleToggle lsp_references<cr>",
|
||||
{ silent = true, noremap = true }
|
||||
)
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
lazy = true,
|
||||
-- cond = false,
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
-- @see: https://github.com/jay-babu/mason-null-ls.nvim
|
||||
|
|
@ -84,7 +111,13 @@ return {
|
|||
local null_ls = require("null-ls")
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.code_actions.eslint_d,
|
||||
null_ls.builtins.diagnostics.codespell,
|
||||
-- null_ls.builtins.diagnostics.cspell,
|
||||
-- null_ls.builtins.diagnostics.editorconfig_checker,
|
||||
null_ls.builtins.diagnostics.eslint_d,
|
||||
null_ls.builtins.formatting.lua_format,
|
||||
-- null_ls.builtins.formatting.prettier_eslint,
|
||||
null_ls.builtins.formatting.prettierd,
|
||||
},
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,21 +1,19 @@
|
|||
-- RevealInFinder
|
||||
-- ---------------------------------------------------------------------------
|
||||
vim.api.nvim_create_user_command('Reveal',
|
||||
function()
|
||||
-- local sysname = vim.loop.os_uname().sysname
|
||||
|
||||
vim.cmd([[
|
||||
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"
|
||||
local currentBuffer = vim.api.nvim_get_current_buf()
|
||||
local bufName = vim.api.nvim_buf_get_name(currentBuffer)
|
||||
local ftype = vim.fn.getftype(bufName)
|
||||
|
||||
if ftype == "dir" then
|
||||
os.execute("xdg-open " .. bufName)
|
||||
else
|
||||
let l:command = "xdg-open ."
|
||||
endif
|
||||
execute ":silent! !" . l:command
|
||||
redraw!
|
||||
endfunction
|
||||
|
||||
command! Reveal call <SID>RevealInFinder()
|
||||
]])
|
||||
os.execute("xdg-open " .. vim.fn.expand("%:p:h"))
|
||||
end
|
||||
end,
|
||||
{}
|
||||
)
|
||||
|
||||
vim.keymap.set('n', '<leader>R', ":Reveal<CR>", { noremap = true, desc = '[R]eveal with xdg-open' })
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue