Keyboard shortcuts
Use keyboard shortcuts to streamline your workflow and reduce dependence on mouse interactions.
Available keyboard commands
Bob offers keyboard commands to enhance your workflow. This page focuses on the Bob.acceptInput command, but here is a quick reference to key keyboard commands:
| Command | Description | Default Shortcut |
|---|---|---|
Bob.acceptInput | Submit text or accept the primary suggestion | None (configurable) |
Bob.focus | Focus the Bob input box | None (configurable) |
| Inline edit | Edit code directly in the editor | Cmd + K (Mac) / Ctrl + K (Windows/Linux) |
| Move to chat | Send selected code to the chat interface | Cmd + L (Mac) / Ctrl + L (Windows/Linux) |
| Literate coding mode | Toggle literate coding mode | Cmd + I (Mac) / Ctrl + I (Windows/Linux) |
For a complete list of all available keyboard shortcuts and to configure custom bindings, open Bob Settings, under General settings and navigate to the Keyboard shortcuts option where you can view and modify all shortcuts.
Key benefits of keyboard commands
- Keyboard-driven interface: Submit text or select the primary suggestion button without mouse interaction
- Improved accessibility: Essential for users with mobility limitations or those who experience discomfort with mouse usage
- Vim/Neovim compatibility: Supports seamless transitions for developers coming from keyboard-centric environments
- Workflow efficiency: Reduces context switching between keyboard and mouse during development tasks
Bob.acceptInput command
The Bob.acceptInput command lets you submit text or accept suggestions with keyboard shortcuts instead of clicking buttons or pressing Enter in the input area.
How the command works
The Bob.acceptInput command is a general-purpose input submission command. When triggered, it:
- Submits your current text or image input when in the text input area (equivalent to pressing Enter)
- Clicks the primary (first) button when action buttons are visible (such as confirm/cancel buttons or any other action buttons)
Detailed setup guide
Method 1: Using the UI
- Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on Mac)
- Type "Preferences: Open Keyboard Shortcuts"
- In the search box, type "Bob.acceptInput"
- Locate "Bob: Accept Input/Suggestion" in the results
- Click the + icon to the left of the command
- Press your desired key combination (e.g., Ctrl+Enter or Alt+Enter)
- Press Enter to confirm
Method 2: Editing keybindings.json directly
- Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on Mac)
- Type "Preferences: Open Keyboard Shortcuts (JSON)"
- Add the following entry to the JSON array:
{
"key": "ctrl+enter", // or your preferred key combination
"command": "Bob.acceptInput",
"when": "BobViewFocused" // This is a context condition that ensures the command only works when Bob is focused
}You can also use a more specific condition:
{
"key": "ctrl+enter",
"command": "Bob.acceptInput",
"when": "webviewViewFocus && webviewViewId == 'Bob-cline.SidebarProvider'"
}Recommended key combinations
Choose a key combination that does not conflict with existing IBM Bob shortcuts:
- Alt+Enter - Easy to press while typing
- Ctrl+Space - Familiar for those who use autocomplete
- Ctrl+Enter - Intuitive for running commands
- Alt+A - Mnemonic for "Accept"
Practical use cases
Quick development workflows
- Text submission: Send messages to Bob without moving your hands from the keyboard
- Action confirmations: Accept operations like saving files, running commands, or applying diffs
- Multi-step processes: Move quickly through steps that require confirmation or input
- Consecutive tasks: Chain multiple tasks together with minimal interruption
Keyboard-centric development
- Vim/Neovim workflows: If you are coming from a Vim/Neovim background, maintain your keyboard-focused workflow
- IDE integration: Use alongside other IBM Bob keyboard shortcuts for a seamless experience
- Code reviews: Quickly accept suggestions when reviewing code with Bob
- Documentation writing: Submit text and accept formatting suggestions when generating documentation
Accessibility use cases
- Hand mobility limitations: Essential for users who have difficulty using a mouse
- Repetitive strain prevention: Reduce mouse usage to prevent or manage repetitive strain injuries
- Screen reader integration: Works well with screen readers for visually impaired users
- Voice control compatibility: Can be triggered via voice commands when using voice control software
Accessibility benefits
The Bob.acceptInput command was designed with accessibility in mind:
- Reduced mouse dependence: Complete entire workflows without reaching for the mouse
- Reduced physical strain: Helps users who experience discomfort or pain from mouse usage
- Alternative input method: Supports users with mobility impairments who rely on keyboard navigation
- Workflow optimization: Particularly valuable for users coming from keyboard-centric environments like Vim/Neovim
Keyboard-centric workflows
Here are some complete workflow examples showing how to effectively use keyboard shortcuts with Bob:
Development workflow example
- Open IBM Bob and navigate to your project
- Open Bob via the sidebar
- Type your request: "Create a REST API endpoint for user registration"
- When Bob asks for framework preferences, use your
Bob.acceptInputshortcut to select the first suggestion - Continue using the shortcut to accept code generation suggestions
- When Bob offers to save the file, use the shortcut again to confirm
- Use IBM Bob's built-in shortcuts to navigate through the created files
Code review workflow
- Select code you want to review and use IBM Bob's "Copy" command
- Ask Bob to review it: "Review this code for security issues"
- As Bob asks clarifying questions about the code context, use your shortcut to accept suggestions
- When Bob provides improvement recommendations, use the shortcut again to accept implementation suggestions
Troubleshooting
| Issue | Solution |
|---|---|
| Shortcut does not work | Ensure Bob is focused (click in the Bob panel first) |
| Wrong suggestion selected | The command always selects the first (primary) button; use mouse if you need a different option |
| Conflicts with existing shortcuts | Try a different key combination in IBM Bob keyboard settings |
| No visual feedback when used | This is normal - the command silently activates the function without visual confirmation |
| Shortcut works inconsistently | Make sure the when clause is properly configured in your keybindings.json (either BobViewFocused or the webview-specific condition) |
Technical implementation
The Bob.acceptInput command is implemented as follows:
- Command registered as
Bob.acceptInputwith display title "Bob: Accept Input/Suggestion" in the command palette - When triggered, it sends an "acceptInput" message to the active Bob webview
- The webview determines the appropriate action based on the current UI state:
- Clicks the primary action button if action buttons are visible and enabled
- Sends the message if the text area is enabled and contains text/images
- No default key binding - users assign their preferred shortcut
Limitations
- Works only when the Bob interface is active
- Has no effect if no inputs or suggestions are currently available
- Prioritizes the primary (first) button when multiple options are shown