timoses / dotfim Goto Github PK
View Code? Open in Web Editor NEWDotfiM - A Dotfile Manager
DotfiM - A Dotfile Manager
File permissions should be synced (e.g. chmod u+x
) to allow e.g. synced shell scripts to work instantaneously.
The file is removed from host where dotfim remove
was executed. However, the removed state is not synced to other hosts (files simply remain).
Shebang notation requires the #!/...
to stay on top of the file! Currently DotfiM moves content into a section and prepends it with comments.
Currently it's not possible to synchronize dotfile setups for specific environment types only. E.g. one would want a dotfile to exist and work for both a Windows and a Linux mashine. The ability to
enable the use of DotfiM for the purpose of
dotfim sync [--profile=<profile>] [<FilesOrFolders>]
: allows syncing only specific profiles and/or files/foldersdotfim profile
: list available profiles, and e.g. mark synced ones with *
, OR: list available commands only
ls
list profiles, like aboveadd
a profile to be synced on this machineremove
profile from this machine's synced profile listdotfim add --profile=<profile>[,<profiles>] <dotfile>
: Add a specific file to one or more profiles
# dotfim profile <...>
control statements!!!default
profile is used. this allows a user to opt-out of the default
profile and only sync specific profiles.# dotfim profile <profile1>,<profile2>,...
: only applied to dotfile if the machine's dotfim is set up to be synced with the profile dotfim profile add
...
dotfim profile add <profile> && dotfim sync --profile <profile>
) before allowing the addition of further passages
#managed by dotfim
): allows listing which hosts use which profilesdotfim add --profile
). This means either
.vimrc.profile_<name1>
), orAdd the following ideas:
Several Profiles Can be Assigned to a Passage.
Allows e.g. creating a 'remote' profile. The same passages can be used in other profiles as well.
What about: if I want a passage profiled 'bash' to have a 'remote' and a 'normal' version? -> Add combination of passages? E.g. <'bash','normal'> and <'bash','remote'>?
profiles are like passages, but they may contain passages. E.g. a gitfile would have:
# dotfim profile windows {
# dotfim local windows-machine
...
# dotfim }
# dotfim profile linux
linux profile line
In effect it works like "local/private" (which filters the host name).
463600b#diff-064c10df0b9143aaf638ec8f14cff24aR271
// TODO: else if git not managed, but dot is still managed?
// This might happen when on another machine a file is unmanaged (removed).
// Another machine starts up and sees an unmanaged gitfile, but dotfile is
// still managed ...
// BEWARE: Sync.4 -> Have to create something like 'unmanageDots' container... for sync.4
// or Sync.5 ???
One might not want to have all git repo dotfiles synchronized on a machine. At the same time picking out single dotfiles to be synchronized by hand might be tedious if the user only wants to synchronize dotfiles for a specific program (which may be more than one file).
Sets could be used to bundle dotfiles together and allowing the user to for example do
dotfim set add/sync <setName>
Add a command dotfim test <dir=.>
which sets up a test environment where
<dir>/dot
<dir>/git
<dir>/repo
(run git init --bare
and eventually set up some test files as examples)Can be useful for unit tests and when users want to try/experiment with dotfim.
Should easily be usable with #8 -> just shell into container and try dotfim.
Currently, the semantics are a bit odd. dotfim sync
initializes (renamed to init
in 642b79c), and dotfim
syncs.
dotfim
:
dotfim init <repository> [<directory>]
:
<directory>/.dotfim/local.(json/yaml)
dotfim sync [--profile=<profile>] [<FilesOrFolders>]
: (actually does the syncing part; currently called update
)
.dotfim.(json/yaml)
for managed gitfiles that do not belong to a specific profiledotfim
should be run in the git repository -> dotfim can store its settings in the git repository
Line 563 in ae5c170
Correction:
Automatically add the correct header to the gitfile (commentIndicator is known as the user had to specify it).
When the set merge tool (git config merge.tool <x>
) is not available the error is thrown:
The merge tool is not available as '<x_cmd>'
This error message could be detected and the user advised to set up a working merge tool.
git config --help
will display available preset mergetools under merge.tool
.
Instead of sections (local and sync) there could be comment control statements to control whether the next line or couple of lines are local.
Control statements are added to the git repository, the comment line is enriched with the host machine name.
dotfile:
<commentIndicator> dotfim local
my local line
gitfile:
<commentIndicator> dotfim local (<HostName>)
my local line
#3 proposes profiles. Dotfim control comments should offer the ability to add lines to specific profile(s) only
<commentIndicator> dotfim profile myprofile1, myprofile2, ...
The default (no comment control statement) means that the line is shared and synced.
A feature to span multiple lines with a control comment should be possible:
# dotfim local {
line 1
line 2
# dotfim }
dotfim local
: will only be applied to the machine dotfim private
: private lines are never written to the git repository. They are the only lines remaining when unsyncing a file (dotfim remove
)dotfim profile <profile1>,<profile2>,...
: only applied to dotfile if the machine's dotfim is set up to be synced with the profile dotfim sync --profile=...
gitfile
into sections of hosts (where only local and private lines are listed). TheA Dockerfile to create an image that users of dotfim can spin up could be useful. People unfamiliar with D
may feel hesitant to build the app themselves. Containers to the rescue!
Aspects to consider:
Container requires access to the user's home directory (where dotfiles reside)
Optimally the container should have a persistent volume (to store its settings and the git repository)
Should enable dotfim test
for experimentation in isolated container
There may be more appropriate structures than using sections within a single dotfile.
Ideas might be
Instead, dotfim remove --all
should be an option.. Should that remove all currently synced files? Or all = all in git repository?
Alternatively, dotfim remove --local <dotfile>
could achieve that a file is only removed locally from the sync list.
So unsync
would do remove --local --all
? Meaning the local dotfim will never sync any files.
This will require to keep a managed list of which hosts are tracking a file (or are not tracking, e.g. tracking the exceptions)!
Further, unsyncing a file will keep the 'local' and 'private' sections in the gitfile, so that when syncing it again, dotfim will be able to recreate the previous state. Only when a file is remove
d the 'local'/'private' sections are removed.
Removing a file should issue a prompt telling the user that the file will no longer be recreated as it is when added again (note: local/private sections remain in dotfile, and git sections in gitfile). (... sections=passages)
Special environment variable in dockerfile -> dotfim init
knows that the folders are /git/
, /dot/
and /repo/
!
No need to ask user.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.