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
71 changes: 60 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
</p>

Instala e gerencia um ambiente de desenvolvimento focado em terminal: shell,
ferramentas CLI modernas, git, Neovim (LazyVim e outras distribuições),
linguagens, ambiente PHP local (lerd ou Flock), Python/dados, containers e o
ferramentas CLI modernas, git, o editor Helix configurado como IDE (com os
servidores de linguagem de cada perfil), Neovim (LazyVim e outras
distribuições, opcionais), linguagens, ambiente PHP local (lerd ou Flock), Python/dados, containers e o
terminal **kitty + herdr**. Tudo vem de um catálogo declarativo (`catalog/`) e de
perfis embutidos, com uma TUI para escolher o que instalar e uma CLI completa
para scripts.
Expand Down Expand Up @@ -75,15 +76,18 @@ execução e resumo. Nada é instalado antes da tela de revisão.

| Perfil | O que traz |
|---|---|
| `blank` | Só a base: shell, ferramentas CLI modernas, git, LazyVim e o terminal |
| `web` | Node, pnpm e Bun, ferramentas de HTTP e tarefas, LazyVim para TypeScript |
| `laravel` | PHP via lerd (Linux) ou Flock (macOS), Composer, Node e LazyVim para PHP |
| `blank` | Só a base: shell, ferramentas CLI modernas, git, Helix e o terminal |
| `web` | Node, pnpm e Bun, ferramentas de HTTP e tarefas, Helix para TypeScript |
| `laravel` | PHP via lerd (Linux) ou Flock (macOS), Composer, Node e Helix para PHP |
| `ml` | Python, uv, Ruff, JupyterLab e CUDA quando há GPU NVIDIA |
| `backend` | Rust, Go, .NET, Java, Podman e ferramentas de Kubernetes |

Todos incluem a base do `blank`. Depois de escolher o perfil, cada categoria
pode ser ajustada item a item. Em categorias exclusivas (distribuição do
Neovim, lerd ou Flock, Docker ou Podman) só um item fica marcado.
Neovim, lerd ou Flock, Docker ou Podman) só um item fica marcado. Nenhuma
distribuição do Neovim vem marcada: o editor padrão é o Helix, e o LazyVim (com
os extras de linguagem do perfil) continua disponível na categoria
"Distribuição Neovim".

## CLI

Expand All @@ -109,7 +113,7 @@ kanivet-cli catalog lint # valida o catálogo
arquivo que já existe aparece marcado com `(backup)` e é copiado para
`~/.local/state/kanivet-cli/backups/<execução>/` antes de ser alterado;
`kanivet-cli restore <execução>` desfaz.
- **Configs opinativas são opcionais.** Cada config (kitty, herdr, LazyVim...)
- **Configs opinativas são opcionais.** Cada config (kitty, herdr, Helix...)
pode ser desmarcada na revisão ou no dashboard.
- **Sem sudo à toa.** No macOS as ferramentas vêm do Homebrew; no Linux, do mise
(binários no `~`). Só os itens da seção "Precisa de sudo" pedem a senha, uma
Expand Down Expand Up @@ -178,17 +182,61 @@ Com os itens instalados, o init do shell ativa:
ferramentas novas usam flags diferentes e quebrariam scripts. Use `rg`, `fd`,
`sd`, `dust`, `duf` e `procs` direto.

## Helix

O Helix é o editor padrão de todos os perfis e define `EDITOR` e `VISUAL` como
`hx`. As configs (opcionais e com backup) deixam ele com cara de IDE: abas no
topo, statusline completa, diagnósticos e dicas de tipo inline, guias de
indentação, auto-save e formatação ao salvar. O tema é o `monokai_soda_ide`
(monokai_soda com a aba ativa e a linha do cursor destacadas).

Atalhos incluídos na config (os nativos do Helix continuam valendo):

| Atalho | Ação |
|---|---|
| `ctrl+s` | salvar (também no modo insert) |
| `ctrl+p` / `ctrl+shift+p` | abrir arquivo / paleta de comandos |
| `ctrl+shift+f` | buscar no projeto |
| `ctrl+e` / `ctrl+y` | explorador de arquivos nativo / yazi |
| `ctrl+b` | lista de buffers |
| `ctrl+g` | lazygit em tela cheia (recarrega os buffers ao sair) |
| `H` / `L` | aba anterior / próxima |
| `ctrl+q` ou `space x` | fechar a aba (`space X` fecha as outras) |
| `F12` / `shift+F12` | ir para a definição / referências |
| `F2` | renomear símbolo |
| `ctrl+.` | code actions |
| `ctrl+space` | hover (no modo insert, autocomplete) |
| `F8` / `shift+F8` | próximo / anterior diagnóstico |
| `alt+↑` / `alt+↓` | mover a linha |
| `space t` / `space W` | liga/desliga dicas de tipo / quebra de linha |
| `space p` | roda o Laravel Pint (`vendor/bin/pint`) no arquivo atual |

