emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* navigate between source code blocks
@ 2015-04-27 14:47 Zhihao Ding
  2015-04-28  7:22 ` Oleh Krehel
  0 siblings, 1 reply; 11+ messages in thread
From: Zhihao Ding @ 2015-04-27 14:47 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

Dear Org experts, 

I’ve got a simple question: how to speed up jumping 
between code blocks? 

My org file grows larger every day with more and more
source code blocks. I find myself spending increasing 
amount of time finding the right code blocks to go to. 

Could anyone suggest a method to increase efficiency?
So far I’ve tried (1)  simple search and (2) C-c C-v g, 
which for some reason often fails to find blocks. 

Thanks very much!

Zhihao


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: navigate between source code blocks
  2015-04-27 14:47 navigate between source code blocks Zhihao Ding
@ 2015-04-28  7:22 ` Oleh Krehel
  2015-04-29  8:20   ` Zhihao Ding
  0 siblings, 1 reply; 11+ messages in thread
From: Oleh Krehel @ 2015-04-28  7:22 UTC (permalink / raw)
  To: Zhihao Ding; +Cc: emacs-orgmode@gnu.org

Hi Zhihao,

> I’ve got a simple question: how to speed up jumping
> between code blocks?

You might be interested in https://github.com/abo-abo/worf.
It allows you to traverse anything that starts with "*" or "#+" with
just "hjkl" keys.
See the docs here: http://oremacs.com/worf/README.html.

regards,
Oleh

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: navigate between source code blocks
  2015-04-28  7:22 ` Oleh Krehel
@ 2015-04-29  8:20   ` Zhihao Ding
  2015-04-30 16:48     ` Leo Ufimtsev
  0 siblings, 1 reply; 11+ messages in thread
From: Zhihao Ding @ 2015-04-29  8:20 UTC (permalink / raw)
  To: Oleh Krehel; +Cc: emacs-orgmode@gnu.org

Thanks very much Oleh. 

Best,
Zhihao


> On 28 Apr 2015, at 08:22, Oleh Krehel <ohwoeowho@gmail.com> wrote:
> 
> Hi Zhihao,
> 
>> I’ve got a simple question: how to speed up jumping
>> between code blocks?
> 
> You might be interested in https://github.com/abo-abo/worf.
> It allows you to traverse anything that starts with "*" or "#+" with
> just "hjkl" keys.
> See the docs here: http://oremacs.com/worf/README.html.
> 
> regards,
> Oleh


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: navigate between source code blocks
  2015-04-29  8:20   ` Zhihao Ding
@ 2015-04-30 16:48     ` Leo Ufimtsev
  2015-04-30 17:25       ` Oleh Krehel
  2015-05-04 10:08       ` Sebastien Vauban
  0 siblings, 2 replies; 11+ messages in thread
From: Leo Ufimtsev @ 2015-04-30 16:48 UTC (permalink / raw)
  To: Zhihao Ding; +Cc: emacs-orgmode, Oleh Krehel

There are some build in things also, 

