Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OmniClaude

Installation

This is a native Vim plugin. Clone or copy this repository into $HOME/.vim/pack/*/start/omniclaude. Common choices of * are plugins and git-plugins.

Usage

Claude Code

To begin using Claude Code, use one of the following commands:

  • :OCvsplit - Open Claude Code in a new vertical split.
  • :OCsplit - Open Claude Code in a new horizontal split.
  • :OCtab - Open Claude Code in a new tab.

In any open file window:

  • :OCmention or :OCat - Creates a reference to the selected range in the Claude Code prompt.

In diff views opened by Claude Code:

  • :OCaccept - Accept the diff and close the diff view.
  • :OCreject - Reject the diff and close the diff view.

Keybindings

OmniClaude does not provide any keybindings of its own.

Claude Code runs in Vim's Terminal mode. Some of Vim's noteworthy keybindings in Terminal mode include:

  • CTRL-W gt / CTRL-W gT - Switch to the next/previous tab.
  • CTRL-W [direction] - Switch to an adjacent split. (same as normal mode)
  • CTRL-W N - Switch from Terminal mode to Normal mode. (Note: This is an uppercase N.)

Completion

By default, OmniClaude provides generative completion through Vim's omni completion feature, typically accessed using CTRL-X CTRL-O.

If g:oc_set_usercomplete is set to 1, it is instead provided through Vim's user completion feature, typically accessed through CTRL-X CTRL-U.

Configuration

OmniClaude is configured by setting variables in your .vimrc.

  • g:oc_no_omnicomplete - Number. Set to 1 to disable assigning OmniClaude as the omnifunc completion provider.
  • g:oc_set_usercomplete - Number. Set to 1 to assign OmniClaude as the completefunc completion provider instead of the omnifunc completion provider.
  • g:oc_filetypes - List. OmniClaude will be assigned as the omnifunc completion provider for filetypes in this list. (Default: all filetypes)
  • g:oc_model - String. The model to use for completion, usually "haiku", "sonnet", or "opus". (Overrides the model settings key.)
  • g:oc_effort - One of "low", "medium", "high", or "max". The effort level to use for completion. Not supported by all models.
  • g:oc_claude_env - Dictionary. Additional environment variables to set when launching Claude Code.
  • g:oc_claude_args - String. Additional command-line arguments to pass to Claude Code.

Why?

I have no great love for generative AI. Even if one were to discount the debates about ethics, energy use, and the chip shortage, it really doesn't fit into the way I approach software engineering.

But if I've got to use it, I'm at least going to use it on my own terms. And that means making it work with the tools I want to use instead of disrupting my workflow even further.

License and Credits

This work has been dedicated to the public domain and all copyright interest in it has been relinquished to the greatest extent permissible.

See CC0 1.0 Universal for more information.

Thanks go to claudecode.nvim for the analysis of the Claude Code protocol.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages