mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 02:52:37 +00:00 
			
		
		
		
	Compare commits
	
		
			12 commits
		
	
	
		
			
				0d2c3a600d
			
			...
			
				cf58d88545
			
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| cf58d88545 | |||
| bf485ab9b6 | |||
| c3ed4dd94f | |||
|   | d76b4284b0 | ||
| aa5b1913e3 | |||
| 0134731d8e | |||
| 7592797325 | |||
| 2586f3ef61 | |||
| c5ed9b3c66 | |||
|   | 9c21bd06a2 | ||
| 939fb8cfc6 | |||
| 441d2f2ec4 | 
					 10 changed files with 462 additions and 321 deletions
				
			
		|  | @ -544,3 +544,10 @@ | |||
| [derethil](https://github.com/derethil): | ||||
| 
 | ||||
| - Fix `vim.lazy.plugins.<name>.enabled` Lua evaluation. | ||||
| 
 | ||||
| [Jules](https://github.com/jules-sommer): | ||||
| 
 | ||||
| [nvim-highlight-colors]: https://github.com/brenoprata10/nvim-highlight-colors | ||||
| 
 | ||||
| - Add [nvim-highlight-colors] plugin in `vim.ui.nvim-highlight-colors` with | ||||
|   `enable` and `setupOpts` | ||||
|  |  | |||
							
								
								
									
										12
									
								
								flake.lock
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										12
									
								
								flake.lock
									
										
									
										generated
									
									
									
								
							|  | @ -38,11 +38,11 @@ | |||
|     }, | ||||
|     "mnw": { | ||||
|       "locked": { | ||||
|         "lastModified": 1748710831, | ||||
|         "narHash": "sha256-eZu2yH3Y2eA9DD3naKWy/sTxYS5rPK2hO7vj8tvUCSU=", | ||||
|         "lastModified": 1756580127, | ||||
|         "narHash": "sha256-XK+ZQWjnd96Uko73jY1dc23ksnuWnF/Myc4rT/LQOmc=", | ||||
|         "owner": "Gerg-L", | ||||
|         "repo": "mnw", | ||||
|         "rev": "cff958a4e050f8d917a6ff3a5624bc4681c6187d", | ||||
|         "rev": "ecdb5ba1b08ac198d9e9bfbf9de3b234fb1eb252", | ||||
|         "type": "github" | ||||
|       }, | ||||
|       "original": { | ||||
|  | @ -53,11 +53,11 @@ | |||
|     }, | ||||
|     "nixpkgs": { | ||||
|       "locked": { | ||||
|         "lastModified": 1755049066, | ||||
|         "narHash": "sha256-ANrc15FSoOAdNbfKHxqEJjZLftIwIsenJGRb/04K41s=", | ||||
|         "lastModified": 1756536218, | ||||
|         "narHash": "sha256-ynQxPVN2FIPheUgTFhv01gYLbaiSOS7NgWJPm9LF9D0=", | ||||
|         "owner": "nixos", | ||||
|         "repo": "nixpkgs", | ||||
|         "rev": "e45f8f193029378d0aaee5431ba098dc80054e9a", | ||||
|         "rev": "a918bb3594dd243c2f8534b3be01b3cb4ed35fd1", | ||||
|         "type": "github" | ||||
|       }, | ||||
|       "original": { | ||||
|  |  | |||
|  | @ -22,7 +22,7 @@ | |||
|     pname = "avante-nvim-lib"; | ||||
|     inherit version src; | ||||
| 
 | ||||
|     cargoHash = "sha256-8mBpzndz34RrmhJYezd4hLrJyhVL4S4IHK3plaue1k8="; | ||||
|     cargoHash = "sha256-pTWCT2s820mjnfTscFnoSKC37RE7DAPKxP71QuM+JXQ="; | ||||
| 
 | ||||
|     nativeBuildInputs = [ | ||||
|       pkg-config | ||||
|  |  | |||
|  | @ -15,7 +15,7 @@ in { | |||
|   config = mkIf cfg.enable { | ||||
|     vim = { | ||||
|       startPlugins = [ | ||||
|         "nvim-bufferline-lua" | ||||
|         "bufferline-nvim" | ||||
|         "bufdelete-nvim" | ||||
|       ]; | ||||
| 
 | ||||
|  |  | |||
|  | @ -3,7 +3,7 @@ | |||
|   lib, | ||||
|   ... | ||||
| }: let | ||||
|   inherit (lib.options) mkOption mkEnableOption literalExpression; | ||||
|   inherit (lib.options) mkOption mkEnableOption literalExpression literalMD; | ||||
|   inherit (lib.types) enum bool either nullOr str int listOf attrs; | ||||
|   inherit (lib.generators) mkLuaInline; | ||||
|   inherit (lib.nvim.binds) mkMappingOption; | ||||
|  | @ -24,17 +24,28 @@ in { | |||
|       movePrevious = mkMappingOption "Move previous buffer" "<leader>bmp"; | ||||
|     }; | ||||
| 
 | ||||
|     setupOpts = mkPluginSetupOption "Bufferline-nvim" { | ||||
|     setupOpts = mkPluginSetupOption "bufferline-nvim" { | ||||
|       highlights = mkOption { | ||||
|         type = either attrs luaInline; | ||||
|         default = | ||||
|           if config.vim.theme.enable && config.vim.theme.name == "catppuccin" | ||||
|           then | ||||
|             mkLuaInline | ||||
|             '' | ||||
|               require("catppuccin.groups.integrations.bufferline").get() | ||||
|             mkLuaInline '' | ||||
|               (function() | ||||
|                 local integration = require("catppuccin.groups.integrations.bufferline") | ||||
|                 return (integration.get_theme or integration.get)() | ||||
|               end)() | ||||
|             '' | ||||
|           else {}; | ||||
|         defaultText = literalMD '' | ||||
|           ```lua | ||||
|           (function() | ||||
|             local integration = require("catppuccin.groups.integrations.bufferline") | ||||
|             return (integration.get_theme or integration.get)() | ||||
|           end)() | ||||
|           ``` | ||||
|           if the active theme is Catppuccin, `{}` otherwise. | ||||
|         ''; | ||||
|         description = '' | ||||
|           Overrides the highlight groups of bufferline. | ||||
| 
 | ||||
|  | @ -59,10 +70,11 @@ in { | |||
|         themable = mkOption { | ||||
|           type = bool; | ||||
|           default = true; | ||||
|           example = false; | ||||
|           description = '' | ||||
|             Whether or not to allow highlight groups to be overridden. | ||||
| 
 | ||||
|             While false, bufferline.nvim sets highlights as default. | ||||
|             While `false`, bufferline.nvim sets highlights as default. | ||||
|           ''; | ||||
|         }; | ||||
| 
 | ||||
|  |  | |||
|  | @ -3,6 +3,7 @@ | |||
|     ./borders | ||||
|     ./breadcrumbs | ||||
|     ./colorful-menu-nvim | ||||
|     ./nvim-highlight-colors | ||||
|     ./colorizer | ||||
|     ./fastaction | ||||
|     ./illuminate | ||||
|  |  | |||
							
								
								
									
										28
									
								
								modules/plugins/ui/nvim-highlight-colors/config.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								modules/plugins/ui/nvim-highlight-colors/config.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,28 @@ | |||
| { | ||||
|   config, | ||||
|   lib, | ||||
|   ... | ||||
| }: let | ||||
|   inherit (lib.modules) mkIf; | ||||
|   inherit (lib.nvim.dag) entryAnywhere; | ||||
|   inherit (lib.nvim.lua) toLuaObject; | ||||
| 
 | ||||
|   cfg = config.vim.ui.nvim-highlight-colors; | ||||
| in { | ||||
|   config = mkIf cfg.enable { | ||||
|     vim = { | ||||
|       startPlugins = [ | ||||
|         "nvim-highlight-colors" | ||||
|       ]; | ||||
| 
 | ||||
|       # enable display of 24-bit RGB colors in neovim | ||||
|       # via the terminal. This is required for nvim-highlight-colors | ||||
|       # to display arbitrary RGB highlights. | ||||
|       options.termguicolors = true; | ||||
| 
 | ||||
|       pluginRC.nvim-highlight-colors = entryAnywhere '' | ||||
|         require('nvim-highlight-colors').setup(${toLuaObject cfg.setupOpts}) | ||||
|       ''; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
							
								
								
									
										6
									
								
								modules/plugins/ui/nvim-highlight-colors/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								modules/plugins/ui/nvim-highlight-colors/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| { | ||||
|   imports = [ | ||||
|     ./nvim-highlight-colors.nix | ||||
|     ./config.nix | ||||
|   ]; | ||||
| } | ||||
|  | @ -0,0 +1,71 @@ | |||
| {lib, ...}: let | ||||
|   inherit (lib.options) mkOption mkEnableOption; | ||||
|   inherit (lib.types) attrsOf enum nullOr submodule bool str; | ||||
|   inherit (lib.modules) mkRenamedOptionModule; | ||||
|   inherit (lib.nvim.types) mkPluginSetupOption; | ||||
|   inherit (lib.nvim.config) mkBool; | ||||
| in { | ||||
|   options.vim.ui.nvim-highlight-colors = { | ||||
|     enable = mkEnableOption "color highlighting [nvim-highlight-colors.lua]"; | ||||
| 
 | ||||
|     setupOpts = mkPluginSetupOption "nvim-highlight-colors" { | ||||
|       render = mkOption { | ||||
|         type = enum ["background" "foreground" "virtual"]; | ||||
|         default = "background"; | ||||
|         example = "virtual"; | ||||
|         description = '' | ||||
|           Style to render color highlighting with. | ||||
| 
 | ||||
|           ::: {.note} | ||||
|           Each render style works as follows: | ||||
|             - 'background' sets the background | ||||
|               highlight of the matched color string | ||||
|               to the RGB color it describes. | ||||
| 
 | ||||
|             - 'foreground' sets the foreground | ||||
|               highlight of the matched color string | ||||
|               to the RGB color it describes. | ||||
| 
 | ||||
|             - 'virtual' displays the matched color | ||||
|               with virtual text alongside the color | ||||
|               string in the buffer. Virtual text can | ||||
|               be configured to display the color in | ||||
|               various ways, i.e custom virtual symbol | ||||
|               (via `virtual_symbol`) positioning | ||||
|               relative to string, suffix/prefix, etc. | ||||
|           ::: | ||||
|         ''; | ||||
|       }; | ||||
| 
 | ||||
|       virtual_symbol_position = mkOption { | ||||
|         type = enum ["inline" "eol" "eow"]; | ||||
|         default = "inline"; | ||||
|         example = "eol"; | ||||
|         description = '' | ||||
|           Where to render the virtual symbol in | ||||
|           relation to the color string. | ||||
| 
 | ||||
|           ::: {.note} | ||||
|           Each render style works as follows: | ||||
|             - 'inline' render virtual text inline, | ||||
|               similar to the style of VSCode color | ||||
|               hinting. | ||||
| 
 | ||||
|             - 'eol' render virtual text at the end | ||||
|               of the line which the color string | ||||
|               occurs (last column). Recommended to | ||||
|               set `virtual_symbol_suffix` to an | ||||
|               empty string when used. | ||||
| 
 | ||||
|             - 'eow' render virtual text at the end | ||||
|               of the word where the color string | ||||
|               occurs. Recommended to set | ||||
|               `virtual_symbol_prefix` to a single | ||||
|               space for padding and the suffix to | ||||
|               an empty string for no padding. | ||||
|           ::: | ||||
|         ''; | ||||
|       }; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue