Skip to content

Latest commit

 

History

History
59 lines (42 loc) · 2.19 KB

README.md

File metadata and controls

59 lines (42 loc) · 2.19 KB

codegate.nvim

CodeGate.nvim is a Neovim plugin that interfaces with CodeGate—a secure local gateway for AI code generation that ensures best practices and protects your code and privacy.

Overview

This plugin allows you to:

  • List Workspaces: Display available workspaces from your CodeGate API.
  • Activate Workspaces: Set an active workspace.
  • Telescope Integration: Use a fuzzy finder to select workspaces (if telescope.nvim is installed).

Installation

Using lazy.nvim, you can use the following code snippet to install and configure codegate.nvim:

{
  "stacklok/codegate.nvim",
  dependencies = { "nvim-lua/plenary.nvim" },
  lazy = false,
  config = function()
    require("codegate").setup({
      base_url = "http://127.0.0.1:8989",
    })
  end,
}

Usage

  • List Workspaces: Run :CodeGateListWorkspaces to display available workspaces.
  • Activate a Workspace: Run :CodeGateSetWorkspace <workspace> to activate a specific workspace.
  • Telescope Picker: If telescope.nvim is installed, run :CodeGateTelescopeWorkspaces to open a fuzzy search picker.

Creating keymaps

To work with CodeGate workspaces more efficiently, you can set up your own keymaps to switch between workspaces. Here are a few ideas that can help you get started!

Use a fuzzy finder to switch between workspaces

vim.api.nvim_set_keymap('n', '<leader>cgg', ':CodeGateTelescopeWorkspaces<CR>', { noremap = true, silent = true })

Switch to a specific workspace with a fixed shortcut

vim.api.nvim_set_keymap('n', '<leader>cga', ':CodeGateSetWorkspace default<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>cgs', ':CodeGateSetWorkspace integration-testing<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>cgd', ':CodeGateSetWorkspace react-implementation<CR>', { noremap = true, silent = true })

Switch to a specific workspace by typing the workspace name

vim.api.nvim_set_keymap('n', '<leader>cgq', ':CodeGateSetWorkspace ', { noremap = true, silent = false }) -- notice `silent = false`