fix: Add Reveal back in

pull/951/head
ggdawson 2 years ago committed by Garrett Dawson
parent 5f98bb2bb2
commit 749ed2e1b3

@ -13,6 +13,8 @@ set.splitright = true
set.tabstop = 2 set.tabstop = 2
set.textwidth = 80 set.textwidth = 80
vim.o.inccommand = "nosplit"
-- prev/next tab -- prev/next tab
vim.keymap.set('n', 'H', 'gT', { desc = 'Tab Left' }) vim.keymap.set('n', 'H', 'gT', { desc = 'Tab Left' })
vim.keymap.set('n', 'L', 'gt', { desc = 'Tab Right' }) vim.keymap.set('n', 'L', 'gt', { desc = 'Tab Right' })
@ -25,7 +27,9 @@ vim.keymap.set('i', '<C-k>', '<ESC>:m .-2<CR>==gi', { noremap = true, desc = 'Bu
vim.keymap.set('v', '<C-k>', ":m '<-2<CR>gv=gv", { noremap = true, desc = 'Bubble Down' }) vim.keymap.set('v', '<C-k>', ":m '<-2<CR>gv=gv", { noremap = true, desc = 'Bubble Down' })
vim.keymap.set('v', '<C-j>', ":m '>+1<CR>gv=gv", { noremap = true, desc = 'Bubble Up' }) vim.keymap.set('v', '<C-j>', ":m '>+1<CR>gv=gv", { noremap = true, desc = 'Bubble Up' })
vim.o.inccommand = "nosplit" -- additional telescope triggers
vim.keymap.set('n', '<C-t>', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })
vim.keymap.set('n', '<C-g>', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
vim.diagnostic.config({ vim.diagnostic.config({
severity_sort = true, severity_sort = true,

@ -192,7 +192,7 @@ require('lazy').setup({
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
-- These are some example plugins that I've included in the kickstart repository. -- These are some example plugins that I've included in the kickstart repository.
-- Uncomment any of the lines below to enable them. -- Uncomment any of the lines below to enable them.
-- require 'kickstart.plugins.autoformat', require 'kickstart.plugins.autoformat',
-- require 'kickstart.plugins.debug', -- require 'kickstart.plugins.debug',
-- NOTE: The import below automatically adds your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- NOTE: The import below automatically adds your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
@ -268,12 +268,15 @@ vim.api.nvim_create_autocmd('TextYankPost', {
-- [[ Configure Telescope ]] -- [[ Configure Telescope ]]
-- See `:help telescope` and `:help telescope.setup()` -- See `:help telescope` and `:help telescope.setup()`
local actions = require "telescope.actions"
require('telescope').setup { require('telescope').setup {
defaults = { defaults = {
mappings = { mappings = {
i = { i = {
['<C-u>'] = false, ['<C-u>'] = false,
['<C-d>'] = false, ['<C-d>'] = false,
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
}, },
}, },
}, },

@ -74,9 +74,36 @@ return {
dependencies = { "justinmk/vim-dirvish", }, 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", "jose-elias-alvarez/null-ls.nvim",
lazy = true, -- 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 -- @see: https://github.com/jay-babu/mason-null-ls.nvim
@ -84,7 +111,13 @@ return {
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.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.lua_format,
-- null_ls.builtins.formatting.prettier_eslint,
null_ls.builtins.formatting.prettierd, 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([[ local currentBuffer = vim.api.nvim_get_current_buf()
function! s:RevealInFinder() local bufName = vim.api.nvim_buf_get_name(currentBuffer)
if filereadable(expand("%")) local ftype = vim.fn.getftype(bufName)
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 <SID>RevealInFinder() 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' }) vim.keymap.set('n', '<leader>R', ":Reveal<CR>", { noremap = true, desc = '[R]eveal with xdg-open' })

Loading…
Cancel
Save