E.g you can name source code blocks:
#+name: EDE Config
#+begin_src emacs-lisp
(require 'ede)
(global-ede-mode)
(load-file (concat user-emacs-directory "my/cedet-projects.el"))
#+end_src

And then with Helm + org-babel-goto-named-src-block you can search your named source code blocks. 

You can also go to the next source code block via org-babel-next-src-block etc. Just to hop around. There is also a command for marking blocks.

Worf I think is a bit on the vi side of things. Helm is more generic.

I usually do things like append 'src' to the title of a heading and then do a helm-heading search to find my source code.

Leo Ufimtsev | Intern Software Engineer @ Eclipse Team


----- Original Message -----
From: "Zhihao Ding" <zhihao.ding@imm.ox.ac.uk>
To: "Oleh Krehel" <ohwoeowho@gmail.com>
Cc: emacs-orgmode@gnu.org
Sent: Wednesday, April 29, 2015 4:20:06 AM
Subject: Re: [O] navigate between source code blocks

Thanks very much Oleh. 

Best,
Zhihao


> On 28 Apr 2015, at 08:22, Oleh Krehel <ohwoeowho@gmail.com> wrote:
> 
> Hi Zhihao,
> 
>> I’ve got a simple question: how to speed up jumping
>> between code blocks?
> 
> You might be interested in https://github.com/abo-abo/worf.
> It allows you to traverse anything that starts with "*" or "#+" with
> just "hjkl" keys.
> See the docs here: http://oremacs.com/worf/README.html.
> 
> regards,
> Oleh

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: navigate between source code blocks
  2015-04-30 16:48     ` Leo Ufimtsev
@ 2015-04-30 17:25       ` Oleh Krehel
  2015-05-01  8:36         ` Zhihao Ding
  2015-05-01 13:55         ` Leo Ufimtsev
  2015-05-04 10:08       ` Sebastien Vauban
  1 sibling, 2 replies; 11+ messages in thread
From: Oleh Krehel @ 2015-04-30 17:25 UTC (permalink / raw)
  To: Leo Ufimtsev; +Cc: emacs-orgmode, Zhihao Ding

Leo Ufimtsev <lufimtse@redhat.com> writes:

> Worf I think is a bit on the vi side of things. Helm is more generic.

Worf is as much on the vi side of things, as `org-use-speed-commands'
are. Almost not at all. It just takes vi-style "hjkl" arrows, because
Emacs-style "bnpf" arrows aren't convenient.

And it's got the best Helm implementation for navigating to
headings. I've just added named blocks to this list as well.
Screenshot: http://oremacs.com/download/worf-goto.png.
The command to call is "M-x" `worf-goto' or "g" while in `worf-mode'.

Oleh

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: navigate between source code blocks
  2015-04-30 17:25       ` Oleh Krehel
@ 2015-05-01  8:36         ` Zhihao Ding
  2015-05-01 13:55         ` Leo Ufimtsev
  1 sibling, 0 replies; 11+ messages in thread
From: Zhihao Ding @ 2015-05-01  8:36 UTC (permalink / raw)
  To: Oleh Krehel; +Cc: Leo Ufimtsev, emacs-orgmode@gnu.org

Thank guys. Wolf is new to me and I am trying it now, it already feels 
very attractive! This increases my navigation efficiency quite a bit!  

Zhihao


> On 30 Apr 2015, at 18:25, Oleh Krehel <ohwoeowho@gmail.com> wrote:
> 
> Leo Ufimtsev <lufimtse@redhat.com> writes:
> 
>> Worf I think is a bit on the vi side of things. Helm is more generic.
> 
> Worf is as much on the vi side of things, as `org-use-speed-commands'
> are. Almost not at all. It just takes vi-style "hjkl" arrows, because
> Emacs-style "bnpf" arrows aren't convenient.
> 
> And it's got the best Helm implementation for navigating to
> headings. I've just added named blocks to this list as well.
> Screenshot: http://oremacs.com/download/worf-goto.png.
> The command to call is "M-x" `worf-goto' or "g" while in `worf-mode'.
> 
> Oleh

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: navigate between source code blocks
  2015-04-30 17:25       ` Oleh Krehel
  2015-05-01  8:36         ` Zhihao Ding
@ 2015-05-01 13:55         ` Leo Ufimtsev
  2015-05-01 15:13           ` Oleh Krehel
  1 sibling, 1 reply; 11+ messages in thread
From: Leo Ufimtsev @ 2015-05-01 13:55 UTC (permalink / raw)
  To: Oleh Krehel; +Cc: emacs-orgmode, Zhihao Ding

[-- Attachment #1: Type: text/plain, Size: 2181 bytes --]

>And it's got the best Helm implementation for navigating to
headings.

Well, when I hear someone use the word 'best', I see it as a challenge X-D.

I used worf-goto for a while. It's certainly amazing and on the odd occasion I still use it, but lately I've switched over to: helm-org-in-buffer-headings

The difference is that worf-goto only looks at the specific headings (e.g the line it self), where as helm-org-in-buffer-headings searches the whole hierarchy. 

E.g if I have a structure like this:

* Gdb 
** Break 
*** on line  (1)
*** on function 
* Eclipse
** Break
*** on line
*** on function 

And I search for "gdb break line", then I will not get a match with worf-goto, but helm-org-in-buffer-headings does do a match on (1).

For example in the attached screenshot I search for "gdb cmd break". It's also smart enough to trim long headings.

This is particularly useful for finding the deeply nested sub-items.

from what I gather, worf doesn't have an equivalent:
https://github.com/abo-abo/worf/blob/master/worf.el
Imho it would benefit from having something of that sort in the package. 

> It just takes vi-style "hjkl" arrows, because
Emacs-style "bnpf" arrows aren't convenient.

Well, I use the Colemak layout, so hjkl is actually not very convenient for me :-/. Meh. 

Leo Ufimtsev | Intern Software Engineer @ Eclipse Team


----- Original Message -----
From: "Oleh Krehel" <ohwoeowho@gmail.com>
To: "Leo Ufimtsev" <lufimtse@redhat.com>
Cc: emacs-orgmode@gnu.org, "Zhihao Ding" <zhihao.ding@imm.ox.ac.uk>
Sent: Thursday, April 30, 2015 1:25:45 PM
Subject: Re: [O] navigate between source code blocks

Leo Ufimtsev <lufimtse@redhat.com> writes:

> Worf I think is a bit on the vi side of things. Helm is more generic.

Worf is as much on the vi side of things, as `org-use-speed-commands'
are. Almost not at all. It just takes vi-style "hjkl" arrows, because
Emacs-style "bnpf" arrows aren't convenient.

And it's got the best Helm implementation for navigating to
headings. I've just added named blocks to this list as well.
Screenshot: http://oremacs.com/download/worf-goto.png.
The command to call is "M-x" `worf-goto' or "g" while in `worf-mode'.

Oleh


[-- Attachment #2: Selection_013.png --]
[-- Type: image/png, Size: 106072 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: navigate between source code blocks
  2015-05-01 13:55         ` Leo Ufimtsev
@ 2015-05-01 15:13           ` Oleh Krehel
  2015-05-04 14:00             ` Leo Ufimtsev
  0 siblings, 1 reply; 11+ messages in thread
From: Oleh Krehel @ 2015-05-01 15:13 UTC (permalink / raw)
  To: Leo Ufimtsev; +Cc: emacs-orgmode, Zhihao Ding

Leo Ufimtsev <lufimtse@redhat.com> writes:

>>And it's got the best Helm implementation for navigating to
> headings.
>
> Well, when I hear someone use the word 'best', I see it as a challenge X-D.
>
> I used worf-goto for a while. It's certainly amazing and on the odd occasion I still use it, but lately I've switched over to: helm-org-in-buffer-headings
>
> The difference is that worf-goto only looks at the specific headings (e.g the line it self), where as helm-org-in-buffer-headings searches the whole hierarchy. 
>
> E.g if I have a structure like this:
>
> * Gdb 
> ** Break 
> *** on line  (1)
> *** on function 
> * Eclipse
> ** Break
> *** on line
> *** on function 
>
> And I search for "gdb break line", then I will not get a match with worf-goto, but helm-org-in-buffer-headings does do a match on (1).
>
> For example in the attached screenshot I search for "gdb cmd break". It's also smart enough to trim long headings.
>
> This is particularly useful for finding the deeply nested sub-items.
>
> from what I gather, worf doesn't have an equivalent:
> https://github.com/abo-abo/worf/blob/master/worf.el
> Imho it would benefit from having something of that sort in the
> package.

Thanks for the feedback, Leo. It's doable, but then it would be pretty
much identical to helm-org-in-buffer-headings.  If you or anyone else is
interested, post at https://github.com/abo-abo/worf/issues.

>> It just takes vi-style "hjkl" arrows, because
> Emacs-style "bnpf" arrows aren't convenient.
>
> Well, I use the Colemak layout, so hjkl is actually not very
> convenient for me :-/. Meh.

Well, it's always something, isn't it :)

By the way, I'm trying to go with general-purpose tools these days.
Here's a link to the search that you mentioned using swiper:
http://oremacs.com/download/org-mode-swiper.png.

Swiper is an isearch replacement, so I could just:

1. "C-s" break -> see 38 matches.
2. "C-a" \* "SPC" -> see 9 matches.
3. "C-n" repeatedly to navigate to the one that I want.

As you see, I kind of stole your notes and the org-bullets
customization, so thanks for that:)

Oleh

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: navigate between source code blocks
  2015-04-30 16:48     ` Leo Ufimtsev
  2015-04-30 17:25       ` Oleh Krehel
@ 2015-05-04 10:08       ` Sebastien Vauban
  2015-05-04 14:04         ` Leo Ufimtsev
  1 sibling, 1 reply; 11+ messages in thread
From: Sebastien Vauban @ 2015-05-04 10:08 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Leo Ufimtsev wrote:
> There are some build in things also, 
>
> E.g you can name source code blocks:
> #+name: EDE Config
> #+begin_src emacs-lisp
> (require 'ede)
> (global-ede-mode)
> (load-file (concat user-emacs-directory "my/cedet-projects.el"))
> #+end_src
>
> And then with Helm + org-babel-goto-named-src-block you can search
> your named source code blocks.

Would you mind sharing your config for the above
(Helm + org-babel-goto-named-src-block)?

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: navigate between source code blocks
  2015-05-01 15:13           ` Oleh Krehel
@ 2015-05-04 14:00             ` Leo Ufimtsev
  0 siblings, 0 replies; 11+ messages in thread
From: Leo Ufimtsev @ 2015-05-04 14:00 UTC (permalink / raw)
  To: Oleh Krehel; +Cc: emacs-orgmode, Zhihao Ding



----- Original Message -----
> From: "Oleh Krehel" <ohwoeowho@gmail.com>
> To: "Leo Ufimtsev" <lufimtse@redhat.com>
> Cc: emacs-orgmode@gnu.org, "Zhihao Ding" <zhihao.ding@imm.ox.ac.uk>
> Sent: Friday, May 1, 2015 11:13:28 AM
> Subject: Re: [O] navigate between source code blocks
> 
> Leo Ufimtsev <lufimtse@redhat.com> writes:
> 
> >>And it's got the best Helm implementation for navigating to
> > headings.
> >
> > Well, when I hear someone use the word 'best', I see it as a challenge X-D.
> >
> > I used worf-goto for a while. It's certainly amazing and on the odd
> > occasion I still use it, but lately I've switched over to:
> > helm-org-in-buffer-headings
> >
> > The difference is that worf-goto only looks at the specific headings (e.g
> > the line it self), where as helm-org-in-buffer-headings searches the whole
> > hierarchy.
> >
> > E.g if I have a structure like this:
> >
> > * Gdb
> > ** Break
> > *** on line  (1)
> > *** on function
> > * Eclipse
> > ** Break
> > *** on line
> > *** on function
> >
> > And I search for "gdb break line", then I will not get a match with
> > worf-goto, but helm-org-in-buffer-headings does do a match on (1).
> >
> > For example in the attached screenshot I search for "gdb cmd break". It's
> > also smart enough to trim long headings.
> >
> > This is particularly useful for finding the deeply nested sub-items.
> >
> > from what I gather, worf doesn't have an equivalent:
> > https://github.com/abo-abo/worf/blob/master/worf.el
> > Imho it would benefit from having something of that sort in the
> > package.
> 
> Thanks for the feedback, Leo. It's doable, but then it would be pretty
> much identical to helm-org-in-buffer-headings.  If you or anyone else is
> interested, post at https://github.com/abo-abo/worf/issues.
> 
> >> It just takes vi-style "hjkl" arrows, because
> > Emacs-style "bnpf" arrows aren't convenient.
> >
> > Well, I use the Colemak layout, so hjkl is actually not very
> > convenient for me :-/. Meh.
> 
> Well, it's always something, isn't it :)
> 
> By the way, I'm trying to go with general-purpose tools these days.
> Here's a link to the search that you mentioned using swiper:
> http://oremacs.com/download/org-mode-swiper.png.
> 
> Swiper is an isearch replacement, so I could just:
> 
> 1. "C-s" break -> see 38 matches.
> 2. "C-a" \* "SPC" -> see 9 matches.
> 3. "C-n" repeatedly to navigate to the one that I want.

I've been meaning to try swiper for a while, I've sort of been waiting for it to mature a bit. 
I'll try the suggestion above sometime, maybe on a thursday evening after work X-D.


> As you see, I kind of stole your notes and the org-bullets
> customization, so thanks for that:)

I am impressed at your finding-emacs-configs-online skills =).

> Oleh
> 

-- 
Leo Ufimtsev | Intern Software Engineer @ Eclipse Team

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: navigate between source code blocks
  2015-05-04 10:08       ` Sebastien Vauban
@ 2015-05-04 14:04         ` Leo Ufimtsev
  0 siblings, 0 replies; 11+ messages in thread
From: Leo Ufimtsev @ 2015-05-04 14:04 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode



----- Original Message -----
> From: "Sebastien Vauban" <sva-news@mygooglest.com>
> To: emacs-orgmode@gnu.org
> Sent: Monday, May 4, 2015 6:08:02 AM
> Subject: Re: [O] navigate between source code blocks
> 
> Leo Ufimtsev wrote:
> > There are some build in things also,
> >
> > E.g you can name source code blocks:
> > #+name: EDE Config
> > #+begin_src emacs-lisp
> > (require 'ede)
> > (global-ede-mode)
> > (load-file (concat user-emacs-directory "my/cedet-projects.el"))
> > #+end_src
> >
> > And then with Helm + org-babel-goto-named-src-block you can search
> > your named source code blocks.
> 
> Would you mind sharing your config for the above
> (Helm + org-babel-goto-named-src-block)?
> 

This is my .emacs.d folder, which I soft symlink:
ln -s ~/git/ldts/.emacs.d ~/.emacs.d
https://github.com/LeoUfimtsev/ldts/tree/master/.emacs.d

Of Some interest:
- init loader and customizations: (not so intresting)
https://github.com/LeoUfimtsev/ldts/blob/master/.emacs.d/init.el

- legacy .emacs file which I haven't fully moved to my orgdotemacs (not as interesting)
https://github.com/LeoUfimtsev/ldts/blob/master/.emacs.d/my/.emacs

- my org-babel-config:
https://github.com/LeoUfimtsev/ldts/blob/master/.emacs.d/my/orgdotemacs.org#org-babel-configuration

But truth be told, my config is somewhat messy with things all over the place. You may want to go with norangs's org-babel config, (I got my stuff from there also)
http://doc.norang.ca/org-mode.html#OrgBabel

Let me know if you have questions.

Thank you.

> Best regards,
>   Seb
> 
> --
> Sebastien Vauban
> 
> 
> 

-- 
Leo Ufimtsev | Intern Software Engineer @ Eclipse Team

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-05-04 14:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-27 14:47 navigate between source code blocks Zhihao Ding
2015-04-28  7:22 ` Oleh Krehel
2015-04-29  8:20   ` Zhihao Ding
2015-04-30 16:48     ` Leo Ufimtsev
2015-04-30 17:25       ` Oleh Krehel
2015-05-01  8:36         ` Zhihao Ding
2015-05-01 13:55         ` Leo Ufimtsev
2015-05-01 15:13           ` Oleh Krehel
2015-05-04 14:00             ` Leo Ufimtsev
2015-05-04 10:08       ` Sebastien Vauban
2015-05-04 14:04         ` Leo Ufimtsev

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).