From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guido Van Hoecke Subject: Re: evil-mode and org Date: Thu, 30 Mar 2017 19:03:40 +0200 Message-ID: References: <1a0d15aafd944fa3864394d8e212046f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> <87y3vom81v.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f403045f3ed88ce022054bf5aeb1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ctdUc-0004nb-Va for emacs-orgmode@gnu.org; Thu, 30 Mar 2017 13:04:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ctdUa-0007M8-RW for emacs-orgmode@gnu.org; Thu, 30 Mar 2017 13:04:14 -0400 Received: from mail-wr0-x229.google.com ([2a00:1450:400c:c0c::229]:34588) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ctdUa-0007LI-Ge for emacs-orgmode@gnu.org; Thu, 30 Mar 2017 13:04:12 -0400 Received: by mail-wr0-x229.google.com with SMTP id l43so70546914wre.1 for ; Thu, 30 Mar 2017 10:04:12 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: orgmode --f403045f3ed88ce022054bf5aeb1 Content-Type: text/plain; charset=UTF-8 Eric, You already mentioned your mappings in http://lists.gnu.org/archive/html/emacs-orgmode/2012-05/msg00153.html Thanks! Finally got myself to write a little lisp to solve my problem and mapped it to go For what it's worth, here it is (but it solves a very specific problem): (defun guivho-insert-topic-under-heading() "Expand heading and insert hyphen and inactive timestamp. Cursor is expected to be in an org header line" (interactive) (let ((sp " ") (hyphen "-")) (org-end-of-line) (evil-append 1) (org-return) (insert hyphen sp) (org-time-stamp nil t) (insert sp) (evil-force-normal-state) (evil-append 0))) This now always inserts a 'dash space timestamp space' line immediately under the current org header, whether it was collapsed or not. Hey, it's not beautiful, but it solves my problem :) And, to whom it may concern, org and evil make a nice combo :) Guido On 30 March 2017 at 12:14, Guido Van Hoecke wrote: > > > Eric, > > Care to share your org-evil mappings? > > One 'conflict' which bites me every time is this: > > I hit /blabla to locate a heading directly under which I want to insert a > text line. > > I then hit enter to acknowledge the find. > > The display shows the heading line followed by its body lines (which all > start with a hyphen) > > I then hit o to insert a line directly under the heading and before the > first existing detail line. > > The result is however that the heading body closes, and that a line is > added before the next header line, so under all existing detail lines of > this header line. > > This undesired behavior only happens if the heading was closed at the time > of the find. If the find locates an open heading, hitting enter and than o > behaves as expected. > > Any suggestions on how this can be fixed would be most welcome :) > > TIA, > > Guido > > On 29 March 2017 at 17:11, Eric S Fraga wrote: > >> On Tuesday, 28 Mar 2017 at 12:57, Matt Price wrote: >> > I've never used Vim but I see a lot of people online raving about evil >> > mode and how much they love it. I'm considering giving it a whirl >> > after the semester ends & I get some free time. I just wondered >> > whether any heavy org users here on the list use evil, and if so, >> > whether you see pain points within org-mode -- my setup is pretty >> > heavily customized, for instance, and I wonder whether that means it >> > will be quite painful to use evil. >> >> I use evil and org all day long. Basically, there is very little clash >> between them so they co-exist very nicely. One of the best things about >> evil is that it is almost orthogonal to emacs and you can continue using >> most C-x and C-c keymap bindings. >> >> In my case, I did add a number of bindings to evil's normal and motion >> keymaps to avoid typing C-c etc. as my motivation in using evil is to >> avoid exacerbating my RSI. Almost all my commands are non-chorded key >> sequences. I barely use the control, shift and meta keys in normal >> use. >> >> -- >> : Eric S Fraga (0xFFFCF67D), Emacs 25.1.1, Org release_9.0.5-391-g36c7cf >> > > --f403045f3ed88ce022054bf5aeb1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks!
=C2=A0
Finally got myself to write a little lisp to solve my= problem and mapped it to go

For what it's worth, here it = is (but it solves a very specific problem):

=C2=A0 (defun guivho-ins= ert-topic-under-heading()
=C2=A0=C2=A0=C2=A0 "Expand heading and in= sert hyphen and inactive timestamp.
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Curso= r is expected to be in an org header line"
=C2=A0=C2=A0=C2=A0 (inte= ractive)
=C2=A0=C2=A0=C2=A0 (let ((sp " ")
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (hyphen "-"))
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 (org-end-of-line)
=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 (evil-append 1)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (org-return)
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 (insert hyphen sp)
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 (org-time-stamp nil t)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (insert sp)=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (evil-force-normal-state)
=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 (evil-append 0)))

This now always insert= s a 'dash space timestamp space' line immediately under the current= org header, whether it was collapsed or not.

Hey, it's no= t beautiful, but it solves my problem :)

And, to whom it may c= oncern, org and evil make a nice combo :)

Guido
<= div>


<= div class=3D"gmail_quote">On 30 March 2017 at 12:14, Guido Van Hoecke <guiv= ho@gmail.com> wrote:


Eric,

Care to share your org-evil mappings?

One 'conflict'= ; which bites me every time is this:

I hit /blabla to locate a= heading directly under which I want to insert a text line.

I = then hit enter to acknowledge the find.

The display shows the = heading line followed by its body lines (which all start with a hyphen)
=

I then hit o to insert a line directly under the heading and befo= re the first existing detail line.

The result is however that = the heading body closes, and that a line is added before the next header li= ne, so under all existing detail lines of this header line.

Th= is undesired behavior only happens if the heading was closed at the time of= the find. If the find locates an open heading, hitting enter and than o be= haves as expected.

Any suggestions on how this can be fixed would be most welcome := )

TIA,

Guido

On 29 March 2017 at 17:11, Eric S Fraga <= e.fraga@ucl.ac.uk> wrote:
O= n Tuesday, 28 Mar 2017 at 12:57, Matt Price wrote:
> I've never used Vim but I see a lot of people online raving about = evil
> mode and how much they love it. I'm considering giving it a whirl<= br> > after the semester ends & I get some free time. I just wondered > whether any heavy org users here on the list use evil, and if so,
> whether you see pain points within org-mode -- my setup is pretty
> heavily customized, for instance, and I wonder whether that means it > will be quite painful to use evil.

I use evil and org all day long.=C2=A0 Basically, there is very little clas= h
between them so they co-exist very nicely.=C2=A0 One of the best things abo= ut
evil is that it is almost orthogonal to emacs and you can continue using most C-x and C-c keymap bindings.

In my case, I did add a number of bindings to evil's normal and motion<= br> keymaps to avoid typing C-c etc. as my motivation in using evil is to
avoid exacerbating my RSI.=C2=A0 Almost all my commands are non-chorded key=
sequences.=C2=A0 I barely use the control, shift and meta keys in normal use.

--
: Eric S Fraga (0xFFFCF67D), Emacs 25.1.1, Org release_9.0.5-391-g36c7cf


--f403045f3ed88ce022054bf5aeb1--