Skip to content

Instantly share code, notes, and snippets.

@Camilotk
Last active February 20, 2023 21:42
Show Gist options
  • Save Camilotk/226ac2f718cdc93244db3ea31b6e75ef to your computer and use it in GitHub Desktop.
Save Camilotk/226ac2f718cdc93244db3ea31b6e75ef to your computer and use it in GitHub Desktop.
;;;
;; pt-br: Repositorios / en: Repositories
;;;
;; Define and initialise package repositories
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(package-refresh-contents)
;; -------------------------------------------------------------------------
;;;
;; pt-br: Pacotes / en: Packages
;;;
;; pt-br: Define os repositórios dos pacotes
;; en: Define packages repositories
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'package-archives
'("melpa-stable" . "http://stable.melpa.org/packages/") t)
;; pt-br: Fixa determinados pacotes a serem buscados no MELPA Stable.
;; en: Fix as MELPA Stable default repo to this packages.
(add-to-list 'package-pinned-packages '(cider . "melpa-stable") t)
(add-to-list 'package-pinned-packages '(magit . "melpa-stable") t)
;; pt-br: Atualiza os pacotes no repositório ELPA no startup.
;; en: This informs Emacs about the latest versions of packages in ELPA
;; and updates them in startup.
(when (not package-archive-contents)
(package-refresh-contents))
;; pt-br: Lista com todos os pacotes que serão instalados. Eles também
;; podem ser instalados com M-x package-install
;; en: The packages you want installed. You can also install these
;; manually with M-x package-install
(defvar camilotk/packages
'(;;;
;; GENERAL PACKAGES / PACOTES GERAIS
;;;
;; pt-br: faz com que seja muito mais fácil trabalhar com LISP
;; en: makes handling lisp expressions much, much easier
;; Cheatsheet: http://www.emacswiki.org/emacs/PareditCheatsheet
paredit
;; pt-br: permite o ido ser usado em todos os contextos possiveis
;; en: allow ido usage in as many contexts as possible.
ido-completing-read+
;; pt-br: Melhora o M-x para facilitar a exec. dos comandos. Cria
;; uma lista com possiveis preenchimentos dos comandos no minibuffer
;; en: Enhances M-x to allow easier execution of commands. Provides
;; a filterable list of possible commands in the minibuffer
;; http://www.emacswiki.org/emacs/Smex
smex
;; pt-br: match colorido de parentesis
;; en: colorful parenthesis matching
rainbow-delimiters
;; pt-br: integração com o git
;; en: git integration
magit
;; pt-br: suporte a markdown
;; en: markdown support
markdown-mode
;; pt-br: suporte a visualização RT
;; en: Real-time visualization support
impatient-mode
;;;
;; PROGRAMING LANGUAGES PACKAGES / PACOTES DE PROGRAMAÇÃO
;;;
;; scheme
racket-mode ;; https://www.racket-mode.com/
;; clojure
clojure-mode
cider
lsp-mode
flycheck
company
;;;
;; UNNECESSARY BUT COOL STUFF / COISAS BACANAS
;;;
solarized-theme ;; better colors pallete / theme
;; my heart is pure, pure evil
evil
;; pacman
pacmacs))
;; pt-br: Instala os pacotes que não estão instalados.
;; en: Installs the uninstalled packages.
(dolist (p camilotk/packages)
(when (not (package-installed-p p))
(package-install p)))
;; pt-br: Inicia o modo de LSP quando estiver editando Clojure
;; en: Starts the LSP mode when editing Clojure
;; DOC: https://emacs-lsp.github.io/lsp-mode/tutorials/clojure-guide/
;; install server: https://clojure-lsp.io/installation/
(add-hook 'clojure-mode-hook 'lsp)
(add-hook 'clojurescript-mode-hook 'lsp)
(add-hook 'clojurec-mode-hook 'lsp)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
'("4c56af497ddf0e30f65a7232a8ee21b3d62a8c332c6b268c81e9ea99b11da0d3" "fee7287586b17efbfda432f05539b58e86e059e78006ce9237b8732fde991b4c" default))
'(package-selected-packages
'(pacmacs solarized-theme racket-mode magit rainbow-delimiters smex ido-completing-read+ paredit)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
;; -------------------------------------------------------------------------
;;;
;; pt-br: Interface de Usuário / en: User Interface
;;;
;; pt-br: Carrega o tema, comente/descomente de acordo com preferencia.
;; en: Loads the EMACS theme, comment/uncomment by preference.
;; (load-theme 'solarized-light t)
(load-theme 'solarized-light t)
;; pt-br: Insere o número das linhas.
;; en: Insert line numbers.
(global-linum-mode)
;; pt-br: Desativa o cursor piscando.
;; en: No cursor blinking, it's distracting.
(blink-cursor-mode 0)
;; pt-br: caminho completo na barra de título.
;; en: full path in title bar
(setq-default frame-title-format "%b (%f)")
;; pt-br: sem sons irritantes.
;; en: no bell
(setq ring-bell-function 'ignore)
;; -------------------------------------------------------------------------
;;;
;; pt-br: Navegação / en: Navigation
;;;
;;PT-BR
;; ido-mode permite que a navegação entre as opções seja mais fácil.
;; EX: quando tem que trocar os buffers, ele apresenta uma lista,
;; de buffers no minibuffer. Quando começasse a digitar ele apresenta
;; um autocomplete dos possíveis nomes de buffers que combinam com
;; o nome que está sendo digitado.
;;EN:
;; ido-mode allows you to more easily navigate choices. For example,
;; when you want to switch buffers, ido presents you with a list
;; of buffers in the the mini-buffer. As you start to type a buffer's
;; name, ido will narrow down the list of buffers to match the text
;; you've typed in
;;DOC
;; http://www.emacswiki.org/emacs/InteractivelyDoThings
(ido-mode t)
;; pt-br: Permite combinações parciais. ex. "ca" combina com "Camilo Azevedo"
;; en: This allows partial matches, e.g. "tl" will match "Tyrion Lannister"
(setq ido-enable-flex-matching t)
;; pt-br: Torna essa função desligada, porque acaba sendo incomôda
;; en: Turn this behavior off because it's annoying
(setq ido-use-filename-at-point nil)
;;PT-BR
;; Não tenta encontrar arquivos em todas as pastas; apenas tenta encontrar
;; arquivos no diretório atual no minibuffer
;;EN
;; Don't try to match file across all "work" directories; only match files
;; in the current directory displayed in the minibuffer
(setq ido-auto-merge-work-directories-length -1)
;;PT-BR
;; Inclui o nome de buffer nos arquivos recentes, mesmo se eles não
;; forem abertos.
;;EN
;; Includes buffer names of recently open files, even if they're not
;; open now
(setq ido-use-virtual-buffers t)
;;PT-BR
;; Isso permite que o ido seja usado em todos os contextos que ele pode
;; ser util para selecionar buffers ou nomes de arquivo.
;;EN
;; This enables ido in all contexts where it could be useful, not just
;; for selecting buffer and file names
(ido-ubiquitous-mode t)
(ido-everywhere t)
;; pt-br: Mostra uma lista de buffers.
;; en: Shows a list of buffers
(global-set-key (kbd "C-x C-b") 'ibuffer)
;; pt-br: Não cria ~ arquivos durante a edição.
;; en: No need for ~ files when editing
(setq create-lockfiles nil)
;; pt-br: Muda as perguntas de yes/no para y/n
;; en: Changes all yes/no questions to y/n type
(fset 'yes-or-no-p 'y-or-n-p)
;; pt-br: Usa o modo evil
;; en: Use evil mode
(require 'evil)
(evil-mode 1)
;; -------------------------------------------------------------------------
;;;
;; pt-br: Minhas funções / en: My functions
;;;
;; pt-br: Converte markdown em HTML
;; en: Converte markdown em HTML
(defun markdown-html (buffer)
(princ (with-current-buffer buffer
(format "<!DOCTYPE html><html><title>Impatient Markdown</title><xmp theme=\"united\" style=\"display:none;\"> %s </xmp><script src=\"http://ndossougbe.github.io/strapdown/dist/strapdown.js\"></script></html>" (buffer-substring-no-properties (point-min) (point-max))))
(current-buffer)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment