emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Orgmode keybindings in Dired?
@ 2024-08-22 18:27 Kepa
  2024-08-23 12:51 ` Fraga, Eric
       [not found] ` <87o75jstll.fsf@mbork.pl>
  0 siblings, 2 replies; 4+ messages in thread
From: Kepa @ 2024-08-22 18:27 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi

I'm starting to use Dired and I like it.
I would like to know your opinion, fellow orgmode users about keybindings in Dired:
Is it worth modifying Dired's keybindings to match those of Org-mode? Could it have any side effect?
Any specific advice?

Has this configuration already been shared? I assume someone else must have thought of this before...

Best regards!

[-- Attachment #2: Type: text/html, Size: 1129 bytes --]

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

* Re: Orgmode keybindings in Dired?
  2024-08-22 18:27 Kepa
@ 2024-08-23 12:51 ` Fraga, Eric
       [not found] ` <87o75jstll.fsf@mbork.pl>
  1 sibling, 0 replies; 4+ messages in thread
From: Fraga, Eric @ 2024-08-23 12:51 UTC (permalink / raw)
  To: Kepa; +Cc: emacs-orgmode@gnu.org

Response below/inline for email Kepa wrote:
> (original email sent 22 Aug 2024 at 18:27)
> I'm starting to use Dired and I like it.

dired is an excellent tool!

> I would like to know your opinion, fellow orgmode users about
> keybindings in Dired:
> Is it worth modifying Dired's keybindings to match those of Org-mode?

What exactly are you imagining?  org mode keybindings make sense within
an org file.  I'm not sure what you expect to do in a dired buffer that
would use org mode keybindings?

Having said that, I do use org-store-link (globally bound to C-c l) all
the time in dired buffers.

-- 
: Eric S Fraga, with org 9.7.10-5ebd97 in Emacs 31.0.50

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

* RE: Orgmode keybindings in Dired?
       [not found] ` <87o75jstll.fsf@mbork.pl>
@ 2024-08-23 14:40   ` Kepa
  0 siblings, 0 replies; 4+ messages in thread
From: Kepa @ 2024-08-23 14:40 UTC (permalink / raw)
  To: mbork, emacs-orgmode@gnu.org

Hi Marcin!
Below I shared some ideas

> -----Original Message-----
> From: mbork at mbork.pl
> <gvscwbfbwppxuzuayumtkykgivwkhhtzvnauvzkhlzgmkgc@simplelogin.co>
> Sent: Friday, August 23, 2024 7:21 AM
> To: Kepa <gnu.cognition199@slmails.com>
> Subject: Re: Orgmode keybindings in Dired?
> 
> On 2024-08-22, at 18:27, Kepa <gnu.cognition199@slmails.com> wrote:
> 
> > Hi
> >
> > I'm starting to use Dired and I like it.
> > I would like to know your opinion, fellow orgmode users about keybindings
> in Dired:
> > Is it worth modifying Dired's keybindings to match those of Org-mode?
> Could it have any side effect?
> > Any specific advice?
> >
> > Has this configuration already been shared? I assume someone else must
> have thought of this before...
> 
> Which keybindings do you mean exactly?  Dired's keybindings are usually
> consistent with the rest of Emacs (and most of them predate Org mode, I
> believe), so one would need to be quite careful not to introduce any
> inconsistencies.

Examples:
w to (dired-do-rename), instead of R, like refile speedkey.
o to (browse-url-of-dired-file), instead of W, like org-open-at-point speedkey.
M-RET to (dired-create-directory), instead of +.
And maybe other org speedkeys.

Although I have found that using dired-subtree gives naturally this oportunity. Here some examples (I must change "u" keybinding, since it is used to unmark files, maybe I could use C-g to unmark files, could it be risky?


;; Bind 'TAB' to toggle subtree visibility (cycle through subdirectories)
(with-eval-after-load 'dired
  (define-key dired-mode-map (kbd "TAB") 'dired-subtree-cycle))

;; (org-speed-move-safe 'outline-up-heading) (similar to 'u' in Org-mode for dired-subtree-up)
(define-key dired-mode-map (kbd "u") 'dired-subtree-up)

 ;; Bind 's' to narrow the view to the current subdirectory
  (define-key dired-mode-map (kbd "s") 'dired-subtree-narrow)


> 
> Best,
> 
> --
> Marcin Borkowski
> https://mbork.pl
> https://crimsonelevendelightpetrichor.net/




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

* Re: Orgmode keybindings in Dired?
@ 2024-08-24 23:22 Kepa
  0 siblings, 0 replies; 4+ messages in thread
From: Kepa @ 2024-08-24 23:22 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

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

> From:     Fraga, Eric
> Subject:     Re: Orgmode keybindings in Dired?
> Date:     Fri, 23 Aug 2024 12:51:32 +0000
> User-agent:     gnus (Emacs 31.0.50)
>
> Response below/inline for email Kepa wrote:
> > (original email sent 22 Aug 2024 at 18:27)
> > I'm starting to use Dired and I like it.
>
> dired is an excellent tool!
>
> > I would like to know your opinion, fellow orgmode users about
> > keybindings in Dired:
> > Is it worth modifying Dired's keybindings to match those of Org-mode?
>
> What exactly are you imagining?  org mode keybindings make sense within
> an org file.  I'm not sure what you expect to do in a dired buffer that
> would use org mode keybindings?
>
> Having said that, I do use org-store-link (globally bound to C-c l) all
> the time in dired buffers.
>
> -- 
> : Eric S Fraga, with org 9.7.10-5ebd97 in Emacs 31.0.50

By the way, Eric, thanks for your tip. I probably wouldn't found that 
org-store-link can be used in Dired. Combined with org-super-links and 
org-open-at-point, it makes it joyful.

You asked about what was I imagining, so I will share the configuration 
I have finished with (by now).

My imagination goes beyond, though, like using "r" and "l" to "move" 
subdirectories one level down or up. Although maybe I would never use 
it. As said, the keybindings I am using in Dired, inspired many of them 
by org-mode keybindings:

;; Bind 'TAB' to toggle subtree visibility (cycle through subdirectories)
(with-eval-after-load 'dired
   (define-key dired-mode-map (kbd "TAB") 'dired-subtree-cycle))

;; Create a new directory (similar to 'M-RET' in Org-mode)
   ;; Existing Dired keybinding: '+' is used for 'dired-create-directory'
   ;; New keybinding: 'M-RET'
(define-key dired-mode-map (kbd "M-RET") 'dired-create-directory)

;; (org-speed-move-safe 'outline-up-heading) (similar to 'u' in Org-mode 
for dired-subtree-up)
   ;; Existing Dired keybinding: 'u' for dired-unmark
(define-key dired-mode-map (kbd "u") 'dired-subtree-up)

  ;; Bind 's' to narrow the view to the current subdirectory
(define-key dired-mode-map (kbd "s") 'dired-subtree-narrow)

(define-key dired-mode-map (kbd "U") 'dired-unmark)
(define-key dired-mode-map (kbd "C-g") 'dired-unmark-all-marks)
(define-key dired-mode-map (kbd "N") 'dired-next-line)
(define-key dired-mode-map (kbd "C-<return>") 'dired-w32explore)

[-- Attachment #2: Type: text/html, Size: 3353 bytes --]

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

end of thread, other threads:[~2024-08-24 23:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-24 23:22 Orgmode keybindings in Dired? Kepa
  -- strict thread matches above, loose matches on Subject: below --
2024-08-22 18:27 Kepa
2024-08-23 12:51 ` Fraga, Eric
     [not found] ` <87o75jstll.fsf@mbork.pl>
2024-08-23 14:40   ` Kepa

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).