Add gitattributes and glitter to shell
This commit is contained in:
parent
d705629e9c
commit
a2c8161d6d
2
.bashrc
2
.bashrc
|
@ -11,7 +11,7 @@ esac
|
||||||
DIR="$(dirname $(readlink ~/.bashrc))"
|
DIR="$(dirname $(readlink ~/.bashrc))"
|
||||||
|
|
||||||
# load all dotfiles in dotfiles repository
|
# load all dotfiles in dotfiles repository
|
||||||
for DOTFILE in `find $DIR/system/.{prompt,alias,functions,path,env}.sh`
|
for DOTFILE in `find $DIR/system/.{prompt,alias,functions,path,env,shell}.sh`
|
||||||
do
|
do
|
||||||
[ -f "$DOTFILE" ] && source "$DOTFILE"
|
[ -f "$DOTFILE" ] && source "$DOTFILE"
|
||||||
done
|
done
|
||||||
|
|
1
git/.gitattributes_global
Normal file
1
git/.gitattributes_global
Normal file
|
@ -0,0 +1 @@
|
||||||
|
*.ipynb filter=nbstrip_full
|
|
@ -6,10 +6,22 @@
|
||||||
[core]
|
[core]
|
||||||
editor = vi
|
editor = vi
|
||||||
excludesfile = ~/.gitignore_global
|
excludesfile = ~/.gitignore_global
|
||||||
|
attributesfile = ~/.gitattributes_global
|
||||||
[filter "lfs"]
|
[filter "lfs"]
|
||||||
clean = git-lfs clean -- %f
|
clean = git-lfs clean -- %f
|
||||||
smudge = git-lfs smudge -- %f
|
smudge = git-lfs smudge -- %f
|
||||||
required = true
|
required = true
|
||||||
|
|
||||||
|
[filter "nbstrip_full"]
|
||||||
|
clean = "jq --indent 1 \
|
||||||
|
'(.cells[] | select(has(\"outputs\")) | .outputs) = [] \
|
||||||
|
| (.cells[] | select(has(\"execution_count\")) | .execution_count) = null \
|
||||||
|
| .metadata = {\"language_info\": {\"name\": \"python\", \"pygments_lexer\": \"ipython3\"}} \
|
||||||
|
| .cells[].metadata = {} \
|
||||||
|
'"
|
||||||
|
smudge = cat
|
||||||
|
required = true
|
||||||
|
|
||||||
[alias]
|
[alias]
|
||||||
# "Custom" commands
|
# "Custom" commands
|
||||||
# diff against characters instead of lines
|
# diff against characters instead of lines
|
||||||
|
|
13
setup.sh
13
setup.sh
|
@ -13,9 +13,10 @@ DIR=$(pwd -L)
|
||||||
|
|
||||||
echo -e "\n${GREEN}linking config files...${NC}\n"
|
echo -e "\n${GREEN}linking config files...${NC}\n"
|
||||||
|
|
||||||
ln -sv "$DIR/.bashrc" ~
|
ln -sbv "$DIR/.bashrc" ~
|
||||||
ln -sv "$DIR/profiles/.bash_profile" ~
|
ln -sbv "$DIR/profiles/.bash_profile" ~
|
||||||
ln -sv "$DIR/profiles/.inputrc" ~
|
ln -sbv "$DIR/profiles/.inputrc" ~
|
||||||
ln -sv "$DIR/profiles/.vimrc" ~
|
ln -sbv "$DIR/profiles/.vimrc" ~
|
||||||
ln -sv "$DIR/git/.gitconfig" ~
|
ln -sbv "$DIR/git/.gitconfig" ~
|
||||||
ln -sv "$DIR/git/.gitignore_global" ~
|
ln -sbv "$DIR/git/.gitignore_global" ~
|
||||||
|
ln -sbv "$DIR/git/.gitattributes_global" ~
|
||||||
|
|
|
@ -3,8 +3,8 @@ export PATH="/usr/local/heroku/bin:$PATH"
|
||||||
|
|
||||||
### Stack executibles
|
### Stack executibles
|
||||||
export PATH="/usr/local/bin/:$PATH"
|
export PATH="/usr/local/bin/:$PATH"
|
||||||
export PATH="/home/gwen/.local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
export PATH="/home/gwen/.stack/programs/x86_64-linux/ghc-8.2.2/bin:$PATH"
|
export PATH="$HOME/.stack/programs/x86_64-linux/ghc-8.2.2/bin:$PATH"
|
||||||
|
|
||||||
### Rust/Cargo executables
|
### Rust/Cargo executables
|
||||||
export PATH="$HOME/.cargo/bin:$PATH"
|
export PATH="$HOME/.cargo/bin:$PATH"
|
||||||
|
|
|
@ -12,11 +12,6 @@ __set_prompt() {
|
||||||
# If the last command didn't exit 0, display the exit code
|
# If the last command didn't exit 0, display the exit code
|
||||||
[ "$EXIT" -ne "0" ] && PS1+="$EXIT "
|
[ "$EXIT" -ne "0" ] && PS1+="$EXIT "
|
||||||
|
|
||||||
# identify debian chroot, if one exists
|
|
||||||
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
|
||||||
PS1+="${debian_chroot:+($(cat /etc/debian_chroot))}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
PS1+="$(glit "$FMT" -e "$ELSE_FMT")"
|
PS1+="$(glit "$FMT" -e "$ELSE_FMT")"
|
||||||
}
|
}
|
||||||
export PROMPT_COMMAND=__set_prompt
|
export PROMPT_COMMAND=__set_prompt
|
||||||
|
|
58
system/.shell.sh
Normal file
58
system/.shell.sh
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
#/usr/bin/env bash
|
||||||
|
|
||||||
|
# Load completion function
|
||||||
|
complete -F _alacritty alacritty
|
||||||
|
|
||||||
|
# Completion function
|
||||||
|
_alacritty()
|
||||||
|
{
|
||||||
|
local cur prev prevprev opts
|
||||||
|
COMPREPLY=()
|
||||||
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
prevprev="${COMP_WORDS[COMP_CWORD-2]}"
|
||||||
|
opts="-h --help -V --version --live-config-reload --no-live-config-reload --print-events -q -qq -v -vv -vvv --ref-test -e --command --config-file -d --dimensions -t --title --working-directory"
|
||||||
|
|
||||||
|
# If `--command` or `-e` is used, stop completing
|
||||||
|
for i in "${!COMP_WORDS[@]}"; do
|
||||||
|
echo "${COMP_WORDS[i]}" >> ./testfile
|
||||||
|
if [[ "${COMP_WORDS[i]}" == "--command" ]] \
|
||||||
|
|| [[ "${COMP_WORDS[i]}" == "-e" ]] \
|
||||||
|
&& [[ "${#COMP_WORDS[@]}" -gt "$(($i + 2))" ]]
|
||||||
|
then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Make sure the Y dimension isn't completed
|
||||||
|
if [[ "${prevprev}" == "--dimensions" ]] || [[ "${prevprev}" == "-d" ]]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Match the previous word
|
||||||
|
case "${prev}" in
|
||||||
|
--command | -e)
|
||||||
|
# Complete all commands in $PATH
|
||||||
|
COMPREPLY=( $(compgen -c -- "${cur}") )
|
||||||
|
return 0;;
|
||||||
|
--config-file)
|
||||||
|
# Path based completion
|
||||||
|
local IFS=$'\n'
|
||||||
|
compopt -o filenames
|
||||||
|
COMPREPLY=( $(compgen -f -- "${cur}") )
|
||||||
|
return 0;;
|
||||||
|
--dimensions | -d | --title | -t)
|
||||||
|
# Don't complete here
|
||||||
|
return 0;;
|
||||||
|
--working-directory)
|
||||||
|
# Directory completion
|
||||||
|
local IFS=$'\n'
|
||||||
|
compopt -o filenames
|
||||||
|
COMPREPLY=( $(compgen -d -- "${cur}") )
|
||||||
|
return 0;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Show all flags if there was no previous word
|
||||||
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||||
|
return 0
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user