Skip to content

Add a motion to vim representing a terminal command (in a terminal buffer) so you can yank it, or navigate by commands rather than words or lines.

License

Notifications You must be signed in to change notification settings

yogeshdhamija/terminal-command-motion.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terminal-command-motion.vim

CI -> status for latest vim
CI -> status for latest neovim

gif

To Install

Using vim-plug:

Plug 'yogeshdhamija/terminal-command-motion.vim'

Works in both vim, and neovim.

Usage

This plugin adds a "terminal command" motion to vim.

yacm to (Y)ank (A)ll of a (C)o(m)mand in a terminal buffer

...and associated commands like 3cm, 2CM, yicm, etc.

See :h terminal-command-motion.txt for details (or check the /doc folder).

Required Setup

You must set g:terminal_command_motion_prompt_matcher (see :h g:terminal_command_motion_prompt_matcher).

This is the search (vim regex enabled) that will be used to find your terminal prompt. Example:

let g:terminal_command_motion_prompt_matcher = 'prompt\$'

To Test

Locally, run:

./test.sh

In docker, run:

docker build . -t testing_terminal-command-motion.vim && docker run testing_terminal-command-motion.vim

About

Add a motion to vim representing a terminal command (in a terminal buffer) so you can yank it, or navigate by commands rather than words or lines.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published