Skip to content

Commit

Permalink
Merge pull request #12 from ice9js/1.2
Browse files Browse the repository at this point in the history
Fixed remaining issues and updated readme
  • Loading branch information
ice9js committed Jul 8, 2015
2 parents 170fc05 + 5fa88af commit a6affb6
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
39 changes: 29 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@ 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, character and line modes which make jumping even easier.
Like it's emacs counterpart, AceJump for sublime features word (on the image below), character and line modes which make jumping even easier.

![AceJump Word Mode Labels](http://crystalplanet-studio.com/img/acejump/acejump.jpg)

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

At the moment only the only way to install the plugin is to do so manually.
To install AceJump, clone this repository into your Packages directory. (Preferences > Browse Packages)
Make sure the directory is named *AceJump* and not *ace-jump-sublime*!
You can install AceJump for sublime 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

Expand Down Expand Up @@ -39,6 +47,21 @@ Labels all non-empty lines and lets you jump to one of them.
- ```Ctrl/Super + Shift + l```
- ```<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

### Multiple cursor mode

After triggering multiple cursor 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)

### 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.
Expand All @@ -52,9 +75,5 @@ If you wish to create your own bindings, you should bind them to these commands:
- ace_jump_word
- ace_jump_char
- ace_jump_line

## Contributing

Feel free to create an issue to report a bug or if you have a feature proposal and I'll see what I can do about it. You're also welcome to send in any pull requests.

## Notes
- ace_jump_select
- ace_jump_add_cursor
8 changes: 6 additions & 2 deletions ace_jump.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,22 @@ def add_labels(self, regex):

global last_index, hints

self.breakpoints = []

last_index = 0
hints = []

self.views = self.views_to_label()
self.changed_views = []
self.breakpoints = []
changed_files = []

for view in self.views[:]:
if view.file_name() in changed_files:
break

view.run_command("add_ace_jump_labels", {"regex": regex})
self.breakpoints.append(last_index)
self.changed_views.append(view)
changed_files.append(view.file_name())

if next_search:
break
Expand Down

0 comments on commit a6affb6

Please sign in to comment.