Os servidores de linguagem ficam na categoria "Servidores de linguagem" e são
instalados pelo mise (pacotes `npm:`, `go:`, `pipx:`, `dotnet:` e `github:`),
exceto o rust-analyzer, que é um componente do rustup:

| Perfil | Servidores e formatadores |
|---|---|
| `web` | typescript-language-server, ESLint/HTML/CSS/JSON (vscode-langservers), Tailwind, prettier |
| `laravel` | intelephense, laravel-ls, blade-formatter e os mesmos do `web` |
| `ml` | basedpyright (o Ruff já vem no perfil) |
| `backend` | rust-analyzer, gopls, goimports, delve, csharp-ls |

O csharp-ls fica fixo na 0.20.0, a última versão que instala com o SDK do .NET 9.
O laravel-ls não tem release para Linux arm64 e é pulado nessa plataforma.
`hx --health <linguagem>` mostra o que o Helix encontrou.

## kitty + herdr

As configs opinativas do terminal (todas opcionais e com backup):

- **kitty**: JetBrainsMono Nerd Font 14, abas no topo, fundo translúcido com
- **kitty**: JetBrainsMono Nerd Font 12, abas no topo, fundo translúcido com
desfoque, tema Afterglow fixo (claro e escuro), e abas/janelas novas no
diretório atual (`cmd+t`, `cmd+enter`, `cmd+n`; no Linux `ctrl+shift+t`,
`ctrl+shift+enter`, `ctrl+shift+n`).
- **herdr**: tema vesper, notificações no próprio herdr, atalhos dos plugins e
lazygit em popup. Plugins herdr-bar, herdr-auto-title, herdr-radar e
herdr-reviewr, cada um num commit fixo, mais as integrações dos agentes de IA
- **herdr**: tema gruvbox, notificações no próprio herdr, atalhos dos plugins e
lazygit em popup. Plugins herdr-bar, herdr-auto-title, herdr-radar,
herdr-reviewr e herdr-sidebar, cada um num commit fixo, mais as integrações dos agentes de IA
encontrados no `PATH`.

O `prefix` do herdr é `ctrl+b`. Atalhos incluídos na config:
Expand All @@ -206,6 +254,7 @@ O `prefix` do herdr é `ctrl+b`. Atalhos incluídos na config:
| Lazygit em popup | `prefix+alt+g` |
| Busca rápida (herdr-bar) | `prefix+space` |
| Painel de review do diff (reviewr) | `prefix+d` |
| Sidebar estilo VS Code: arquivos, busca e git (herdr-sidebar) | `prefix+f` |
| Radar: alternar ativos / recentes | `prefix+a` |
| Radar: configurações | `prefix+,` |

Expand Down
2 changes: 1 addition & 1 deletion catalog/catalog.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
schema: 1
version: "0.1.0"
categories: [terminal, shell, replacements, navigation, git, neovim, editors, languages, php-local, python-data, container-engine, containers, data-apis, managers]
categories: [terminal, shell, replacements, navigation, git, editors, lsp, neovim, languages, php-local, python-data, container-engine, containers, data-apis, managers]
4 changes: 4 additions & 0 deletions catalog/categories/lsp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
id: lsp
name: {en: "Language servers", pt-BR: "Servidores de linguagem"}
description: {en: "LSPs and formatters used by Helix (and any LSP-aware editor)", pt-BR: "LSPs e formatadores usados pelo Helix (e por qualquer editor com LSP)"}
exclusive: false
140 changes: 140 additions & 0 deletions catalog/configs/helix/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
theme = "monokai_soda_ide"

# ───────────────────────────── Editor ─────────────────────────────
[editor]
line-number = "absolute" # números absolutos, como numa IDE
cursorline = true # destaca a linha atual
rulers = [100] # régua vertical na coluna 100
bufferline = "always" # "abas" de buffers no topo
color-modes = true # cor do modo na statusline
mouse = true # clique, scroll e seleção com o mouse
scrolloff = 8
true-color = true
undercurl = true # sublinhado ondulado nos erros (kitty suporta)
popup-border = "all" # bordas em popups/menus (hover, completion)
completion-trigger-len = 1
completion-timeout = 5
completion-replace = true
idle-timeout = 50
auto-pairs = true
auto-format = true
trim-trailing-whitespace = true
insert-final-newline = true
end-of-line-diagnostics = "hint" # diagnóstico no fim da linha
gutters = ["diagnostics", "spacer", "line-numbers", "spacer", "diff"]

