feat: move :Reveal to a plugin
This commit is contained in:
parent
48db037cfc
commit
7e978b24fc
6
init.lua
6
init.lua
|
@ -183,7 +183,11 @@ require('lazy').setup({
|
||||||
-- An additional note is that if you only copied in the `init.lua`, you can just comment this line
|
-- An additional note is that if you only copied in the `init.lua`, you can just comment this line
|
||||||
-- to get rid of the warning telling you that there are not plugins in `lua/custom/plugins/`.
|
-- to get rid of the warning telling you that there are not plugins in `lua/custom/plugins/`.
|
||||||
{ import = 'custom.plugins' },
|
{ import = 'custom.plugins' },
|
||||||
}, {})
|
}, {
|
||||||
|
dev = {
|
||||||
|
path = "~/repos",
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
-- [[ Setting options ]]
|
-- [[ Setting options ]]
|
||||||
-- See `:help vim.o`
|
-- See `:help vim.o`
|
||||||
|
|
|
@ -71,7 +71,7 @@ return {
|
||||||
|
|
||||||
{
|
{
|
||||||
"kristijanhusak/vim-dirvish-git",
|
"kristijanhusak/vim-dirvish-git",
|
||||||
dependencies = { "justinmk/vim-dirvish", },
|
dependencies = { "justinmk/vim-dirvish" },
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -103,24 +103,35 @@ return {
|
||||||
|
|
||||||
{
|
{
|
||||||
"jose-elias-alvarez/null-ls.nvim",
|
"jose-elias-alvarez/null-ls.nvim",
|
||||||
-- cond = false,
|
|
||||||
dependencies = { "nvim-lua/plenary.nvim" },
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
config = function()
|
config = function()
|
||||||
-- @see: https://github.com/jay-babu/mason-null-ls.nvim
|
|
||||||
-- might want to just use mason-null-ls. not yet sure what the advantage is.
|
|
||||||
local null_ls = require("null-ls")
|
local null_ls = require("null-ls")
|
||||||
|
|
||||||
null_ls.setup({
|
null_ls.setup({
|
||||||
sources = {
|
sources = {
|
||||||
null_ls.builtins.code_actions.eslint_d,
|
null_ls.builtins.code_actions.eslint_d,
|
||||||
null_ls.builtins.diagnostics.codespell,
|
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.diagnostics.eslint_d,
|
||||||
null_ls.builtins.formatting.lua_format,
|
|
||||||
-- null_ls.builtins.formatting.prettier_eslint,
|
|
||||||
null_ls.builtins.formatting.prettierd,
|
null_ls.builtins.formatting.prettierd,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"jay-babu/mason-null-ls.nvim",
|
||||||
|
cond = false,
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
dependencies = {
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
"jose-elias-alvarez/null-ls.nvim",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("mason-null-ls").setup({
|
||||||
|
ensure_installed = {},
|
||||||
|
automatic_installation = true,
|
||||||
|
automatic_setup = false,
|
||||||
|
})
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +1,9 @@
|
||||||
vim.api.nvim_create_user_command('Reveal',
|
|
||||||
function()
|
|
||||||
-- local sysname = vim.loop.os_uname().sysname
|
|
||||||
|
|
||||||
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
|
|
||||||
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' })
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
{
|
||||||
|
"killtheliterate/nvim-reveal",
|
||||||
|
dev = false,
|
||||||
|
config = function()
|
||||||
|
require('nvim-reveal').setup {}
|
||||||
|
end
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue