Code Monkey home page Code Monkey logo

Comments (10)

anishathalye avatar anishathalye commented on September 28, 2024 1

This is independent of Dotbot. E.g. Vim 8 will automatically load packages in a particular directory (https://shapeshed.com/vim-packages/). You can put them there using Git submodules.

from dotfiles.

tyr898 avatar tyr898 commented on September 28, 2024 1

Thank you for this crash course in maintaining plugins without git repos! Unfortunately I think I had the impression that plugins must have a corresponding plugin manager. Most popular ones automatically use git clone instead of git submodule add, and I think I was looking in the wrong place in trying to modify the plugin managers to use submodules instead of repos. Now I know better!

from dotfiles.

anishathalye avatar anishathalye commented on September 28, 2024

I wouldn't modify the .gitmodules file directly. You can use the git submodule family of commands, e.g. git submodule add, to add them.

from dotfiles.

tyr898 avatar tyr898 commented on September 28, 2024

Has this been documented somewhere? I believe the way that things work in Vim plugin managers is that you execute some ex command like :PlugInstall and the plugin manager clones the repos for you in the appropriate folder. Does this mean you would have to add submodules for those repositorys manually to be compatible with dotbot (and not have git repos inside a submodule?)

from dotfiles.

tyr898 avatar tyr898 commented on September 28, 2024

I see.. Please excuse my inexperience. In summary, the way these dotfiles work for plugins is that using Git submodules, the Github repo for the plugin is "cloned" using git submodule add ... to the appropriate directory.

If we want to remove the plugin, we simply modify .gitmodules as done here: b1f82c9? Do we remove the files as shown here or did you do something different for that commit?

Do we still need to do this step using this method: Run rm -rf .git/modules/path_to_submodule (no trailing slash) when removing a submodule or will git handle it?

from dotfiles.

anishathalye avatar anishathalye commented on September 28, 2024

Yes, that's correct, I use git submodule add to clone the plugin as a submodule. When the dotfiles directory is cloned, the git submodule update ... command is used to check out the appropriate versions of all the submodules. Reading the documentation on submodules might help with understanding this.

To remove a plugin, you can just git rm the file, and Git will know that it's a submodule and make the appropriate modifications to .gitmodules. If you look at b1f82c9, you'll see that the .gitmodules file was edited (automatically by git, when I ran git rm), and the emacs.d/vendor/undo-tree submodule reference was also deleted.

from dotfiles.

tyr898 avatar tyr898 commented on September 28, 2024

Regarding submodules, is there any relevance to ignore=untracked as in your .gitmodules:

[submodule "vim/bundle/vim-markdown"]
	path = vim/pack/vendor/start/vim-markdown
	url = https://github.com/tpope/vim-markdown
	ignore = untracked

According to documentation: "Only untracked files in submodules will be ignored. Committed differences and modifications to tracked files will show up."

I suppose this would only be relevant if you are actually modifying the code in your submodules. Otherwise, it makes no difference, correct?

from dotfiles.

anishathalye avatar anishathalye commented on September 28, 2024

It's relevant when e.g. untracked temporary files are created in submodule directories.

from dotfiles.

tyr898 avatar tyr898 commented on September 28, 2024

Does this shell command from .install.conf.yaml achieve something similar? Deleting the untracked files (even in those submodules that have ignore = untracked) to create a fresh dotfiles directory every time ./install is run? (BTW perhaps you should call this on vim/pack/vendor instead of vim/bundle since you don't use pathogen anymore)

  - >
    git cleanall -f
    emacs.d/vendor/
    irssi/scripts/vendor/
    jupyter/nbextensions/
    shell/plugins/
    vim/bundle/
    zsh/plugins/

from dotfiles.

anishathalye avatar anishathalye commented on September 28, 2024

Yeah, I think this removes submodules that were deleted on another machine, and then we git pulled on the current machine. And thanks for pointing out the vim/pack/vendor thing.

from dotfiles.

Related Issues (9)

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.