[editor.auto-save]
focus-lost = true # salva ao trocar de janela
after-delay.enable = true # e após um tempo sem digitar
after-delay.timeout = 3000

[editor.inline-diagnostics]
cursor-line = "warning" # mensagem completa na linha do cursor
other-lines = "disable"

[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"

[editor.indent-guides]
render = true
character = "│"
skip-levels = 1

[editor.soft-wrap]
enable = false

[editor.whitespace.render]
tab = "all"
nbsp = "all"
nnbsp = "all"

[editor.whitespace.characters]
tab = "→"
nbsp = "⍽"

[editor.file-picker]
hidden = false # mostra dotfiles (respeita .gitignore)
git-ignore = true

[editor.lsp]
display-inlay-hints = true # tipos/parâmetros inline
display-messages = true
display-progress-messages = true
auto-signature-help = true
snippets = true

[editor.statusline]
left = ["mode", "spinner", "version-control", "file-name", "read-only-indicator", "file-modification-indicator"]
center = []
right = ["diagnostics", "workspace-diagnostics", "selections", "register", "position", "position-percentage", "file-encoding", "file-line-ending", "file-type"]
separator = "│"
mode.normal = "NORMAL"
mode.insert = "INSERT"
mode.select = "SELECT"

# ─────────────────────────── Atalhos ────────────────────────────
# Estilo VS Code por cima dos atalhos nativos (que continuam valendo).
[keys.normal]
C-s = ":write" # salvar
C-p = "file_picker" # abrir arquivo
C-S-p = "command_palette" # paleta de comandos
C-S-f = "global_search" # buscar no projeto
C-e = "file_explorer" # explorador de arquivos (nativo)
C-b = "buffer_picker" # buffers abertos
F2 = "rename_symbol"
F12 = "goto_definition"
S-F12 = "goto_reference"
"C-." = "code_action"
C-space = "hover"
F8 = "goto_next_diag"
S-F8 = "goto_prev_diag"
H = "goto_previous_buffer" # aba anterior
L = "goto_next_buffer" # próxima aba
C-q = ":buffer-close" # fechar aba
esc = ["collapse_selection", "keep_primary_selection"]

# Mover linha para cima/baixo (Alt+↑/↓)
A-up = ["extend_to_line_bounds", "delete_selection", "move_line_up", "paste_before"]
A-down = ["extend_to_line_bounds", "delete_selection", "paste_after"]

# lazygit em tela cheia; recarrega os buffers ao sair
C-g = [":write-all", ":new", ":insert-output lazygit", ":buffer-close!", ":redraw", ":reload-all"]

# terminal (shell) em tela cheia; `exit` ou Ctrl+D volta ao Helix e recarrega os buffers
C-t = [
":write-all",
":new",
':insert-output printf "\x1b[2J\x1b[H" > /dev/tty; $SHELL -i < /dev/tty > /dev/tty 2>&1',
':insert-output echo "\x1b[?1049h\x1b[?2004h" > /dev/tty',
":buffer-close!",
":redraw",
":reload-all",
]

# yazi como explorador: abre o arquivo escolhido
C-y = [
':sh rm -f /tmp/helix-yazi-chooser',
':insert-output yazi "%{buffer_name}" --chooser-file=/tmp/helix-yazi-chooser',
':insert-output echo "\x1b[?1049h\x1b[?2004h" > /dev/tty',
':open %sh{cat /tmp/helix-yazi-chooser}',
':redraw',
]

[keys.normal.space]
x = ":buffer-close"
X = ":buffer-close-others"
q = ":quit-all"
t = ":toggle lsp.display-inlay-hints"
W = ":toggle soft-wrap.enable"
p = [":write", ":sh vendor/bin/pint %{buffer_name}", ":reload"] # Laravel Pint no arquivo atual

[keys.insert]
C-s = ["normal_mode", ":write"]
C-space = "completion"
A-up = ["normal_mode", "extend_to_line_bounds", "delete_selection", "move_line_up", "paste_before", "insert_mode"]
A-down = ["normal_mode", "extend_to_line_bounds", "delete_selection", "paste_after", "insert_mode"]

[keys.select]
C-s = ["normal_mode", ":write"]
127 changes: 127 additions & 0 deletions catalog/configs/helix/languages.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# ─────────────────────── Language servers ───────────────────────
[language-server.rust-analyzer.config]
check.command = "clippy" # lint com clippy ao salvar
cargo.features = "all"
procMacro.enable = true
inlayHints.bindingModeHints.enable = false
inlayHints.closingBraceHints.minLines = 10
inlayHints.closureReturnTypeHints.enable = "with_block"
inlayHints.lifetimeElisionHints.enable = "skip_trivial"

[language-server.basedpyright]
command = "basedpyright-langserver"
args = ["--stdio"]

[language-server.basedpyright.config.basedpyright.analysis]
typeCheckingMode = "standard"
autoImportCompletions = true
inlayHints.variableTypes = true
inlayHints.functionReturnTypes = true
inlayHints.callArgumentNames = true

# ─────────────────────────── Linguagens ──────────────────────────
[[language]]
name = "rust"
auto-format = true

[[language]]
name = "python"
# basedpyright: tipos/goto/hover · ruff: lint + format
language-servers = ["basedpyright", "ruff"]
auto-format = true

# ═════════════════════ PHP / Laravel ═════════════════════
# intelephense: autocomplete, definição, hover, diagnósticos
# laravel-ls: rotas, views, config, env e bindings do app()
[language-server.laravel-ls]
command = "laravel-ls"

[[language]]
name = "php"
language-servers = ["intelephense", "laravel-ls"]
auto-format = false # projetos Laravel usam o Pint: `Space p` roda vendor/bin/pint

[[language]]
name = "blade"
language-servers = ["laravel-ls", "vscode-html-language-server", "tailwindcss-ls"]
formatter = { command = "blade-formatter", args = ["--stdin"] }
auto-format = true

# ═════════════════════════ C# ═════════════════════════
# csharp-ls 0.20: última versão que instala com o SDK do .NET 9
[language-server.csharp-ls]
command = "csharp-ls"

[[language]]
name = "c-sharp"
language-servers = ["csharp-ls"]
auto-format = true

# ═════════════════════════ Go ═════════════════════════
[language-server.gopls.config]
gofumpt = true
staticcheck = true
usePlaceholders = true
completeUnimported = true
hints = { assignVariableTypes = true, compositeLiteralFields = true, constantValues = true, functionTypeParameters = true, parameterNames = true, rangeVariableTypes = true }

[[language]]
name = "go"
language-servers = ["gopls"]
auto-format = true
formatter = { command = "goimports" } # format + organize imports

# ═════════════════ TypeScript / JavaScript ═════════════════
[language-server.eslint]
command = "vscode-eslint-language-server"
args = ["--stdio"]

[language-server.eslint.config]
validate = "on"
run = "onType"
format = false
quiet = false
nodePath = ""
onIgnoredFiles = "off"
rulesCustomizations = []
experimental = {}
problems = { shortenToSingleLine = false }
workingDirectory = { mode = "auto" }
codeAction = { disableRuleComment = { enable = true, location = "separateLine" }, showDocumentation = { enable = true } }

[language-server.typescript-language-server.config]
preferences = { importModuleSpecifierPreference = "non-relative" }
typescript.inlayHints = { includeInlayParameterNameHints = "all", includeInlayFunctionParameterTypeHints = true, includeInlayVariableTypeHints = true, includeInlayPropertyDeclarationTypeHints = true, includeInlayFunctionLikeReturnTypeHints = true, includeInlayEnumMemberValueHints = true }
javascript.inlayHints = { includeInlayParameterNameHints = "all", includeInlayFunctionParameterTypeHints = true, includeInlayVariableTypeHints = true, includeInlayFunctionLikeReturnTypeHints = true }

[[language]]
name = "typescript"
language-servers = ["typescript-language-server", "eslint"]
formatter = { command = "prettier", args = ["--stdin-filepath", "%{buffer_name}"] }
auto-format = true

[[language]]
name = "tsx"
language-servers = ["typescript-language-server", "eslint", "tailwindcss-ls"]
formatter = { command = "prettier", args = ["--stdin-filepath", "%{buffer_name}"] }
auto-format = true

[[language]]
name = "javascript"
language-servers = ["typescript-language-server", "eslint"]
formatter = { command = "prettier", args = ["--stdin-filepath", "%{buffer_name}"] }
auto-format = true

[[language]]
name = "jsx"
language-servers = ["typescript-language-server", "eslint", "tailwindcss-ls"]
formatter = { command = "prettier", args = ["--stdin-filepath", "%{buffer_name}"] }
auto-format = true

[[language]]
name = "html"
language-servers = ["vscode-html-language-server", "tailwindcss-ls"]

[[language]]
name = "css"
language-servers = ["vscode-css-language-server", "tailwindcss-ls"]
Loading
Loading