Comments (2)
This is just what it looks like to mix linewise and chararacterwise motions. When you try to paste linewise content (the line targeted by cxx
) over a characterwise selection (the word targeted by cxw
), the result is that the linewise content is still on its own line. Here's an example that illustrates it more clearly:
1 before word after
2 this is a sentence
Use cxw
on word and cxx
on line 2. The result:
1 before
2 this is a sentence
3 after
4 word
While this is probably not what you wanted, it's much easier to understand why it happened. The linewise motion defined by cxx
wants to continue being its own line. If we remove before and after, we actually see the exact same behaviour that you described.
For your case, you could use matching -wise motions to achieve the result you want:
cxw
andcx$
cxx
andcxx
from vim-exchange.
Ah, thanks for the explanation, that makes sense now. And yes, using matching -wise motions is probably a better idea.
from vim-exchange.
Related Issues (20)
- Highlighting is not cleared when exchanging indented nested regions HOT 5
- :ExchangeClear causes ambiguity with :Ex HOT 5
- Don't require +xterm_clipboard option HOT 2
- Option for disabling highlighting HOT 5
- Exchange paragraph with last paragraph of file using cxap (no blank line at eof) HOT 5
- Idea: Extend exchange.vim by bubbling commands HOT 1
- Clipboard provider in Neovim may be unavailable HOT 3
- '.' Doesn't Repeat Custom Text Objects Before Version 7.4 HOT 21
- allow count for cxx HOT 1
- Highlighting is incorrect for the wrapped lines if linebreak is set HOT 2
- support repeating swap operations HOT 2
- Able to exchange two regions selected visually with multiple-cursors HOT 5
- Add option to set custom colors HOT 1
- Swapping words hangs after 3 times when used as part of a macro HOT 5
- Clipboard error happens when used in NeoVim in WIN10 HOT 2
- support to keep cursor as it was after calling <plug>(Exchange) HOT 3
- cxx highlights two lines (ideavim) HOT 2
- Transpose the last 2 words HOT 5
- How to Reset HOT 3
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-exchange.