Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

$HOME directory config files

NotificationsYou must be signed in to change notification settings

pbryon/dotfiles

Repository files navigation

Yet another dotfiles repo. Mine might be different in the following aspects.

.bashrc

read_config

My.bashrc uses a config file (.bashrc.conf) to read config parameters:

  • REPO: the directory you clone repositories to
  • GIT: the drectory used for local machine remotes
  • SCHOOL: the directory where I keep my school files
  • FIND_FILE_IGNORE: regex of folders to ignore when usingfind_file_string andfind_git_string

These are then read in theread_config() functions inrepo.sh andschool.sh to export environment variables.

load_import_files

This function imports sources into the .bashrc.

import_files=(ps1 repo git-log git-all find-git-string school)load_import_files

Each of these sources can be found in thebash subdirectory.

Please note that the above list of imports is subject to change.

PS1

Source:ps1.sh

My PS1 shows a shorter path for$REPO and$HOME (sub)directories.

When the current directory is a git repo, it will show the git branch and status behind the directory name, filtering status for behind and ahead.

e.g.dotfiles(ahead) [master]$

repo alias

Source:repo.sh

The aliasrepo usesgoto_repo() andcomplete_repo(). It can:

  • navigate to a repository:repo dotfiles orrepo dot<TAB>
  • navigate and perform a git action:repo dot<TAB> pull

It uses the$REPO environment variable set inread_config().

If you want to use these aliases without usingread_config(), add the following line to the.bashrc before theload_import_files function call:

export REPO=<directory to your repositories>

and remove theread_config line and/or function.

find_file_string()

Source:find-file-string.sh

Default alias: ff (configurable in the source file)

Finds a string in the current directory's files (based onfind . -type f).

Usage:

ff [extension] <pattern>With no extension, it will search all files.If the pattern ends with a bang (!), it's case sensitive

Examples:

CommandDescription
ff fooLooks for case insensitive string "foo"
ff foo!Looks for the case sensitive string "foo"
ff cs fooLooks for the case insensitive string in all.cs files

find_name

Source:find-file-string.sh

Default alias: fn (configurable in the source file)

Finds a file in the current direcotry and subdirectories by name

Usage:

fn <pattern>

not()

Source:find-file-string.sh

Excludes the given pattern and filters out empty linesUsage:not<pattern>

find_git_string()

Source:find-git-string.sh

Default alias: gf (configurable in the source file)

Finds a string in the current repo's tracked files (based ongit ls-files).

Usage:

gf [extension] <pattern>With no extension, it will search all files.If the pattern ends with a bang (!), it's case sensitive

Examples:

CommandDescription
gf fooLooks for case insensitive string "foo"
gf foo!Looks for the case sensitive string "foo"
gf cs fooLooks for the case insensitive string in all.cs files

find_merge_conflict()

Source:find-git-string.sh

Default alias: gfc (configurable in the source file)

Finds merge conflicts based on "HEAD", "<<<<" and ">>>>"

Usage:

gfc         Shows files with merge conflict indicatorsgfc -v      Show conflict context (grep -C)

git aliases

Source:git-aliases.sh

Contains a bunch of shorthand git aliases:

AliasCommand
gaagit add --all
gacgit add --all && git commit -v
gaigit add --interactive
ganegit commit --amend --no-edit
gbgit branch -avv
gcpgit cherry-pick
gmtgit mergetool
gsgit status
gsfgit fetch && git status
grcgit rebase --continue
grsgit rebase --skip

gitall()

Source:git-all.sh

Runsgit $@ on all subdirectories that are git repos.

Also includespullall, which runsgitall pull.

Checks whether each directory is a git repo by:

  • Presence of .git directory
  • Current git branch

git log()

Source:git-log.sh

AliasCommandDefault entries shown
glgit log -n10
glpgit log -n with pretty format200
refsgit reflog | head -n10

git reset to

Source:git-reset-to.sh

Resets the current branch's HEAD to a given commit

Usage:

$ grtUsage: grt <target commit>

git refork

Source:git-refork.sh

Rebases this forked repository on the upstream branch

Usage:

$ refork <upstream remote>

If left blank, the upstream remote will default to "upstream"

git tags

Source:git-tags.sh

Show all defined tags and their related commits.

Usage:

$ git-tagssprint0         Finish sprint 0  0223702   Pieter Bryon            2020-10-11 17:10:04 +0200         Add TODOssprint1         Finish sprint 1  79ac3c6   vangorpdirk             2020-11-07 14:23:26 +0100#5 create personal profile page

school

Probably of no use to you. Aliases for my school repo.

The aliases only get set when you've got a$SCHOOL variable in your.bashrc.conf

PowerShell functions

These can be found in./ps

tail

Source:tail.ps1

Mimics UNIXtail -f

Usage:

tail <file>

newest

Lists the newest file in a directory.

Source:newest.ps1

Usage:newest

Rprofile.site

The profile loaded for R Studio.

Git hooks

These can be found in thegit_hooks folder and have a first line comment describing their purpose.

They purposefully don't have shebangs, so they'll work in Visual Studio

Scripts

touchpad.sh

This script checks every second for a connected mouse (identified through the$mouse variable). When a mouse is connected, it disables the trackpad. When it's disconnected, it re-enables it.

This script has only ever been tested on a Lenovo ThinkPad E570, so I don't know how portable it is beyond that.

update.sh

This script is for personal use. I would advise against using it unless you plan to fork this repo.

Syntax:./update.sh <category>

This script can update categories of dotfiles - run the script without arguments to see which.

For *rc files, it removes the old $HOME file and creates a symlink to the copy in the directory for this repository.

If a file already exists or when it already is a symlink with a different target, you'll be prompted whether you want to remove the old file.

VSCode

Thevscode directory contains two scripts:

save-extensions.sh

This script exports your currently installed VSCode extensions to a text file

update-extensions.sh

This script installs/updates the extensions in the text file.

It's also called by theupdate.sh script, provided you run it with one of:

./update.sh all./update.sh code./update.sh vscode

web directory

This directory contains some boilerplate files for web development projects with Sass and TypeScript.

About

$HOME directory config files

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp