Compare commits
1 Commits
36687b2f3c
...
generic-gi
| Author | SHA1 | Date | |
|---|---|---|---|
| 9618713542 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,2 @@
|
|||||||
# Ignore all plugin files in subdirectories
|
# Ignore all plugin files in subdirectories
|
||||||
zsh-*/
|
*/
|
||||||
local
|
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ commands:
|
|||||||
if ! [ -f $PWD/.enter ] || ! [ -f $PWD/.exit ]; then
|
if ! [ -f $PWD/.enter ] || ! [ -f $PWD/.exit ]; then
|
||||||
echo '.enter or .exit not found'; return 1
|
echo '.enter or .exit not found'; return 1
|
||||||
fi
|
fi
|
||||||
|
# If vim exists, edit enter and exit scripts.
|
||||||
|
if which vim &> /dev/null; then
|
||||||
# Exit the autoenv before editing.
|
# Exit the autoenv before editing.
|
||||||
_autoenv_exit $PWD
|
_autoenv_exit $PWD
|
||||||
if $EDITOR -p $PWD/.enter $PWD/.exit; then
|
if $EDITOR -p $PWD/.enter $PWD/.exit; then
|
||||||
@@ -56,6 +58,9 @@ commands:
|
|||||||
fi
|
fi
|
||||||
# Enter the autoenv.
|
# Enter the autoenv.
|
||||||
_autoenv_enter $PWD
|
_autoenv_enter $PWD
|
||||||
|
else
|
||||||
|
echo 'vim not found'; return 1
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
deinit) # Remove .enter and .exit scripts in current directory.
|
deinit) # Remove .enter and .exit scripts in current directory.
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ alias build="build-dir --build"
|
|||||||
# Detect installed debugger and set the `debug` alias to debug a program with
|
# Detect installed debugger and set the `debug` alias to debug a program with
|
||||||
# command line arguments.
|
# command line arguments.
|
||||||
if [ `uname` = Linux ]; then
|
if [ `uname` = Linux ]; then
|
||||||
|
if [[ "`vim --version|head -1|cut -c 19-21`" =~ "^8\.[123456789]$" ]]; then
|
||||||
autoload -U regexp-replace
|
autoload -U regexp-replace
|
||||||
function vimdebug() {
|
function vimdebug() {
|
||||||
# For each item in $* replace * and \* and then replace \ with \\
|
# For each item in $* replace * and \* and then replace \ with \\
|
||||||
@@ -15,9 +16,12 @@ if [ `uname` = Linux ]; then
|
|||||||
regexp-replace arg '\*' '\\*'
|
regexp-replace arg '\*' '\\*'
|
||||||
args+=($arg)
|
args+=($arg)
|
||||||
done
|
done
|
||||||
nvim "+packadd termdebug" "+TermdebugCommand $args"
|
vim "+packadd termdebug" "+TermdebugCommand $args"
|
||||||
}
|
}
|
||||||
if which gdb &> /dev/null; then
|
alias debug='vimdebug'
|
||||||
|
elif which cgdb &> /dev/null; then
|
||||||
|
alias debug='cgdb --args'
|
||||||
|
elif which gdb &> /dev/null; then
|
||||||
alias debug='gdb --args'
|
alias debug='gdb --args'
|
||||||
fi
|
fi
|
||||||
elif [ `uname` = Darwin ]; then
|
elif [ `uname` = Darwin ]; then
|
||||||
|
|||||||
19
git-prompt.c
19
git-prompt.c
@@ -21,6 +21,11 @@
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define color8(CODE) "\e[3" #CODE "m"
|
||||||
|
#define color256(CODE) "\e[38;5;" #CODE "m"
|
||||||
|
#define bold "\e[1m"
|
||||||
|
#define reset "\e[0m"
|
||||||
|
|
||||||
typedef struct process {
|
typedef struct process {
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
FILE* out;
|
FILE* out;
|
||||||
@@ -104,7 +109,7 @@ int main() {
|
|||||||
}
|
}
|
||||||
char* branch = trim(branch_buf);
|
char* branch = trim(branch_buf);
|
||||||
char prompt[1024] = {};
|
char prompt[1024] = {};
|
||||||
append(prompt, 3, " %{%F{66}%}", branch, "%{%f%}");
|
append(prompt, 3, " " color256(66), branch, reset);
|
||||||
|
|
||||||
// get the upstream remote if one exists
|
// get the upstream remote if one exists
|
||||||
char command[1024] = {};
|
char command[1024] = {};
|
||||||
@@ -178,22 +183,22 @@ int main() {
|
|||||||
if (indexed || modified || deleted || unmerged || untracked) { // modified
|
if (indexed || modified || deleted || unmerged || untracked) { // modified
|
||||||
char int_buf[32];
|
char int_buf[32];
|
||||||
if (indexed) {
|
if (indexed) {
|
||||||
append(prompt, 3, "%{%F{2}%}*", inttostr(int_buf, indexed), "%{%f%}");
|
append(prompt, 3, color8(2) "*", inttostr(int_buf, indexed), reset);
|
||||||
}
|
}
|
||||||
if (modified) {
|
if (modified) {
|
||||||
append(prompt, 3, "%{%F{1}%}+", inttostr(int_buf, modified), "%{%f%}");
|
append(prompt, 3, color8(1) "+", inttostr(int_buf, modified), reset);
|
||||||
}
|
}
|
||||||
if (deleted) {
|
if (deleted) {
|
||||||
append(prompt, 3, "%{%F{1}%}-", inttostr(int_buf, deleted), "%{%f%}");
|
append(prompt, 3, color8(1) "-", inttostr(int_buf, deleted), reset);
|
||||||
}
|
}
|
||||||
if (unmerged) {
|
if (unmerged) {
|
||||||
append(prompt, 3, "%{%B%F{1}%}×", inttostr(int_buf, unmerged), "%{%f%b%}");
|
append(prompt, 3, bold color8(1) "×", inttostr(int_buf, unmerged), reset);
|
||||||
}
|
}
|
||||||
if (untracked) {
|
if (untracked) {
|
||||||
append(prompt, 1, "%{%F{1}%}…%{%f%}");
|
append(prompt, 1, color8(1) "…" reset);
|
||||||
}
|
}
|
||||||
} else { // clean
|
} else { // clean
|
||||||
append(prompt, 1, "%{%B%F{2}%}✓%{%f%b%}");
|
append(prompt, 1, bold color8(2) "✓" reset);
|
||||||
}
|
}
|
||||||
|
|
||||||
// print the prompt
|
// print the prompt
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
#!/usr/bin/env zsh
|
|
||||||
|
|
||||||
# Loop over available completions and add existing commands to array.
|
|
||||||
local -a completions
|
|
||||||
completions=(~/.config/zsh/zsh-completions/src/*)
|
|
||||||
local -a command_list
|
|
||||||
for completion in $completions; do
|
|
||||||
local filename=$(basename $completion)
|
|
||||||
local name=${filename:1}
|
|
||||||
if command -v $name &> /dev/null; then
|
|
||||||
command_list+=($name)
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Print JSON array of commands Ansible can consume.
|
|
||||||
echo '['
|
|
||||||
local length=${#command_list[@]}
|
|
||||||
for (( i = 1; i < $length; i++ )); do
|
|
||||||
echo " \"${command_list[$i]}\","
|
|
||||||
done
|
|
||||||
echo " \"${command_list[-1]}\""
|
|
||||||
echo ']'
|
|
||||||
@@ -49,8 +49,8 @@ prompt_fresh_setup() {
|
|||||||
local userhost="$userhost@`hostname`"
|
local userhost="$userhost@`hostname`"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PS1="$user "
|
PS1="«$user» "
|
||||||
PS2="${(l:${#userhost}:: :)} "
|
PS2="«${(l:${#userhost}:: :)}» "
|
||||||
|
|
||||||
prompt_opts=(percent sp subst)
|
prompt_opts=(percent sp subst)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,11 +44,14 @@ usage: sandbox [-h] {create,rename,destroy,enable,disable,list} ..
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
unset git
|
unset git
|
||||||
|
|
||||||
[[ -z "$name" ]] && \
|
[[ -z "$name" ]] && \
|
||||||
error "missing argument <name>\n$usage" && return 1
|
error "missing argument <name>\n$usage" && return 1
|
||||||
|
|
||||||
local sandbox=$SANDBOX_ROOT/$name
|
local sandbox=$SANDBOX_ROOT/$name
|
||||||
[[ -d "$sandbox" ]] && \
|
[[ -d "$sandbox" ]] && \
|
||||||
error "sandbox already exists $name" && return 1
|
error "sandbox already exists $name" && return 1
|
||||||
|
|
||||||
if [[ -n "$repo" ]]; then
|
if [[ -n "$repo" ]]; then
|
||||||
mkdir -p $SANDBOX_ROOT &> /dev/null
|
mkdir -p $SANDBOX_ROOT &> /dev/null
|
||||||
git clone $repo $sandbox
|
git clone $repo $sandbox
|
||||||
@@ -58,49 +61,55 @@ usage: sandbox [-h] {create,rename,destroy,enable,disable,list} ..
|
|||||||
cd $sandbox
|
cd $sandbox
|
||||||
git init &> /dev/null
|
git init &> /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "SANDBOX_HOME=\$(dirname -- "\$0:a")" >> $sandbox/.enter
|
echo "SANDBOX_HOME=\$(dirname -- "\$0:a")" >> $sandbox/.enter
|
||||||
echo "SANDBOX_NAME=$name" >> $sandbox/.enter
|
echo "SANDBOX_NAME=$name" >> $sandbox/.enter
|
||||||
_autoenv_authorized $sandbox/.enter yes
|
_autoenv_authorized $sandbox/.enter yes
|
||||||
|
|
||||||
echo "unset SANDBOX_NAME" >> $sandbox/.exit
|
echo "unset SANDBOX_NAME" >> $sandbox/.exit
|
||||||
echo "unset SANDBOX_HOME" >> $sandbox/.exit
|
echo "unset SANDBOX_HOME" >> $sandbox/.exit
|
||||||
_autoenv_authorized $sandbox/.exit yes
|
_autoenv_authorized $sandbox/.exit yes
|
||||||
|
|
||||||
_autoenv_enter $sandbox
|
_autoenv_enter $sandbox
|
||||||
;;
|
;;
|
||||||
|
|
||||||
rename)
|
rename)
|
||||||
local old_name=$1 new_name=$2
|
local old_name=$1 new_name=$2
|
||||||
[[ -z "$old_name" ]] && \
|
[[ -z "$old_name" ]] && \
|
||||||
error "missing argument <old-name>\n$usage" && return 1
|
error "missing argument <old-name>\n$usage" && return 1
|
||||||
[[ -z "$new_name" ]] && \
|
[[ -z "$new_name" ]] && \
|
||||||
error "missing argument <new-name>\n$usage" && return 1
|
error "missing argument <new-name>\n$usage" && return 1
|
||||||
|
|
||||||
local old=$SANDBOX_ROOT/$old_name new=$SANDBOX_ROOT/$new_name
|
local old=$SANDBOX_ROOT/$old_name new=$SANDBOX_ROOT/$new_name
|
||||||
[[ ! -d "$old" ]] && \
|
[[ ! -d "$old" ]] && \
|
||||||
error "sandbox does not exist $old_name" && return 1
|
error "sandbox does not exist $old_name" && return 1
|
||||||
[[ -d "$new" ]] && \
|
[[ -d "$new" ]] && \
|
||||||
error "sandbox already exists $new_name" && return 1
|
error "sandbox already exists $new_name" && return 1
|
||||||
|
|
||||||
[[ "$PWD" = "$old"* ]] && _autoenv_exit $PWD
|
[[ "$PWD" = "$old"* ]] && _autoenv_exit $PWD
|
||||||
|
|
||||||
mv $old $new
|
mv $old $new
|
||||||
sed -i "s/$old_name/$new_name/g" $new/.enter
|
sed -i "s/$old_name/$new_name/g" $new/.enter
|
||||||
_autoenv_authorized $new/.enter yes
|
_autoenv_authorized $new/.enter yes
|
||||||
_autoenv_authorized $new/.exit yes
|
_autoenv_authorized $new/.exit yes
|
||||||
|
|
||||||
[[ "$PWD" = "$old"* ]] && cd $new
|
[[ "$PWD" = "$old"* ]] && cd $new
|
||||||
;;
|
;;
|
||||||
|
|
||||||
destroy)
|
destroy)
|
||||||
local name=$1
|
local name=$1
|
||||||
[[ -z "$name" ]] && \
|
[[ -z "$name" ]] && \
|
||||||
error "missing argument <name>\n$usage" && return 1
|
error "missing argument <name>\n$usage" && return 1
|
||||||
|
|
||||||
local sandbox=$SANDBOX_ROOT/$name
|
local sandbox=$SANDBOX_ROOT/$name
|
||||||
[[ ! -d $sandbox ]] && \
|
[[ ! -d $sandbox ]] && \
|
||||||
error "sandbox does not exist $name" && return 1
|
error "sandbox does not exist $name" && return 1
|
||||||
|
|
||||||
[[ "$PWD" = "$sandbox"* ]] && cd ~
|
[[ "$PWD" = "$sandbox"* ]] && cd ~
|
||||||
|
|
||||||
rm -rf $sandbox
|
rm -rf $sandbox
|
||||||
;;
|
;;
|
||||||
|
|
||||||
list)
|
list)
|
||||||
ls -1 $SANDBOX_ROOT | less -F -K -R -X
|
ls -1 $SANDBOX_ROOT | less -F -K -R -X
|
||||||
;;
|
;;
|
||||||
|
|
||||||
enable)
|
enable)
|
||||||
local name=$1
|
local name=$1
|
||||||
[[ -z "$name" ]] && \
|
[[ -z "$name" ]] && \
|
||||||
@@ -109,19 +118,16 @@ usage: sandbox [-h] {create,rename,destroy,enable,disable,list} ..
|
|||||||
local sandbox=$SANDBOX_ROOT/$name
|
local sandbox=$SANDBOX_ROOT/$name
|
||||||
[[ ! -d $sandbox ]] && \
|
[[ ! -d $sandbox ]] && \
|
||||||
error "sandbox does not exist $name" && return 1
|
error "sandbox does not exist $name" && return 1
|
||||||
|
|
||||||
export SANDBOX_RETURN=$PWD
|
export SANDBOX_RETURN=$PWD
|
||||||
cd $sandbox
|
cd $sandbox
|
||||||
;;
|
;;
|
||||||
|
|
||||||
disable)
|
disable)
|
||||||
[[ -z "$SANDBOX_RETURN" ]] && \
|
[[ -z "$SANDBOX_RETURN" ]] && \
|
||||||
error "sandbox is not currently active" && return 1
|
error "sandbox is not currently active" && return 1
|
||||||
|
|
||||||
cd $SANDBOX_RETURN
|
cd $SANDBOX_RETURN
|
||||||
unset SANDBOX_RETURN
|
unset SANDBOX_RETURN
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
|
||||||
error "invalid sandbox command: $cmd" && return 1
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|||||||
99
tasks.yaml
Normal file
99
tasks.yaml
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
---
|
||||||
|
- name: zsh install packages
|
||||||
|
become: '{{package_become}}'
|
||||||
|
package:
|
||||||
|
name: zsh
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: zsh install Debian packages
|
||||||
|
when: ansible_os_family == "Debian"
|
||||||
|
become: true
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- pinentry-curses
|
||||||
|
- silversearcher-ag
|
||||||
|
- unzip
|
||||||
|
- zsh-doc
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: zsh install macOS packages
|
||||||
|
when: ansible_os_family == "Darwin"
|
||||||
|
become: false
|
||||||
|
homebrew:
|
||||||
|
name: the_silver_searcher
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: zsh clone plugin repos
|
||||||
|
git:
|
||||||
|
repo: '{{item.repo}}'
|
||||||
|
dest: '{{item.dest}}'
|
||||||
|
with_items:
|
||||||
|
- repo: https://github.com/zsh-users/zsh-autosuggestions.git
|
||||||
|
dest: ~/.config/zsh/zsh-autosuggestions
|
||||||
|
- repo: https://github.com/zsh-users/zsh-history-substring-search.git
|
||||||
|
dest: ~/.config/zsh/zsh-history-substring-search
|
||||||
|
- repo: https://github.com/zsh-users/zsh-syntax-highlighting.git
|
||||||
|
dest: ~/.config/zsh/zsh-syntax-highlighting
|
||||||
|
- repo: https://github.com/zsh-users/zsh-completions.git
|
||||||
|
dest: ~/.config/zsh/zsh-completions
|
||||||
|
- repo: https://github.com/junegunn/fzf.git
|
||||||
|
dest: ~/.config/zsh/fzf
|
||||||
|
|
||||||
|
- name: zsh install fzf binaries
|
||||||
|
command:
|
||||||
|
cmd: ~/.config/zsh/fzf/install --bin
|
||||||
|
creates: ~/.config/zsh/fzf/bin/fzf
|
||||||
|
|
||||||
|
- name: zsh create directories
|
||||||
|
file:
|
||||||
|
state: directory
|
||||||
|
dest: '{{item}}'
|
||||||
|
with_items:
|
||||||
|
- ~/.local/bin
|
||||||
|
- ~/.local/share/zsh/site-functions
|
||||||
|
|
||||||
|
- name: zsh create symbolic links
|
||||||
|
file:
|
||||||
|
state: link
|
||||||
|
src: '{{item.src}}'
|
||||||
|
dest: '{{item.dest}}'
|
||||||
|
with_items:
|
||||||
|
- src: ~/.config/zsh/zlogin
|
||||||
|
dest: ~/.zlogin
|
||||||
|
- src: ~/.config/zsh/zlogout
|
||||||
|
dest: ~/.zlogout
|
||||||
|
- src: ~/.config/zsh/zprofile
|
||||||
|
dest: ~/.zprofile
|
||||||
|
- src: ~/.config/zsh/zshenv
|
||||||
|
dest: ~/.zshenv
|
||||||
|
- src: ~/.config/zsh/zshrc
|
||||||
|
dest: ~/.zshrc
|
||||||
|
- src: ~/.config/zsh/prompt_fresh_setup
|
||||||
|
dest: ~/.local/share/zsh/site-functions/prompt_fresh_setup
|
||||||
|
- src: ~/.config/zsh/build/_build-dir
|
||||||
|
dest: ~/.local/share/zsh/site-functions/_build-dir
|
||||||
|
- src: ~/.config/zsh/sandbox/_sandbox
|
||||||
|
dest: ~/.local/share/zsh/site-functions/_sandbox
|
||||||
|
- src: ~/.config/zsh/layout/_layout
|
||||||
|
dest: ~/.local/share/zsh/site-functions/_layout
|
||||||
|
- src: ~/.config/zsh/notes/_note
|
||||||
|
dest: ~/.local/share/zsh/site-functions/_note
|
||||||
|
- src: ~/.config/zsh/fzf/bin/fzf
|
||||||
|
dest: ~/.local/bin/fzf
|
||||||
|
- src: ~/.config/zsh/fzf/bin/fzf-tmux
|
||||||
|
dest: ~/.local/bin/fzf-tmux
|
||||||
|
- src: ~/.config/zsh/cmake-uninstall
|
||||||
|
dest: ~/.local/bin/cmake-uninstall
|
||||||
|
- src: ~/.config/zsh/$
|
||||||
|
dest: ~/.local/bin/$
|
||||||
|
|
||||||
|
- name: zsh get absolute path
|
||||||
|
shell: command -v zsh
|
||||||
|
register: zsh
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: zsh set default shell
|
||||||
|
user:
|
||||||
|
name: '{{lookup("env", "USER")}}'
|
||||||
|
shell: '{{zsh.stdout}}'
|
||||||
|
become: true
|
||||||
19
update-completion-links.zsh
Executable file
19
update-completion-links.zsh
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
# Check if third party completions are present.
|
||||||
|
local zsh_completions=~/.config/zsh/zsh-completions
|
||||||
|
[ ! -d $zsh_completions ] && return 0
|
||||||
|
|
||||||
|
# Loop over all completions.
|
||||||
|
for completion in $zsh_completions/src/_*; do
|
||||||
|
local name=`basename $completion`
|
||||||
|
local symlink=~/.local/share/zsh/site-functions/$name
|
||||||
|
# Remove existing completion file if it exists.
|
||||||
|
[ -f $symlink ] && rm $symlink
|
||||||
|
# Check if the command exists on the PATH.
|
||||||
|
if command -v ${name:1} &> /dev/null; then
|
||||||
|
# Symlink the completion for the existing command.
|
||||||
|
[ `uname` = Darwin ] && \
|
||||||
|
ln -s $completion $symlink || ln -sr $completion $symlink
|
||||||
|
fi
|
||||||
|
done
|
||||||
22
url/_url
22
url/_url
@@ -1,22 +0,0 @@
|
|||||||
#compdef url
|
|
||||||
|
|
||||||
_url() {
|
|
||||||
local ret=1 context curcontext="$curcontext" state line
|
|
||||||
typeset -A opt_args
|
|
||||||
|
|
||||||
_arguments -C -w -s \
|
|
||||||
'(-h --help)'{-h,--help}'[show this help message and exit]' \
|
|
||||||
'1: :->command'
|
|
||||||
|
|
||||||
case $state in
|
|
||||||
(command)
|
|
||||||
declare -a commands
|
|
||||||
local commands=(
|
|
||||||
encode:'encode unencoded text'
|
|
||||||
decode:'decode encoded text'
|
|
||||||
)
|
|
||||||
_describe -t commands command commands && ret=0 ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
return ret
|
|
||||||
}
|
|
||||||
22
url/url
22
url/url
@@ -1,22 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
from argparse import ArgumentParser
|
|
||||||
from urllib import parse
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
cli = ArgumentParser(description=__doc__)
|
|
||||||
cli.add_argument('command', choices=['encode', 'decode'])
|
|
||||||
cli.add_argument('text')
|
|
||||||
args = cli.parse_args()
|
|
||||||
{
|
|
||||||
'encode': parse.quote,
|
|
||||||
'decode': parse.unquote,
|
|
||||||
}[args.command](args.text)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
try:
|
|
||||||
main()
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
exit(130)
|
|
||||||
16
zshenv
16
zshenv
@@ -22,17 +22,10 @@ INFOPATH=$HOME/.local/share/info:$INFOPATH
|
|||||||
|
|
||||||
# Add ccache compiler aliases to PATH and use XDG base dir paths
|
# Add ccache compiler aliases to PATH and use XDG base dir paths
|
||||||
if [ `uname` = Darwin ]; then
|
if [ `uname` = Darwin ]; then
|
||||||
if [ `uname -m` = arm64 ]; then
|
[ -d /usr/local/opt/python/libexec/bin ] && \
|
||||||
homebrew_root=/opt/homebrew
|
PATH=/usr/local/opt/python/libexec/bin:$PATH
|
||||||
[ -d /opt/homebrew/bin ] && \
|
[ -f /usr/local/bin/ccache ] && \
|
||||||
PATH=$homebrew_root/bin:$PATH
|
PATH=/usr/local/opt/ccache/libexec:$PATH
|
||||||
else
|
|
||||||
homebrew_root=/usr/local
|
|
||||||
fi
|
|
||||||
[ -d $homebrew_root/opt/python/libexec/bin ] && \
|
|
||||||
PATH=$homebrew_root/opt/python/libexec/bin:$PATH
|
|
||||||
[ -f $homebrew_root/bin/ccache ] && \
|
|
||||||
PATH=$homebrew_root/opt/ccache/libexec:$PATH
|
|
||||||
elif [ -f /usr/bin/ccache ]; then
|
elif [ -f /usr/bin/ccache ]; then
|
||||||
if [ -d /usr/lib/ccache/bin ]; then
|
if [ -d /usr/lib/ccache/bin ]; then
|
||||||
PATH=/usr/lib/ccache/bin:$PATH
|
PATH=/usr/lib/ccache/bin:$PATH
|
||||||
@@ -108,6 +101,5 @@ export GTK2_RC_FILES=$HOME/.config/gtk-2.0/gtkrc
|
|||||||
export PYLINTHOME=$HOME/.cache/pylint
|
export PYLINTHOME=$HOME/.cache/pylint
|
||||||
command -v rustup &> /dev/null && \
|
command -v rustup &> /dev/null && \
|
||||||
export RUSTUP_HOME=$HOME/.local/share/rustup
|
export RUSTUP_HOME=$HOME/.local/share/rustup
|
||||||
[ -f $HOME/.config/wget/rc ] && \
|
|
||||||
export WGETRC=$HOME/.config/wget/rc
|
export WGETRC=$HOME/.config/wget/rc
|
||||||
# TODO: terminfo
|
# TODO: terminfo
|
||||||
|
|||||||
13
zshrc
13
zshrc
@@ -172,20 +172,12 @@ if [[ ! -z "$cursor_block" && ! -z "$cursor_line" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Frequntly used directories
|
# Frequntly used directories
|
||||||
function frequent-directory() {
|
function frequent-directory() { export $1; hash -d $1 }
|
||||||
# Replace - with _ in environment variable name.
|
|
||||||
local name=$(echo $1 | sed 's/^\(.*\)=.*$/\1/g' | sed 's/-/_/g')
|
|
||||||
local value=$(echo $1 | sed 's/^.*=\(.*$\)/\1/g')
|
|
||||||
export $name=$value
|
|
||||||
hash -d $1
|
|
||||||
}
|
|
||||||
frequent-directory Projects="$HOME/Projects"
|
frequent-directory Projects="$HOME/Projects"
|
||||||
frequent-directory Sandbox="$HOME/Sandbox"
|
frequent-directory Sandbox="$HOME/Sandbox"
|
||||||
|
|
||||||
# Load work related config
|
# Load work related config
|
||||||
[ -f ~/.config/work/zshrc ] && source ~/.config/work/zshrc
|
[ -f ~/.config/work/zshrc ] && source ~/.config/work/zshrc
|
||||||
[ -f ~/.config/private/zshrc ] && source ~/.config/private/zshrc
|
|
||||||
[ -f ~/.config/zsh/local ] && source ~/.config/zsh/local
|
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
alias grep='grep --color=always'
|
alias grep='grep --color=always'
|
||||||
@@ -211,6 +203,3 @@ case `uname` in
|
|||||||
alias debug='lldb --'
|
alias debug='lldb --'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
command -v wol > /dev/null && \
|
|
||||||
alias wakeonlan='wol'
|
|
||||||
|
|||||||
Reference in New Issue
Block a user