Git Product home page Git Product logo

ace-jump-sublime's Introduction

AceJump

A plugin for Sublime Text 3 heavily inspired by AceJump for emacs.

AceJump allows you to move the cursor to any character to any place currently on screen. To clarify, you can jump between characters in all visible portions of currently open documents in any panes. Like it's emacs counterpart, AceJump for sublime features word (on the image below), character and line modes which make jumping even easier.

AceJump

After selecting a mode, you type in a character (except in line mode, where you don't have to type in anything) and appropriate labels are displayed. Then all you need to do is press the key from the label and voila!

Installation

PackageControl

You can install AceJump from PackageControl by following the steps below:

  • Open up the command palette and select Package Control: Install Package
  • Wait for the packages index to load and select AceJump

Manual installation

You can install AceJump manually using git by running the following command within sublime packages directory (Preferences > Browse Packages):

$ git clone [email protected]:ice9js/ace-jump-sublime.git AceJump/

Or you can just copy the contents of this repository into Packages/AceJump.

Usage

Word mode

Goes to a word starting with the given character. This mode works only with alphanumeric characters. If you're interested in jumping to a special character, use character mode instead.

  • Ctrl/Super + Shift + ;
  • <head character>
  • <label>

No need to press enter after selecting a label!

Word mode

Character mode

Goes to an occurence of the given character.

  • Ctrl/Super + Shift + '
  • <character>
  • <label>

Character mode

Line mode

Labels all non-empty lines and lets you jump to one of them.

  • Ctrl/Super + Shift + .
  • <label>

Line mode

Within Line mode

Labels all words within the line where current cursor locate and lets you jump to one of them.

  • Ctrl/Super + Shift + ,
  • <label>

Select mode

After triggering select mode, the next jump will select everything inbetween the current cursor position and the selected label. When select mode is triggered, the next jump is limited to the current file.

  • Alt+; (Ctrl+; for OS X)
  • perform a jump using word, character or line mode

Select mode

Multiple cursors mode

After triggering multiple cursors mode, the next jump will add a new cursor to the view instead of moving the existing one. Again, when this mode is triggered, only jumps in the same file are available.

  • Alt+' (Ctrl+' for OS X)

Multiple cursors mode

Jump-after mode

In this mode, the cursor will jump behind the targeted instance. Unfortunetely, this mode cannot be paired with select or multiple cursors mode yet.

  • Alt+. (Ctrl+. for OS X)

Jump-after mode

Batching

In case there are more places to jump to than labels available, labels will be batched and you can cycle through them by simply pressing enter.

Batching

Customization

In order to access AceJump settings, go to Preferences > Package Settings > AceJump > Settings - User.

Key bindings

Go to Preferences > Package Settings > AceJump > Key Bindings - User. You can then override the bindings for any of the following commands:

  • ace_jump_word
  • ace_jump_char
  • ace_jump_line
  • ace_jump_within_line
  • ace_jump_select
  • ace_jump_add_cursor
  • ace_jump_after

The commands accept an optional Boolean current_buffer_only argument. When present and set to true, AceJump only performs on the currently edited buffer.

Labels

You can override the labels setting to provide your own set of labels to be used by AceJump.

Highlighting

You can also set the syntsx scope that's used for highlighting by overriding labels_scope. The default scope is invalid.

Case sensitivity

Ace jump is case sensitive by default. Case sensitivity can be toggled on and off by altering the search_case_sensitivity setting.

Jumping behind the last character in a line

By setting jump_behind_last_characters to true, AceJump will jump behind a character if it's the last character on a line, without the need to trigger jump after mode. This only works in character mode and is switched off by default.

Known issues

It has been reported that the Select mode, Multi cursors mode and Jump after mode might not work using the specified keybinding.
As a workaround for that follow these steps:

  • Start a regular search, e.g. word search (default keybinding: Ctrl+Shift+;).
  • Before entering any character, activate the advanced mode (e.g. for Select mode use Alt+;).
  • Now enter the character to lookup.
  • Use the label to go to the corresponding location.

ace-jump-sublime's People

Contributors

aziz avatar bismarck2100 avatar ice9js avatar ishanray avatar mango1234 avatar mreq avatar nikhilmitrax avatar omanf avatar vladmrnv 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ace-jump-sublime's Issues

Add line mode

After completing #1, a line mode can be added, where labels are displayed for each line.

Code clean-up

AceJump's development was rushed and the code could use a clean-up.

Enter line number at ace_jump_line prompt

Hi there, would it be possible to support entering line numbers at the the ace_jump_line prompt? This would be awesome for debugging purposes and would make the experience more in line with Emacs avy.

Setting "placeholder_chars"?

Thanks for the plug.
Will the setting "placeholder_chars" and override the highlight color for jump targets in EasyMotion?

Add a select mode

A select mode could be added.
After triggering it, the next jump would select everything inbetween the current cursor position and the label (included).
When triggering select mode, the labels should be displayed only on the currently active file, even when working with multiple panes.

Always in Select Mode

Whenever I perform a jump, text is always selected.

I'm using Super+Shift+; then typing r to get to the first require call. Notice that the text from the beginning of the document to the character I select is selected.

