Giter VIP home page Giter VIP logo

lightspeed.nvim's People

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

lightspeed.nvim's Issues

Include Boolean Option for native , and ; character search

This suggestion naturally follows from the second part of #46

Include boolean option for including native ; and , functionality, rather than suggesting that the user copy one of the implementations that are included in the documentation; this will help avoid further clutter in users' config files, and also simplify the documentation.

Space character in labels

And useless search character prefix, which confuses user.

Screenshot 1

Screenshot

Screenshot 2

Screenshot 2

Screenshot 3 - Hop

Hop short jumps

Screenshot 4

Screenshot 4

  1. In screenshot above, I searched for e, The green color parts don't need first e to jump to, so they are confusing.

  2. f & j in purple color need space key to be pressed first, which is not obvious, and space is neither in the labels config.

  3. And why do I have very few 1 character jumps in Screenshot 2? Hop & Easymotion make jump labels as short as possible. See Line 1-6 in Hop screenshot.

  4. In Screenshot 4, there is a capital H, which I didn't include in labels config, why is it there?

How to remove space form labels & e from those green color areas.

Config

require'lightspeed'.setup({
	jump_to_first_match = false,
	highlight_unique_chars = false,
	grey_out_search_area = true,
    -- Target keys
	labels = {'d', 'k', 'f', 'j', 's', 'l', 'a', ';', ',', 'c', 'm', 'e', 'i', 'w', 'o', 'g', 'h', 'v', 'n', 'r', 'u', 't', 'x', ',', 'q', 'p', '[', ']', 'z', '.', '/', 'y', 'b'}
})

What theme are you using?

I'm wondering what theme your using in the screenshots (and what theme(s) you're personally using currently if different)

Add Media to readme.md to Preview Functionality

Title. I think it would improve user adoption rate based. A picture is worth a thousand words so for some of the more meatier plugins it really helped me understand their purpose when I was new to vim.

Willing/able to do this myself but I adopted this plugin today and need to familiarize myself.

If the decision is that this is not the right move then I'm still interested if anyone has something they want to show off to someone new.

Turn off scrolloff while lightspeeding?

After pressing the second character, lightspeed immediately jumps to the first match. Unfortunately, if one has 'scrolloff' activated, this may cause the screen to scroll, making it hard to keep focus on the remaining labels. Would it be possible to temporarily disable the setting?

Question regarding match highlighting

Hey πŸ‘‹πŸΌ,

I'm a bit confused if the highlighting is working correctly or not. In the πŸ‘‡πŸΌ attached mp4 I want to move to the last instance of match.

I input sm and this gives me 5 hits, for parameters and match. I then input a and it narrows it down even further to only match. This is the state that is confusing to me as lightspeed is still highlighting a over the matches. I would assume it to only view valid input options and a is not valid in this case. The correct input would be d.

simplescreenrecorder-2021-06-28_09.36.34.mp4

Is it possible to customize the keys that are used for the hints?

Right now it seems to use s,f,n,/,t,g and the shifted forms of those, maybe more. I suppose because those keys are associated with searching before. but they are also all over the place, I was thinking that using home row keys (starting from index finger and going out) should be better. At least for me, thats why I wondered if there is a config option yet?

Restore greyed out area after jump to 1st match after a timeout

First: thanks for this awesome plugin! I really start to get the hang of it.

But after some weeks of use I found one thing that could maybe be tweaked. It's about this feature (from the README):

the cursor automatically jumps to the first match by default; pressing any other key than a group-switch or a target label exits the plugin now

After typing 2 chars I often find, that I'm already where I wanted to go. But now the area is still greyed out. All I wanted to do is go to that new location, e.g. to reason about some piece of code. But my brain feels disturbed a lot by the still greyed out area. I now feel a disruption because I have think about "How can I get rid of that greyed out area?". I could press a key without any binding (ESC is to far away. On my german keyboard Γ€ may be a good candidate). But it still requires me to press yet another key - for no real action.

I wonder if we couldn't just get a (configurable) timeout: After the cursor jumped to the first match, we could wait x seconds and then exit the plugin and restore the greyed out area.

Does this make sense? Or is there an even better alternative that I'm missing?

Limit f/F/t/T scope to current line for macros and `:normal`

This should definitely be an option at least, even for 2-character search maybe. I wonder what would be the best solution interface-wise. Should we add an opts flag, something like limit_scope_to_current_line_for_macros? Or a prefix key that switches off multiline search on demand? Any ideas/preferences?

