Skip to content

Commit

Permalink
✨ dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
juftin committed Mar 1, 2024
0 parents commit eedf93d
Show file tree
Hide file tree
Showing 12 changed files with 1,971 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release
on:
push:
branches: [main, next, beta, alpha, "*.x"]
jobs:
release:
name: Release
if: github.repository_owner == 'juftin'
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Semantic Release
uses: juftin/actions/semantic-release@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Empty file added .gitignore
Empty file.
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
default_stages: [commit]
fail_fast: false

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
exclude: mkdocs.yaml
- id: check-ast
- id: check-docstring-first
- id: check-merge-conflict
- id: mixed-line-ending

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
hooks:
- id: prettier
args: [--print-width=88, --tab-width=4]
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.8.0-1
hooks:
- id: shfmt
18 changes: 18 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"branches": [
"main",
"master",
"next",
"next-major",
"+([0-9])?(.{+([0-9]),x}).x",
{
"name": "beta",
"prerelease": true
},
{
"name": "alpha",
"prerelease": true
}
],
"plugins": ["semantic-release-gitmoji", "@semantic-release/github"]
}
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# dot-files

This repository contains my personal dot-files.

```shell
git clone https://github.com/juftin/dotfiles.git ~/.dotfiles
```

### `~/.zshrc`

```shell
##########################################################
################# DOTFILE INSTALLATION ###################
##########################################################

DOTFILE_REPO="juftin/dotfiles"

if [[ ! -d ${HOME}/.dotfiles ]]; then
print -P "%F{33}▓▒░ %F{220}Installing %F{33}~/.dotfiles%F{220} from GitHub…%f"
command echo git clone https://github.com/${DOTFILE_REPO} "${HOME}/.dotfiles" && \
print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \
print -P "%F{160}▓▒░ The clone has failed.%f%b"
fi

[[ ! -f ${HOME}/.dotfiles/dotfiles.zsh ]] || source ${HOME}/.dotfiles/dotfiles.zsh

##########################################################
```
16 changes: 16 additions & 0 deletions dotfiles.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
##########################################################
#################### juftin/dotfiles #####################
##########################################################

DOTFILES_DIR="${0:a:h}"

# Load zinit
[[ ! -f ${DOTFILES_DIR}/shell/zsh/zinit.zsh ]] || source ${DOTFILES_DIR}/shell/zsh/zinit.zsh
# Shell History
[[ ! -f ${DOTFILES_DIR}/shell/zsh/history.zsh ]] || source ${DOTFILES_DIR}/shell/zsh/history.zsh
# Shell Search
[[ ! -f ${DOTFILES_DIR}/shell/zsh/search.zsh ]] || source ${DOTFILES_DIR}/shell/zsh/search.zsh
# Shell Autocomplete
[[ ! -f ${DOTFILES_DIR}/shell/zsh/autocomplete.zsh ]] || source ${DOTFILES_DIR}/shell/zsh/autocomplete.zsh
# Global Shell Aliases
[[ ! -f ${DOTFILES_DIR}/shell/aliases.zsh ]] || source ${DOTFILES_DIR}/shell/aliases.zsh
37 changes: 37 additions & 0 deletions shell/aliases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
##########################################################
##################### SHELL ALIASES ######################
##########################################################

alias c="clear"
alias cls="clear"
alias ls="ls -G -a -F"

# File search functions
function f() {
find . -iname "*$1*" ${@:2}
}
function r() {
grep "$1" ${@:2} -R .
}

# Create a folder and move into it in one command
function mkcd() {
mkdir -p "$@" && cd "$_"
}

# CHECKOUT A GIT BRANCH
function check() {
git checkout $1
log_event info "Working On Git Branch: ${1}"
}

# REMOVE LOCAL VERSIONS OF DELETED REMOTE BRANCHES
function git-remove-deleted() {
git fetch -p
for branch in $(git branch -vv | grep ': gone]' | awk '{print $1}'); do
git branch -D $branch
done
}

# GIT STATUS - VERBOSE BY DEFAULT
alias status="git status --verbose --ahead-behind --branch --find-renames"
Loading

0 comments on commit eedf93d

Please sign in to comment.