Git Product home page Git Product logo

evil-lion's People

Contributors

edkolev avatar noctuid avatar ogdenwebb avatar panchoh avatar syohex avatar timjstewart 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

evil-lion's Issues

no operator-state cursor when waiting for alignment character

When I type gl, the cursor changes from normal to operator (in my setup, goes from a filled green box to an empty red one), but after I've typed e.g. ip, it changes back to the normal-state (green box). Can we have it stay the operator cursor until I've typed the alignment character? The first time I tried it, I thought alignment wasn't working at all, so I gave up and pressed M-x align โ€ฆ

consider incorporating some ideas from spacemacs alignment functions

Spacemacs has some interesting functions regarding alignment right here.

Consider incorporating some the functionality into lion. the align-repeat seems to be the most useful. Here's the snippet:

;; BEGIN align functions

;; modified function from http://emacswiki.org/emacs/AlignCommands
(defun spacemacs/align-repeat (start end regexp &optional justify-right after)
  "Repeat alignment with respect to the given regular expression.
If JUSTIFY-RIGHT is non nil justify to the right instead of the
left. If AFTER is non-nil, add whitespace to the left instead of
the right."
  (interactive "r\nsAlign regexp: ")
  (let* ((ws-regexp (if (string-empty-p regexp)
                        "\\(\\s-+\\)"
                      "\\(\\s-*\\)"))
         (complete-regexp (if after
                              (concat regexp ws-regexp)
                            (concat ws-regexp regexp)))
         (group (if justify-right -1 1)))
    (message "%S" complete-regexp)
    (align-regexp start end complete-regexp group 1 t)))

;; Modified answer from http://emacs.stackexchange.com/questions/47/align-vertical-columns-of-numbers-on-the-decimal-point
(defun spacemacs/align-repeat-decimal (start end)
  "Align a table of numbers on decimal points and dollar signs (both optional)"
  (interactive "r")
  (require 'align)
  (align-region start end nil
                '((nil (regexp . "\\([\t ]*\\)\\$?\\([\t ]+[0-9]+\\)\\.?")
                       (repeat . t)
                       (group 1 2)
                       (spacing 1 1)
                       (justify nil t)))
                nil))

(defmacro spacemacs|create-align-repeat-x (name regexp &optional justify-right default-after)
  (let ((new-func (intern (concat "spacemacs/align-repeat-" name))))
    `(defun ,new-func (start end switch)
       (interactive "r\nP")
       (let ((after (not (eq (if switch t nil) (if ,default-after t nil)))))
         (spacemacs/align-repeat start end ,regexp ,justify-right after)))))

(spacemacs|create-align-repeat-x "comma" "," nil t)
(spacemacs|create-align-repeat-x "semicolon" ";" nil t)
(spacemacs|create-align-repeat-x "colon" ":" nil t)
(spacemacs|create-align-repeat-x "equal" "=")
(spacemacs|create-align-repeat-x "math-oper" "[+\\-*/]")
(spacemacs|create-align-repeat-x "ampersand" "&")
(spacemacs|create-align-repeat-x "bar" "|")
(spacemacs|create-align-repeat-x "left-paren" "(")
(spacemacs|create-align-repeat-x "right-paren" ")" t)
(spacemacs|create-align-repeat-x "backslash" "\\\\")

;; END align functions

Thanks again for the package.

Mode? How to best integrate evil-lion with evil and not lose flexibility

This is such a great feature. One of those things that you've always missed without knowing it. One question, though: Does it make sense that this has it's own mode? I would guess that users want this when evil mode is on but not otherwise. Making this its own mode means that it can be switched on with evil off and the reverse. Not sure if there are any use cases for these combinations.

no minibuffer history for /

Whenever I use /, the minibuffer suggests / as the default instead of what I last used. Ie. do glap/-- RET and then glap/ and it'll show Pattern [/]: instead of Pattern [--]:

Incorrect Autoload Cookies

evil-define-operator is not supported by autoload cookies, so the whole (evil-define-operator...) will be pulled into the autoload file. You need to manually specify the autoload. For example:

;; nil can be replaced with a docstring
;;;###autoload (autoload 'evil-lion-left "evil-lion" nil t)
(evil-define-operator evil-lion-left ....)

provide a way to customize the keybinds

Hi, thanks for the package.

Please consider providing a way for the user to customize the keybinds. I for one already use the gl bind for something else.

Different behavior in built-in Emacs alignment and evil-lion

Evil-lion-left and built-in align-regexp have the different rules to align the strings. With evil-lion it looks like you align a piece of code to a new string(fourth string) instead of align a new string to the existing piece of code.

For example:

(teal-green "#6fb593")
(wheat            "#b9c791")
(dark-blue  "#2a4661")
(blue       "#5485b6")
(alt-blue   "#6666be")
(cyan       "#54b6b6")

screenshot-2017-03-29_15-29-22

In my opinion, the align-regexp way is more natural.
Would you like to add an option to set alignment rules? Or maybe change the current behavior?

Aligning on spaces doesn't work correctly

hi @edkolev,

is it possible to turn this:

#<ip-address>  <hostname.domain.org>                   <hostname>
127.0.0.1	localhost.localdomain	localhost
::1		localhost.localdomain	localhost
# 127.0.0.1	thinkpad.localdomain	thinkpad
192.168.0.4       julicloud.local    julicloud
127.0.1.1       thinkpad.localdomain    thinkpad

into this:

#<ip-address>   <hostname.domain.org>   <hostname>
127.0.0.1	localhost.localdomain	localhost
::1		localhost.localdomain	localhost
# 127.0.0.1	thinkpad.localdomain	thinkpad
192.168.0.4     julicloud.local         julicloud
127.0.1.1       thinkpad.localdomain    thinkpad

with your package?

Incorrect indentation

When using evil-lion functions on lisp forms the result always gets
two spaces as indentation regardless. For example gl<space> gives this result
(<m> refers to the mark and | refers to point):

Before:

(prog1 'evil-surround
  (add-to-list 'package-selected-packages 'evil-surround)
  (when (fboundp 'evil-surround-mode)
    (autoload #'evil-surround-edit "evil-surround" nil t)
    (autoload #'evil-Surround-edit "evil-surround" nil t)
    (autoload #'evil-surround-region "evil-surround" nil t)
    (autoload #'evil-Surround-region "evil-surround" nil t)
<m> (define-key evil-operator-state-map "s" 'evil-surround-edit)
    (define-key evil-operator-state-map "S" 'evil-Surround-edit)
    (define-key evil-visual-state-map "s" 'evil-surround-region)
    (define-key evil-visual-state-map "S" 'evil-Surround-region)))
|

After:

(prog1 'evil-surround
  (add-to-list 'package-selected-packages 'evil-surround)
  (when (fboundp 'evil-surround-mode)
    (autoload #'evil-surround-edit "evil-surround" nil t)
    (autoload #'evil-Surround-edit "evil-surround" nil t)
    (autoload #'evil-surround-region "evil-surround" nil t)
    (autoload #'evil-Surround-region "evil-surround" nil t)
| (define-key evil-operator-state-map "s" 'evil-surround-edit)
  (define-key evil-operator-state-map "S" 'evil-Surround-edit)
  (define-key evil-visual-state-map   "s" 'evil-surround-region)
  (define-key evil-visual-state-map   "S" 'evil-Surround-region)))

Versions:

Emacs 28.1
Evil: 1.14.2
Evil-lion: 0.0.2

I have other packages installed as well, but these are the most relevant.

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.