Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling line numbers on Neotree #3202

Closed
angrygoats opened this issue Sep 30, 2015 · 14 comments
Closed

Disabling line numbers on Neotree #3202

angrygoats opened this issue Sep 30, 2015 · 14 comments

Comments

@angrygoats
Copy link

Hey everyone,

I was enabling line numbers and it seems that if you use the code

   (global-linum-mode)

It will enable line numbers as expected, however it also enables them in neotree! Its not critical or anything, but it seems pointless to have them in there. Is there anything I can add to remove them just for neotree, or is this intended behavior?

Thanks!

@robbyoconnor
Copy link
Contributor

SPC t n is a short fix

@angrygoats
Copy link
Author

@robbyoconnor Yeah, that's what I have been doing, I was curious if there was anything I could add to my .spacemacs file. I'm still pretty new to emacs, so you'll have to forgive me.

@justbur
Copy link
Contributor

justbur commented Sep 30, 2015

Try this in your dotfile

(with-eval-after-load 'neotree
  (add-hook 'neotree-mode-hook 
    (lambda () (with-current-buffer " *NeoTree*"
      (setq-local linum-mode nil)))))

@angrygoats
Copy link
Author

@justbur Thank you for your help. I am getting No buffer named *NeoTree* now.

@justbur
Copy link
Contributor

justbur commented Sep 30, 2015

Probably need to use a mode-hook. I can't test this right now but i edited my previous comment to show how. If that doesn't work, I'll figure it out tomorrow for you.

@angrygoats
Copy link
Author

@justbur Very weird. I can play around with it a little, seems to be giving me the same error.

@syohex
Copy link
Contributor

syohex commented Sep 30, 2015

@angrygoats How about this ?

(defun my/neotree-hook (_unused)
  (linum-mode -1))
(add-hook 'neo-after-create-hook 'my/neotree-hook)

@angrygoats
Copy link
Author

@syohex Where should I put this in my dotfile?

@syl20bnr
Copy link
Owner

Put it in dotspacemacs/user-config

@angrygoats
Copy link
Author

@syohex @syl20bnr

That worked! awesome!

Thanks everyone.

@robbyoconnor
Copy link
Contributor

This really should be default imho.

@dvcrn
Copy link
Contributor

dvcrn commented Sep 30, 2015

Oddly enough, I don't have this problem. (global-linum-mode t) is in my .spacemacs, but no line numbers in neotree.

Doing a live reload with f e R is adding them to neotree temporarily but after a clean restart of emacs, they are gone and only in my other buffers.

@synic
Copy link
Contributor

synic commented Oct 3, 2015

I've seen it too with global-linum-mode, but they are off by default. Certain actions will turn them on and then they stay on until you restart emacs or toggle them off.

@StreakyCobra
Copy link
Contributor

#3557 will solve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants