insall codecompanion
This commit is contained in:
		
							parent
							
								
									fdbc21f043
								
							
						
					
					
						commit
						2f48251e91
					
				
					 2 changed files with 62 additions and 0 deletions
				
			
		| 
						 | 
					@ -33,6 +33,7 @@
 | 
				
			||||||
    ./plugins/git/lazygit.nix
 | 
					    ./plugins/git/lazygit.nix
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Utils
 | 
					    # Utils
 | 
				
			||||||
 | 
					    ./plugins/utils/codecompanion.nix
 | 
				
			||||||
    ./plugins/utils/markdown-preview.nix
 | 
					    ./plugins/utils/markdown-preview.nix
 | 
				
			||||||
    ./plugins/utils/telescope.nix
 | 
					    ./plugins/utils/telescope.nix
 | 
				
			||||||
    ./plugins/utils/whichkey.nix
 | 
					    ./plugins/utils/whichkey.nix
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										61
									
								
								config/plugins/utils/codecompanion.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								config/plugins/utils/codecompanion.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,61 @@
 | 
				
			||||||
 | 
					{...}: {
 | 
				
			||||||
 | 
					  plugins.codecompanion = {
 | 
				
			||||||
 | 
					    enable = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    settings = {
 | 
				
			||||||
 | 
					      adapters = {
 | 
				
			||||||
 | 
					        ollama = {
 | 
				
			||||||
 | 
					          __raw = ''
 | 
				
			||||||
 | 
					            function()
 | 
				
			||||||
 | 
					              return require('codecompanion.adapters').extend('ollama', {
 | 
				
			||||||
 | 
					                env = {
 | 
				
			||||||
 | 
					                  url = "http://127.0.0.1:11434",
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                schema = {
 | 
				
			||||||
 | 
					                  model = {
 | 
				
			||||||
 | 
					                    default = 'deepseek-coder-v2:latest',
 | 
				
			||||||
 | 
					                  },
 | 
				
			||||||
 | 
					                  num_ctx = {
 | 
				
			||||||
 | 
					                    default = 4096,
 | 
				
			||||||
 | 
					                  },
 | 
				
			||||||
 | 
					                  num_predict = {
 | 
				
			||||||
 | 
					                    default = -1,
 | 
				
			||||||
 | 
					                  },
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					              })
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
 | 
					          '';
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					      opts = {
 | 
				
			||||||
 | 
					        log_level = "TRACE";
 | 
				
			||||||
 | 
					        send_code = true;
 | 
				
			||||||
 | 
					        use_default_actions = true;
 | 
				
			||||||
 | 
					        use_default_prompts = true;
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					      strategies = {
 | 
				
			||||||
 | 
					        agent = {
 | 
				
			||||||
 | 
					          adapter = "ollama";
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					        chat = {
 | 
				
			||||||
 | 
					          adapter = "ollama";
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					        inline = {
 | 
				
			||||||
 | 
					          adapter = "ollama";
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  keymaps = [
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      mode = ["n" "v"];
 | 
				
			||||||
 | 
					      key = "<leader>tc";
 | 
				
			||||||
 | 
					      action = "<cmd>CodeCompanionChat Toggle<cr>";
 | 
				
			||||||
 | 
					      options = {
 | 
				
			||||||
 | 
					        silent = true;
 | 
				
			||||||
 | 
					        desc = "Toggle CodeCompanion";
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  ];
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue