Comments (15)
Oh, got it, Visual mode is also ok, I just forgot to use <cmd>
in the Vimscript example (the Lua snippet is fine). Correcting the docs in a minute.
from lightspeed.nvim.
Just tested it and if mapped before plugging, it indeed works 👍🏻
from lightspeed.nvim.
@andrevmatos Good catch! This is not because of the workaround, repeating with t/T
behaves the same way (edit: yeah, I see your edit now :D). I know where the problem is, raised a separate issue (#19). Thanks again for catching this.
from lightspeed.nvim.
Yeah not having the ability to prevent mapping fFtT and also not have the ;, work as expected is a is frustration/limitation with using this plugin...
from lightspeed.nvim.
You can disable that if you want, just map dummy key(seq)s to the corresponding <Plug>
keys (:h lightspeed-disable-default-mappings
). (Or, if you've been using Sneak: mapping f/F/t/T
to Sneak's corresponding commands also works.) As for mapping ;,
, I am working on a clean solution. I don't really want to encourage that, but I see that I should provide some workaround for people who (have to) use vanilla Vim a lot, and cannot undo the muscle memory.
from lightspeed.nvim.
I tried adding:
nnoremap lf <Plug>Lightspeed_f
nnoremap lF <Plug>Lightspeed_F
nnoremap lt <Plug>Lightspeed_t
nnoremap lT <Plug>Lightspeed_T
But it still remaps the default fFtF keys...
from lightspeed.nvim.
I don't really want to encourage that, but I see that I should provide some workaround for people who (have to) use vanilla Vim a lot, and cannot undo the muscle memory.
So how would you suggest to do it? If if do f,
it highlights all ,
but doesn't allow we to choose which to jump to. So is that a bug then?
from lightspeed.nvim.
I tried adding:
nnoremap lf <Plug>Lightspeed_f nnoremap lF <Plug>Lightspeed_F nnoremap lt <Plug>Lightspeed_t nnoremap lT <Plug>Lightspeed_T
But it still remaps the default fFtF keys...
You should use nmap
instead of nnoremap
when mapping to <Plug>
keys, since these should work recursively by nature - they are aliases for other mappings. But I don't recommend lf
, etc., because that will cause a lag every time you press the l
key. Use something like <C-F12>
for the prefix, that won't collide with anything... you get the idea.
from lightspeed.nvim.
I don't really want to encourage that, but I see that I should provide some workaround for people who (have to) use vanilla Vim a lot, and cannot undo the muscle memory.
So how would you suggest to do it? If if do
f,
it highlights all,
but doesn't allow we to choose which to jump to. So is that a bug then?
What do you mean by choosing which to jump to? There are no labels for f/t
searches in this plugin, but you can repeat them (by pressing the same key again), and thus move forward/backward, or give them a count, like 3fa
, just like with the native f/t
.
There is a bug with the workaround I just commited (Visual mode is not so simple, Normal is fine now), so the ;,
issue is still pending, but working on it...
from lightspeed.nvim.
It still remaps f...
I now have:
nmap <C-F9> <Plug>Lightspeed_f
nmap <C-F10> <Plug>Lightspeed_F
nmap <C-F11> <Plug>Lightspeed_t
nmap <C-F12> <Plug>Lightspeed_T
And when I open a new nvim and type :verbose nmap f
I get this:
from lightspeed.nvim.
I tested the workaround for ;,
and it seems to work great (at least in normal mode). So in that case I don't mind that fFtT are remapped, I can use them in the same fashion now 👍🏻
from lightspeed.nvim.
It still remaps f...
I guess the problem is that you remapped them after the plugin has loaded... (it simply cannot be anything else). Would you please try that again, putting those lines before the Plug
section, so that we can close this? Thanks very much!
from lightspeed.nvim.
The suggested fun!
doesn't seem to work on visual selection for t
/T
: if I'm visually selecting with t
, and type ;
, it seems to recall previous f
operation, instead of the current t
one
from lightspeed.nvim.
@andrevmatos You probably used a simple :call
, instead of <cmd>call
, isn't that the problem? It should work with the latter, I cannot reproduce the issue.
from lightspeed.nvim.
@ggandor thank you for your response, I had just copied the command from a previous commit, and it was not working because I had some t?
binds on my config which seems to prevent t
moving from working properly in x/v
mode.
Unfortunately, it's still not working perfectly: by moving with f
, I can move correctly between two consecutive occurrences of a character with ;
and back with ,
, but if I try to do the same with t
, it seems that the first time I switch between ;
and ,
, it skips one occurrence. e.g. if I'm in the beginning of a line with 4 letters x
, and type tx
, it'll go to the 1st x
, pressing ;
will go to the 2nd, and again, to the 3rd and 4th, but then if I press ,
, it'll jump to the 2nd, and again to 1st, and back to ;
will jump to 3rd and 4th, skipping next char occurrence when switching between moving with ;
and ,
.
This is seem both on normal and visual selection modes. It doesn't occur with f
.
Thank you again for your support and the great plugin.
Edit: noticed this "skipping" also happens when alternating between prev/next occurrence with Tt
as well, not only with ;,
, so I'd say this is a small unrelated bug.
from lightspeed.nvim.
Related Issues (20)
- Update configuration in init.vim HOT 6
- Control timeout of instant jump/instant repeat labels separately HOT 4
- Error in `set_editor_opts` in `LightspeedLeave` autocommand HOT 3
- fatal: invalid reference: master when Installing or Updating with vim-plug HOT 1
- A suggestion for f/t HOT 3
- Problems when setting safe_labels = {} HOT 1
- Error on yank after jumping HOT 1
- Features Request: Search all windows in the tabpage HOT 1
- Configurable delay/timeout for f motions HOT 1
- Option to add characters to special character list HOT 1
- Lightspeed overwriting neogit shortcuts HOT 4
- Newly installed lightspeed.nvim throws error. Doesn't override nvim defaults. HOT 2
- Potential matched words get highlighted, doesn't go away HOT 2
- Matching Issues HOT 2
- lightspeed with vim-multiple-cursors
- Lightspeed resets scrolloff to 0 HOT 1
- automatically exit f/F HOT 3
- multibyte bug with display bounds computation HOT 2
- how to begin troubleshooting if plugin does not seem to have mapped keys? HOT 2
- Cursor not refreshing.
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 lightspeed.nvim.