Bob Nnamtrop | 30 Jul 18:46 2014
Picon

Include underscore in word

This seems like a trivial question but a lot of searching has not produced an answer. I'm trying to make the change from viper to evil. One thing that surprises me is the underscores are not considered part of a work for various word commands (e.g, w, cw, etc). I tried vim and they are considered part of the word and in viper they are as well. I find the choice in evil strange. Is there a way to make underscores part of words in evil?

Thanks,
Bob
_______________________________________________
implementations-list mailing list
implementations-list <at> lists.ourproject.org
https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
Linus Arver | 26 Jul 18:56 2014
Picon

visual selection and X primary behavior

Hello all,

In regular Emacs (with Evil mode turned on, of course), I can (1) do
visual selection of a region, and it will automatically copy that
selection into the X primary selection buffer. This way, I can simply do
SHIFT+INSERT in another X program (e.g., Firefox) and I will paste the
selection that way. Conversely, I can (2) SHIFT+INSERT into Emacs/Evil
(in Insert mode), and it will paste whatever is in the X primary buffer.

However, behavior (1) does not work in terminal-mode Emacs (`emacs
-nw`), although behavior (2) works as expected. I have tried to work
around this by using my `"+y` macro which is enabled with

    (define-key evil-normal-state-map ",y" "\"+y")

in my .emacs, but it fails with the message

    After 0 kbd macro iterations: X selection unavailable for this frame

. Is this a bug in Evil or is it something in Emacs itself?

-L
Gulshan Singh | 1 Jul 08:06 2014
Picon

Vim Movement

Hi,

I'm wondering how if it's possible emulate Vim word movement using the same M-f and M-b bindings in Emacs? I've currently done this:

