Giter VIP home page Giter VIP logo

dotfiles's People

Contributors

bisgardo avatar

Watchers

 avatar

dotfiles's Issues

Make `rm` command move to `./.trash/`

Instead of irreversibly deleting files, rm should move them into a trash folder in the same directory as it lived in before.

Alternatively, trashing is something that is "installed" in a directory (e.g. just by creating a .trash/). Whenever a file or directory is deleted in a subdirectory, it is moved to the parent's trash in a matching subdirectory structure.

An "empty trash" command then permanently deletes a directory's trash. There may also be commands for "bubbling up" the contents of a trash to a parent.

For the trash's subdirectory structure to be consistent, we might also want to rename/move directories whenever the "live" subdirectory tree is modified.

Naturally, there should be ways/rules for overriding/prompting for trashing.

Note that this functionality might already exist elsewhere. In any case, this should probably be a separate project.

Set "parent shell" variable and enable teardown of unsupported features

Make it possible for "modules" to not reinitialize when they don't need to (or shoudn't - e.g. dirs) and tear themselves down when a new subshell that the module doesn't support is started.

It may also be that a module just needs to reregister correctly. For example, in dirs zsh register, the function __dirs_path_components is overwritten. When bash is started as a subshell, this function should revert to its original definition.

Add utilities for pushing/popping items to PS1 as a stack

There should be an internal stack of modified PS1 variables.

Scripts like the event functions in .dotfiles-dir can push new values of PS1 to this stack and restore the previous value later on.

Side note: This ability to modify PS1 "on the side" (including by third parties like Python env) is the reason that we shouldn’t recompute PS1 all the time from PROMPT_COMMAND. The reason that one might want to do that is to have more flexibility to return color codes from functions/scripts. Due to the fact that bash only interprets color codes before evaluating code, this is usually not possible. But note that since the method proposed here modifies PS1 directly, we actually do seem to get that flexibility anyway.

Make functions print usage message

The functions should print a usage message when called with e.g. -h or --help, or when required arguments are not provided.

Maybe there should even be a utility for making this easy?

Ensure that repository works without install when its copied directly into home directory

In certain cases, the project will be automatically copied directly into the home directory. In other cases, one might want to clone it as a bare repository.

In both cases, the dotfiles should just work without calling the install script. This means that .bashrc etc. should reside in the root directory of the project. The install script should symlink these files from the home directory if it the project is not in the home directory (which it should be able to determine this by itself) and link other files appropriately.

For such a setup, the only function of the install script will likely be modifying various OS-specific settings.

Extract dir events to separate module or project

The dir events feature seems to be so generally usable that we might want people to make use of it without depending on the rest of dotfiles.

The setup is merely setting the PROMPT_COMMAND variable.

In that regard the first step is to define a module system for creating things like this as plugins. It would be awesome if plugins could work not only cross-OS, but cross-shell!

Add utility for setting "standard" arguments on well-known commands

Example: On Linux, netstat is most often called with the flags -tulpn. However, these flags don't work on the Mac variant of the program.

Something like a std command could take a program and passes "standard" arguments depending on the platform and possibly some other configuration. In the example above, std netstat [args] would return netstat -tulpn [args] on Linux and [equivalent Mac command] on a Mac. There doesn't seem to be a need for the program to be called directly as the user can easily send the result to a subshell (after possibly verifying the result) or define a new command that performs the call directly.

In a more advanced solution, the utility could arbitrarily translate between arguments on different platforms. I.e. the command linux-args netstat -tulpn returns the equivalent Mac command. (Maybe this already exists?)

This is a very broad, ill-defined, and probably extremely complex task that should be viewed more as a general idea than something that is immediately implementable.

Add function for moving and updating symbolic links

The interface of the function (named e.g. deepmv) should be

deepmv <from-path> <to-path> [<symlink>...]

The function just calls mv and then relinks every <symlink> to <to-path> (should require that it exists and that it used to link to <from-path>?).

The functions may then be combined with the following ones into commands like "move the directory linked to by this symlink and update all links in this directory":

  • Function for searching a directory for symbolic links to some file/directory and print them out
  • Function for (recursively) resolve symbolic link (probably already exist?).

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.