Also, is there any hack out there that makes it possible to detect whether we are currently executing a normal command, and not actually typing it live (like we can check macro playback with reg_executing)?

fFtT repeats do not work with vim-cutlass

When svermeulen/vim-cutlass is registered after lightspeed the repeating single character searches does not work. The initial single character search still works, but pressing, as an example, f again just starts a new f single character search.

I'm able to work around this issue by

nnoremap s <nop>
Plug 'svermeulen/vim-cutlass'
unmap s
Plug 'ggandor/lightspeed.nvim'

but thought you might want to be aware of the potential conflict. In particular cutlass does not, that I can tell, ever mess with any of fFtT.

Changing highlighting colors

I was wondering how one can modify the highlight colors and particularly change the background color of the Shortcut labels. I read the documentation and I think that it is related to lightspeed-highlighting and the LightspeedShortcut part in the :help section but it is not clear how to use it. Thank you!

Turn into module and lazy-load

I appreciate that the current design is much easier to maintain, but it would be nice to have lightspeed do proper on-demand loading (similarly to how old vimscript plugins did the heavy lifting in autoload functions that are not sourced unconditionally at startup).

(Basically, you want to move as much as possible into modules that are required only on executing the mappings.)

Failing to set keybind overrides

Hey πŸ‘‹πŸΌ,

I'm trying to run the following config:

--  β•»  ╻┏━╸╻ ╻╺┳╸┏━┓┏━┓┏━╸┏━╸╺┳┓
--  ┃  ┃┃╺┓┣━┫ ┃ ┗━┓┣━┛┣╸ ┣╸  ┃┃
--  ┗━╸╹┗━┛╹ β•Ή β•Ή ┗━┛╹  ┗━╸┗━╸╺┻┛
return function()
    require('lightspeed').setup {
        jump_to_first_match = false,
        cycle_group_fwd_key = '<tab>',
        cycle_group_bwd_key = '<s-tab>'
    }
end

but the cycle keybind overrides are not working. Strangely the default Space is no longer working either. This must be a bug, no? πŸ› πŸ”¨

A minor thought is that I find it somewhat strange that a option alters the default keymap. What's the reasoning behind this?

Remapping s key?

I'd like to remap s to another key. I see in the docs you have:

`<Plug>Lightspeed_s`

But for those of us not using vim-plug how does one accomplish a remap?

Allow custom characters as substitutes for highlighting whitespace characters (tab/space)

It might be nice to be able to set stand-ins for characters in labels.

See in this attached screenshot, where I have run vs0 from the start of the line (taken with Nord colorscheme so probably reasonably representative of many users):

image

Technically the first match is 0<space>, which makes sense, but it can be easy to overlook, I naturally want to type 00 because my brain reads it as a shortcut jump. I know this is wrong but still it happens.

If I could specify space_label = "Λ½", my brain might read it correctly.

image

I don't really know what the complexity would be, I think it's totally serviceable as is, but maybe a nice to have?

Omni direction

Hello. The main reason why I use hop is Omni-direction. I can press just shortcut for :Hop2char and press two characters and move both top or bottom direction. I don't care about two different shortcuts.
May I do it with lightspeed?

Allow for targeting the visible part of wrapped last lines

NVIM v0.6.0-dev+266-g5fd21b8d3
Lightspeed: 27625ea

If I have some very long lines which are wrapped, lightspeed doesn't seem to let me search everything visible. This may be a deliberate limitation for performance?

It's easier to see with a video. I have 3 lines. From line 1, I can only "query" (with s) into lines 1 and 2. From line 2, I can only query into line 2. I think it's to do with line 3 ending off screen?

lightspeed-2021-09-27_03.08.01.mp4

