DEV Community

Marian Ignev
Marian Ignev

Posted on

How I Built a Cursor Alternative That Runs in the Terminal

Vimsor - Vim with Claude AI integration and Sublime-like keybindings

A guide to Vimsor - Vim with Claude AI integration and Sublime-like keybindings


The Problem

I've been using Cursor for AI-assisted coding, and it's genuinely excellent. The AI chat, the code explanations, the refactoring suggestions - it all works beautifully.

But there were a few things bothering me:

  1. It's another Electron app - My laptop was already running VS Code, Slack, Discord, and now Cursor. The RAM usage was getting out of hand.

  2. It doesn't work over SSH - I frequently work on remote servers. Cursor can't help me there.

  3. I missed Vim - After years of muscle memory, I found myself reaching for Vim keybindings that didn't exist.

  4. I wanted Claude - Cursor uses GPT, but I've found Claude to be better for coding tasks.

So I asked myself: What if I could have Cursor's features in Vim?

The Solution: Vimsor

Vimsor is a Vim configuration that brings Cursor-like AI features to the terminal. It combines:

  • Claude AI integration - Chat, explain, fix, and refactor code
  • Sublime-like keybindings - Ctrl+P, Ctrl+B, Ctrl+N work as expected
  • Modern plugins - Fuzzy finding, multi-cursor, git integration
  • Beautiful UI - Ayu theme with a custom status line

Let me show you how it works.

AI Features

Chat with Claude

Press ,cc to open Claude Code in a side panel:

┌─────────────────────────────┬──────────────────────────────┐
│                             │                              │
│   Your Code                 │   Claude Chat                │
│                             │                              │
│   def fibonacci(n):         │   > How can I optimize       │
│       if n <= 1:            │     this function?           │
│           return n          │                              │
│       return fibonacci(n-1) │   You could use memoization  │
│            + fibonacci(n-2) │   or convert to iterative... │
│                             │                              │
└─────────────────────────────┴──────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode

Explain Code

Select some code and press ,ce to get an explanation:

# Select this code and press ,ce
def quicksort(arr):
    if len(arr) <= 1:
        return arr
    pivot = arr[len(arr) // 2]
    left = [x for x in arr if x < pivot]
    middle = [x for x in arr if x == pivot]
    right = [x for x in arr if x > pivot]
    return quicksort(left) + middle + quicksort(right)
Enter fullscreen mode Exit fullscreen mode

Claude responds with a clear explanation in a new split.

Fix Bugs

Found a bug? Select the code and press ,cf:

# Before (buggy)
def divide(a, b):
    return a / b  # Crashes on b=0

# After (Claude's fix)
def divide(a, b):
    if b == 0:
        raise ValueError("Cannot divide by zero")
    return a / b
Enter fullscreen mode Exit fullscreen mode

Refactor Code

Select code and press ,cr, then describe what you want:

Edit instruction: Convert to async/await
Enter fullscreen mode Exit fullscreen mode

Claude rewrites the selection for you.

Sublime-like Keybindings

If you've used Sublime Text or VS Code, these will feel familiar:

Key Action
Ctrl+P Fuzzy file finder
Ctrl+B Toggle sidebar
Ctrl+N Multi-cursor (select next match)
Ctrl+/ Toggle comment
Ctrl+S Save
Alt+↑/↓ Move line up/down

The leader key is , for additional commands:

Key Action
,cc Claude chat
,ce Claude explain
,cf Claude fix
,cr Claude refactor
,f Search in project
,d Duplicate line

The Status Line

One thing I love about modern editors is the informative status line. Vimsor includes a custom one:

┌──────────────────────────────────────────────────────────────────┐
│ NORMAL │ ⑂ master │ » app.py ● │ ◆ python │ ↕ 50% │ ☰ 42:15    │
└──────────────────────────────────────────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode
  • ⑂ master - Git branch (in red)
  • » app.py - Current file
  • - Modified (unsaved changes)
  • ◆ python - File type
  • ↕ 50% - Position in file
  • ☰ 42:15 - Line and column

Installation

One command for macOS or Linux:

curl -fsSL https://raw.githubusercontent.com/mignev/vimsor/main/install.sh | bash
Enter fullscreen mode Exit fullscreen mode

The script:

  1. Installs dependencies (vim, fzf, ripgrep)
  2. Sets up vim-plug
  3. Installs all plugins
  4. Creates the vimrc symlink

For Claude AI features, you'll also need Claude Code installed.

What's Under the Hood

Vimsor uses these excellent plugins:

Plugin Purpose
fzf.vim Fuzzy file finder
NERDTree File sidebar
vim-visual-multi Multi-cursor
vim-commentary Comment toggle
vim-fugitive Git integration
vim-gitgutter Git diff in gutter
lightline.vim Status line
ayu-vim Color scheme

The Claude integration is custom VimScript that shells out to the Claude Code CLI:

function! ClaudeChat()
  vertical botright terminal ++cols=80 claude
endfunction

function! ClaudeFix()
  let l:tmpfile = tempname()
  '<,'>write! `=l:tmpfile`
  let l:cmd = 'claude -p "Fix any bugs. Output ONLY code." < ' . l:tmpfile
  let l:result = system(l:cmd)
  " ... replace selection with result
endfunction
Enter fullscreen mode Exit fullscreen mode

Why Not Just Use Cursor?

Cursor is great! Use it if:

  • You prefer a full GUI
  • You're always on a local machine
  • You like the GPT integration

Use Vimsor if:

  • You live in the terminal
  • You work over SSH frequently
  • You prefer Claude over GPT
  • You want something lighter
  • You love Vim but want AI assistance

Customization

Change the theme

let ayucolor="mirage"  " Options: light, mirage, dark
Enter fullscreen mode Exit fullscreen mode

Change the leader key

let mapleader = ","  " Change to space, backslash, etc.
Enter fullscreen mode Exit fullscreen mode

Add your own keybindings

" Example: Map F5 to run Python
autocmd FileType python nnoremap <F5> :!python %<CR>
Enter fullscreen mode Exit fullscreen mode

Try It Out

The project is open source and MIT licensed:

GitHub: https://github.com/mignev/vimsor

Star it if you find it useful, and feel free to open issues or PRs!

What's Next

Some features I'm considering:

  • [ ] Neovim support with native LSP
  • [ ] Code completion with Claude
  • [ ] Image support for multi-modal prompts
  • [ ] Session persistence for Claude chat

Let me know what features you'd like to see!


Thanks for reading! Follow me for more developer tools and terminal workflows.

Tags: #vim #ai #claude #opensource #terminal #productivity #coding


About the Author

Marian Ignev is a software developer who spends too much time configuring his terminal. Find him on GitHub, Twitter, SashiDo and Contentship.

Top comments (0)