mishkun / ideavim-sneak Goto Github PK
View Code? Open in Web Editor NEWVim-sneak for IdeaVim!
License: Other
Vim-sneak for IdeaVim!
License: Other
S keyword conflict with vim-surround S
Hey,
Thanks for your work first of all.
I installed this right away because I've been missing the functionality of sneak for some time now.
However, the behavior of the forward and backward jump is not correct,
it is supposed to also search vertically, but this plugin only searches within the same line.
In vim-sneak, you can set g:sneak#use_ic_scs
.
From :help sneak
:
g:sneak#use_ic_scs = 0
0: Always case-sensitive
1: Case sensitivity is determined by 'ignorecase' and 'smartcase'.
Ideavim already supports set ignorecase smartcase
, so this setting would take that into account.
In vim-sneak, you can set let g:sneak#s_next = 1
, allowing you to repeat the match using s
(forward) or S
(backward) once you've entered both characters.
In clever-f, you can do the same for the f
and t
keys.
Benefits:
;
and ,
;
to :
to type commands more easily)If the plugin is set in the rc file any mappings for f
and t
keys does not get activated unless I edit the rc file and manually resource the file.
I have also created an issue with idea-vim
Greetings,
On vim, I make extensive use of
let g:sneak#label = 1
From vim-sneak's help pages:
Label-mode minimizes the steps to jump to a location, using a clever interface
similar to EasyMotion. If enabled, Sneak overlays text with "labels" which can be jumped-to by typing the label character.
I think it would be nice to have it as an option in Ideavim as well.
err is ,
java.lang.NoClassDefFoundError: com/maddyhome/idea/vim/option/OptionsManager
at io.github.mishkun.ideavimsneak.IdeaVimSneakExtension$Direction.matches(IdeaVimSneakExtension.kt:150)
at io.github.mishkun.ideavimsneak.IdeaVimSneakExtension$Direction$FORWARD.findBiChar(IdeaVimSneakExtension.kt:129)
at io.github.mishkun.ideavimsneak.IdeaVimSneakExtension$Companion.jumpTo(IdeaVimSneakExtension.kt:118)
at io.github.mishkun.ideavimsneak.IdeaVimSneakExtension$Companion.access$jumpTo(IdeaVimSneakExtension.kt:110)
at io.github.mishkun.ideavimsneak.IdeaVimSneakExtension$SneakHandler.execute(IdeaVimSneakExtension.kt:69)
at com.maddyhome.idea.vim.extension.VimExtensionHandler.execute(VimExtensionHandler.kt:24)
at com.maddyhome.idea.vim.key.ToHandlerMappingInfo.execute$lambda$2(MappingInfo.kt:188)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:225)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:177)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:167)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:153)
at com.maddyhome.idea.vim.helper.IjActionExecutor.executeCommand(IjActionExecutor.kt:201)
at com.maddyhome.idea.vim.key.ToHandlerMappingInfo.execute(MappingInfo.kt:186)
at com.maddyhome.idea.vim.command.MappingProcessor.handleCompleteMappingSequence(MappingProcessor.kt:181)
at com.maddyhome.idea.vim.command.MappingProcessor.handleKeyMapping$vim_engine(MappingProcessor.kt:58)
at com.maddyhome.idea.vim.KeyHandler.handleKey(KeyHandler.kt:110)
at com.maddyhome.idea.vim.key.ToKeysMappingInfo.execute(MappingInfo.kt:101)
at com.maddyhome.idea.vim.command.MappingProcessor.handleCompleteMappingSequence(MappingProcessor.kt:181)
at com.maddyhome.idea.vim.command.MappingProcessor.handleKeyMapping$vim_engine(MappingProcessor.kt:58)
at com.maddyhome.idea.vim.KeyHandler.handleKey(KeyHandler.kt:110)
at com.maddyhome.idea.vim.KeyHandler.handleKey(KeyHandler.kt:65)
at com.maddyhome.idea.vim.VimTypedActionHandler.execute(VimTypedActionHandler.kt:80)
at com.intellij.openapi.editor.actionSystem.TypedAction.lambda$actionPerformed$2(TypedAction.java:198)
at com.intellij.reporting.FreezeLoggerImpl.runUnderPerformanceMonitor(FreezeLoggerImpl.java:28)
at com.intellij.openapi.editor.actionSystem.TypedAction.actionPerformed(TypedAction.java:197)
at com.intellij.openapi.editor.impl.EditorImpl.processKeyTypedNormally(EditorImpl.java:1325)
at com.intellij.openapi.editor.impl.EditorImpl.processKeyTyped(EditorImpl.java:1307)
at com.intellij.openapi.editor.impl.EditorImpl.processKeyTyped(EditorImpl.java:3621)
at com.intellij.openapi.editor.impl.EditorImpl$6.keyTyped(EditorImpl.java:1139)
at java.desktop/java.awt.AWTEventMulticaster.keyTyped(AWTEventMulticaster.java:247)
at java.desktop/java.awt.AWTEventMulticaster.keyTyped(AWTEventMulticaster.java:247)
at java.desktop/java.awt.AWTEventMulticaster.keyTyped(AWTEventMulticaster.java:247)
at java.desktop/java.awt.Component.processKeyEvent(Component.java:6612)
at java.desktop/javax.swing.JComponent.processKeyEvent(JComponent.java:2892)
at java.desktop/java.awt.Component.processEvent(Component.java:6434)
at java.desktop/java.awt.Container.processEvent(Container.java:2266)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:886)
at java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1166)
at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1023)
at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:849)
at com.intellij.ide.IdeKeyboardFocusManager.access$dispatchEvent$s1569605750(IdeKeyboardFocusManager.kt:18)
at com.intellij.ide.IdeKeyboardFocusManager$dispatchEvent$1.invoke(IdeKeyboardFocusManager.kt:25)
at com.intellij.ide.IdeKeyboardFocusManager$dispatchEvent$1.invoke(IdeKeyboardFocusManager.kt:25)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1014)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1014)
at com.intellij.ide.IdeKeyboardFocusManager.dispatchEvent(IdeKeyboardFocusManager.kt:25)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4904)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2809)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:794)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:766)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:764)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:763)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:695)
at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.kt:623)
at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$11(IdeEventQueue.kt:581)
at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:75)
at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:67)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:581)
at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:72)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:355)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:354)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:793)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:354)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:349)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1014)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:114)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1014)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:349)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:848)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:391)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
Caused by: java.lang.ClassNotFoundException: com.maddyhome.idea.vim.option.OptionsManager PluginClassLoader(plugin=PluginDescriptor(name=IdeaVim-Sneak, id=io.github.mishkun.ideavimsneak, descriptorPath=plugin.xml, path=~\AppData\Roaming\JetBrains\Rider2023.3\plugins\ideavim-sneak, version=1.2.0, package=null, isBundled=false), packagePrefix=null, state=active)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.kt:156)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
... 90 more
I'm quite used to using 's' to replace a single character.
Is there a way to remap 's' in IdeaVim ?
In regular Vims, one would use nnoremap <a-s> <Plug>Sneak_s
, but it doesn't work in PyCharm.
SOLUTION:
Use nmap <a-s> <Plug>(sneak-s)
. Note: nnoremap
does not work.
s
and S
don't work in visual move with plugin enabled
I would like ;
and ,
to move across lines, but nothing happens when I press ;
/,
after I run out of matches on the current line.
I have
Hey,
what is the reasoning that you made this a separate plugin as opposed to merging it to the IdeaVim repo?
I would personally prefer it that way, but interested to hear your thoughts:)
I use pycharm 2018.3.7 pro, because I only has this liscense, I like this plugin, it's more suitable for me rather than easy-motion plugin, but I can't install it in my older version of pycharm sadly ๐ข
like there is nmap s
/ S
shouldn't there be a omap z
/ Z
& x
/ X
?(z
would act as f
and x
as t
)
The license section says that this plugin is licensed under GPL-2.0: https://github.com/Mishkun/ideavim-sneak#license
But the license file itself refers to GPL-3.0: https://github.com/Mishkun/ideavim-sneak/blob/master/LICENSE.txt
The "license" link on the plugins page refers to GPL-3.0 as well.
Hello, I have the following in .ideavimrc
"Remap vim sneak and restore s functionality"
nmap <leader>lb <Plug>(sneak-S)
nmap <leader>lf <Plug>(sneak-s)
:nmap s s
:nmap S S
I've tried with and without :
, I can use s normally only until I close the IDE, if I relaunch it again It goes back to using vim-sneak with s or S (My custom mappings still work alongside s-S)
Idea vim version: 2.7.5
IdeaVim-Sneak version:1.2.0
If IdeaVim-Quickscope is installed and enabled, when you use ideavim-sneak with a set of characters and then use f
/F
/t
/T
, when you use ;
or ,
afterwards, the cursor moves to the next sneak set instead of the character used with f
/F
/ t
/T
.
The screencast doesn't show what I was pressing on my keyboard, so here's the series of events:
sOT
then ;
to go to the next sneak matchk
three times to go up, then ^
to go to the start of the line's textfN
to go to the next "N" in "NEW";
and instead of going to the "N" in "NOT", the cursor jumps to the "OT" in "NOT"$
to go to the end of the line and then Fo
to go to the previous "o";
and instead of repeating Fo
, the cursor jumps to "OT" againVersions:
It's not possible to define mapping to f
for the ideavim-sneak inside of .ideavimrc.
This happens because the extension ideavim-sneak is always loaded after .ideavimrc execution and overrides my f
mapping. Also, it sets mapping to s
even I defined a different one.
The common vim approach to that is to set the mapping only in case there are no other mappings to the target combination, so instead of map a b
they use if hasnomap('b') { map a b }
. This approach is also possible with IdeaVim, but you need to bump IdeaVim version to be able to use com.maddyhome.idea.vim.extension.VimExtensionFacade#putKeyMappingIfMissing
instead of VimExtensionFacade.putKeyMapping
.
AlexPl292@7bc0cc9#diff-70f746b80ee793cd4c788716eb5f0e7435f1ac6e81e0f73af0ee9dbc641acbbeR39
Right now sneak action does not cancel on esc press, waiting for another keystroke. We should cancel sneak action on esc and exit action handler
There is an issue that I discussed it here: JetBrains/ideavim#288 with the IdeaVim maintainer:
At the moment setting plugin options in .ideavimrc only works if done before the set sneak
line.
For example this doesn't work:
set sneak
let g:sneak_clevers = 1
but this does:
let g:sneak_clevers = 1
set sneak
I'll quote the IdeaVim maintainer:
Do you have the line with let g:sneaksnext=1 after set sneak line?
If yes, the line with your option was not yet parsed at the moment when sneak is initialized.
But this is incorrect behaviour and you should update IdeaVim dependency from 0.61 to 0.66.
However, the problem is that 0.66 version of IdeaVim has 2020.2+ compatibility and this plugin is 2020.1+.
So, you have two options:
- bump up the versions of IdeaVim dependency and IJ
- Make a note that line with the option should stand before set sneak
Not sure what is more convenient for you, but I thought you should be notified.
Also I think it should be good to mention for future contributions that the #
symbol isn't currently supported (let g:sneak#clever_s = 1
won't work).
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.