Skip to content

Commit fe75dcf

Browse files
committed
add keymaps docs
1 parent e64d7a5 commit fe75dcf

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

+26
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Using **lazy.nvim**, you can use the following code snippet to install and confi
1616
```lua
1717
{
1818
"stacklok/codegate.nvim",
19+
dependencies = { "nvim-lua/plenary.nvim" },
20+
lazy = false,
1921
config = function()
2022
require("codegate").setup({
2123
base_url = "http://127.0.0.1:8989",
@@ -30,4 +32,28 @@ Using **lazy.nvim**, you can use the following code snippet to install and confi
3032
- **Activate a Workspace**: Run `:CodeGateSetWorkspace <workspace>` to activate a specific workspace.
3133
- **Telescope Picker**: If **telescope.nvim** is installed, run `:CodeGateTelescopeWorkspaces` to open a fuzzy search picker.
3234

35+
## Creating keymaps
36+
37+
To work with CodeGate workspaces more efficiently, you can set up your own keymaps to
38+
switch between workspaces. Here are a few ideas that can help you get started!
39+
40+
**Use a fuzzy finder to switch between workspaces**
41+
42+
```lua
43+
vim.api.nvim_set_keymap('n', '<leader>cgg', ':CodeGateTelescopeWorkspaces<CR>', { noremap = true, silent = true })
44+
```
45+
46+
**Switch to a specific workspace with a fixed shortcut**
47+
48+
```lua
49+
vim.api.nvim_set_keymap('n', '<leader>cga', ':CodeGateSetWorkspace default<CR>', { noremap = true, silent = true })
50+
vim.api.nvim_set_keymap('n', '<leader>cgs', ':CodeGateSetWorkspace integration-testing<CR>', { noremap = true, silent = true })
51+
vim.api.nvim_set_keymap('n', '<leader>cgd', ':CodeGateSetWorkspace react-implementation<CR>', { noremap = true, silent = true })
52+
```
53+
54+
**Switch to a specific workspace by typing the workspace name**
55+
56+
```lua
57+
vim.api.nvim_set_keymap('n', '<leader>cgq', ':CodeGateSetWorkspace ', { noremap = true, silent = false }) -- notice `silent = false`
58+
```
3359

0 commit comments

Comments
 (0)