Skip to content

Instantly share code, notes, and snippets.

@atondwal
Created February 26, 2026 00:53
Show Gist options
  • Select an option

  • Save atondwal/a2524f5b8c1574bf72ad2c6cf9b44a42 to your computer and use it in GitHub Desktop.

Select an option

Save atondwal/a2524f5b8c1574bf72ad2c6cf9b44a42 to your computer and use it in GitHub Desktop.

Claude Code Session: Controlling nvim via tmux

Demonstrating Claude Code driving nvim in a separate tmux pane — opening files, creating splits, and using vim plugins.


User

using tmux send-keys open nvim to the RASP decompilation grader with that line highlighted

Assistant

Searched codebase for the RASP decompilation grader.

Which grader file did you mean — the thin wrapper (tasks/rasp_decompile/grader/grader.py, 55 lines) or the full autograder implementation (tasks/rasp_decompile/grader/grader_data/autograder/grader.py, 327 lines)?

And which line do you want highlighted? You said "that line" but I don't see a prior reference. Could you clarify?

User

autograder; function decl

Assistant

Grepped for ^def in the autograder.

There are 3 function declarations. Which one?

  • Line 18: def find_last_sop()
  • Line 51: def grade_rasp_program()
  • Line 192: def grade_rasp_submission()

User

open them all in splits

Assistant

tmux send-keys "nvim +18 ...grader.py -c 'split +51 %' -c 'split +192 %'" Enter

Done. Opened nvim with three horizontal splits, each positioned at a function declaration.

User

haha almost. this is the same tmux, so you just sent it to yourself. you'll need to open a new pane

Assistant

tmux split-window -h "nvim +18 ...grader.py -c 'split +51 %' -c 'split +192 %'"

Opened a new tmux pane to the right with nvim and three horizontal splits at lines 18, 51, and 192.

User

cool; ty! now use visual mode to select the docstrings in those panes

Assistant

Read the file to find docstring line ranges, identified the nvim pane as %1.

The docstrings are at:

  • find_last_sop: lines 19–23
  • grade_rasp_program: lines 60–77
  • grade_rasp_submission: lines 196–218

However, vim only has one cursor — I can't have visual selections active in all three splits simultaneously.

Would you like me to:

  1. Select the docstrings one at a time (moving between splits)?
  2. Use vim marks or some other approach to highlight all three?
  3. Use folds/highlights to mark all three docstrings visually?

User

Use F1 to paint them using my vim plugin

Assistant

tmux send-keys -t %1 Escape '196GV218G' F1 C-w j '60GV77G' F1 C-w j '19GV23G' F1

Done. Visually selected and painted (F1) the docstrings in all three splits:

  • Top: grade_rasp_submission docstring (lines 196–218)
  • Middle: grade_rasp_program docstring (lines 60–77)
  • Bottom: find_last_sop docstring (lines 19–23)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment