cleaned up dired interactive functions

This commit is contained in:
petrucci4prez 2018-09-16 23:37:47 -04:00
parent 276dbe063c
commit 860fe0c01e
1 changed files with 8 additions and 3 deletions

View File

@ -1680,6 +1680,11 @@ Keeping confirmation enabled does weird stuff with helm. Not ideal at the moment
#+END_SRC #+END_SRC
*** interactive functions *** interactive functions
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun nd/dired-move-to-parent-directory ()
"Move buffer to parent directory (like 'cd ..')."
(interactive)
(find-alternate-file ".."))
(defun nd/dired-xdg-open () (defun nd/dired-xdg-open ()
"Open all non-text files in external app using xdg-open. Only regular files are considered" "Open all non-text files in external app using xdg-open. Only regular files are considered"
(interactive) (interactive)
@ -2208,11 +2213,11 @@ Dired makes new buffers by default. Use =find-alternate-file= to avoid this.
(evil-define-key 'normal dired-mode-map (evil-define-key 'normal dired-mode-map
"a" 'dired-find-file "a" 'dired-find-file
"gs" 'nd/dired-sort-by "gs" 'nd/dired-sort-by
"^" 'nd/dired-move-to-parent-directory
"q" 'nd/kill-current-buffer
(kbd "<return>") 'dired-find-alternate-file (kbd "<return>") 'dired-find-alternate-file
"^" (lambda () (interactive) (find-alternate-file ".."))
(kbd "C-<return>") 'nd/dired-xdg-open (kbd "C-<return>") 'nd/dired-xdg-open
(kbd "M-<return>") 'nd/dired-open-with (kbd "M-<return>") 'nd/dired-open-with)
"q" 'nd/kill-current-buffer)
#+END_SRC #+END_SRC
**** helm **** helm
I like tab completion...regardless of what the helm zealots say. This is actually easier and faster because I can just scroll through the source list with j/k and mash TAB when I find the right directory. I like tab completion...regardless of what the helm zealots say. This is actually easier and faster because I can just scroll through the source list with j/k and mash TAB when I find the right directory.