13

I suppose I could use mkdir / touch but I'm not sure if these would go in the current directory as viewed in ranger.

13

To create a directory in ranger, just type

:mkdir exampledir

or,

:touch examplefile
4

The accepted answer is correct, but someone might prefer to get these commands typed just by pressing one key. As @jaustin describes in his answer, one need to have keys mapped in ~/.config/ranger/rc.conf config file.

If you copied default configuration files by

ranger --copy-config=all

then you already have the shortest access to mkdir / touch:

  • F7 - mkdir (config: map <F7> console mkdir%space)
  • Insert - touch (config: map <INSERT> console touch%space)

Mine current version of Ranger is 1.9.2.

BTW: extra space at the end of map c console touch␣ doesn't work. Only map c console touch%space will work.

3

You can use :touch somefile, but I prefer it mapped to a key.

:map c console touch  (note the extra space at the end)

Place this at the bottom of your ~/.config/ranger/rc.conf minus the leading :

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.