Coder Social home page Coder Social logo

Comments (3)

valignatev avatar valignatev commented on June 30, 2024

Looks like this:

(when (and vc-mode buffer-file-name)

returns nil for me although the file is certainly under git.

UPD: Oh, I see. It looks like an unintuitive behavior of vc-mode. It returns nil for dired buffers and for gitignored files. It's quite unfortunate.

Is it worth to replace vc-mode check with something more intuitive, what do you think? Maybe I'm still doing something wrong and there's a way of fixing/configuring this? Basically what I want is current branch info on my modeline whenever I'm in project buffers regardless of if files being ignored or if it's dired buffer.

Hope it all makes sense lol.

from doom-modeline.

seagle0128 avatar seagle0128 commented on June 30, 2024

Hello, doom-modeline depends on vc-mode to detect vcs info. I believe doom-emacs also has the same behavior. vc-mode is nil in dired buffer. C-x v d to provide vc-dir to check the folder status. I think you should report the issue you mentioned above to upstream vc-mode. Or we find other ways to detect git info, like magit? But vc-mode is built-in and is a general interface of vcs. The similar question is on https://emacs.stackexchange.com/questions/38914/show-git-branch-in-dired-modeline. You can try https://github.com/10sr/git-ps1-mode-el, or port the codes to use global-mode-string to display in doom-modeline. I don't think it's worth to take much time to implement it.

BTW, I think it makes sense not displaying branch info for ignored files, otherwise you shouldn't add them to .gitignore, right?

from doom-modeline.

valignatev avatar valignatev commented on June 30, 2024

BTW, I think it makes sense not displaying branch info for ignored files, otherwise you shouldn't add them to .gitignore, right?
It's debatable, I see this as a project info, no the individual file, but I see why it works like that, it makes sense as well.

Anyways, thanks for the links and your help, I think I'll handle that from here. :)

from doom-modeline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.