How to make a keybinding for dired to create a new file?

I tried to look at dired config but couldn’t find the keybinding for creating a new folder which would have been helpful to create one for new file.

Here’s what I got so far:

(map! "N" #'dired-create-empty-file)

Also, in which file would I have been able to find the keybinding for new folder in dired?

Found it although something is missing to make it work only within dired.

Here’s what I’ve got:

(map! :map (dired-mode-map normal)
      :leader
      "+" #'dired-create-empty-file)

The dired command is set into the evil mode collection which I don’t know where to find in emacs folder, but I found this..

something is missing to make it work only within dired.

You shouldn’t need normal, (map! :map dired-mode-map :n "+" #'dired-create-empty-file) should work.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.