Skip to content
Open
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
59 changes: 59 additions & 0 deletions git/.gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# ╔══════════════════════════════════════════════════════════════════════════╗
# ║ GIT CONFIG ║
# ║ Tema: Catppuccin Mocha ║
# ╚══════════════════════════════════════════════════════════════════════════╝

[user]
# Configure seu nome e email:
# git config --global user.name "Seu Nome"
# git config --global user.email "seu@email.com"

[init]
defaultBranch = main

[core]
pager = delta
editor = vim

[interactive]
diffFilter = delta --color-only

[delta]
navigate = true
dark = true
side-by-side = true
line-numbers = true
hyperlinks = true
syntax-theme = Catppuccin Mocha

# Cores Catppuccin Mocha
minus-style = syntax "#3e1f24"
minus-emph-style = syntax "#6e2d35"
plus-style = syntax "#1e3a29"
plus-emph-style = syntax "#2e5a3e"
line-numbers-minus-style = "#f38ba8"
line-numbers-plus-style = "#a6e3a1"
line-numbers-zero-style = "#6c7086"
hunk-header-style = syntax bold
hunk-header-decoration-style = "#89b4fa" box

[merge]
conflictStyle = zdiff3

[diff]
colorMoved = default

[pull]
rebase = false

[push]
autoSetupRemote = true

[alias]
st = status
co = checkout
br = branch
ci = commit
lg = log --oneline --graph --all --decorate --color
last = log -1 HEAD
unstage = reset HEAD --
109 changes: 107 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# ║ • Alacritty (terminal GPU-accelerated) ║
# ║ • tmux (multiplexador de terminal) ║
# ║ • Vim (editor com plugins) ║
# ║ • lazygit (TUI para Git) ║
# ║ • delta (pager para diffs) ║
# ║ • Fonte JetBrains Mono ║
# ║ ║
# ║ Tema: Catppuccin Mocha ║
Expand Down Expand Up @@ -82,9 +84,9 @@ print_help() {
echo " --dry-run Simula a instalação sem fazer alterações"
echo ""
echo "O QUE SERÁ INSTALADO:"
echo " • Dependências: tmux, vim, fzf, ripgrep, xclip"
echo " • Dependências: tmux, vim, fzf, ripgrep, xclip, lazygit, delta"
echo " • Fonte: JetBrains Mono"
echo " • Configs: Alacritty, tmux, Vim"
echo " • Configs: Alacritty, tmux, Vim, lazygit, Git"
echo " • Tema: Catppuccin Mocha"
echo ""
echo "ATALHOS PRINCIPAIS:"
Expand Down Expand Up @@ -273,6 +275,92 @@ install_alacritty() {
esac
}

# ============================================================================
# INSTALAÇÃO DO LAZYGIT
# ============================================================================

install_lazygit() {
print_step "Instalando lazygit..."

if command -v lazygit &> /dev/null; then
print_success "lazygit já instalado ($(lazygit --version 2>/dev/null | head -1))"
return 0
fi

case $PKG_MANAGER in
apt)
# lazygit não está nos repos padrão, usa o release do GitHub
print_substep "Baixando lazygit do GitHub..."
if [ "$DRY_RUN" = false ]; then
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -Lo /tmp/lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar xf /tmp/lazygit.tar.gz -C /tmp lazygit
sudo install /tmp/lazygit /usr/local/bin
rm /tmp/lazygit /tmp/lazygit.tar.gz
fi
print_success "lazygit instalado"
;;
dnf)
run_cmd sudo dnf copr enable atim/lazygit -y
run_cmd sudo dnf install -y lazygit
print_success "lazygit instalado"
;;
pacman)
run_cmd sudo pacman -S --noconfirm lazygit
print_success "lazygit instalado"
;;
brew)
run_cmd brew install lazygit
print_success "lazygit instalado"
;;
*)
print_warning "Instale lazygit manualmente: https://github.com/jesseduffield/lazygit#installation"
;;
esac
}

# ============================================================================
# INSTALAÇÃO DO DELTA
# ============================================================================

