Skip to content

CodeAwareness/kawa.vim

Repository files navigation

Kawa Code for Vim/Neovim

Real-time collaboration extension that highlights code intersections between your working copy and teammates' work.

Features

  • Real-time highlights: See lines being worked on by you or your team
  • Early conflict detection: Know about potential conflicts before pushing
  • Instant navigation: View and diff peer code without waiting for commits
  • Low overhead: Asynchronous IPC and efficient highlighting
  • Cross-platform: Works on Linux, macOS, and Windows

Requirements

  • Neovim 0.5.0 or higher (recommended: 0.8.0+)
  • Vim 8.2+ with Python3 support (some limitations apply, see below)
  • Kawa Code desktop app (download here)

Vim 8.2+ Support

The plugin supports Vim 8.2+ using a pure VimScript implementation with the following requirements:

  • Python3 support compiled in (check with :version and look for +python3)
  • Signs support (check with :version and look for +signs)

Architecture: The plugin automatically detects your editor and uses:

  • Neovim: Native Lua implementation with async I/O and extmarks
  • Vim 8.2+: Pure VimScript implementation with Python3 sockets and signs

Implementation differences:

  • Neovim uses Lua for all logic (faster, more features)
  • Vim uses VimScript for logic and Python3 for socket operations (stable, compatible)
  • Both implementations provide the same core features (highlighting, IPC, commands)

Installation

For Neovim

lazy.nvim

{
  'CodeAwareness/kawa.vim',
  config = function()
    require('code-awareness').setup({
      -- Optional configuration
      debug = false,
    })
  end,
}

packer.nvim

use {
  'CodeAwareness/kawa.vim',
  config = function()
    require('code-awareness').setup()
  end
}

vim-plug (Neovim)

Plug 'CodeAwareness/kawa.vim'

" In your init.vim or init.lua:
lua << EOF
require('code-awareness').setup()
EOF

For Vim 8.2+

Manual Installation (Recommended for Vim)

  1. Clone the repository to your Vim pack directory:
# Create pack directory if it doesn't exist
mkdir -p ~/.vim/pack/plugins/start

# Clone the plugin
cd ~/.vim/pack/plugins/start
git clone https://github.com/CodeAwareness/kawa.vim.git
  1. Add configuration to your ~/.vimrc:
" Kawa Code configuration
lua << EOF
require('code-awareness').setup({
  debug = false,
})
EOF

vim-plug (Vim)

Plug 'CodeAwareness/kawa.vim'

" In your .vimrc:
lua << EOF
require('code-awareness').setup()
EOF

Pathogen

cd ~/.vim/bundle
git clone https://github.com/CodeAwareness/kawa.vim.git

Then add to your ~/.vimrc:

lua << EOF
require('code-awareness').setup()
EOF

Vundle

Add to your ~/.vimrc:

Plugin 'CodeAwareness/kawa.vim'

Then run :PluginInstall and add configuration:

lua << EOF
require('code-awareness').setup()
EOF

Verify Installation

After installation, verify the plugin is working:

  1. Check if plugin loaded:

    :echo exists('g:loaded_code_awareness')
    " Should output: 1
  2. Check Python3 support (Vim only):

    :version
    " Look for +python3 in the output
  3. Test the command:

    :CodeAwareness status

Quick Start

  1. Install the Kawa Code desktop app and login
  2. Install this plugin using your package manager (see Installation above)
  3. Open Vim/Neovim in a Git repository
  4. Plugin will automatically connect to Kawa Code
  5. Highlights will appear on lines you or your teammates are working on
  6. Kawa Code will display the contributors for that file, as well as other info

Note for Vim users: Make sure you have Python3 support enabled. You can check with :version and look for +python3. If you see -python3, you'll need to recompile Vim with Python3 support or use a Vim distribution that includes it (like vim-nox on Debian/Ubuntu).

Commands

Command Description
:CodeAwareness status Show connection and auth status
:CodeAwareness toggle Enable/disable plugin
:CodeAwareness refresh Force refresh current buffer
:CodeAwareness clear Clear all highlights
:CodeAwareness reconnect Reconnect to Kawa Code app

Configuration

Neovim Configuration

Add to your init.lua or init.vim:

require('code-awareness').setup({
  -- Enable debug logging
  debug = false,

  -- Highlight settings
  highlight = {
    enabled = true,
    intensity = 0.3,
    full_width = true,
    colors = {
      light = '#00b1a420',
      dark = '#03445f',
    },
  },

  -- Update behavior
  update_delay = 500,  -- ms debounce
  send_on_save = true,
  send_on_buffer_enter = true,

  -- IPC settings
  connection_timeout = 5000,
  max_poll_attempts = 5,
})

Vim Configuration

Add to your ~/.vimrc:

" Kawa Code configuration
lua << EOF
require('code-awareness').setup({
  debug = false,
  highlight = {
    enabled = true,
    intensity = 0.3,
    full_width = true,
    colors = {
      light = '#00b1a420',
      dark = '#03445f',
    },
  },
  update_delay = 500,
  send_on_save = true,
  send_on_buffer_enter = true,
  connection_timeout = 5000,
  max_poll_attempts = 5,
})
EOF

Note: Vim 8.2+ supports Lua, so you can use the same configuration format as Neovim.

Documentation

See :help code-awareness for full documentation.

For architecture details, see ARCHITECTURE.md.

For development and contributing, see DEVELOPMENT.md.

License

MIT License - see LICENSE for details.

Related Projects

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors