Code Monkey home page Code Monkey logo

vim-snipe's People

Contributors

bcortier-devolutions avatar cbenoit avatar cycl0 avatar hauleth avatar skt041959 avatar voldikss avatar yangmillstheory avatar ychin avatar zkwinkle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vim-snipe's Issues

Pressing <Esc> should cancel a movement

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.

Only show the first character in a multi-character sequence by default

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.

Using a motion should not alter the buffer's "modified" state

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.

Unicode messes up jump targets

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 .

When cancelling a command with an operator, always stay in normal mode

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"

Jumping to a target, undoing, and trying to jump to any target with the same letter jumps to the first option

Mappings

omap l (snipe-t)
omap L (snipe-f)
omap h (snipe-T)
omap H (snipe-F)

Steps to reproduce

"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

Pressing <Esc> should cancel an active motion

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.

Add neovim support

A couple issues prevent this from being compatible with neovim.

  • neovim doesn't have v:t_number, using type(0) is the recommended alternative
  • neovim doesn't allow empty keys in dictionaries (even though the docs say it's allowed). Naive fix is simply adding a space to the end of each key in s:known_modes and concatenating a space to the end of a:mode.

t and T doesn't work in some cases

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.

Edits need to work with dot operator

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.