(global-set-key (kbd "M-f") 'evil-forward-word-begin)
(global-set-key (kbd "M-b") 'evil-backward-word-end)

That's decent, but I think that actual Vim movement uses the evil-forward-word-end and evil-backward-word-begin methods as well. How can I do this?
_______________________________________________
implementations-list mailing list
implementations-list <at> lists.ourproject.org
https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
Johann Klähn | 27 Jun 14:26 2014
Picon

evil: work on support for ]p, [p (adjust indent on paste)

Hi there,
I would like to work on a patch to add support for ]p and [p to evil. I have some working code (see below) to adjust the indent after a call to evil-paste-after / evil-paste-before, but I would appreciate tips on how to integrate this with existing evil code (especially so that ]p will be a single undo step, that evil-paste-pop still works, …).

All the best,
Johann

(defun get-common-indent-in-region (start end)
  (setq end (copy-marker end))
  (unwind-protect
      (let (indentation)
        (save-excursion
          (goto-char start)
          (or (bolp) (forward-line 1))
          (while (< (point) end)
            (skip-chars-forward " \t")
            (setq indentation
                  (cons (current-column) indentation))
            (forward-line 1)))
        (apply #'min indentation))
    (move-marker end nil)))

(defun my-evil-adjust-indent-afer-paste ()
  (interactive)

  (unless (memq last-command
                '(evil-paste-after
                  evil-paste-before))
    (error "Previous command was not a line-wise evil-paste: %s" last-command))

  (let* ((start (evil-get-marker ?\[))
         (end (evil-get-marker ?\]))
         (common (get-common-indent-in-region start end))
         (this
          (save-excursion
            (cond
             ((eq last-command 'evil-paste-before)
              (goto-char end)
              (forward-line 1))
             (t
              (goto-char start)
              (forward-line -1)))
            (skip-chars-forward " \t")
            (current-column))))
    (indent-rigidly start end (- this common))))
_______________________________________________
implementations-list mailing list
implementations-list <at> lists.ourproject.org
https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
Justin M. Keyes | 7 Jun 09:45 2014
Picon

binding to "cp" without breaking "c"

Hi,

I'm trying to bind a command to the "unused namespace" that happens to
start with "c". By "unused namespace" I mean things like "cp" or "co"
for which there is no valid text object or motion. In Vim, you can
bind "cow" and it does not affect the behavior of "cdw", "ciw", etc,
because "o" is not defined as a text object. For example, in
unimpaired.vim[1], "cow" toggles word-wrap. I would like to do this in
emacs evil, so I tried:

    (define-key evil-normal-state-map (kbd "c o w") 'toggle-truncate-lines)

It reports "eval-region: Key sequence c p w starts with non-prefix key
c". But I don't want to unbind "c" because then I can't use the
evil-change operator.

I tried defining a custom operator, but after looking at the evil
source code I couldn't figure out how to hook into evil-change to
preserve its behavior while listening for "o" and then routing it
somewhere else.

It seems like I'm missing something, I would think this is a common
task, but I haven't found any posts that address this.

Thanks for evil, it's superb!

[1] https://github.com/tpope/vim-unimpaired

Justin M. Keyes
Ed Kostas | 6 Jun 10:26 2014
Picon

In Evil, Ctrl-o is not working like in Vim

When I press Ctrl-o in insert state, then press :w, Evil remains in normal
state after executing the colon command.  

When I press Ctrl-o in Vim, then the :w command, the command is 
executed and Vim returns to the insert state.

In other words, in Vim, Ctrl-o executes one command and remains
in insert state. In Evil, it remains in Normal state after executing the 
command.  

It would be fine if Ctrl-o had exactly the same behaviour in Evil and
in Vim. Is there any reason for this not being so?
Dima Gorbik | 2 Jun 08:01 2014
Picon

Opening a new line in evil-mode

Hello all,

Please take a look at the following piece of code:

(goto-char (point-max))
(insert "\n”)

In normal state of evil-mode goto-char moves the cursor to the end of line visually, but it points before the
last symbol, not after. Although the example above works just fine — it works as if the cursor is pointing
after the last symbol so the last symbol is not carried to the next line which is a correct behavior. I wonder
how evil determines that it needs to insert after the last symbol, not before.

The reason I ask about this is because I am trying to understand why hitting enter in haskell-mode repl in
normal state in evil-mode puts the last symbol of the current line on the next line. It looks like (insert
"\n") is invoked in a callback and evil doesn't know that it needs to maintain the compatibility.

Thanks,
Dima
Stefan Monnier | 30 May 17:46 2014
Picon

Including Evil in GNU ELPA

I remember asking this a few years ago, but somehow I can't seem to find
the answer.  So here it is again: I think it would be great to include
Evil in the GNU ELPA archive.

Would Evil's maintainers be interested in doing so?  If yes, then please
get in touch with me, so we can work out the details (which mostly have
to do with copyright paperwork, since we have the same policy for GNU
ELPA as for Emacs, to make it easy to move code between the two).

        Stefan
Nikolai Weibull | 29 May 10:06 2014
Picon

Wrapping paredit-forward

Hi!

How should I go about wrapping paredit-forward so that it will work in
normal mode?

The problem currently is that once you hit a ‘)’ at the end of a line
you can’t go forward any more, as point will be /at/ the ‘)’, due to
the way Evil works, not /after/ the ‘)’, as paredit expects it to be.

_______________________________________________
implementations-list mailing list
implementations-list <at> lists.ourproject.org
https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
Frank Fischer | 25 May 11:41 2014
Picon

Re: Last character in visual selection remains unhighlighted

Am 21.05.2014 15:42, schrieb Sujith Abraham:
> In the Vim manual it is stated that ) is as an 'exclusive' motion, and % is
> an 'inclusive' motion. Does this have anything to do with this? 

Should not.

> Shouldn't
> both be giving different results?

Yes.

Up to now I have not been able to reproduce the problem. On my system
everthing works as expected and the visual selection always includes the
closing parenthesis. As long as nobody provides an example to reproduce
the error it is almost impossible for me to find the problem (starting
with a minimal configuration, a sequence of keystrokes, whether you work
in X or terminal, preferably a screenshot as it is a "visual" issue), sorry.

Best regards,
Frank
Connor Smith | 21 Mar 22:12 2014
Picon

New evil plugin: evil-args

Hi all,

I wanted to notify this board about a new plugin I wrote for evil
called evil-args. It provides motions and text objects for delimited
arguments.

For example, `cia` changes:

    function(arg1, arg2, ar|g3.f())

to

    function(arg1, arg2, |)

You can find more examples and the source at
https://github.com/wcsmith/evil-args. Any feedback on code or issue
reports would be welcome.

--Connor
_______________________________________________
implementations-list mailing list
implementations-list <at> lists.ourproject.org
https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list

Gmane