update neotree to be the default file explorer

This commit is contained in:
Gilad Sher 2024-09-12 11:01:44 -04:00
parent 83795a2d2c
commit 251f422d76
No known key found for this signature in database
3 changed files with 34 additions and 1 deletions

View File

@ -673,7 +673,7 @@ require('lazy').setup({
-- https://github.com/pmizio/typescript-tools.nvim
--
-- But for many setups, the LSP (`tsserver`) will work just fine
tsserver = {
ts_ls = {
javascript = {
inlayHints = {
includeInlayEnumMemberValueHints = true,

View File

@ -0,0 +1 @@
return { 'echasnovski/mini.nvim', version = false }

View File

@ -13,8 +13,40 @@ return {
keys = {
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
},
init = function()
vim.api.nvim_create_autocmd('BufNewFile', {
group = vim.api.nvim_create_augroup('RemoteFile', { clear = true }),
callback = function()
local f = vim.fn.expand '%:p'
for _, v in ipairs { 'sftp', 'scp', 'ssh', 'dav', 'fetch', 'ftp', 'http', 'rcp', 'rsync' } do
local p = v .. '://'
if string.sub(f, 1, #p) == p then
vim.cmd [[
unlet g:loaded_netrw
unlet g:loaded_netrwPlugin
runtime! plugin/netrwPlugin.vim
silent Explore %
]]
vim.api.nvim_clear_autocmds { group = 'RemoteFile' }
break
end
end
end,
})
vim.api.nvim_create_autocmd('BufEnter', {
group = vim.api.nvim_create_augroup('NeoTreeInit', { clear = true }),
callback = function()
local f = vim.fn.expand '%:p'
if vim.fn.isdirectory(f) ~= 0 then
vim.cmd('Neotree current dir=' .. f)
vim.api.nvim_clear_autocmds { group = 'NeoTreeInit' }
end
end,
})
end,
opts = {
filesystem = {
hijack_netrw_behavior = 'open_current',
window = {
mappings = {
['\\'] = 'close_window',