See screencast:
ace-jump bug

OSX 10.10.4 - ST3 b3083

AceJump causes exit from visual mode in Vintageous

When I'm trying to select end selection position with Ctrl+Shift+', Visual mode changes to Normal. I guess it should be fixed in AceJump rather in Vintageous. Sorry if this is unrelated to your plugin.

"ace_jump_word" doesn't work with cyrillic

ace_jump_word command doesn't work with cyrillic letters, instead the plugin reopens the panel without showing results. Strangely ace_jump_char does work. The file encoding I tried this with is UTF-8, and it is the latest version of ST3.

It would be a nice touch if the labels were in cyrillic too if a cyrillic char is used (ordered according to the russian alphabet as the most used cyrillic alphabet, or this could be made user modifiable for serbian, ukranian alphabets etc.) so a user wouldn't need to change the keyboard layout every time if working with an all-cyrillic text.

Input a non-matched character then cancel loses cursor position

Hi,

It looks like the cursor position is loss after trying to jump to a non-matched character and then cancel (by pressing Escape or entering random letter). This works fine with any matched character, just the non-matched ones don't work, this behavior is a little bit annoying.

System Configuration

Sublime Text: Version 3 dev build 3119
Ace Jump: Version 1.5.0 (installed with package control)
Vintage/Vintageous: No

To Reproduce

  1. Having a text of something like "Hello World".
  2. Put the cursor somewhere in the text.
  3. Hit key combination for Character jump (other modes don't work too).
  4. Enter v (non-matched character). No match is found, no highlight is shown.
  5. Press Esc or any character.
  6. Cursor doesn't go back to its original position.

Animated screenshots

How did you do these cool animated screenshots @ice9js (in README.md) ? I tried a lot of software, but I always have difficulty to produce such nice GIF. What did you use?

This is awesome, but some functions do not work

My computer is mac,version: 10.10.4
sublime version : 3114
"ace_jump_select,ace_jump_add_cursor,ace_jump_after" These commends do not work, though i set custom short-key for these commend.
Thanks for your help!

Only word mode works

Hey,

I can only get super+shift+; to work. None of the other hotkeys seem to work. I have tried remapping them to different keys and/or adding the alt key but no dice.

I'm on ST3 and Mac OS

Cycling back with shift+enter

It would be nice if we can go back to the previous highlight by pressing shift+enter. In my case, I have a big screen and have to cycle a lot. Sometimes I step past where I really wanted to be and have to start cycling again from the beginning.

Thanks

Syntax specific typeface and size (fonts)

The jump view looks very disorienting in some syntaxes because I have specified syntax specific typefaces and sizes (e.g., code vs prose). Ace Jump should see if there is a syntax specific specification and use that instead of the generic one.

Multiple views for one file

The plugin makes a mess when multiple views are open for the same file.
A possible solution would be to use batching, and show the labels in only one of those views at a time.

Select mode, multiple cursor mode and jump after mode not working

Sublime Text Build 3126:

I tried in a Windows 7 machine and none of the above modes can be activated with the default key bindings. Changing key bindings does not fix the issue too. Later I tried in a MacBook and the above modes cannot be activated too.

Are these modes currently working?

Give a option for Ace Jump to highlight occcurences of char/line/word throught the file and not just the current view.

Currently "Ace Jump Char" only highlights the occurences of a character that are in the current view. It won't highlight any of the occurences of that character that are above or below the visible lines of code and switching between batches by hitting enter is also not possible. I am not sure if this is by design or just a limitation of Ace Jump. A workaround I have found to select content between 2 chars is to put my cursor behind the first occurence of the char, turn on "Ace Jump Select" mode and then use "Ace Jump Line" mode. This will at first mark only the lines in the current view but hitting enter will turn on batching, which will highlight the next batch of lines. keep hiting enter until you reach the line where the 2nd occurence of the char you want to select upto occurs and select that line, this will select everthing between the 1st char and this line. Please make it straight forward to select the content between any 2 occurences of a character.

Support for "Within Line" motion

Hi, thanks for a great plugin, I use it a lot.

I come from Vim background and in Vim there is the Easymotion plugin which allows for within line motion, that is, which just one command, the beginning of each word in the current line is highlighted/marked so you just have to enter the key corresponding to the word you want to go to. I find this a bit faster than looking and typing for a particular character and then go to it.

It would be great if you can implement this feature in future versions of your plugin. Thanks!

Add possibility to jump after found instance

If I understood it correctly, right now there is no way to make the plugin jump behind a character or word or whathaveyou. This'd be a great feature to have. Maybe one could make it work by holding down a modifier key while pressing on the label.

Should work relative to wanted letter instead of alphabetic.

Wouldn't it be nice if I did something like "Shortcut+k" and the first occurrence of the letter was placed on the key I was searching for (I.E the letter k in this case) instead of on "a" every time?
The rest of the occurrences would then be placed from the letter in question instead of alphabetically.
If we use k as an example on a regular qwerty, it would then be:
First occurrence: "k",
Second occurrence: "l",
third occurrence: "j",
fourth occurrence: "m",
etc....

I think that would boost the speed at least for me, by about 100%.

Runs out of selections at 'Z' - could it extend to numerical values?

First of all - I love this functionality. Thanks for the great plugin.

Edge case so something for a rainy day ;)

