emacs-neotree icon indicating copy to clipboard operation
emacs-neotree copied to clipboard

Shorten long file name

Open PaulPichaureau opened this issue 8 years ago • 2 comments

Hi,

I've just tested neotree. It's a very promising package, good work!

But I've find an annoying behavior: when files have long names, the display is quite clumsy and hard to read.

neotree long file name

In my opinion, long name should be shortened. For example:

verylongnameofafile.pdf

should be displayed

verylo(....).pdf

What do you think?

PaulPichaureau avatar Feb 09 '17 15:02 PaulPichaureau

I have the same issue.

Neotree looks great, thank you guys! I would like to continue use it, so maybe you can advice some way to shorten long file names, or truncate them.

I have tried to truncate lines using neotree-mode-hook, but this wasn't work for me unfortunately.

my code:

(add-hook 'neotree-mode-hook (lambda () (progn
    (setq truncate-lines t)
    (setq word-wrap nil))))

dajnz avatar Apr 23 '17 23:04 dajnz

Try this

(add-hook 'neo-after-create-hook
   #'(lambda (_)
       (with-current-buffer (get-buffer neo-buffer-name)
         (setq truncate-lines t)
         (setq word-wrap nil)
         (make-local-variable 'auto-hscroll-mode)
         (setq auto-hscroll-mode nil))))

lukertty avatar May 23 '17 09:05 lukertty