Open neo-tree on directory open in netrw style
This commit is contained in:
		
							parent
							
								
									f577a7036f
								
							
						
					
					
						commit
						a5b6985f46
					
				
							
								
								
									
										28
									
								
								init.lua
								
								
								
								
							
							
						
						
									
										28
									
								
								init.lua
								
								
								
								
							|  | @ -917,35 +917,7 @@ require('lazy').setup({ | ||||||
|       }, |       }, | ||||||
|       indent = { enable = true, disable = { 'ruby' } }, |       indent = { enable = true, disable = { 'ruby' } }, | ||||||
|     }, |     }, | ||||||
|     -- There are additional nvim-treesitter modules that you can use to interact |  | ||||||
|     -- with nvim-treesitter. You should go explore a few and see what interests you: |  | ||||||
|     -- |  | ||||||
|     --    - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` |  | ||||||
|     --    - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context |  | ||||||
|     --    - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects |  | ||||||
|   }, |   }, | ||||||
| 
 |  | ||||||
|   -- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the |  | ||||||
|   -- init.lua. If you want these files, they are in the repository, so you can just download them and |  | ||||||
|   -- place them in the correct locations. |  | ||||||
| 
 |  | ||||||
|   -- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart |  | ||||||
|   -- |  | ||||||
|   --  Here are some example plugins that I've included in the Kickstart repository. |  | ||||||
|   --  Uncomment any of the lines below to enable them (you will need to restart nvim). |  | ||||||
|   -- |  | ||||||
|   -- require 'kickstart.plugins.debug', |  | ||||||
|   -- require 'kickstart.plugins.indent_line', |  | ||||||
|   -- require 'kickstart.plugins.lint', |  | ||||||
|   -- require 'kickstart.plugins.autopairs', |  | ||||||
|   -- require 'kickstart.plugins.neo-tree', |  | ||||||
|   -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps |  | ||||||
| 
 |  | ||||||
|   -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` |  | ||||||
|   --    This is the easiest way to modularize your config. |  | ||||||
|   -- |  | ||||||
|   --  Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. |  | ||||||
|   --    For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` |  | ||||||
|   { import = 'custom.plugins' }, |   { import = 'custom.plugins' }, | ||||||
| }, { | }, { | ||||||
|   ui = { |   ui = { | ||||||
|  |  | ||||||
|  | @ -264,6 +264,26 @@ return { | ||||||
|       'MunifTanjim/nui.nvim', |       'MunifTanjim/nui.nvim', | ||||||
|       -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information |       -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information | ||||||
|     }, |     }, | ||||||
|  |     config = function() | ||||||
|  |       require('neo-tree').setup { | ||||||
|  |         source_selector = { | ||||||
|  |           winbar = true, | ||||||
|  |           statusline = true, | ||||||
|  |         }, | ||||||
|  |       } | ||||||
|  |     end, | ||||||
|  |     init = function() | ||||||
|  |       if vim.fn.argc(-1) == 1 then | ||||||
|  |         local stat = vim.loop.fs_stat(vim.fn.argv(0)) | ||||||
|  |         if stat and stat.type == 'directory' then | ||||||
|  |           require('neo-tree').setup { | ||||||
|  |             filesystem = { | ||||||
|  |               hijack_netrw_behavior = 'open_current', | ||||||
|  |             }, | ||||||
|  |           } | ||||||
|  |         end | ||||||
|  |       end | ||||||
|  |     end, | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|     'SmiteshP/nvim-navic', |     'SmiteshP/nvim-navic', | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue