Last active
August 14, 2026 18:19
-
-
Save anabastos/58f58de0ef2bada05d2746ee80742f27 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; -*- mode: emacs-lisp; lexical-binding: t -*- | |
| ;; This file is loaded by Spacemacs at startup. | |
| ;; It must be stored in your home directory. | |
| ;; Fixar evil-want-keybinding ANTES que evil carregue. | |
| ;; Precisa estar ANTES de qualquer outra coisa, no scope global. | |
| (setq evil-want-keybinding nil) | |
| (defun dotspacemacs/layers () | |
| "Layer configuration: | |
| This function should only modify configuration layer settings." | |
| (setq-default | |
| dotspacemacs-distribution 'spacemacs | |
| dotspacemacs-enable-lazy-installation 'unused | |
| dotspacemacs-ask-for-lazy-installation t | |
| dotspacemacs-configuration-layer-path '() | |
| ;; List of configuration layers to load. | |
| dotspacemacs-configuration-layers | |
| '(;; ================================================================== | |
| ;; BASE / EDITOR | |
| ;; Layers fundamentais do dia a dia: navegacao, busca e edicao. | |
| ;; ================================================================== | |
| emacs-lisp | |
| helm ; framework de busca/navegacao (SPC SPC, SPC f f...) | |
| multiple-cursors ; edicao com varios cursores | |
| treemacs ; arvore de arquivos lateral (SPC f t) | |
| ;; auto-completion: necessario para o company mostrar as sugestoes | |
| ;; do LSP (JS/TS/Python/etc). Sem essa layer, lsp-mode roda mas | |
| ;; sem popup de completion. | |
| auto-completion | |
| ;; ================================================================== | |
| ;; LINGUAGENS | |
| ;; Cada layer traz syntax highlight, indentacao e integracao com | |
| ;; LSP/REPL da linguagem correspondente. | |
| ;; ================================================================== | |
| markdown | |
| typescript | |
| elixir | |
| (dart :variables | |
| lsp-dart-sdk-dir "/Users/ana.luiza/sdk-flutter/bin/cache/dart-sdk/") | |
| (javascript :variables | |
| javascript-backend 'lsp | |
| javascript-import-tool 'import-js | |
| javascript-fmt-tool 'prettier | |
| javascript-fmt-on-save t | |
| node-add-modules-path t | |
| javascript-repl 'nodejs | |
| javascript-lsp-linter t) | |
| common-lisp | |
| (python :variables | |
| python-backend 'lsp | |
| python-lsp-server 'pyright) | |
| (yaml :variables yaml-enable-lsp t) | |
| haskell | |
| (clojure :variables clojure-enable-linters 'clj-kondo) | |
| react | |
| elm | |
| ;; rust: usa rust-analyzer via LSP (instalar com `rustup component | |
| ;; add rust-analyzer`); formata com rustfmt ao salvar | |
| (rust :variables | |
| rust-backend 'lsp | |
| rustic-format-on-save t) | |
| html | |
| ocaml | |
| (reasonml :variables reason-auto-refmt t) | |
| vimscript | |
| ;; ================================================================== | |
| ;; DEVOPS / INFRA | |
| ;; ================================================================== | |
| (docker :variables docker-dockerfile-backend 'lsp) | |
| kubernetes | |
| ;; ================================================================== | |
| ;; FERRAMENTAS | |
| ;; ================================================================== | |
| ;; shell-default-shell fixado em eshell para nao puxar vterm | |
| ;; (foi removido intencionalmente, ver pacotes excluidos abaixo) | |
| (shell :variables shell-default-shell 'eshell) | |
| org ; organizacao, notas e agenda (org-mode) | |
| git ; integracao com git via magit (SPC g s) | |
| parinfer ; balanceamento automatico de parenteses (lisps) | |
| ;; ================================================================== | |
| ;; SOCIAL / DIVERSAO | |
| ;; ================================================================== | |
| emoji | |
| ;; ================================================================== | |
| ;; TEMAS | |
| ;; ================================================================== | |
| themes-megapack) | |
| ;; ------------------------------------------------------------------ | |
| ;; Pacotes avulsos (fora de layers): | |
| ;; agent-shell -> Claude Code / Cursor dentro do Emacs (ver | |
| ;; `dotspacemacs/user-config') | |
| ;; elcord -> Discord Rich Presence: mostra no seu perfil do | |
| ;; Discord o que voce esta editando no Emacs | |
| ;; ------------------------------------------------------------------ | |
| dotspacemacs-additional-packages '(agent-shell | |
| elcord) | |
| ;; A list of packages that cannot be updated. | |
| dotspacemacs-frozen-packages '() | |
| ;; Pacotes de IA removidos explicitamente (substituidos por agent-shell) | |
| dotspacemacs-excluded-packages '(copilot | |
| gptel | |
| aidermacs | |
| aider | |
| ellama | |
| vterm | |
| forge) | |
| dotspacemacs-install-packages 'used-only)) | |
| (defun dotspacemacs/init () | |
| "Initialization: | |
| This function is called at the very beginning of Spacemacs startup, | |
| before layer configuration." | |
| (setq-default | |
| dotspacemacs-elpa-timeout 5 | |
| dotspacemacs-gc-cons '(100000000 0.1) | |
| dotspacemacs-read-process-output-max (* 1024 1024) | |
| dotspacemacs-use-spacelpa nil | |
| dotspacemacs-verify-spacelpa-archives t | |
| dotspacemacs-check-for-update nil | |
| dotspacemacs-elpa-subdirectory 'emacs-version | |
| dotspacemacs-editing-style 'vim | |
| dotspacemacs-startup-buffer-show-version t | |
| dotspacemacs-startup-banner 'official | |
| dotspacemacs-startup-banner-scale 'auto | |
| dotspacemacs-startup-lists '((recents . 5) | |
| (projects . 7)) | |
| dotspacemacs-startup-buffer-responsive t | |
| dotspacemacs-show-startup-list-numbers t | |
| dotspacemacs-startup-buffer-multi-digit-delay 0.4 | |
| dotspacemacs-startup-buffer-show-icons nil | |
| dotspacemacs-new-empty-buffer-major-mode 'text-mode | |
| dotspacemacs-scratch-mode 'text-mode | |
| dotspacemacs-scratch-buffer-persistent nil | |
| dotspacemacs-scratch-buffer-unkillable nil | |
| dotspacemacs-initial-scratch-message nil | |
| dotspacemacs-themes '(spacemacs-dark | |
| spacemacs-light) | |
| ;; mode-line com icones (all-the-icons) | |
| dotspacemacs-mode-line-theme 'all-the-icons | |
| dotspacemacs-colorize-cursor-according-to-state t | |
| ;; Victor Mono como fonte principal, com Fira Code como fallback | |
| ;; caso Victor Mono nao esteja instalada. Ambas tem suporte a | |
| ;; ligatures (ver `dotspacemacs/user-config'). | |
| dotspacemacs-default-font '(("Victor Mono" | |
| :size 16 | |
| :weight normal | |
| :width normal) | |
| ("Fira Code" | |
| :size 16 | |
| :weight normal | |
| :width normal)) | |
| dotspacemacs-default-icons-font 'all-the-icons | |
| dotspacemacs-leader-key "SPC" | |
| dotspacemacs-emacs-command-key "SPC" | |
| dotspacemacs-ex-command-key ":" | |
| dotspacemacs-emacs-leader-key "M-m" | |
| dotspacemacs-major-mode-leader-key "," | |
| dotspacemacs-major-mode-emacs-leader-key (if window-system "M-<return>" "C-M-m") | |
| dotspacemacs-distinguish-gui-tab nil | |
| dotspacemacs-default-layout-name "Default" | |
| dotspacemacs-display-default-layout nil | |
| dotspacemacs-auto-resume-layouts nil | |
| dotspacemacs-auto-generate-layout-names nil | |
| dotspacemacs-large-file-size 1 | |
| dotspacemacs-auto-save-file-location 'cache | |
| dotspacemacs-max-rollback-slots 5 | |
| dotspacemacs-enable-paste-transient-state nil | |
| dotspacemacs-which-key-delay 0.4 | |
| dotspacemacs-which-key-position 'bottom | |
| dotspacemacs-switch-to-buffer-prefers-purpose nil | |
| dotspacemacs-maximize-window-keep-side-windows t | |
| dotspacemacs-enable-load-hints nil | |
| dotspacemacs-enable-package-quickstart nil | |
| dotspacemacs-loading-progress-bar t | |
| dotspacemacs-fullscreen-at-startup nil | |
| dotspacemacs-fullscreen-use-non-native nil | |
| dotspacemacs-maximized-at-startup t | |
| dotspacemacs-undecorated-at-startup nil | |
| dotspacemacs-active-transparency 90 | |
| dotspacemacs-inactive-transparency 90 | |
| dotspacemacs-background-transparency 90 | |
| dotspacemacs-show-transient-state-title t | |
| dotspacemacs-show-transient-state-color-guide t | |
| dotspacemacs-mode-line-unicode-symbols t | |
| dotspacemacs-smooth-scrolling t | |
| dotspacemacs-scroll-bar-while-scrolling t | |
| ;; mantendo igual a primeira config (sem numeros de linha globais) | |
| dotspacemacs-line-numbers nil | |
| dotspacemacs-folding-method 'evil | |
| dotspacemacs-smartparens-strict-mode nil | |
| dotspacemacs-activate-smartparens-mode t | |
| dotspacemacs-smart-closing-parenthesis nil | |
| dotspacemacs-highlight-delimiters 'all | |
| dotspacemacs-enable-server nil | |
| dotspacemacs-server-socket-dir nil | |
| dotspacemacs-persistent-server nil | |
| dotspacemacs-search-tools '("rg" "ag" "ack" "grep") | |
| dotspacemacs-undo-system 'undo-fu | |
| dotspacemacs-frame-title-format "%I@%S" | |
| dotspacemacs-icon-title-format nil | |
| dotspacemacs-show-trailing-whitespace t | |
| dotspacemacs-whitespace-cleanup nil | |
| dotspacemacs-use-clean-aindent-mode t | |
| dotspacemacs-use-SPC-as-y nil | |
| dotspacemacs-swap-number-row nil | |
| dotspacemacs-zone-out-when-idle nil | |
| dotspacemacs-pretty-docs nil | |
| dotspacemacs-home-shorten-agenda-source nil | |
| dotspacemacs-byte-compile nil)) | |
| (defun dotspacemacs/user-env () | |
| "Environment variables setup." | |
| (spacemacs/load-spacemacs-env)) | |
| (defun dotspacemacs/user-init () | |
| "Initialization for user code, before layer configuration." | |
| ) | |
| (defun dotspacemacs/user-config () | |
| "Configuration for user code, after layer configuration." | |
| ;; ==================================================================== | |
| ;; LSP -- configuracao geral | |
| ;; Vale para todas as linguagens que usam lsp-mode (JS/TS/Python...). | |
| ;; ==================================================================== | |
| (setq lsp-enable-snippet t ; expande snippets vindos do servidor | |
| lsp-idle-delay 0.5 ; espera 0.5s parado antes de consultar | |
| lsp-log-io nil ; sem log de I/O (mais performance) | |
| lsp-prefer-flymake nil) ; usa flycheck em vez de flymake | |
| ;; Arquivos .cljc e .edn abrem em clojure-mode | |
| (add-to-list 'auto-mode-alist '("\\.cljc\\'" . clojure-mode)) | |
| (add-to-list 'auto-mode-alist '("\\.edn\\'" . clojure-mode)) | |
| ;; ==================================================================== | |
| ;; JAVASCRIPT / TYPESCRIPT | |
| ;; Indentacao de 2 espacos + LSP ligado automaticamente. | |
| ;; ==================================================================== | |
| (setq js-indent-level 2 | |
| js2-basic-offset 2 | |
| typescript-indent-level 2) | |
| (add-hook 'typescript-mode-hook #'lsp) | |
| (add-hook 'js-mode-hook #'lsp) | |
| ;; ==================================================================== | |
| ;; PYTHON | |
| ;; Interprete python3 + LSP (pyright, ver layers). | |
| ;; ==================================================================== | |
| (setq python-shell-interpreter "python3") | |
| (add-hook 'python-mode-hook #'lsp) | |
| ;; ==================================================================== | |
| ;; CLOJURE / CIDER | |
| ;; ==================================================================== | |
| (setq clojure-enable-linters t | |
| cider-repl-display-help-banner nil ; sem banner no REPL | |
| cider-save-file-on-load t ; salva ao dar load | |
| cider-font-lock-dynamically '(macro core function var)) | |
| (add-hook 'cider-repl-mode-hook #'rainbow-delimiters-mode) | |
| ;; ==================================================================== | |
| ;; EDICAO / QUALIDADE DE VIDA | |
| ;; ==================================================================== | |
| ;; Recarrega buffers automaticamente quando o arquivo muda no disco | |
| (global-auto-revert-mode t) | |
| ;; Mode-line mostra o caminho abreviado do arquivo, nao so o nome | |
| (spaceline-define-segment buffer-id | |
| (if (buffer-file-name) | |
| (abbreviate-file-name (buffer-file-name)) | |
| (powerline-buffer-id))) | |
| ;; Fecha o minibuffer ao clicar fora dele (evita ficar "preso") | |
| (defun stop-using-minibuffer () | |
| "Kill the minibuffer when clicking outside of it." | |
| (when (and (>= (recursion-depth) 1) (active-minibuffer-window)) | |
| (abort-recursive-edit))) | |
| (add-hook 'mouse-leave-buffer-hook 'stop-using-minibuffer) | |
| ;; Espacos em vez de tabs, largura 4, em todos os modos | |
| (add-hook 'after-change-major-mode-hook | |
| (lambda () | |
| (setq-default indent-tabs-mode nil) | |
| (setq c-basic-indent 4) | |
| (setq tab-width 4))) | |
| ;; ==================================================================== | |
| ;; FONTE + LIGATURES | |
| ;; Victor Mono como principal, Fira Code como fallback. A tabela | |
| ;; abaixo habilita as ligatures (=>, ->, === viram simbolos unicos). | |
| ;; ==================================================================== | |
| (when (window-system) | |
| (cond | |
| ((member "Victor Mono" (font-family-list)) | |
| (set-frame-font "Victor Mono-16" nil t)) | |
| ((member "Fira Code" (font-family-list)) | |
| (set-frame-font "Fira Code-16" nil t)))) | |
| (let ((alist '((33 . ".\\(?:\\(?:==\\|!!\\)\\|[!=]\\)") | |
| (35 . ".\\(?:###\\|##\\|_(\\|[#(?[_{]\\)") | |
| (36 . ".\\(?:>\\)") | |
| (37 . ".\\(?:\\(?:%%\\)\\|%\\)") | |
| (38 . ".\\(?:\\(?:&&\\)\\|&\\)") | |
| (42 . ".\\(?:\\(?:\\*\\*/\\)\\|\\(?:\\*[*/]\\)\\|[*/>]\\)") | |
| (43 . ".\\(?:\\(?:\\+\\+\\)\\|[+>]\\)") | |
| (45 . ".\\(?:\\(?:-[>-]\\|<<\\|>>\\)\\|[<>}~-]\\)") | |
| (46 . ".\\(?:\\(?:\\.[.<]\\)\\|[.=-]\\)") | |
| (47 . ".\\(?:\\(?:\\*\\*\\|//\\|==\\)\\|[*/=>]\\)") | |
| (48 . ".\\(?:x[a-zA-Z]\\)") | |
| (58 . ".\\(?:::\\|[:=]\\)") | |
| (59 . ".\\(?:;;\\|;\\)") | |
| (60 . ".\\(?:\\(?:!--\\)\\|\\(?:~~\\|->\\|\\$>\\|\\*>\\|\\+>\\|--\\|<[<=-]\\|=[<=>]\\||>\\)\\|[*$+~/<=>|-]\\)") | |
| (61 . ".\\(?:\\(?:/=\\|:=\\|<<\\|=[=>]\\|>>\\)\\|[<=>~]\\)") | |
| (62 . ".\\(?:\\(?:=>\\|>[=>-]\\)\\|[=>-]\\)") | |
| (63 . ".\\(?:\\(\\?\\?\\)\\|[:=?]\\)") | |
| (91 . ".\\(?:]\\)") | |
| (92 . ".\\(?:\\(?:\\\\\\\\\\)\\|\\\\\\)") | |
| (94 . ".\\(?:=\\)") | |
| (119 . ".\\(?:ww\\)") | |
| (123 . ".\\(?:-\\)") | |
| (124 . ".\\(?:\\(?:|[=|]\\)\\|[=>|]\\)") | |
| (126 . ".\\(?:~>\\|~~\\|[>=@~-]\\)") | |
| ))) | |
| (dolist (char-regexp alist) | |
| (set-char-table-range composition-function-table (car char-regexp) | |
| `([,(cdr char-regexp) 0 font-shape-gstring])))) | |
| ;; ==================================================================== | |
| ;; AGENT SHELL (Claude Code + Cursor, via ACP) | |
| ;; https://github.com/xenodium/agent-shell | |
| ;; ==================================================================== | |
| ;; Dependencias externas (rodar uma vez fora do Emacs): | |
| ;; npm install -g @agentclientprotocol/claude-agent-acp ; Claude Agent | |
| ;; npm install -g @blowmage/cursor-agent-acp ; Cursor (empresa) | |
| ;; Depois, logar uma vez em cada CLI fora do Emacs (claude / cursor-agent | |
| ;; login) para autenticar a assinatura. | |
| (setq agent-shell-anthropic-authentication | |
| (agent-shell-anthropic-make-authentication :login t)) | |
| (setq agent-shell-preferred-agent-config | |
| (agent-shell-anthropic-make-claude-code-config)) | |
| ;; M-x agent-shell-anthropic-start-claude-code -> sessao com Claude | |
| ;; M-x agent-shell-cursor-start-agent -> sessao com Cursor | |
| ;; ==================================================================== | |
| ;; DISCORD (elcord -- Rich Presence) | |
| ;; https://github.com/Mstrodl/elcord | |
| ;; Mostra no seu perfil do Discord o arquivo/linguagem que voce esta | |
| ;; editando. O Discord precisa estar aberto na mesma maquina. | |
| ;; ==================================================================== | |
| (setq elcord-editor-icon "emacs_icon" ; icone do Emacs no presence | |
| elcord-quiet t ; sem mensagens de conexao no echo | |
| elcord-idle-message "Fazendo outra coisa...") | |
| ;; Desliga o presence quando o Emacs fica ocioso (privacidade + economia) | |
| (setq elcord-idle-timer 300) | |
| (elcord-mode) | |
| ;; Para desligar na sessao atual: M-x elcord-mode | |
| ;; Do not write anything past this comment. This is where Emacs will | |
| ;; auto-generate custom variable definitions. | |
| ) | |
| ;; Este bloco eh gerado automaticamente pelo Emacs (Customize). | |
| ;; Deixe vazio num arquivo novo -- sera preenchido sozinho na primeira | |
| ;; vez que voce rodar o Spacemacs e ele instalar as layers. | |
| (custom-set-variables | |
| ;; custom-set-variables was added by Custom. | |
| ) | |
| (custom-set-faces | |
| ;; custom-set-faces was added by Custom. | |
| ) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.drupal.org/docs/develop/development-tools/emacs