Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yogeshdhamija/terminal-command-motion.vim

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.
https://github.com/yogeshdhamija/terminal-command-motion.vim

neovim neovim-plugin vim vim-plugin vim-plugins

Last synced: 3 months ago
JSON representation

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.

Awesome Lists containing this project

README

        

# terminal-command-motion.vim

[![CI](https://github.com/yogeshdhamija/terminal-command-motion.vim/actions/workflows/ci.yml/badge.svg)](https://github.com/yogeshdhamija/terminal-command-motion.vim/actions/workflows/ci.yml) -> status for latest vim
[![CI](https://github.com/yogeshdhamija/terminal-command-motion.vim/actions/workflows/ci.yml/badge.svg)](https://github.com/yogeshdhamija/terminal-command-motion.vim/actions/workflows/ci.yml) -> status for latest neovim

![gif](https://user-images.githubusercontent.com/4468354/150797271-0293d84c-a9e7-4c89-a3e8-4b0a4e68ecca.gif)

## To Install
Using [vim-plug](https://github.com/junegunn/vim-plug):
```vim
Plug 'yogeshdhamija/terminal-command-motion.vim'
```

Works in both [vim](https://www.vim.org/), and [neovim](https://neovim.io/).

## 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
```