On a single page view, this works great. However, on a split view, on a large monitor, I run out of symbols in line view. E.g. if I enter line view and I have 100 lines on screen across two panes I only get indicators up to Z - any way this can be extended with numbers? I know it will only get another 10 lines but just a thought.

Thanks again for making this.

Double-use of key-binding breaks syntax highlight

Hi,

It looks like hitting bound key combination multiple times will break ace jump function. It may also leave ace jump highlighter on, which requires changing it back manually.

SublimeText version: 3 dev build 3119
Ace Jump version: 1.5.0 (installed with package control)

To reproduce:

  1. hit key combination (for word, char or line jump)
  2. hit another key combination (for word, char or line jump)
  3. enter character
  4. see how nothing happens

To reproduce leaving ace jump syntax highlight:

  1. hit key combination (for word, char or line jump)
  2. enter character
  3. hit another key combination (for word, char or line jump)
  4. see how nothing happens
  5. hit ESC or ENTER
  6. file stays with ace jump syntax highlighter

Even worse is that if you press any key between steps 3 and 4, you will modify file content.

This may be problematic, especially for new users of ace jump, who did not memorize key bindings perfectly yet :).

Maybe module could ignore second call until first one is done? Or, even better, change mode of first one and let user continue searching?

Respect view settings like hidden line numbers

I'm working or a markdown document and all my markdown documents don't have any line numbers.
whenever I use Acejump, which I love by the way, the jump screen adds back line numbers which cause a very annoying horizontal jump.

Labels not removed in any mode if text is edited before jumping the cursor

In any mode, if before choosing a label to jump to, the text content is edited, and then the jump is made, the labels don't get removed even after the jump has finished.
If the file is now saved, the labels get saved instead of the actual text content.
The following are screen shots detailing the same:

ace-1

ace-2

The labels remain even after the jump has finished:
ace-3

After saving the file:
ace-4

AttributeError: 'NoneType' object has no attribute 'settings'

When you use ace_jump_word with the follow key no work
{
"keys": ["ctrl+shift+b"],
"command": "ace_jump_word"
},

AttributeError: 'NoneType' object has no attribute 'settings'
Traceback (most recent call last):
File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 553, in run_
return self.run()
File "ace_jump in C:\Users\Casa\AppData\Roaming\Sublime Text 3\Installed Packages\AceJump.sublime-package", line 89, in run
File "ace_jump in C:\Users\Casa\AppData\Roaming\Sublime Text 3\Installed Packages\AceJump.sublime-package", line 40, in get_views_setting
AttributeError: 'NoneType' object has no attribute 'settings'

This is Sublime Build 3114 in Windows 7

Add a multiple cursor mode

A multiple cursor mode could be added.
After triggering the mode, the next jump would add another cursor at the selected location.
When using multiple cursor mode, labels should only be displayed in the currently active document.

Highlighting does not seem to work

After pressing Ctrl+Shift+; and pressing the letter 'g' all g's are highlighted, but not replaced by labels.

OS: Windows, current version
Sublime Text: 3.1.1, build 3176

Characte mode doesnt work

On my mac super+shift+' does nothing. Nothing happening in console either.

What's the best way to debug this?

If character is last in line, go to after character instead of before

For example:

console.log('logging');

call ace_jump_char

Char: ;

console.log('logging');|

I'm not sure how many people would prefer this, but could this be an option in the settings:

Its much easier to use backspace than the delete key if I want to delete the last character

AceJump only displays labels on editable files

When using the plugin on non-editable pages (e.g. default system pages, as opposed to user settings), the selected character is highlighted but not labeled.
Only on user-editable pages does the labels show,

selection_001

selection_002

Substitute tabs with spaces

Replacing a tab character (for example when in line mode) causes the text to jump.
We should be checking for the tab character in the substitution function and append an appropriate amount of spaces to the label if necessary to prevent this behavior.

Lines (or characters) previously hidden by another popup are not labelled.

Since get_active_views is called before any previous popups have disappeared (which happens due to the window.show_input_panel being called), the viewport does not represent the actual view while using the plugin.

This causes a part of the possible labeling to not be labelled.

Previous Popup:
screen shot 2017-10-28 at 03 52 24

Some labels missing:
screen shot 2017-10-28 at 03 52 31

This is probably not a very complex fix (call get_active_views after showing the input prompt), but it does seem nontrivial.

Not splitting lines when word wrapped is on makes jumping difficult to pick the location because text position changes

If you have a document that is soft word-wrapped like markdown or Latex and you issue a jump_to_word or jump_to_char it changes the word wrapping so it is really hard to visualize where you want to jump because all the text is now moved to a different location.

I noticed the problem is that it doesn't split up a line in the middle (eg. Table~\ref{tbl:chord_data_sets} will move to the next line unstead of being split across two lines). This then propagates down through the text so makes it really difficult to pick a location. Is there anyway around this besides hard wrapping each paragraph as then it works fine or turning word-wrapping off?

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.