(if embed is broken https://streamable.com/rvs7as)

Content used, but any long, wrapped content will work.

Ipsum accusamus minus totam eum aliquid. Nisi animi accusantium nam suscipit mollitia. Quae animi veritatis at ex unde! Natus doloribus ducimus mollitia provident facere Pariatur hic omnis adipisci eos consequuntur Ipsum accusamus minus totam eum aliquid. Nisi animi accusantium nam suscipit mollitia. Quae animi veritatis at ex unde! Natus doloribus ducimus mollitia provident facere Pariatur hic omnis adipisci eos consequuntur Ipsum accusamus minus totam eum aliquid. Nisi animi accusantium nam suscipit mollitia. Quae animi veritatis at ex unde! Natus doloribus ducimus mollitia provident facere Pariatur hic omnis adipisci eos consequuntur Ipsum accusamus minus totam eum aliquid. Nisi animi accusantium nam suscipit mollitia. Quae animi veritatis at ex unde! Natus doloribus ducimus mollitia provident facere Pariatur hic omnis adipisci eos consequuntur Ipsum accusamus minus totam eum aliquid. Nisi animi accusantium nam suscipit mollitia. Quae animi veritatis at ex unde! Natus doloribus ducimus mollitia provident facere Pariatur hic omnis adipisci eos consequuntur Ipsum accusamus minus totam eum aliquid. Nisi animi accusantium nam suscipit mollitia. Quae animi veritatis at ex unde! Natus doloribus ducimus mollitia provident facere Pariatur hic omnis adipisci eos consequuntur Ipsum accusamus minus totam eum aliquid. Nisi animi accusantium nam suscipit mollitia. Quae animi veritatis at ex unde! Natus doloribus ducimus mollitia provident facere Pariatur hic omnis adipisci eos consequuntur Ipsum accusamus minus totam eum aliquid. Nisi animi accusantium nam suscipit mollitia.
Consectetur autem cupiditate nemo harum pariatur! Vero unde adipisci velit aperiam in. Nostrum aspernatur eligendi hic praesentium optio Tenetur officiis aperiam non necessitatibus architecto Beatae sit ex dolor doloremque doloribus. Consectetur autem cupiditate nemo harum pariatur! Vero unde adipisci velit aperiam in. Nostrum aspernatur eligendi hic praesentium optio Tenetur officiis aperiam non necessitatibus architecto Beatae sit ex dolor doloremque doloribus. Consectetur autem cupiditate nemo harum pariatur! Vero unde adipisci velit aperiam in. Nostrum aspernatur eligendi hic praesentium optio Tenetur officiis aperiam non necessitatibus architecto Beatae sit ex dolor doloremque doloribus. Consectetur autem cupiditate nemo harum pariatur! Vero unde adipisci velit aperiam in. Nostrum aspernatur eligendi hic praesentium optio Tenetur officiis aperiam non necessitatibus architecto Beatae sit ex dolor doloremque doloribus.
Adipisicing consequuntur obcaecati dolorem quae reprehenderit Perspiciatis reiciendis architecto molestiae odio corporis Architecto soluta optio quaerat expedita expedita. Neque voluptate tempora magni consectetur suscipit ea. Architecto nihil vitae delectus a? Adipisicing consequuntur obcaecati dolorem quae reprehenderit Perspiciatis reiciendis architecto molestiae odio corporis Architecto soluta optio quaerat expedita expedita. Neque voluptate tempora magni consectetur suscipit ea. Architecto nihil vitae delectus a? Adipisicing consequuntur obcaecati dolorem quae reprehenderit Perspiciatis reiciendis architecto molestiae odio corporis Architecto soluta optio quaerat expedita expedita. Neque voluptate tempora magni consectetur suscipit ea. Architecto nihil vitae delectus a? Adipisicing consequuntur obcaecati dolorem quae reprehenderit Perspiciatis reiciendis architecto molestiae odio corporis Architecto soluta optio quaerat expedita expedita. Neque voluptate tempora magni consectetur suscipit ea. Architecto nihil vitae delectus a? Adipisicing consequuntur obcaecati dolorem quae reprehenderit Perspiciatis reiciendis architecto molestiae odio corporis Architecto soluta optio quaerat expedita expedita. Neque volupccctate tempora magni consectetur suscipit ea. Architecto nihil vitae delectus a? Adipisicing consequuntur obcaecati dolorem quae reprehenderit Perspiciatis reiciendis architecto molestiae odio corporis Architecto soluta optio quaerat expedita expedita. Neque voluptate tempora magni consectetur suscipit ea. Architecto nihil vitae delectus a?

Option to have uniform highlighting?

One type of highlights changes the label's font color only (e.g. red), whereas another type changes the background and the font color (e.g. red bg, white font):

2021-06-29-02:00:27-screenshot

Is there any way to make it the former only? The latter is too low contrast so it's not easy on the eyes.

Also, why do the highlights differ anyway? Functionality, they seem to achieve the same purpose since they're of the same group of labels.

Error when using F when 'limit_ft_matches' is zero

When I set the line

lua require'lightspeed'.opts['limit_ft_matches'] = 0

And search with F or f (Fa or fa) for example and then try to reverse the search with F I get the warning not found: [character typed] and I have to press F twice for each reverse jump. The problem goes away when I set limit_ft_matches to a value of one or greater. The problem does not occur using T.

Visual mode, 'S' for backward selection not working

Just installed and using standard config:

require("lightspeed").setup({})

In visual mode, using 's' to select forwards works as expected. However, 'S' from visual mode does not. It stays in Visual mode but does not enter 'lightpeed'.

Consider removing F/f/T/t search from lightspeed and splitting it into a different plugin

It is a good functionality that I've come to like. There were some design decisions I wasn't sure of but after thinking about it I've come to like it. But I think it would be more elegant/UNIX-philosophy compliant if this was in a separate plugin. I know that someone who doesn't want these features can just unmap them but I think it is more elegant and maintainable to only add what you want to your config, as opposed to adding and removing.

An alternative would be a boolean option of whether to include this functionality rather than making it the responsibility of the user to write unmaps.

Cursor color changing when lightspeed is active

πŸ‘‹πŸΌ,

I explicitly set my cursor color in alacritty which help me track it. The cursor color changes when lightspeed is activated though - which is very confusing to me and I have a really hard time seeing where my cursor is.

Not active:
2021-06-28_12-31

Active:
2021-06-28_12-31_1

This is highly noticable when using t or f repeatedly. The cursor color changes depending on the syntax highlighting and it's just confusing...

Is there an option to disable this or is it possible to add one? πŸ™πŸΌ

If the third character make the match unique, use that third character to jump and why the reminder character should stay on screen

If the third character make the match unique, use that third character to jump, this way we can reduce the "surprise" factor.

In this case if I search for pr there are only 2 possibilities: project and previousTctTask_
fullScreen
The ideal it would be I could jump to project with o and previousTctTask_ with e

The jump to the first match could be automatically, but you get the idea.

Also, it is necessary that r when I have already pressed pr?
Captura de pantalla de 2021-06-15 20-52-37

Semicolon (;) and Comma (,) repeats not working when mapping with : instead of <CMD>

Hi, this is a relatively small issue but when changing the command triggers found in the help for ; and , repeating, it stops working in visual mode. (Changing the <cmd> to :). When trying to use ; or , in visual mode, it doesn't expand the selection after the first search with f or t. However, it works fine when I do what the help says. I'm not sure if this is a Neovim or Lightspeed issue so if it doesn't seem like a Lightspeed issue (or if it's a non-problem) feel free to just resolve this.

