这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# private scripts
./scripts/open
149 changes: 149 additions & 0 deletions alacritty/alacritty.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# Example: https://github.com/alacritty/alacritty/blob/master/alacritty.yml
#
# ----------------------
# TERM env customization.
# ----------------------
env:
# If this property is not set, alacritty will set it to xterm-256color.
#
# Note that some xterm terminfo databases don't declare support for italics.
# You can verify this by checking for the presence of `smso` and `sitm` in
# `infocmp xterm-256color`.
TERM: xterm-256color

# ----------------------
# Font configuration
# ----------------------
font:
# Font Size
size: 11
offset:
x: 0
y: 1

normal:
family: JetBrains Mono
style: Regular
bold:
family: JetBrains Mono
style: Bold
italic:
family: JetBrains Mono
style: Italic
bold_italic:
family: JetBrains Mono
style: Bold Italic
# ----------------------
# Window Padding
# ----------------------
#
window:
padding:
x: 8
y: 8
opacity: 0.8

# ----------------------
# Others
# ----------------------

# Display tabs using this many cells (changes require restart)
# tabspaces: 8

# When true, bold text is drawn using the bright variant of colors.
draw_bold_text_with_bright_colors: true

# Disable bell
visual_bell:
animation: EaseOutExpo
duration: 0

hide_cursor_when_typing: true


# ----------------------
# THEME: Gruvbox
# ----------------------
#
# Source: https://github.com/alacritty/alacritty/wiki/Color-schemes

colors:
primary:
# hard contrast background - '#1d2021'
background: &gruvbox_dark_bg '#282828'
# soft contrast background - '#32302f'
foreground: '#ebdbb2'
bright_foreground: '#fbf1c7'
dim_foreground: '#a89984'
cursor:
text: CellBackground
cursor: CellForeground
vi_mode_cursor:
text: CellBackground
cursor: CellForeground
# search:
# matches:
# foreground: '#000000'
# background: '#ffffff'
# focused_match:
# foreground: CellBackground
# background: CellForeground
# bar:
# background: ''
# foreground: ''
# line_indicator:
# foreground: None
# background: None
selection:
text: CellBackground
background: CellForeground
bright:
black: '#928374'
red: '#fb4934'
green: '#b8bb26'
yellow: '#fabd2f'
blue: '#83a598'
magenta: '#d3869b'
cyan: '#8ec07c'
white: '#ebdbb2'
normal:
black: *gruvbox_dark_bg
red: '#cc241d'
green: '#98971a'
yellow: '#d79921'
blue: '#458588'
magenta: '#b16286'
cyan: '#689d6a'
white: '#a89984'
dim:
black: '#32302f'
red: '#9d0006'
green: '#79740e'
yellow: '#b57614'
blue: '#076678'
magenta: '#8f3f71'
cyan: '#427b58'
white: '#928374'
# indexed_colors: []

# ----------------------
# Keybindings
# ----------------------
key_bindings:
- { key: T, mods: Control, command: { program: "alacritty" } }
# copy-paste
- { key: V, mods: Control, action: Paste }
- { key: C, mods: Control, action: Copy }
# control + shift + c -> interrupt
- { key: C, mods: Control|Shift, chars: "\x03" }

- { key: Paste, action: Paste }
- { key: Copy, action: Copy }
- { key: L, mods: Control, action: ClearLogNotice }
- { key: L, mods: Control, chars: "\x0c" }
- { key: PageUp, mods: Shift, action: ScrollPageUp, mode: ~Alt }
- { key: PageDown, mods: Shift, action: ScrollPageDown, mode: ~Alt }
- { key: Home, mods: Shift, action: ScrollToTop, mode: ~Alt }
- { key: End, mods: Shift, action: ScrollToBottom, mode: ~Alt }

- { key: F11, action: ToggleFullscreen }
38 changes: 17 additions & 21 deletions bash/aliases.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
#!/usr/bin/env bash

# Vi
alias vimdiff="nvim -d"

# ngrok aliases
alias ng-pg="ngrok tcp --region=eu --remote-addr=3.tcp.eu.ngrok.io:22146 5432"

# Shortcuts
alias fonts="open ~/.local/share/fonts"
alias horario="open ~/zet/assets/horario.png"
alias kitty="nvim ~/.config/kitty/kitty.conf"

alias lazydocker="TERM=xterm-kitty lazydocker"

# Utils
alias ..="cd .."
alias ls="ls --format=single-column --classify --color --group-directories-first"
alias la="ls -la"
alias sb="source ~/.bashrc"

