mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 02:52:37 +00:00 
			
		
		
		
	feat(languages: move markdown and tidal to languages module)
This commit is contained in:
		
					parent
					
						
							
								ba463a3bdf
							
						
					
				
			
			
				commit
				
					
						fdca3b1e7e
					
				
			
		
					 17 changed files with 56 additions and 111 deletions
				
			
		|  | @ -13,6 +13,10 @@ inputs: let | ||||||
|       configuration.imports = modules; |       configuration.imports = modules; | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|  |   tidalConfig = { | ||||||
|  |     config.vim.languages.tidal.enable = true; | ||||||
|  |   }; | ||||||
|  | 
 | ||||||
|   mainConfig = isMaximal: { |   mainConfig = isMaximal: { | ||||||
|     config = { |     config = { | ||||||
|       vim = { |       vim = { | ||||||
|  | @ -191,5 +195,5 @@ inputs: let | ||||||
|     }; |     }; | ||||||
|   }; |   }; | ||||||
| in { | in { | ||||||
|   inherit neovimConfiguration mainConfig; |   inherit neovimConfiguration mainConfig tidalConfig; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -8,6 +8,9 @@ with lib; let | ||||||
|     }; |     }; | ||||||
| in { | in { | ||||||
|   imports = [ |   imports = [ | ||||||
|  |     ./markdown  | ||||||
|  |     ./tidal | ||||||
|  | 
 | ||||||
|     ./clang.nix |     ./clang.nix | ||||||
|     ./go.nix |     ./go.nix | ||||||
|     ./nix.nix |     ./nix.nix | ||||||
|  |  | ||||||
							
								
								
									
										24
									
								
								modules/languages/markdown/config.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								modules/languages/markdown/config.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,24 @@ | ||||||
|  | { | ||||||
|  |   pkgs, | ||||||
|  |   config, | ||||||
|  |   lib, | ||||||
|  |   ... | ||||||
|  | }: | ||||||
|  | with lib; | ||||||
|  | with builtins; let | ||||||
|  |   cfg = config.vim.languages.markdown; | ||||||
|  | in { | ||||||
|  |   config = mkIf cfg.enable (mkMerge [ | ||||||
|  |     (mkIf cfg.glow.enable { | ||||||
|  |       vim.startPlugins = ["glow-nvim"]; | ||||||
|  | 
 | ||||||
|  |       vim.globals = { | ||||||
|  |         "glow_binary_path" = "${pkgs.glow}/bin"; | ||||||
|  |       }; | ||||||
|  | 
 | ||||||
|  |       vim.configRC.glow = nvim.dag.entryAnywhere '' | ||||||
|  |         autocmd FileType markdown noremap <leader>p :Glow<CR> | ||||||
|  |       ''; | ||||||
|  |     }) | ||||||
|  |   ]); | ||||||
|  | } | ||||||
|  | @ -1,7 +1,6 @@ | ||||||
| {...}: { | {...}: { | ||||||
|   imports = [ |   imports = [ | ||||||
|     ./glow |  | ||||||
|     ./config.nix |     ./config.nix | ||||||
|     ./module.nix |     ./markdown.nix | ||||||
|   ]; |   ]; | ||||||
| } | } | ||||||
							
								
								
									
										20
									
								
								modules/languages/markdown/markdown.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								modules/languages/markdown/markdown.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,20 @@ | ||||||
|  | { | ||||||
|  |   pkgs, | ||||||
|  |   config, | ||||||
|  |   lib, | ||||||
|  |   ... | ||||||
|  | }: | ||||||
|  | with lib; | ||||||
|  | with builtins; let | ||||||
|  |   cfg = config.vim.languages.markdown; | ||||||
|  | in { | ||||||
|  |   options.vim.languages.markdown = { | ||||||
|  |     enable = mkEnableOption "Markdown language support"; | ||||||
|  | 
 | ||||||
|  |     glow.enable = mkOption { | ||||||
|  |       type = types.bool; | ||||||
|  |       default = true; | ||||||
|  |       description = "Enable markdown preview in neovim with glow"; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | } | ||||||
|  | @ -8,7 +8,7 @@ with lib; | ||||||
| with builtins; let | with builtins; let | ||||||
|   cfg = config.vim.languages.nix; |   cfg = config.vim.languages.nix; | ||||||
| 
 | 
 | ||||||
|   useFormat = "on_attach = default_on_attatch"; |   useFormat = "on_attach = default_on_attach"; | ||||||
|   noFormat = "on_attach = attach_keymaps"; |   noFormat = "on_attach = attach_keymaps"; | ||||||
| 
 | 
 | ||||||
|   defaultServer = "nil"; |   defaultServer = "nil"; | ||||||
|  |  | ||||||
|  | @ -1,12 +0,0 @@ | ||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| with lib; { |  | ||||||
|   config = { |  | ||||||
|     vim.markdown = { |  | ||||||
|       enable = mkDefault false; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
|  | @ -1,33 +0,0 @@ | ||||||
| { |  | ||||||
|   pkgs, |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| with lib; let |  | ||||||
|   cfg = config.vim.markdown.glow; |  | ||||||
| in { |  | ||||||
|   config = (mkIf cfg.enable) { |  | ||||||
|     vim.startPlugins = [ |  | ||||||
|       "glow-nvim" |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     vim.globals = { |  | ||||||
|       "glow_binary_path" = "${pkgs.glow}/bin"; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     vim.configRC.glow-nvim = nvim.dag.entryAnywhere '' |  | ||||||
|       autocmd FileType markdown noremap <leader>pm :Glow<CR> |  | ||||||
|     ''; |  | ||||||
| 
 |  | ||||||
|     vim.luaConfigRC.glow-nvim = nvim.dag.entryAnywhere '' |  | ||||||
|       require('glow').setup({ |  | ||||||
|         -- use glow path from vim.globals |  | ||||||
|         path = vim.g.glow_binary_path, |  | ||||||
|         border = "${toString cfg.border}", |  | ||||||
|         pager = ${boolToString cfg.pager}, |  | ||||||
|         width = 120, |  | ||||||
|       }) |  | ||||||
|     ''; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
|  | @ -1,6 +0,0 @@ | ||||||
| _: { |  | ||||||
|   imports = [ |  | ||||||
|     ./glow.nix |  | ||||||
|     ./config.nix |  | ||||||
|   ]; |  | ||||||
| } |  | ||||||
|  | @ -1,33 +0,0 @@ | ||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| with lib; |  | ||||||
| with builtins; { |  | ||||||
|   options.vim.markdown.glow = { |  | ||||||
|     enable = mkOption { |  | ||||||
|       type = types.bool; |  | ||||||
|       default = false; |  | ||||||
|       description = "Enable markdown preview in neovim with glow"; |  | ||||||
|     }; |  | ||||||
|     border = mkOption { |  | ||||||
|       type = types.enum ["shadow" "rounded" "single" "double" "none"]; |  | ||||||
|       default = "double"; |  | ||||||
|       description = "Border style for glow preview"; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # style should be either light or dark |  | ||||||
|     style = mkOption { |  | ||||||
|       type = types.enum ["light" "dark"]; |  | ||||||
|       default = "dark"; |  | ||||||
|       description = "Style for glow preview"; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     pager = mkOption { |  | ||||||
|       type = types.bool; |  | ||||||
|       default = false; |  | ||||||
|       description = "Enable pager for glow preview"; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
|  | @ -1,19 +0,0 @@ | ||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| with lib; |  | ||||||
| with builtins; let |  | ||||||
|   cfg = config.vim.markdown; |  | ||||||
| in { |  | ||||||
|   options.vim.markdown = { |  | ||||||
|     enable = mkEnableOption "Enable markdown tools and plugins"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf (cfg.enable) { |  | ||||||
|     /* |  | ||||||
|     ... |  | ||||||
|     */ |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
|  | @ -14,10 +14,8 @@ | ||||||
|     ./visuals |     ./visuals | ||||||
|     ./lsp |     ./lsp | ||||||
|     ./treesitter |     ./treesitter | ||||||
|     ./tidal |  | ||||||
|     ./autopairs |     ./autopairs | ||||||
|     ./snippets |     ./snippets | ||||||
|     ./markdown |  | ||||||
|     ./git |     ./git | ||||||
|     ./minimap |     ./minimap | ||||||
|     ./dashboard |     ./dashboard | ||||||
|  |  | ||||||
|  | @ -106,7 +106,7 @@ in { | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|         ${ |         ${ | ||||||
|         if config.vim.markdown.glow.enable |         if config.vim.languages.markdown.glow.enable | ||||||
|         then '' |         then '' | ||||||
|           -- Markdown |           -- Markdown | ||||||
|           ["<leader>pm"] = { name = "+Preview Markdown" }, |           ["<leader>pm"] = { name = "+Preview Markdown" }, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 NotAShelf
				NotAShelf