All Projects → jeanCarloMachado → vim-toop

jeanCarloMachado / vim-toop

Licence: MIT License
Add custom behaviour to your text objects

Programming Languages

Vim Script
2826 projects

Projects that are alternatives of or similar to vim-toop

productivity-tips-for-mac
Awesome Productivity Tips for Mac Developers
Stars: ✭ 38 (-11.63%)
Mutual labels:  productivity
jira-cli
🔥 [WIP] Feature-rich interactive Jira command line.
Stars: ✭ 809 (+1781.4%)
Mutual labels:  productivity
infrared
✨🚀 Blazing fast, inferred static type checker for JavaScript.
Stars: ✭ 46 (+6.98%)
Mutual labels:  productivity
WeekToDoWeb
WeekToDo is a free minimalist weekly planner app focused on privacy. Schedule your tasks and projects with to do lists and a calendar. Available for Windows, Mac, Linux or online.
Stars: ✭ 48 (+11.63%)
Mutual labels:  productivity
lir.nvim
Neovim file explorer
Stars: ✭ 194 (+351.16%)
Mutual labels:  nvim
knowledge-base-content
Open-source knowledge base covering topics about developer experience.
Stars: ✭ 73 (+69.77%)
Mutual labels:  productivity
deoplete-rtags
Deoplete external source for c/c++/objc[++] using rtags.
Stars: ✭ 19 (-55.81%)
Mutual labels:  nvim
atom-package-sync
Synchronize your atom packages and settings easily
Stars: ✭ 22 (-48.84%)
Mutual labels:  productivity
AHKCommandPicker
An AutoHotkey (AHK) script that allows you to easily run AHK functions. Instead of having to remember what shortcut key maps to each of your AHK scripts, this displays a list of all your AHK functions and allows you to easily run them.
Stars: ✭ 50 (+16.28%)
Mutual labels:  productivity
AlfredWorkflows
My workflow creations for Alfred on macOS.
Stars: ✭ 55 (+27.91%)
Mutual labels:  productivity
dotfiles-manjaro-i3
Dotfiles for my old manjaro system.
Stars: ✭ 17 (-60.47%)
Mutual labels:  nvim
dotfiles
🚀 tmux, ohmyzsh, powerlevel10k, neovim 🔧
Stars: ✭ 24 (-44.19%)
Mutual labels:  nvim
atlas.vim
Colorful theme for colorful souls
Stars: ✭ 72 (+67.44%)
Mutual labels:  nvim
better-escape.nvim
Escape from insert mode without delay when typing
Stars: ✭ 166 (+286.05%)
Mutual labels:  nvim
neovim
🌟 Cool & Modularized vim configurations to work like an IDE
Stars: ✭ 17 (-60.47%)
Mutual labels:  nvim
solarized.nvim
Port of the Solarized colorscheme for vim, written in lua, with treesitter support.
Stars: ✭ 60 (+39.53%)
Mutual labels:  nvim
close-buffers.nvim
📑 Delete multiple vim buffers based on different conditions
Stars: ✭ 54 (+25.58%)
Mutual labels:  nvim
arvis
Extendable cross-platform launcher that aims to help you run, edit, create any workflow simply
Stars: ✭ 39 (-9.3%)
Mutual labels:  productivity
stay-productive
Remove feed from Facebook, Twitter and Linkedin... To stay productive !
Stars: ✭ 15 (-65.12%)
Mutual labels:  productivity
pyimgscan
Take any phone-taken picture and turn it into a document scan.
Stars: ✭ 48 (+11.63%)
Mutual labels:  productivity

Toop

Toop stands for Text Objects OPerations. It allows you to send text objects to functions or to the shell using Vim's native lingo.

Toop allows to add behavior equivalent to the native d part in dap or dis (delete a paragraph or inside a sentence).

Actually let's build that:

call toop#mapShell('return', '<leader>d')

Done! It works like the native d.

Examples

toop#mapShell

mapShell sends the text object directly to the shell stdin

"make json objects beautiful
call toop#mapShell('jq .', '<leader>jq')
"make cool graphs
call toop#mapShell('graph-easy', 'mg')
"translate german to english
call toop#mapShell('trans -b  -no-theme -no-auto -no-ansi de:en', '<leader>ge')
"make markdown numbered list
call toop#mapShell("awk 'BEGIN { c=1 } // { print c\". \"$0; c = c+1 }'", '<leader>nl')
"base 64 encode
call toop#mapShell('base64', '64e')

toop#mapFunction

mapFunction sends the text object as the only argument to the function you defined.

"using vim functions
function! Duplicate(string)
    return a:string.a:string
endfun
call toop#mapFunction('Duplicate', "<leader>2x")

fun! FoldSomething(str)
    let comment=split(&commentstring, '%s')
    if len(l:comment)==1
        call add(comment, l:comment[0])
    endif
    return l:comment[0]." {{{\n".a:str."\n".l:comment[1]."}}}"
endfun
call toop#mapFunction('FoldSomething', '<leader>fo')

fun! GoogleIt(str)
    execute 'AsyncRun $BROWSER "'.a:str.'"'
endfunc
call toop#mapFunction('GoogleIt', '<leader>gi')

After having mapped some behaviour you can use it in the following ways:

  • with a text object is<leader>jb
  • repeat the operations over text objects with the . (dot)
  • with the current line by repeat the last key of the stroke <leader>jbb
  • After a visual selection <C-v><leader>jb

Want more? Check the ideas in the wiki.

Installation

Use your favourite package manager:

Plug 'jeanCarloMachado/vim-toop'

Exponential functionality out of the box

By adding a new operation with toop you get it for all text objects. And when you add new text objects you get all operations for free. This is the most native way of extending your Vim.

These plugins complement toop nicely by allowing you to create new text objects:

Acknowledgments

Another meaning for this project name is Tim pOpe Original Project.

The original code snippet came from one of his projects where it was used as auxiliary functionality. Since there's only a code snippet hanging around the internet I decided to create a proper project and work on the idea.

And here is the result! Let me know your thoughts.

Roadmap

  1. Add async support
  2. Results in preview pane

Q&A

What is a text-object? Instead of editing character by is much more efficient to edit by word, sentence, and paragraph. In Vim, these higher-level concepts are called text objects. But in the end just a block of text. If you want to go deeper take a look at this post and also the official documentation :h text-object.

More questions? Checkout the Q&A.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].