briandoll / change-inside-surroundings.vim Goto Github PK
View Code? Open in Web Editor NEWvim plugin to change the contents of the innermost 'surrounding'
Home Page: http://briandoll.github.com/change-inside-surroundings.vim/
vim plugin to change the contents of the innermost 'surrounding'
Home Page: http://briandoll.github.com/change-inside-surroundings.vim/
Love the plugin, would it be possible to support vi and va type of commands ?
In the following: "Brian's vim plugin is broken."
If the cursor is in front of the single apostrophe, the plugin commands will work. If the cursor is placed after the single apostrophe the commands will have no effect beyond leaving you in insert mode.
Sometimes it would be nice to be able to change only everything on the left or right site of the cursor instead of everything in the surrounding.
It would be great if typing <Leader>ci
, then some replacement text, then <Esc>
, then u
would restore the state back to the way things were before the change command. Right now you need to undo twice, once for the actions of the s:ChangeSurrounding
function and once for the text added as part of the startinsert
that begins at the end of that function.
I tried to hack the script up to use undojoin
, especially undojoin | startinsert
, but it didn't work. I'm not sure if I'm lacking the vim-fu or if this is a fundamental (and stupid) limitation of vim's undojoin
behavior.
I just created the basic shell of an Atom plugin that will replicate this functionality in the Atom text editor. Join in if you want to help out!
Right now, changing inside xml-style tags works well ("|" marks cursor):
<div> some | text </div>
However, changing inside the tags themselves does not do anything:
<div | class="blah">
It would be awesome if both could be supported.
Great plugin! It would be even better if we could integrate it with this bit of code by Steve Losh which lets you do something like "cinb" to change inside next bracket. So you don't have to be standing inside the bracket. I might take a crack at this next weekend unless you like this idea and get to it first :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.