Thank you

A way to map repeat `s` motions? (Hopefully with `;`/`,` as well)

Thanks for this plugin!

Just like there is a way to map ; and , (or custom keys) to repeat f/t motions, is there a way to map keys to repeat s (2-key) motions? If not, is there a way to repeat them at all? perhaps, by pressing s again?

It isn't currently documented and I tried to do it myself adhoc by adjusting the example for ft but from looking at the code, the ft and the s tables aren't exactly identical so I couldn't simply adjust the code in the documentation to apply to s.

I wonder if it's just a niche use-case? I'm using 2-key motions for everything; same line, next line or across half a screen. I find that the cost of pressing the second character is almost zero and the benefits it brings in disambiguation to reduce the number of matches is big. I also have jump-to-first-match enabled.

Thanks again!

Can't extend visual selection if (vim) windows show different buffers

If you have multiple (VIM) windows open which show different buffers lightspeed commands (s, S, f, t, F, T) will exit visual mode.

Example

  • open neovim
  • split the current buffer :sp
  • switch to visual mode and try e.g. f i, f, f etc.
    • The selection should be extended as one would expect
  • switch one of the windows to another buffer
  • switch to visual mode and try e.g. f i, f, f etc.
    • The cursor jumps but we're back in normal mode

lightspeed

Minimal NVIM configuration used in the example
local install_path = vim.fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
local is_packer_installed = vim.fn.isdirectory(install_path) == 1
if not is_packer_installed then
    vim.api.nvim_command('!git clone https://github.com/wbthomason/packer.nvim ' .. install_path)
end

