Skip to content

Commit a5b6985

Browse files
Open neo-tree on directory open in netrw style
1 parent f577a70 commit a5b6985

File tree

2 files changed

+20
-28
lines changed

2 files changed

+20
-28
lines changed

init.lua

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -917,35 +917,7 @@ require('lazy').setup({
917917
},
918918
indent = { enable = true, disable = { 'ruby' } },
919919
},
920-
-- There are additional nvim-treesitter modules that you can use to interact
921-
-- with nvim-treesitter. You should go explore a few and see what interests you:
922-
--
923-
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
924-
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
925-
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
926920
},
927-
928-
-- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the
929-
-- init.lua. If you want these files, they are in the repository, so you can just download them and
930-
-- place them in the correct locations.
931-
932-
-- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart
933-
--
934-
-- Here are some example plugins that I've included in the Kickstart repository.
935-
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
936-
--
937-
-- require 'kickstart.plugins.debug',
938-
-- require 'kickstart.plugins.indent_line',
939-
-- require 'kickstart.plugins.lint',
940-
-- require 'kickstart.plugins.autopairs',
941-
-- require 'kickstart.plugins.neo-tree',
942-
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
943-
944-
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
945-
-- This is the easiest way to modularize your config.
946-
--
947-
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
948-
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
949921
{ import = 'custom.plugins' },
950922
}, {
951923
ui = {

lua/custom/plugins/init.lua

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,26 @@ return {
264264
'MunifTanjim/nui.nvim',
265265
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
266266
},
267+
config = function()
268+
require('neo-tree').setup {
269+
source_selector = {
270+
winbar = true,
271+
statusline = true,
272+
},
273+
}
274+
end,
275+
init = function()
276+
if vim.fn.argc(-1) == 1 then
277+
local stat = vim.loop.fs_stat(vim.fn.argv(0))
278+
if stat and stat.type == 'directory' then
279+
require('neo-tree').setup {
280+
filesystem = {
281+
hijack_netrw_behavior = 'open_current',
282+
},
283+
}
284+
end
285+
end
286+
end,
267287
},
268288
{
269289
'SmiteshP/nvim-navic',

0 commit comments

Comments
 (0)