if [[ $OSTYPE == "darwin"* ]]; then
alias ls="/usr/local/bin/gls --format=single-column --classify --color --group-directories-first"
alias la="/usr/local/bin/gls --format=single-column --classify --color --group-directories-first -la"
alias find="/usr/local/bin/gfind"
fi
alias hosts="sudoedit /etc/hosts"

# you can't cd on the current shell process by "cd-ing" on a shell script
# https://stackoverflow.com/questions/255414/why-cant-i-change-directories-using-cd-in-a-script
jump() {
[ -h "$MARKPATH/$1" ] && cd "$(readlink "${MARKPATH}/${1}")" || exit 1
[ -h "$MARKPATH/$1" ] && cd "$(readlink "${MARKPATH}/${1}")" || echo "mark not found :("
}

# cd into repos where you'll want to work on
repos() {
local GITHUB_PATH="$HOME/github.com"

repo=$(
find "$GITHUB_PATH" -mindepth 2 -maxdepth 2 -type d |
fzf-tmux -p 40% --multi --prompt="Your repositories > "
)

cd "$repo" || return
}

# Use nvr to avoid nesting nvim in Terminal buffers.
alias nvim="nvim-nvr"
# check ~/dot/scripts/nvimr
#
alias nvim="nvimr"
2 changes: 1 addition & 1 deletion bash/bash
20 changes: 2 additions & 18 deletions bash/editor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,5 @@ fi
export HRULEWIDTH=73

# Define the editor
if [[ ! -x "$(command -v nvim-nvr)" ]]; then
export VISUAL=/usr/bin/vim
export EDITOR="$VISUAL"
else
if [[ $OSTYPE == "darwin"* ]]; then
VISUAL=/usr/local/bin/nvim
EDITOR="$VISUAL"

export VISUAL
export EDITOR
else
VISUAL=/usr/bin/nvim
EDITOR="$VISUAL"

export VISUAL
export EDITOR
fi
fi
export VISUAL=/usr/bin/nvim
export EDITOR="$VISUAL"
19 changes: 8 additions & 11 deletions bash/fzf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@ FD_OPTIONS="--follow --exclude .git --exclude node_modules"
FZF_BINDS="--bind 'f2:toggle-preview,ctrl-d:half-page-down,ctrl-u:half-page-up,ctrl-/:toggle-all'"
FZF_STYLES="--height=90% --layout=reverse --preview-window right:60%"

FZF_TOKYO_THEME='
--color=fg:#c0caf5,bg:#1a1b26,hl:#bb9af7
--color=fg+:#c0caf5,bg+:#1a1b26,hl+:#7dcfff
--color=info:#7aa2f7,prompt:#7dcfff,pointer:#7dcfff
--color=marker:#9ece6a,spinner:#9ece6a,header:#9ece6a'
# --color=fg:#c0caf5,bg:#1a1b26,hl:#bb9af7

export FZF_DEFAULT_OPTS="--no-mouse ${FZF_STYLES} ${FZF_BINDS} ${FZF_TOKYO_THEME}"
# FZF_TOKYO_THEME='
# --color=fg:#c0caf5,hl:#bb9af7
# --color=fg+:#c0caf5,bg+:#1a1b26,hl+:#7dcfff
# --color=info:#7aa2f7,prompt:#7dcfff,pointer:#7dcfff
# --color=marker:#9ece6a,spinner:#9ece6a,header:#9ece6a'

export FZF_DEFAULT_OPTS="--no-mouse ${FZF_STYLES} ${FZF_BINDS}"

export FZF_DEFAULT_COMMAND="fd --hidden --type f --type l ${FD_OPTIONS}"
export FZF_CTRL_T_COMMAND="fd ${FD_OPTIONS}"
export FZF_ALT_C_COMMAND="fd --type d ${FD_OPTIONS}"

# To install fd
# sudo apt install fd-find
# ln -s $(which fdfind) ~/.local/bin/fd
# Make sure that $HOME/.local/bin is in your $PATH.
23 changes: 23 additions & 0 deletions bash/git-ssh.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Reference: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/working-with-ssh-key-passphrases

env=~/.ssh/agent.env

agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; }

agent_start () {
(umask 077; ssh-agent >| "$env")
. "$env" >| /dev/null ; }

agent_load_env

# agent_run_state: 0=agent running w/ key; 1=agent w/o key; 2=agent not running
agent_run_state=$(ssh-add -l >| /dev/null 2>&1; echo $?)

