Comments (9)
A workaround appears to be adding an extra surround for searching:
let g:operator#surround#blocks = {
\ '-' : [
\ {'block': ['\langle', '\rangle'], 'motionwise': ['char', 'line', 'block'], 'keys': ['<','>']},
\ {'block': ['\\langle', '\\rangle'], 'motionwise': ['char', 'line', 'block'], 'keys': []},
\ ] }
from vim-operator-surround.
Hi.
Strings in block
are used as regular expression here. So backslash must be escaped with extra backslash. I think below works.
let g:operator#surround#blocks = {
\ '-' : [
\ {'block': ['\\langle', '\\rangle'], 'motionwise': ['char', 'line', 'block'], 'keys': ['<', '>']},
\ ] }
from vim-operator-surround.
['\\langle\>', '\\rangle\>']
may be better as you mentioned.
from vim-operator-surround.
The problem with this one seems to be when inserting the brackets. Here it is not used as a regular expression, but inserted verbatim, right?
from vim-operator-surround.
Ah, I understood. That's true. I'll consider how to resolve this issue..
from vim-operator-surround.
I think, if searching could be made non regular expression, that would solve it. Likely it's not really needed if this hasnthasn't been a problem before.
from vim-operator-surround.
Exactly the solution resolves this issue. However, it breaks other block definitions which rely on regular expression.
I think it is good to enable to define inserted block text explicitly as below.
let g:operator#surround#blocks = {
\ '-' : [
\ {
\ 'block': ['\\langle', '\\rangle'],
\ 'block_text': ['\langle', '\rangle'],
\ 'motionwise': ['char', 'line', 'block'],
\ 'keys': ['<', '>']},
\ ] }
What do you think?
from vim-operator-surround.
That would certainly work :-)
I guess I just can't imagine any cases where you'd want to insert a regular
expression verbatim as a bracket.
On Fri, Oct 9, 2015, 11:03 AM Linda_pp [email protected] wrote:
Exactly the solution resolves this issue. However, it breaks other block
definitions which rely on regular expression.
I think it is good to enable to define inserted block explicitly as below.let g:operator#surround#blocks = {\ '-' : [\ {\ 'block': ['\langle', '\rangle'],
\ 'block_text': ['\langle', '\rangle'],
\ 'motionwise': ['char', 'line', 'block'],\ 'keys': ['<', '>']},\ ] }
What do you think?
—
Reply to this email directly or view it on GitHub
#25 (comment)
.
from vim-operator-surround.
e.g. HTML tag
from vim-operator-surround.
Related Issues (20)
- ファイルタイプ毎の設定にデフォルト設定をマージしたい HOT 8
- effec of map <silent>ys <Plug>(operator-surround-append) in o and v-mode
- textobjectがスペースに隣接している場合<Plug>(operator-surround-replace)を使うとsurroundにスペースが含まれてしまう HOT 4
- 囲み処理を行ったあとに、処理を行いたい
- Tag ~operator~
- surround append with <backslash> procduces regex error HOT 1
- escaping in config
- escaping for $ not working
- operator-surround-replace kills indent in visual mode
- surounding with a space dosn't work HOT 1
- Oops from manbou
- <Plug>(operator-surround-replace) doesn't work with g:operator#surround#ignore_space=0 HOT 3
- Option to retain cursor position
- .vimrcを再読み込みしたときにg:operator#surround#default_blocksがマージされない? HOT 5
- Decrements counter? HOT 1
- Space is trimmed when replacing delimiter of string literal contains trailing space
- Suggestion for documentation
- Is this still maintained? HOT 1
- g:operator#surround#blocks['-'] 未定義時の動作 HOT 2
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 vim-operator-surround.