Code Monkey home page Code Monkey logo

ace-jump-zap's Introduction

MELPA MELPA Stable

Ace Jump Zap

ace-jump-zap provides the functionality of zap-to-char and zap-up-to-char using ace-jump-mode. In a nutshell, you may trigger a key-binding to launch ace-jump-char-mode to vaporize all characters between the cursor and the selected character.

Installation

Recommended install from MELPA with M-x package-install ace-jump-zap.

Commands

Bind (ace-jump-zap-to-char) or (ace-jump-zap-up-to-char) to the key-binding of your heart's desire and zap away.

Alternatively, you can bind the helper functions (ace-jump-zap-to-char-dwim) and (ace-jump-zap-up-to-char-dwim). Calling them interactively will trigger (zap-to-char) and (zap-up-to-char) respectively, but with a prefix it will call the ace-jump-zap version.

Variables

ajz/zap-function

This is the function used for zapping between point and char. The default is 'delete-region but it could also be 'kill-region.

ajz/forward-only

Set to non-nil to choose to only zap forward from the point. Default will zap in both directions from the point in the current window.

ajz/sort-by-closest

Non-nil means sort the zap candidates by proximity to the current point. Set to nil for the default ace-jump-mode ordering. Enabled by default as of 0.1.0.

ajz/52-character-limit

Set to non-nil to limit zapping reach to the first 52 characters. This is only really useful with ajz/sort-by-closest set to non-nil. Enabled by default as of 0.1.0.

ace-jump-zap's People

Contributors

mwfogleman avatar waymondo 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

Watchers

 avatar  avatar  avatar  avatar  avatar

ace-jump-zap's Issues

Prioritise characters closest to point.

If I have the following file, where | is point:

<!DOCTYPE html>
<html>
    <head>
        <title>
        </title>
        <style type="text/css">
        </style>
    </head>
    <body>
        <p>foo| bar</p>
    </body>
</html>

If I call M-x ace-jump-zap-up-to-char <RET> < <RET>, I end up with:

zap_cropped

This is less useful -- it's rare that I would want to zap all the way to the beginning. This is particularly awkward when I'm zapping up to a common character, such as a space.

Could ace-jump-zap ensure that the characters closest to point are prioritised? I'd like something like this:

Bbody>
  Ap>foo| bara/p>
b/body>

so the closest characters after point are assigned a, b and so on.

Error

You are a hero for making this package! :)

I'm seeing some strange errors:

[AceJump] One candidate, move to it directly
ace-jump-zap-up-to-char: Wrong type argument: keymapp, nil
Mark set
Copied line
[AceJump] Internal Error: invalid tree node type
Mark set
[AceJump] One candidate, move to it directly
ace-jump-zap-up-to-char: Wrong type argument: keymapp, nil
Type C-x 1 to delete the help window, C-M-v to scroll help.
[AceJump] Internal Error: invalid tree node type

It is possible this has to do with my bindings, or something else... I'm using bind-keys and friends from use-package.

Let me know how I can help you debug this problem. And thanks again for the package!

ace-jump-zap error after upgrading to melpa 20150227.1740

I see ajz/maybe-sort-candidate-list: Symbol's function definition is void: -sort in the minibuffer. I tested this without a init file as well with the same result.

Just let me know if I can test anything or provide more information.

May you please create a tag for release?

Good evening,

Tonight I am writing to humbly put in a request for you to tag this project.

The reason is that a lot of users want to rely on a "numbered" release, by
the most broad definition of the term. For me, it is really simple, I am setting
up a "kind of stable" Emacs configuration of my system here https://github.com/grettke/home/blob/master/.emacs.el
and I would like to rely 100% just one tag. Whenever a "kind of stable" version
is ready, another tag would be super, too.

You might already have the most stable version in the mainline; and tagging it
would make it crystal clear to new users. Perhaps you have already released such
a version elsewhere, and if so, my apologies, and where does it live?

Stable is not the best word here. It just means that the project lives on GitHub
and that it has a tag. It doesn't mean that the software is perfect, it just
means that it is tagged. That tag gives users a version to settle on and go on
with their life is all.

I've used your package for a long time, love it, and so do many, many others.
This is a way to get that project out to the other thousands and thousands of
users who also rely upon MELPA stable.

All it takes is for you to create a tag, and within hours, it will show up on
MELPA stable.

Can't wait to hear about what you think and whether or not a tag is in this
project's future!

Kind regards,

Grant Rettke

P.S.

delete-region vs. kill-region

I find ace-jump-zap very useful.
However, emac built-in function zap-to-char uses kill-region, while ace-jump-zap uses delete-region.

I would like to have possibility to choose the behaviour. For the moment, I changed my local ace-jump-zap.el file.

Add docstrings

Checkdoc throws "All variables and subroutines might as well have a documentation string" and "All interactive functions should have documentation."

Improve prompt in ace-jump-zap-up-to-char

With this one line change of the call to ace-jump-char-mode within ace-jump-zap-to-up-to-char, you can then see both what operation is being performed and associated settings (killing/deleting and zap-to or zap-up-to):

    (ace-jump-char-mode (read-char (format "Zap (%s) to%s char:"
                                           (car (split-string (symbol-name ajz/zap-function) "-"))
                                           (if ajz/to-char "" " before"))))  I

I think the word 'before' works because if point is after the character selected you looking backwards as the characters to see what is deleted so you still look for the characters prior to/before you run into the selected character to be removed. I think the 'up to' terminology is less clear since it is not clear whether it is inclusive or not.

Backward ace-jump-zap-to-char behaves differently than zap-to-char

Both examples start with a buffer like (where the cursor is on the character above the caret):

a_b_a
  ^

Ex 1: zap-to-char going backwards inclusively kills the character.

C-u -1 M-x zap-to-char a
b_a
^

Ex 2: ace-jump-zap-to-char does not.

C-u -1 M-x ace-jump-zap-to-char a
(selecting the first "a")
ab_a
 ^

The forward examples work consistently with their non-ace-jump counterpart. The *-dwim functions also behave similarly.

Is this intentional? Thanks!

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.