nvim-tree + auto-session fix
This commit is contained in:
		
							parent
							
								
									a6709013ff
								
							
						
					
					
						commit
						7dd9c63f32
					
				
					 3 changed files with 59 additions and 1 deletions
				
			
		| 
						 | 
					@ -18,6 +18,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # UI plugins
 | 
					    # UI plugins
 | 
				
			||||||
    ./plugins/ui/lualine.nix
 | 
					    ./plugins/ui/lualine.nix
 | 
				
			||||||
 | 
					    ./plugins/ui/nvim-tree.nix
 | 
				
			||||||
    ./plugins/ui/web-devicons.nix
 | 
					    ./plugins/ui/web-devicons.nix
 | 
				
			||||||
    ./plugins/ui/whichkey.nix
 | 
					    ./plugins/ui/whichkey.nix
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,25 @@
 | 
				
			||||||
{...}: {
 | 
					{...}: {
 | 
				
			||||||
  plugins.auto-session = {
 | 
					  plugins.auto-session = {
 | 
				
			||||||
    enable = true;
 | 
					    enable = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # fix: nvim-tree / auto-session 
 | 
				
			||||||
 | 
					    settings = {
 | 
				
			||||||
 | 
					      log_level = "error";
 | 
				
			||||||
 | 
					      pre_save_cmds = [
 | 
				
			||||||
 | 
					        "NvimTreeClose"
 | 
				
			||||||
 | 
					      ];
 | 
				
			||||||
 | 
					      post_save_cmds = [
 | 
				
			||||||
 | 
					        "NvimTreeOpen"
 | 
				
			||||||
 | 
					      ];
 | 
				
			||||||
 | 
					      post_open_cmds = [
 | 
				
			||||||
 | 
					        "NvimTreeOpen"
 | 
				
			||||||
 | 
					      ];
 | 
				
			||||||
 | 
					      post_restore_cmds = [
 | 
				
			||||||
 | 
					        "NvimTreeOpen"
 | 
				
			||||||
 | 
					      ];
 | 
				
			||||||
 | 
					      cwd_change_handling = true;
 | 
				
			||||||
 | 
					    }; 
 | 
				
			||||||
 | 
					    # https://github.com/zwhitchcox/auto-session-nvim-tree
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  keymaps = [
 | 
					  keymaps = [
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										38
									
								
								config/plugins/ui/nvim-tree.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								config/plugins/ui/nvim-tree.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,38 @@
 | 
				
			||||||
 | 
					{...}: {
 | 
				
			||||||
 | 
					  plugins.nvim-tree = {
 | 
				
			||||||
 | 
					    enable = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Configure nvim-tree
 | 
				
			||||||
 | 
					    extraOptions = {
 | 
				
			||||||
 | 
					      # Set width of nvim-tree
 | 
				
			||||||
 | 
					      view = {
 | 
				
			||||||
 | 
					        width = 38;
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      # Hide dotfiles
 | 
				
			||||||
 | 
					      filters = {
 | 
				
			||||||
 | 
					        dotfiles = true;
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      # fix: nvim-tree / auto-session 
 | 
				
			||||||
 | 
					      sync_root_with_cwd = true;
 | 
				
			||||||
 | 
					      actions = {
 | 
				
			||||||
 | 
					        change_dir = {
 | 
				
			||||||
 | 
					          global = true;
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					      }; 
 | 
				
			||||||
 | 
					      # https://github.com/zwhitchcox/auto-session-nvim-tree
 | 
				
			||||||
 | 
					    }; 
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  keymaps = [
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      mode = ["n"];
 | 
				
			||||||
 | 
					      key = "<leader>e";
 | 
				
			||||||
 | 
					      action = "<cmd>NvimTreeFocus<cr>";
 | 
				
			||||||
 | 
					      options = {
 | 
				
			||||||
 | 
					        desc = "Focus NvimTree";
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  ];
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue