preservim / vim-textobj-sentence Goto Github PK
View Code? Open in Web Editor NEWImproving on Vim's native sentence text object and motion
License: Other
Improving on Vim's native sentence text object and motion
License: Other
Consider the case:
Prof. Plum said, "Hey Mr. Green. Didn't see you there." He casually slid the revolver behind a nearby book. Plum lit his pipe.
If the cursor is on the beginning of the line in normal mode, and I press )
, it goes to the "D" of "didn't". I think this is reasonable. However, if I press )
again, it jumps to the "P" in the second "Plum" (last sentence) and skips over the "He" sentence. I was thinking that it would move to the middle sentence instead.
It is entirely possible that I have a bad configuration or interaction with another plugin of some sort. Just wanted to file this in case it is not the desired behavior. I could see this being confusing if I had a lot of back-and-forth dialog in a piece of writing. Hope this helps, and thanks for making this plugin!
Sometimes it goes to the end of the current sentence, and other times the next sentence.
Given document:
/////////////////////////
This is a test.
“this is a test”
/////////////////////////
From first sentence hit ')' to jump to the next. Nothing happens.
Hi Reed, hope things are going well! I was reading through the documentation (working on previously referenced Vim book (finally)) and saw a couple of benefits that the README mentions that I'm not sure I fully understand. I could dig into the code, but figured it might be a case where it could be clearer to others as well.
Here are the relevant sections:
I was not clear how having dashes would affect the sentence finding algorithm. Same with things like asterisks around words inside of sentences.
Thank you for your work on this plugin, it is quite useful for moving around and manipulating sentences!
Hi,
I have enjoyed using your plugin but I have a small request. Would it be possible to add a new text object for clauses (or fragments bounded by commas or periods, whatever you call it) and make it sort of a sister object of the sentence object?
Thanks,
Mac
The plugin treats e.g.
and i.e.
as sentence endings. It seems to work for markdown files, but not latex. For example this sentence is treated as two objects.
Here is a sentence i.e. this is an example.
I tried adding another abbreviations to g:textobj#sentence#abbreviations
that it didn't fix the problem.
First, thanks for this plugin! I found it while looking for something that improves on vim's built-in handling of sentences in LaTeX files. (If you're bored and curious for more details: https://vi.stackexchange.com/q/23228/7933.)
The good news: out of the box, this plugin handles some very ugly situations in LaTeX wonderfully!
The bad news: the plugin cannot handle parenthetical sentences. Here's a test sample:
(|This is a test.) This is only a test. Still testing.
This is only a test. (|This is a test.) Still testing.
If |
is the initial cursor position, then )
in the first line jumps to Still
. In the second line, )
moves directly down to the next line.
Thanks again for writing this plugin.
Place the cursor where the '*' is and hit vas
Third sentence. To exchange *two cursor, place your words on the first word and type cxiw.
vis works
I'd love this to be able to delimit by a single carriage return.
I write screenplays in fountain and selecting the first sentence of dialogue will invariably also select characters' names.
I tried to hack around in sentence.vim but I don't sufficiently understand what is happening here.
Stripped all non-word characters from War and Peace.
Hit ( to find first sentence. Hang.
Need to find some way to limit regex to avoid hang.
Using https://github.com/FooSoft/md2vim or similar.
I've just installed this on my Vim 7.4 and when I open a file in Vim, I get these messages:
Error detected while processing function textobj#sentence#init..textobj#user#plugin..369:
line 15:
E605: Exception not caught: Unknown command: 'pattern'
Error detected while processing function textobj#sentence#init..textobj#user#plugin:
line 15:
E171: Missing :endif
Not sure how best to track this one down.
I tried adding '(' to the abbreviations, but it does not work. Backtick/Grave does not work either. For example, I'd like things like (.) or .
or an escaped period to be ignored. I can't think of any situation in which a sentence would end with these characters except for possibly backtick, so it might be nice to have ( and \ ignored by default.
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.