if [ ! "$SSH_AUTH_SOCK" ] || [ $agent_run_state = 2 ]; then
agent_start
ssh-add
elif [ "$SSH_AUTH_SOCK" ] && [ $agent_run_state = 1 ]; then
ssh-add
fi

unset env
50 changes: 19 additions & 31 deletions bash/path.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

# Java
export JAVA_HOME=$(/usr/libexec/java_home -v 16)
export JUNIT_HOME="$HOME/java"
export CLASSPATH="$CLASSPATH:$JUNIT_HOME/junit-4.13.2.jar:$JUNIT_HOME/hamcrest-core-1.3.jar"
# export JAVA_HOME=$(/usr/libexec/java_home -v 17)
# export JUNIT_HOME="$HOME/java"
# export CLASSPATH="$CLASSPATH:$JUNIT_HOME/junit-4.13.2.jar:$JUNIT_HOME/hamcrest-core-1.3.jar"

# Go
export GOROOT="/usr/local/go"
Expand All @@ -24,34 +24,22 @@ export GOPATH="$HOME/go"
export CARGOPATH="/home/odas0r/.cargo"

# Tools
export LUA_LSP="$TOOLS/lua-language-server/bin/Linux"
export LUA_LANGUAGE_SERVER="$TOOLS/lua-language-server/bin"

# WSL Shit
if [ -n "$WSL_DISTRO_NAME" ]; then
# Desktop Global Variable
export DESKTOP="/mnt/c/Users/guilh/Desktop"

# Browser on WSL
export BROWSER="/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe"

# Perl
export PERLPATH="/home/odas0r/perl5"
export PERL5LIB="/home/odas0r/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"
export PERL_LOCAL_LIB_ROOT="/home/odas0r/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"
export PERL_MB_OPT='--install_base "/home/odas0r/perl5"'
export PERL_MM_OPT="INSTALL_BASE=/home/odas0r/perl5"
fi

# MacOS Shit
if [[ $OSTYPE == "darwin"* ]]; then
# CoreUtils for macos
# brew install coreutils
export GNU_UTILS="/usr/local/opt/coreutils/libexec/gnubin"

# Tools
export LUA_LSP="$TOOLS/lua-language-server/bin/macOS"

fi
# Perl
export PERLPATH="/hom/odas0r/perl5"
export PERL5LIB="/home/odas0r/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"
export PERL_LOCAL_LIB_ROOT="/home/odas0r/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"
export PERL_MB_OPT='--install_base "/home/odas0r/perl5"'
export PERL_MM_OPT="INSTALL_BASE=/home/odas0r/perl5"

# Global Path
export PATH="$PATH:/bin:/usr/local/bin:$GOROOT/bin:$GOPATH/bin:$CARGOPATH/bin:$PERLPATH/bin:$LOCAL_BIN:$LOCAL_SCRIPTS:$LUA_LSP:$GNU_UTILS"
PATH="$PATH:/bin:/usr/local/bin:"
PATH+="$GOROOT/bin:$GOPATH/bin:"
PATH+="$CARGOPATH/bin:"
PATH+="$PERLPATH/bin:"
PATH+="$LOCAL_BIN:$LOCAL_SCRIPTS:"
PATH+="$LUA_LANGUAGE_SERVER:"
PATH+="$GNU_UTILS"

export PATH
4 changes: 2 additions & 2 deletions bash/ps1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ parse_git_branch() {

# ret=$?
# PS1=$(if [[ ${ret} = 0 ]]; then echo "👋 "; else echo "🐞 "; fi)
PS1="👋 "
PS1="=> "
PS1+="$cyan/\W$reset"
PS1+=" $magenta\$(parse_git_branch)$reset"
PS1+="$ "

PS2="📝keep typing...> "
PS2="Keep typing...> "
10 changes: 1 addition & 9 deletions bashrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@

#### FIG ENV VARIABLES ####
# Please make sure this block is at the start of this file.
[ -s ~/.fig/shell/pre.sh ] && source ~/.fig/shell/pre.sh
#### END FIG ENV VARIABLES ####
#!/usr/bin/env bash

if [ -e /etc/bashrc ]; then
Expand All @@ -18,7 +13,4 @@ for file in $HOME/.bash/autocomplete/*.sh; do
. $file
done

#### FIG ENV VARIABLES ####
# Please make sure this block is at the end of this file.
[ -s ~/.fig/fig.sh ] && source ~/.fig/fig.sh
#### END FIG ENV VARIABLES ####
alias luamake=/home/odas0r/tools/lua-language-server/3rd/luamake/luamake
Loading