mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 06:12:34 +00:00
Added a few git functions and fixed fpath not being set in the appropriate spot
This commit is contained in:
4
zsh/.zshenv
Normal file
4
zsh/.zshenv
Normal file
@@ -0,0 +1,4 @@
|
||||
# This needs placed in the ~/.zshenv
|
||||
|
||||
export ZDOTDIR="$HOME/.config/zsh"
|
||||
[ -f "$ZDOTDIR/.zshenv" ] && source "$ZDOTDIR/.zshenv"
|
||||
@@ -1,3 +1,5 @@
|
||||
# This should be placed in "$XDG_CONFIG_HOME/zsh/.zshenv"
|
||||
|
||||
# Config
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_DATA_HOME="$HOME/.local"
|
||||
|
||||
@@ -65,6 +65,15 @@ path_prepend \
|
||||
"$HOME/.local/bin" \
|
||||
"$SCRIPTS"
|
||||
|
||||
fpath_prepend \
|
||||
"$(brew --prefix)/share/zsh/site-functions" \
|
||||
"$(brew --prefix)/share/zsh-completions" \
|
||||
"$ZDOTDIR/completions" \
|
||||
"$HOME/.local/completions" \
|
||||
"$ZDOTDIR/functions"
|
||||
|
||||
autoload -Uz $fpath[1]/*(.:t)
|
||||
|
||||
#------------------------------ history ------------------------------
|
||||
setopt appendhistory # append to history
|
||||
setopt sharehistory # share history across multiple sessions
|
||||
@@ -137,8 +146,6 @@ alias ga='git add'
|
||||
alias gcb='git checkout -b'
|
||||
alias gco='git checkout'
|
||||
alias gcm='git commit -a -m'
|
||||
#alias gl() { git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit }
|
||||
#alias gma() { git add . && git commit -m "$1" }
|
||||
alias gp='git push'
|
||||
alias gs='git status'
|
||||
alias l='ls -lah --color=auto'
|
||||
@@ -158,14 +165,3 @@ alias nvim-lazy='NVIM_APPNAME=lazy nvim'
|
||||
#------------------------------ local configs ------------------------------
|
||||
_source_if "$ZDOTDIR/.zshrc-local"
|
||||
|
||||
#------------------------------ functions ------------------------------
|
||||
fpath_prepend \
|
||||
"$(brew --prefix)/share/zsh/site-functions" \
|
||||
"$(brew --prefix)/share/zsh-completions" \
|
||||
"$ZDOTDIR/completions" \
|
||||
"$HOME/.local/completions" \
|
||||
"$ZDOTDIR/functions"
|
||||
|
||||
autoload -Uz $fpath[1]/*(.:t)
|
||||
|
||||
|
||||
|
||||
8
zsh/config/functions/gl
Executable file
8
zsh/config/functions/gl
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# Prettier git log
|
||||
function gl() {
|
||||
git log --graph \
|
||||
--pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' \
|
||||
--abbrev-commit
|
||||
}
|
||||
11
zsh/config/functions/gma
Executable file
11
zsh/config/functions/gma
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# Add all and commit to git.
|
||||
|
||||
function gma() {
|
||||
[ -z "$1" ] \
|
||||
&& echo "usage: gma <commit-message>" \
|
||||
&& return 1
|
||||
|
||||
git add . && git commit -m "$1"
|
||||
}
|
||||
Reference in New Issue
Block a user