install_delta() {
print_step "Instalando delta (pager para diffs)..."

if command -v delta &> /dev/null; then
print_success "delta já instalado ($(delta --version 2>/dev/null | head -1))"
return 0
fi

case $PKG_MANAGER in
apt)
# delta não está nos repos padrão, usa o release do GitHub
print_substep "Baixando delta do GitHub..."
if [ "$DRY_RUN" = false ]; then
DELTA_VERSION=$(curl -s "https://api.github.com/repos/dandavison/delta/releases/latest" | grep -Po '"tag_name": "\K[^"]*')
curl -Lo /tmp/delta.deb "https://github.com/dandavison/delta/releases/latest/download/git-delta_${DELTA_VERSION}_amd64.deb"
sudo dpkg -i /tmp/delta.deb
rm /tmp/delta.deb
fi
print_success "delta instalado"
;;
dnf)
run_cmd sudo dnf install -y git-delta
print_success "delta instalado"
;;
pacman)
run_cmd sudo pacman -S --noconfirm git-delta
print_success "delta instalado"
;;
brew)
run_cmd brew install git-delta
print_success "delta instalado"
;;
*)
print_warning "Instale delta manualmente: https://github.com/dandavison/delta#installation"
;;
esac
}

# ============================================================================
# CONFIGURAÇÃO DOS SYMLINKS
# ============================================================================
Expand All @@ -283,6 +371,7 @@ setup_symlinks() {
# Criar diretórios necessários
run_cmd mkdir -p ~/.config/alacritty
run_cmd mkdir -p ~/.config/tmux
run_cmd mkdir -p ~/.config/lazygit

# Função para criar symlink com backup
create_symlink() {
Expand Down Expand Up @@ -313,6 +402,8 @@ setup_symlinks() {
create_symlink "$DOTFILES_DIR/alacritty/alacritty.toml" ~/.config/alacritty/alacritty.toml "Alacritty"
create_symlink "$DOTFILES_DIR/tmux/.tmux.conf" ~/.tmux.conf "tmux"
create_symlink "$DOTFILES_DIR/vim/.vimrc" ~/.vimrc "Vim"
create_symlink "$DOTFILES_DIR/lazygit/config.yml" ~/.config/lazygit/config.yml "lazygit"
create_symlink "$DOTFILES_DIR/git/.gitconfig" ~/.gitconfig "Git"

# Scripts do tmux (diretório)
if [ -L ~/.config/tmux/scripts ]; then
Expand Down Expand Up @@ -451,6 +542,18 @@ print_summary() {
echo " Espaço+/ Buscar conteúdo"
echo " gcc Comentar linha"
echo ""
echo " lazygit (TUI para Git):"
echo " lg Abrir lazygit (alias)"
echo " ? Mostrar atalhos"
echo " space Stage/unstage arquivo"
echo " c Commit"
echo " p / P Push / Pull"
echo ""
echo " delta (diffs melhorados):"
echo " Side-by-side Diff lado a lado"
echo " Line numbers Clicáveis (abre no editor)"
echo " Syntax highlight Colorização por linguagem"
echo ""
}

# ============================================================================
Expand Down Expand Up @@ -497,6 +600,8 @@ main() {

install_font
install_alacritty
install_lazygit
install_delta
setup_symlinks
setup_vim

Expand Down
96 changes: 96 additions & 0 deletions lazygit/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# ╔══════════════════════════════════════════════════════════════════════════╗
# ║ LAZYGIT CONFIG ║
# ║ Tema: Catppuccin Mocha ║
# ╚══════════════════════════════════════════════════════════════════════════╝

gui:
# Mostra icones (requer Nerd Font - JetBrains Mono suporta)
nerdFontsVersion: "3"

# Layout
showFileTree: true
showListFooter: false
showRandomTip: false
showCommandLog: false
showBottomLine: false

# Comportamento
skipDiscardChangeWarning: false
skipStashWarning: false

# Tema Catppuccin Mocha
theme:
activeBorderColor:
- "#a6e3a1" # green
- bold
inactiveBorderColor:
- "#a6adc8" # subtext0
optionsTextColor:
- "#89b4fa" # blue
selectedLineBgColor:
- "#313244" # surface0
cherryPickedCommitBgColor:
- "#45475a" # surface1
cherryPickedCommitFgColor:
- "#f5c2e7" # pink
unstagedChangesColor:
- "#f38ba8" # red
defaultFgColor:
- "#cdd6f4" # text
searchingActiveBorderColor:
- "#f9e2af" # yellow

git:
paging:
colorArg: always
pager: delta --paging=never --line-numbers --hyperlinks --side-by-side --hyperlinks-file-link-format="lazygit-edit://{path}:{line}"

# Commits
autoFetch: true
autoRefresh: true
branchLogCmd: "git log --graph --color=always --abbrev-commit --decorate --date=relative --pretty=medium {{branchName}} --"
allBranchesLogCmd: "git log --graph --all --color=always --abbrev-commit --decorate --date=relative --pretty=medium"

# Pull/Push
skipHookPrefix: WIP

# Parsing
parseEmoji: true

# Confirmacoes
confirmOnQuit: false
quitOnTopLevelReturn: true

# Keybindings customizados
keybinding:
universal:
quit: "q"
quit-alt1: "<c-c>"
return: "<esc>"
togglePanel: "<tab>"
prevItem: "<up>"
nextItem: "<down>"
prevPage: ","
nextPage: "."
scrollLeft: "H"
scrollRight: "L"
gotoTop: "<"
gotoBottom: ">"
prevBlock: "<left>"
nextBlock: "<right>"
nextMatch: "n"
prevMatch: "N"
startSearch: "/"
optionMenu: "x"
edit: "e"
openFile: "o"
scrollUpMain: "<pgup>"
scrollDownMain: "<pgdown>"
copyToClipboard: "<c-o>"
refresh: "R"
undo: "z"
redo: "<c-z>"

os:
# Abre arquivos no editor padrao
editPreset: "vim"
38 changes: 35 additions & 3 deletions tmux/.tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,27 @@ unbind C-b
set -g prefix C-a
bind C-a send-prefix

# Reduz delay do Escape (padrão 500ms)
set -sg escape-time 10

# Alternar para última janela
bind a last-window

# Modo vi para navegação
setw -g mode-keys vi
bind Escape copy-mode
bind-key -T copy-mode-vi v send-keys -X begin-selection

# Clipboard: detecta OS (macOS = pbcopy, Linux/WSL = xclip)
if-shell "uname | grep -q Darwin" \
"bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'pbcopy'" \
"bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -selection clipboard'"

# Mouse habilitado + copia ao selecionar
set -g mouse on
if-shell "uname | grep -q Darwin" \
"bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'pbcopy'" \
"bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -selection clipboard'"
"bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'pbcopy'" \
"bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -selection clipboard'"

# Histórico maior
set -g history-limit 10000
Expand All @@ -36,7 +49,23 @@ bind -n M-Down select-pane -D
bind r source-file ~/.tmux.conf \; display "Config recarregada!"

# Cheatsheet popup
bind h display-popup -E -w 67 -h 42 "~/.config/tmux/scripts/cheatsheet.sh"
bind h display-popup -E -w 112 -h 90% "~/.config/tmux/scripts/cheatsheet.sh"

# Popup flutuante para comando rápido (efêmero)
bind p display-popup -E -w 80% -h 80%
bind P command-prompt -p "Comando:" "display-popup -E -w 80%% -h 80%% '%%'"

# Scratch terminal (pode virar pane depois)
bind t if-shell "tmux has-session -t scratch 2>/dev/null" \
"if-shell \"[ \\\"$(tmux display-message -p '#S')\\\" = scratch ]\" \
'detach-client' \
'display-popup -E -w 80% -h 80% \"tmux attach -t scratch\"'" \
"display-popup -E -w 80% -h 80% 'tmux new-session -s scratch'"

# Mover pane atual para scratch (shift+t)
bind T if-shell "tmux has-session -t scratch 2>/dev/null" \
"join-pane -t scratch" \
"new-session -d -s scratch && join-pane -t scratch"

# Cores e visual
set -g default-terminal "tmux-256color"
Expand All @@ -53,3 +82,6 @@ set -g window-status-current-format "#[bg=#313244,fg=#cdd6f4,bold] #I:#W "
set -g pane-border-style fg="#313244"
set -g pane-active-border-style fg="#89b4fa"
set -g message-style bg="#313244",fg="#cdd6f4"
bind-key J choose-tree 'join-pane -s %%'
bind-key B break-pane
bind-key S choose-tree 'join-pane -t %%'
Loading