emacs

Consider also joining #cider, #lsp and #inf-clojure, where most of the tool-specific discussions are happening.
agilecreativity 2021-06-09T14:20:09.041100Z

Hi, Does anyone know how can I get the backspace to skip pass just one char when using it with dired from top level directory to base directory? e.g.

Find file: ~/projects/some-project/sub-dir

# When I press Backspace at the sub-dir level I want it to go directly to 
~/projects/some-project/ not by one char e.g.
~/projects/some-projec 

agilecreativity 2021-06-09T14:21:38.041200Z

In Spacemacs, it seems I can get the effect by pressing Ctl-h, but what I want is this to be the default behavior when pressing backspace.

agilecreativity 2021-06-09T14:26:26.041400Z

Probably dired-up-directory?

lukasz 2021-06-09T14:28:30.041600Z

You can use ^ to jump up. That said, one of the packages I have installed (ivy?) enables the mode you're asking about - pressing delete/backspace removes a single path segment not a single character

1πŸ‘
tvirolai 2021-06-09T14:28:38.041800Z

Ido does this https://www.masteringemacs.org/article/introduction-to-ido-mode

1πŸ‘
tvaughan 2021-06-09T14:29:58.042Z

(defun tvaughan/parent-directory (path)
  "Return the parent directory of PATH."
  (or (file-name-directory (directory-file-name path)) ""))

(defun tvaughan/backward-delete-directory (arg)
  "Delete characters backward until encountering the end of a word.
With ARG, do this that many times."
  (interactive "p")
  (let ((contents (minibuffer-contents)))
    (delete-minibuffer-contents)
    (insert (tvaughan/parent-directory contents))))

(use-package selectrum
  :config
  (selectrum-mode +1))

(define-key selectrum-minibuffer-map (kbd "DEL") #'tvaughan/backward-delete-directory)

1πŸ‘
tvaughan 2021-06-09T14:31:27.042200Z

ido does this much better. This still doesn't replicate it as well. Granted, this is used with selectrum, but should be adaptable

grazfather 2021-06-09T15:22:52.042500Z

Is Ido basically a competitor for help or ivy?

agilecreativity 2021-06-09T16:15:00.043100Z

I want the same thing and I really like aggressive-indent-mode and wish I can customize it to make it produce the same output as cljfmt so the same rules can be used with other team member.

agilecreativity 2021-06-09T16:24:03.043300Z

Thanks @grazfather after adding ivy, and now I get the desired effect that I want. I am trying a new config and can’t remember how this work with my old config. And ivy package seems to be the one that I really need.

2πŸ‘