require('packer').startup(function(use)
    use 'wbthomason/packer.nvim'
    use 'ggandor/lightspeed.nvim'
end)

I have had a look in the code, but could not see what could cause this behavior πŸ™

Missing target

Running command Se and I noticed that I don't get a prompt for one of the e's above

16a43856ef7e10d8fd29265e9a976619

Resizing the window during an action moves the view to the actual cursor position

Hello!
I understand that this the cursor being moved to this "blank portion"(for lack of a better term) is intended behavior, but how can the resizing of the editor itself be handled?

Here's a video showing the said behavior using 2 character search and f:

lightspeedcursorresize.mp4

I have a few of ideas on how it could work, simplest of them being:

VimResize autocommand on start -> winrestview(winsaveview-saved-somewhere) -> disable autocommand on end

But then how best would it be best to implement the saving of window view?
Since there is no VimResizePre auto command, Would it be a CursorMoved autocommand that enables when lightspeed is active? Or would it be better to use a completely different approach?

Sorry for the questions, curious about what approach others would take :D

Issue with f/t's same-key repeat

Thanks for creating this plugin. I'm liking it so far but I encountered one issue where the native f/t was nicer (or I'm doing it wrong πŸ˜‰)

Imagine this situation where | is the cursor.

 |   hello abcade

When I would want to delete abca.

With native f I would type fad;.

With lightspeed I haven't found a way except fadfa. I would have expected fadf<CR> to work but this deleted until the end of line.

nvim_echo is nil value

I'm getting:

E5108: Error executing lua /home/mc/.vim/plugged/lightspeed.nvim/lua/lightspeed.lua:35: attempt to call field 'nvim_echo' (a nil value) when I try hitting s after installing via Plug.

I've pulled the very latest Neovim nightly (Ubuntu) on two different machines:

> apt policy neovim
neovim:
  Installed: 0.5.0+ubuntu2+git202106150022-b28d458f8-d569569c9-e70091b15~ubuntu18.04.1
  Candidate: 0.5.0+ubuntu2+git202106150022-b28d458f8-d569569c9-e70091b15~ubuntu18.04.1
  Version table:
 *** 0.5.0+ubuntu2+git202106150022-b28d458f8-d569569c9-e70091b15~ubuntu18.04.1 500
        500 http://ppa.launchpad.net/neovim-ppa/unstable/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status
     0.4.4-1~ubuntu18.04.1~ppa1 500
        500 http://ppa.launchpad.net/neovim-ppa/stable/ubuntu bionic/main amd64 Packages
     0.2.2-3 500
        500 http://au.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages

I've also tried a minimal vimrc file with only this Plug install and nothing else - same error.

This looks like a Neovim / Lua API problem - It was my understanding that Lua was now bundled with Neovim. Is there some way to check I have a compatible version of Lua compiled into Neovim correctly?

Tui support for highlighting

The Highlighting groups don't provide any cterm definitions for the TUI.
I found in lua/lightspeed.lua around line 175 the definition of the highlight groups

Is a target of this project to support TUI too?, then I could open a PR with my changes to discuss a possible implementation.

Quick-Scope like functionality.

Over at LunarVim we are wanting to integrate lightspeed, some users also want to have quick-scope installed, but this is vim-script only.

Would this functionality be something you'd consider adding to lightspeed (or accepting a patch for)..

It would be great to have the one lightspeed plugin to rule them all.

sneak#is_sneaking() equivalent

I have a mapping which looks like this:

nmap <expr> ; sneak#is_sneaking() ? '<Plug>Sneak_;' : ':'
vmap <expr> ; sneak#is_sneaking() ? '<Plug>Sneak_;' : ':'

Basically means map ; to : when not in "label mode" otherwise let the plugin handle the mapping.

Is it currently possible to have the same behavior?

Disable conceallevel while lightspeed is active

the problem is that when conceallevel > 0 you can't really see where you are trying to jump to. So it would make to disable conceal while jumping.

Is there anyway easy way to do this? or could this be feature of this plugin?

Interested in porting to Emacs?

Hi, first of all I want to say this is an amazing plugin! I consider this to be an essential plugin in my workflow now. Not really an issue but since you have implemented this in Lisp, I was wondering if you are interested in implementing this plugin in Emacs? Evil-snipe and Avy are substitutes for vim-sneak and EasyMotion, but I don't think there is anything like lightspeed in Emacs.

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.