mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-11-03 20:22:21 +00:00 
			
		
		
		
	treewide: begin restructuring the module tree
This commit is contained in:
		
					parent
					
						
							
								e1835f6c46
							
						
					
				
			
			
				commit
				
					
						7c730a78e5
					
				
			
		
					 254 changed files with 749 additions and 664 deletions
				
			
		
							
								
								
									
										36
									
								
								modules/plugins/utility/preview/glow/config.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								modules/plugins/utility/preview/glow/config.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,36 @@
 | 
			
		|||
{
 | 
			
		||||
  pkgs,
 | 
			
		||||
  config,
 | 
			
		||||
  lib,
 | 
			
		||||
  ...
 | 
			
		||||
}: let
 | 
			
		||||
  inherit (lib.modules) mkIf mkMerge;
 | 
			
		||||
  inherit (lib.nvim.binds) mkBinding;
 | 
			
		||||
  inherit (lib.nvim.dag) entryAnywhere;
 | 
			
		||||
  # TODO: move this to its own module
 | 
			
		||||
  inherit (lib) pushDownDefault;
 | 
			
		||||
 | 
			
		||||
  cfg = config.vim.utility.preview.glow;
 | 
			
		||||
  self = import ./glow.nix {
 | 
			
		||||
    inherit lib config pkgs;
 | 
			
		||||
  };
 | 
			
		||||
  mappings = self.options.vim.utility.preview.glow.mappings;
 | 
			
		||||
in {
 | 
			
		||||
  config = mkIf cfg.enable {
 | 
			
		||||
    vim.startPlugins = ["glow-nvim"];
 | 
			
		||||
 | 
			
		||||
    vim.maps.normal = mkMerge [
 | 
			
		||||
      (mkBinding cfg.mappings.openPreview ":Glow<CR>" mappings.openPreview.description)
 | 
			
		||||
    ];
 | 
			
		||||
 | 
			
		||||
    vim.binds.whichKey.register = pushDownDefault {
 | 
			
		||||
      "<leader>pm" = "+Preview Markdown";
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    vim.luaConfigRC.glow = entryAnywhere ''
 | 
			
		||||
      require('glow').setup({
 | 
			
		||||
        glow_path = "${pkgs.glow}/bin/glow"
 | 
			
		||||
      });
 | 
			
		||||
    '';
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue