Vim plugin to quickly parse strings into arrays.

Related tags

Command-line butcher
Overview

butcher

Vim plugin to quickly parse strings into arrays.

It is painful to write arrays in any programming language, so butcher makes it easy for you.

Installation

With vim-plug:

Plug "zim0369/butcher"

Add this to your vimrc:

noremap 
   
    n :'<,'>. !xargs $HOME/.vim/plugged/butcher/nums
    
     
noremap 
     
      s :'<,'>. !xargs $HOME/.vim/plugged/butcher/string
      

      
     
    
   

Usage

Suppose you have this line in your program that you want to turn into an array of strings.

Turn this into an array of strings

Now visually select the entire line and press s .

The above line gets replaced with this beautiful array :

["Turn", "this", "into", "an", "array", "of", "strings"]

Array of characters? Suppose you have this word in your program that you want to turn into an array of characters.

Characters

Now visually select the entire line and press s .

The above line gets replaced with this beautiful array :

['C', 'h', 'a', 'r', 'a', 'c', 't', 'e', 'r', 's']

Array of numbers? Suppose you have this line in your program that you want to turn into an array of numbers.

1 2 4 5 4 5 5

Now visually select the entire line and press n .

The above line gets replaced with this beautiful array :

[1, 2, 4, 5, 4, 5, 5]

You can go ahead and change the keybindings.

You might also like...
Small CLI for escaping and unescaping characters in strings

🐌 esc Small CLI for escaping characters in strings. Install cargo install esc Usage cat LICENSE-MIT | esc escape | pbcopy pbpaste | esc unescape | pb

Vari (Väri) is a Rust library for formatting strings with colors and cosmetic stuff to the terminal.
Vari (Väri) is a Rust library for formatting strings with colors and cosmetic stuff to the terminal.

Vari Vari (Väri) is a Rust library for formatting strings with colors and cosmetic stuff to the terminal. Like Rich library for Python. Väri means "co

A CLI tool to rename files to randomly generated strings.
A CLI tool to rename files to randomly generated strings.

rng-rename A CLI tool to rename files to randomly generated strings. Why? Suppose you downloaded a few hundred images to use as your desktop wallpaper

A small command-line utility for encoding and decoding bech32 strings

A small command-line utility for encoding and decoding bech32 strings.

Easy access of struct fields in strings using different/custom pre/postfix:
Easy access of struct fields in strings using different/custom pre/postfix: "Hello, {field}" in rust

Easy access to struct fields in strings 🐠 add strung to the dependencies in the Cargo.toml: [dependencies] strung = "0.1.3" 🦀 use/import everything

Immutable strings, in Rust.
Immutable strings, in Rust.

Immutable Strings Inspired by the bytes crate, which offers zero-copy byte slices, this crate does the same but for strings. It is backed by standard

Rust parser/validator for Debian version strings

debian version handling in rust This simple crate provides a struct for parsing, validating, manipulating and comparing Debian version strings. It aim

Statically verified Rust struct field names as strings.

field Statically verified struct field names as strings. See the documentation for more details. Installation Add the following to your Cargo manifest

Parse command line arguments by defining a struct.

StructOpt Parse command line arguments by defining a struct. It combines clap with custom derive. Documentation Find it on Docs.rs. You can also check

Owner
null
lemmy-help is a emmylua parser as well as a CLI which takes that parsed tree and converts it into vim help docs.

lemmy-help is a emmylua parser as well as a CLI which takes that parsed tree and converts it into vim help docs.

Vikas Raj 117 Jan 3, 2023
parse command-line arguments into a hashmap and vec of positional args

parse command-line arguments into a hashmap and vec of positional args This library doesn't populate custom structs, format help messages, or convert types.

James Halliday 17 Aug 11, 2022
Cargo-eval - A cargo plugin to quickly evaluate some Rust source code.

cargo eval A cargo plugin to quickly evaluate some Rust source code. Installation $ cargo install --git https://github.com/timClicks/cargo-eval.git Us

Tim McNamara 9 Dec 21, 2022
hackernews_tui is a Terminal UI to browse Hacker News with vim-like key bindings.

hackernews_tui is written in Rust with the help of Cursive TUI library. It uses HN Algolia search APIs to get Hacker News data.

Thang Pham 364 Dec 28, 2022
Basic vim-like editor for Redox-OS

red red is an editor based on vim written in Rust. Goal of this project is to provide a basic command-line editor, much like nano. Targeted for Redox.

null 1 Mar 5, 2022
A code-completion engine for Vim

YouCompleteMe: a code-completion engine for Vim Help, Advice, Support Looking for help, advice or support? Having problems getting YCM to work? First

null 24.5k Dec 31, 2022
A user-friendly TUI for secure file transfers, with arrow-key and VIM-style navigation

gsftp SFTP with an interactive text-based user interface (TUI). Transfer files through an encrypted connection with a visual interface, so you can see

Ben Jiron 3 Jul 7, 2022
A structure editor for a simple functional programming language, with Vim-like shortcuts and commands.

dilim A structure editor for a simple functional programming language, with Vim-like shortcuts and commands. Written in Rust, using the Yew framework,

Joomy Korkut 6 Nov 18, 2022
Command-line tool that provides a workflow for extending, editing, diffing, and writing to vim-style grep lines.

Grug Grug is a command-line tool that provides a workflow for expanding, editing, diffing, and writing edits to files using vim-styled grep lines (suc

null 4 Apr 25, 2023
A simple overlay for OBS to display consecutive keystrokes. Primarily for programming, especially for Vim.

Keystroke-Display A simple overlay for OBS to display consecutive keystrokes. Primarily for programming, especially for Vim. This will work on Windows

null 7 May 13, 2023