mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 02:52:37 +00:00 
			
		
		
		
	feat: add cellular automaton to visuals
This commit is contained in:
		
					parent
					
						
							
								1426deb3e6
							
						
					
				
			
			
				commit
				
					
						5d6f7dc3f3
					
				
			
		
					 3 changed files with 64 additions and 0 deletions
				
			
		
							
								
								
									
										17
									
								
								flake.lock
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										17
									
								
								flake.lock
									
										
									
										generated
									
									
									
								
							|  | @ -48,6 +48,22 @@ | |||
|         "type": "github" | ||||
|       } | ||||
|     }, | ||||
|     "cellular-automaton": { | ||||
|       "flake": false, | ||||
|       "locked": { | ||||
|         "lastModified": 1674679594, | ||||
|         "narHash": "sha256-h4KQCf8+GbxWSyZzDny07YFZm7j+aSSfm51lsaK0Ers=", | ||||
|         "owner": "Eandrju", | ||||
|         "repo": "cellular-automaton.nvim", | ||||
|         "rev": "679943b8e1e5ef79aaeeaf4b00782c52eb4e928f", | ||||
|         "type": "github" | ||||
|       }, | ||||
|       "original": { | ||||
|         "owner": "Eandrju", | ||||
|         "repo": "cellular-automaton.nvim", | ||||
|         "type": "github" | ||||
|       } | ||||
|     }, | ||||
|     "cheatsheet-nvim": { | ||||
|       "flake": false, | ||||
|       "locked": { | ||||
|  | @ -823,6 +839,7 @@ | |||
|         "alpha-nvim": "alpha-nvim", | ||||
|         "bufdelete-nvim": "bufdelete-nvim", | ||||
|         "catppuccin": "catppuccin", | ||||
|         "cellular-automaton": "cellular-automaton", | ||||
|         "cheatsheet-nvim": "cheatsheet-nvim", | ||||
|         "cinnamon-nvim": "cinnamon-nvim", | ||||
|         "cmp-buffer": "cmp-buffer", | ||||
|  |  | |||
|  | @ -66,6 +66,7 @@ | |||
|           nvimWebDevicons.enable = true; | ||||
|           scrollBar.enable = true; | ||||
|           smoothScroll.enable = true; | ||||
|           cellularAutomaton.enable = true; | ||||
|           lspkind.enable = true; | ||||
|           indentBlankline = { | ||||
|             enable = true; | ||||
|  | @ -429,6 +430,11 @@ | |||
|       flake = false; | ||||
|     }; | ||||
| 
 | ||||
|     cellular-automaton = { | ||||
|       url = "github:Eandrju/cellular-automaton.nvim"; | ||||
|       flake = false; | ||||
|     }; | ||||
| 
 | ||||
|     indent-blankline = { | ||||
|       url = "github:lukas-reineke/indent-blankline.nvim"; | ||||
|       flake = false; | ||||
|  |  | |||
|  | @ -34,6 +34,12 @@ in { | |||
|       description = "enable smooth scrolling [cinnamon-nvim]"; | ||||
|     }; | ||||
| 
 | ||||
|     cellularAutomaton.enable = mkOption { | ||||
|       type = types.bool; | ||||
|       description = "enable cellular automaton [cellular-automaton]"; | ||||
|       default = false; | ||||
|     }; | ||||
| 
 | ||||
|     cursorWordline = { | ||||
|       enable = mkOption { | ||||
|         type = types.bool; | ||||
|  | @ -108,6 +114,11 @@ in { | |||
|           then "cinnamon-nvim" | ||||
|           else null | ||||
|         ) | ||||
|         ( | ||||
|           if cfg.cellularAutomaton.enable | ||||
|           then "cellular-automaton" | ||||
|           else null | ||||
|         ) | ||||
|       ]; | ||||
| 
 | ||||
|       vim.luaConfigRC.visuals = nvim.dag.entryAnywhere '' | ||||
|  | @ -169,6 +180,36 @@ in { | |||
|           then "require('cinnamon').setup()" | ||||
|           else "" | ||||
|         } | ||||
|         ${ | ||||
|           if cfg.cellularAutomaton.enable | ||||
|           then '' | ||||
|             local config = { | ||||
|               fps = 50, | ||||
|               name = 'slide', | ||||
|             } | ||||
| 
 | ||||
|             -- init function is invoked only once at the start | ||||
|             -- config.init = function (grid) | ||||
|             -- | ||||
|             -- end | ||||
| 
 | ||||
|             -- update function | ||||
|             config.update = function (grid) | ||||
|             for i = 1, #grid do | ||||
|               local prev = grid[i][#(grid[i])] | ||||
|                 for j = 1, #(grid[i]) do | ||||
|                   grid[i][j], prev = prev, grid[i][j] | ||||
|                 end | ||||
|               end | ||||
|               return true | ||||
|             end | ||||
| 
 | ||||
|             require("cellular-automaton").register_animation(config) | ||||
| 
 | ||||
|             vim.keymap.set("n", "<leader>fml", "<cmd>CellularAutomaton make_it_rain<CR>") | ||||
|           '' | ||||
|           else "" | ||||
|         } | ||||
|       ''; | ||||
|     }; | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 NotAShelf
				NotAShelf