4

I have recently moved from dired to ranger. While using it on a regular work day, I noticed there isn't any command for creating a new directory.

Is there a workaround or am I missing something?

myTerminal
  • 417
  • 1
  • 5
  • 15

3 Answers3

4

I am assuming this is talking about the https://github.com/ralesi/ranger.el package available from Melpa. There are several things you can do

  1. Use "!" to run a command. This is made slightly tricky as ranger seems to want to pass the filename you are on to the command, so something like mkdir wibble ; : could be used on unix systems.

  2. Switch to dired mode using control-p, then use + to call dired-create-directory, and then control-p to switch back to ranger

  3. Add

    (require 'ranger)
    (define-key ranger-normal-mode-map (kbd "+") #'dired-create-directory)
    

to your startup file.

Whilst ranger is quite pretty, I dislike the way it takes away standard ways to discover things. In particular binding control-h to toggle hidden (dot) files is bad.

icarus
  • 1,904
  • 1
  • 10
  • 15
1

To create a new directory you can use either of the two commands (Ranger v1.7.2-1 on Arch Linux):

F7

:mkdir

You can also assign your custom hotkey by editing file

~/.config/ranger/rc.conf
Kirkx
  • 11
  • 1
  • I think you are talking about ranger as a stand-alone program, rather than https://github.com/ralesi/ranger.el which is a piece of emacs lisp code which gives you a similar interface. – icarus Dec 01 '16 at 20:25
0

The quickest way is dired-create-directory (bound by default to + in dired). It will prompt you for the name of the directory to create.

pietrodito
  • 177
  • 7
  • Welcome to Emacs.SE! Please note that the [accepted answer](https://emacs.stackexchange.com/a/28473) and related comment already provide this information. – Dan Aug 28 '19 at 16:29