Giter Club home page Giter Club logo

ideavim-sneak's People

Contributors

alexpl292 avatar citizenmatt avatar jannes avatar mishkun 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

Watchers

 avatar  avatar  avatar  avatar

ideavim-sneak's Issues

Supported versions of IJ

For now, the plugin supports 2020.1.* versions of IJ. Is it possible include the 2020.2.* and 2020.3.* versions of IJ as well, or there are some incompatibilities? Special thanks if it would be possible to leave an empty "until-version", so the plugin could also be used from IJ nightly builds.

image

s/S does not jump vertically

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.

Support ignorecase and smartcase

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.

Support clever functionality

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:

  • Easier to use
  • Reduces the amount of keys you have to work with by getting rid of ; and ,
  • Free to remap the other keys (e.g. ; to : to type commands more easily)

Support for labels

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.

ideavim-sneak error in ideavim 2.8.0

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

How to remap 's' ?

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.

f, F, t, and T do not move across lines

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

  • IdeaVim 2.2.0
  • IdeaVim-QuickScope 1.0.11
  • IdeaVim-Sneak 1.2.0
  • PyCharm 2023.2 EAP (Professional Edition)

Why not merge as extension in IdeaVim repo?

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:)

Can this plugin support older version of idea?

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 ๐Ÿ˜ข

Support for operators

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)

Unmap for default keymapping isn't persistant

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

Sneak overrides ;/, for f/t/F/T when IdeaVim-Quickscope is installed

simplescreenrecorder-2023-05-04_11 28 07

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 match
  • k three times to go up, then ^ to go to the start of the line's text
  • fN to go to the next "N" in "NEW"
  • Here's where the bug is. At this point I press ; 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"
  • Here's the bug again. ; and instead of repeating Fo, the cursor jumps to "OT" again

Versions:

  • idea-sneak 1.2.0
  • IdeaVim 2.2.0
  • IntelliJ IDEA 2023.1.1 (Ultimate Edition)
  • IdeaVim-Quickscope 1.0.11

ideavim-sneak doesn't use mappings from .ideavimrc

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

Cancel sneak action on ESC pressed

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

Bump up IdeaVim version

@Mishkun

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).

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.