Comments (2)
If you type the command
ci{
, the resulting output should (intuitively) erase "arg 2" and leave you in the appropriate spot in insert mode. The current behavior ends up with
I agree that it would be sometimes useful to change arg 2
with ci{
, but if I prefer to seek into targets in the current line over selecting the surrounding target it will be impossible to work on the surrounding target.
One idea could be to add a modifier like c
(for current) that doesn't seek. In that case ci}
could operate on arg 2
, while cic}
would select the big block. This would collide with textobj-word-column.vim.
Alternatively we could add a modifier that seeks like s
. In this case ci{
would select the surrounding target while cis{
would seek into arg 2
. This would collide with sentence text objects (which I don't use).
Additionally, it's also worth noting that vim's built in % matching command seems to automatically match the first line with the "matching" bracket 50 lines down, just like your plugin does.
That sounds like there are some unmatched brackets in your file (like the ]
in ]p
). This confuses Vim's pair matching that targets.vim relies on. I use the same %
command internally.
If I'm within, say, 10-15 characters of something more narrow that matches the command, then act on that instead of the wider selection, and if I'm further away from it (say, at the other end of a line of code), the plugin should act on the larger area.
I'm not a big fan of such random numbers. It's always hard to judge how the plugin will behave depending on such limits. As commented elsewhere I could like the idea of not seeking into a target that is completely off screen. Or even only seeking into targets that at least touch the current line.
I could start to like the idea of seeking into targets that are completely contained in the current line, even if there is a bigger surrounding target present, but I'm not sure yet.
In any case, thank you for your feedback, I will consider it in the future!
Let me know what you think of my comments.
from targets.vim.
@thang1thang2: Sorry for the late update, but seeking has been improved and made customizable in #129. I just tested your example again and it works now as you desired. Thanks!
from targets.vim.
Related Issues (20)
- Arguments doesn't work in {} HOT 1
- Inconsistent behavior in default seek ranges
- Question: on deleting the last element in a list plus its preceding comma HOT 1
- [Bug Report] Why does targets.vim reset my filetype?
- targets.vim causing issue with macros HOT 6
- cin' not working with \
- Disabling mappings still causes health check warnings.
- Define argument source with longer separator (multiple characters). HOT 2
- cin" doesn't target next quotes properly HOT 2
- `ia` doesn't handle nested braces when arguments are put each on it's own line HOT 4
- Square brackets argument doesn't work HOT 1
- Supporting Other Plugins HOT 1
- Unable to select pair text object with other pair on the same line HOT 1
- Stops working with "set nomagic"
- dot-repeat echoes sometimes ':call targets#do()'
- README.md has Pathogen example that uses "git://" URL instead of "https://" or "ssh://" URL
- ci( doesn't seek forward
- repeat motion in visual mode does not extend selection
- Missing mapping for r
- How to install for Intellij's ideavim HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from targets.vim.