yangmillstheory / vim-snipe Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Expected behavior: If I start a movement and press <Esc>, the movement should be cancelled and I should be back in Vim's normal mode.
Current behavior: If I start a movement and press <Esc>, vim-snipe throws an error.
Just good practice.
Possible culprit:
Lines 203 to 206 in 28602fb
To reproduce:
(snipe-w)
, or(snipe-b)
(snipe-f-i)
(snipe-F-i)
(snipe-f-a)
(snipe-F-a)
This would be IMHO more useful. for touch typists.
When there are more options than the default number of tokens (26 of them), vim-snipe uses a multi-keystroke sequence. Right now it shows the full sequence, which has the issue of shifting the text around as it converts a single character into multiple ones. This makes it hard to use the plugin as the positioning of the character is the one thing the user has to remember which position to pick.
For example if the tokens are "asd" (for simplicity), and the line is 12 34 56 78
, then doing (snipe-w) will show a2 s4 da6 ds8
, which makes it hard to parse. Ideally it would be a2 s4 d6 d8
instead (then when you press 'd', it will show 12 34 a6 s8
for further filtering down).
Also, see #16 for examples.
I have a pull request incoming, but wanted to get some thoughts on this first. It will change the default to the new behavior but provide backward compatability. I could switch the default around as well.
Expected behavior: If I use a motion in an unmodified buffer, the buffer should still be considered unmodified after the motion is finished.
Current behavior: If I use a motion in an unmodified buffer, the buffer is considered to be "modified" after the motion is finished.
function! LightlineAleWarning()
let counts = ale#statusline#Count(bufnr(''))
let n_warnings = counts.style_warning + counts.warning + counts.info
return counts.total == 0 || n_warnings == 0
\ ? ''
\ : printf('%d ◆', n_warnings)
endfunction
Try (snipe-f-w)
on the same line as ◆
, before ◆
.
Hello again :-)
Using map <leader><leader>f <Plug>(snipe-f)
as keybinding
Pressing c<leader><leader>f<esc>
should stay in normal mode instead of going in insert mode.
And if I'm not mistaken, if you go through with the jump, you undo, then you try to do the same jump with the same letter but you cancel, everything is deleted until the first occurrence of the letter. For example
"random piece of text"
c<leader><leader>fe
shows
"random piacs of tdxt"
You go through with d, so you end up with
"xt"
You undo. You press c<leader><leader>f<esc>
and you get
"ece of text"
omap l (snipe-t)
omap L (snipe-f)
omap h (snipe-T)
omap H (snipe-F)
"this is an example sentence"
If we try to jump to any target with the letter e (with snipe-t, for example) we get
"this is an example santsncd"
Jump to any character. Undo. Try to jump to any target with the letter e. You get none, and it automatically leaves:
"sentence"
since it's what you would get if it jumped to the first target
Expected behavior: If I start a movement with <Plug>(snipe-f)
, and choose a letter, I see a list of targets. If I then press <Esc>, the movement should be cancelled and I should be back in Vim's normal mode.
Current behavior: If I press <Esc> when choosing from a list of targets, Snipe throws an error.
A couple issues prevent this from being compatible with neovim.
v:t_number
, using type(0)
is the recommended alternatives:known_modes
and concatenating a space to the end of a:mode
.Given the line ************** t and T doesn't always work.
It seems to need at least 2 chars which don't match the target on the left (for t) or the right (for T).
ie. this works:
ab****
if you put the cursor on a and press t, but not if you put the cursor on b. F and f seem fine.
Given baaa
, swap 'b' from the end of the line. Should be able to repeat until 'b' is at the front of the line.
Even if there are multiple occurrences of b
, we should remember the jump target that was initially chosen.
See #16 (comment), triggered by (snipe-f-w)
.
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.