<div dir="ltr">I wrote these functions for vimpulse. If you rewrite them for evil, send me a copy:<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div><br></div><div>
(defun ny-eval-region-dwim ()</div><div>  &quot;Evaluates the current region if it exists. Otherwise evals the current line&quot;</div><div>  (interactive)</div><div>  ;; if there is no region, select current line</div><div>
  (when (not vimpulse-visual-mode)</div><div>    (progn</div><div>      (viper-beginning-of-line 1)</div><div>      (vimpulse-visual-toggle-line)</div><div>      (viper-goto-eol 1)))</div><div>  (eval-region (region-beginning) (region-end))</div>
<div>  ;; de-activate visual mode</div><div>  (vimpulse-visual-mode -1))</div><div><br></div><div>(defun ny-eval-buffer ()</div><div>  (interactive)</div><div>  (eval-buffer))</div></div><div><br></div><div>;; sample mappings</div>
<div><div>(vimpulse-map &quot;,er&quot; &#39;ny-eval-region-dwim)</div><div>(vimpulse-map &quot;,eb&quot; &#39;ny-eval-buffer)</div></div><div><br></div></blockquote><div><br clear="all"><div dir="ltr"><div>Natan</div><div>
<br></div><div><span style="border-collapse:collapse;color:rgb(136, 136, 136);font-family:arial, sans-serif;font-size:13px"><div>--</div><div>blog: <a href="http://natanyellin.com/" style="color:rgb(87, 151, 176)" target="_blank">http://natanyellin.com</a></div>

<div><a href="http://natanyellin.com/" style="color:rgb(87, 151, 176)" target="_blank"></a>twitter: <a href="http://twitter.com/aantn" style="color:rgb(87, 151, 176)" target="_blank">@aantn</a></div></span></div></div><br>
<div class="gmail_quote">On Sun, Sep 18, 2011 at 9:11 PM, Eric S Fraga <span dir="ltr">&lt;<a href="mailto:e.fraga@ucl.ac.uk" target="_blank">e.fraga@ucl.ac.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Lorenz Köhl &lt;<a href="mailto:rainbowtwigs@googlemail.com" target="_blank">rainbowtwigs@googlemail.com</a>&gt; writes:<br>
<br>
&gt; Hello,<br>
&gt;<br>
&gt; evil is awesome.<br>
&gt;<br>
&gt; As I was customizing to make my vim and emacs habits non-exclusive I<br>
&gt; realized that C-x C-e (eval-last-sexp) works on the next to last sexp<br>
&gt; and I couldn&#39;t move over the last paren as it&#39;s usually the last<br>
&gt; character.<br>
&gt;<br>
&gt; How do you eval in evil?<br>
<br>
I was just going to ask the same question!  The problem is the mismatch<br>
between emacs point and vi&#39;s character position.<br>
<br>
In any case, the solution is quite straightforward: put the cursor<br>
(point) at the start of the next line.  Not ideal but it works.<br>
<br>
HTH,<br>
eric<br>
<font color="#888888"><br>
--<br>
Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D)<br>
<br>
<br>
_______________________________________________<br>
implementations-list mailing list<br>
<a href="mailto:implementations-list@lists.ourproject.org" target="_blank">implementations-list@lists.ourproject.org</a><br>
<a href="https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list" target="_blank">https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list</a><br>
</font></blockquote></div><br></div></div>