update neotree to be the default file explorer
This commit is contained in:
parent
83795a2d2c
commit
251f422d76
2
init.lua
2
init.lua
|
@ -673,7 +673,7 @@ require('lazy').setup({
|
||||||
-- https://github.com/pmizio/typescript-tools.nvim
|
-- https://github.com/pmizio/typescript-tools.nvim
|
||||||
--
|
--
|
||||||
-- But for many setups, the LSP (`tsserver`) will work just fine
|
-- But for many setups, the LSP (`tsserver`) will work just fine
|
||||||
tsserver = {
|
ts_ls = {
|
||||||
javascript = {
|
javascript = {
|
||||||
inlayHints = {
|
inlayHints = {
|
||||||
includeInlayEnumMemberValueHints = true,
|
includeInlayEnumMemberValueHints = true,
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
return { 'echasnovski/mini.nvim', version = false }
|
|
@ -13,8 +13,40 @@ return {
|
||||||
keys = {
|
keys = {
|
||||||
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
|
{ '\\', ':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 = {
|
opts = {
|
||||||
filesystem = {
|
filesystem = {
|
||||||
|
hijack_netrw_behavior = 'open_current',
|
||||||
window = {
|
window = {
|
||||||
mappings = {
|
mappings = {
|
||||||
['\\'] = 'close_window',
|
['\\'] = 'close_window',
|
||||||
|
|
Loading…
Reference in New Issue