Skip to content

Instantly share code, notes, and snippets.

@pr00thmatic
Created May 8, 2019 21:56
Show Gist options
  • Save pr00thmatic/932c6f76558ee493613a268d05c69e86 to your computer and use it in GitHub Desktop.
Save pr00thmatic/932c6f76558ee493613a268d05c69e86 to your computer and use it in GitHub Desktop.
(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.
'(default ((t (:family "Ubuntu Mono" :foundry "outline" :slant normal :weight normal :height 98 :width normal)))))
(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.
'(ansi-color-names-vector
["#424242" "#EF9A9A" "#C5E1A5" "#FFEE58" "#64B5F6" "#E1BEE7" "#80DEEA" "#E0E0E0"])
'(ansi-term-color-vector
[unspecified "#424242" "#EF9A9A" "#C5E1A5" "#FFEE58" "#64B5F6" "#E1BEE7" "#80DEEA" "#E0E0E0"])
'(custom-enabled-themes (quote (ahungry)))
'(custom-safe-themes
(quote
("c70799e6420521bdd782842cd38ed9d18ba221ca294098f786e2c4ca4b2e9521" "1db337246ebc9c083be0d728f8d20913a0f46edc0a00277746ba411c149d7fe5" "5a0eee1070a4fc64268f008a4c7abfda32d912118e080e18c3c865ef864d1bea" default)))
'(evil-emacs-state-cursor (quote ("#E57373" bar)))
'(evil-insert-state-cursor (quote ("#E57373" hbar)))
'(evil-normal-state-cursor (quote ("#FFEE58" box)))
'(evil-visual-state-cursor (quote ("#C5E1A5" box)))
'(fci-rule-color "#2e2e2e")
'(highlight-symbol-colors
(quote
("#FFEE58" "#C5E1A5" "#80DEEA" "#64B5F6" "#E1BEE7" "#FFCC80")))
'(highlight-symbol-foreground-color "#E0E0E0")
'(highlight-tail-colors
(if
(eq
(quote dark)
(quote light))
(quote
(("#FFA726" . 0)
("#FFEE58" . 10)
("#FFF59D" . 30)
("#474747" . 60)
("#424242" . 80)))
(quote
(("#F8BBD0" . 0)
("#FF80AB" . 10)
("#9575CD" . 30)
("#474747" . 60)
("#424242" . 80)))))
'(pos-tip-background-color "#000000")
'(pos-tip-foreground-color "#9E9E9E")
'(show-paren-mode t)
'(tabbar-background-color "#353535")
'(tool-bar-mode nil)
'(vc-annotate-background "#3b3b3b")
'(vc-annotate-color-map
(quote
((20 . "#dd5542")
(40 . "#CC5542")
(60 . "#fb8512")
(80 . "#baba36")
(100 . "#bdbc61")
(120 . "#7d7c61")
(140 . "#6abd50")
(160 . "#6aaf50")
(180 . "#6aa350")
(200 . "#6a9550")
(220 . "#6a8550")
(240 . "#6a7550")
(260 . "#9b55c3")
(280 . "#6CA0A3")
(300 . "#528fd1")
(320 . "#5180b3")
(340 . "#6380b3")
(360 . "#DC8CC3"))))
'(vc-annotate-very-old-color "#DC8CC3")
'(yas-also-auto-indent-first-line t))
(add-hook 'after-init-hook (lambda ()
(load-theme 'ahungry)
(tool-bar-mode -1)
(menu-bar-mode -1)
(scroll-bar-mode -1)))
;; wtf?!
(global-set-key (kbd "M-;") 'beginning-of-buffer)
(global-set-key (kbd "M-:") 'end-of-buffer)
(global-set-key (kbd "M--") 'dabbrev-expand)
;; whitespace inquisition
(global-set-key "\C-\M-z" 'whitespace-cleanup)
;; js indent at 2
(setq js-indent-level 2)
;; linum mode
(global-linum-mode)
;; wind moves
(windmove-default-keybindings)
;; shut up emacs!
(setq ring-bell-function 'ignore)
;; transparent emacs
(set-frame-parameter (selected-frame) 'alpha '(90 90))
(set-face-attribute 'default nil :background "#000000"
:foreground "white")
;; full screen
(toggle-frame-fullscreen)
;; coding goods
(show-paren-mode 1)
;; melpa
(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/"))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(setq package-archives '(("melpa" . "http://melpa.org/packages/")))
(package-initialize) ;; You might already have this line
;; ********** YASNIPPET **********
;; yasnippet popup menu
;;; use popup menu for yas-choose-value
(require 'popup)
;; add some shotcuts in popup menu mode
(define-key popup-menu-keymap (kbd "M-n") 'popup-next)
(define-key popup-menu-keymap (kbd "TAB") 'popup-next)
(define-key popup-menu-keymap (kbd "<tab>") 'popup-next)
(define-key popup-menu-keymap (kbd "<backtab>") 'popup-previous)
(define-key popup-menu-keymap (kbd "M-p") 'popup-previous)
(defun yas-popup-isearch-prompt (prompt choices &optional display-fn)
(when (featurep 'popup)
(popup-menu*
(mapcar
(lambda (choice)
(popup-make-item
(or (and display-fn (funcall display-fn choice))
choice)
:value choice))
choices)
:prompt prompt
;; start isearch mode immediately
:isearch t
)))
(setq yas-prompt-functions '(yas-popup-isearch-prompt yas-ido-prompt yas-no-prompt))
;; yasnippet on load
(yas-global-mode 1)
(add-hook 'term-mode-hook (lambda ()
(yas-minor-mode -1)))
;; emacs o.O
;; 73 ^
;; masm
(require 'asm-mode)
(add-hook 'asm-mode-hook (lambda ()
(setq indent-tabs-mode nil) ; use spaces to indent
(electric-indent-mode -1) ; indentation in asm-mode is annoying
(setq tab-stop-list (number-sequence 2 60 2))))
(define-key asm-mode-map (kbd "<ret>") 'newline-and-indent)
(define-key asm-mode-map (kbd "M-.") 'helm-etags-select)
;; copy from pdf
(defun purge-pdf ()
(interactive)
(progn
(goto-char 1)
;; párrafos a salto auxiliar
(while (search-forward-regexp "\\([.\)]\\)\\($\\)\\([^\-]\\)" nil t)
(goto-char (match-end 0))
(insert "ZOMGZALIENZ"))
;; saltos dentro del párrafo
(goto-char 1)
(while (search-forward-regexp "\\($\\)\\([^$]\\)" nil t)
(replace-match " "))
;; salto auxiliar a doble salto
(goto-char 1)
(while (search-forward "ZOMGZALIENZ" nil t) (replace-match "\n\n"))
;; vocales y eñes
(goto-char 1)
(while (search-forward-regexp " ́\\(\s\\)?a" nil t) (replace-match "á"))
(goto-char 1)
(while (search-forward-regexp " ́\\(\s\\)?e" nil t) (replace-match "é"))
(goto-char 1)
(while (search-forward-regexp " ́\\(\s\\)?ı" nil t) (replace-match "í"))
(goto-char 1)
(while (search-forward-regexp " ́\\(\s\\)?o" nil t) (replace-match "ó"))
(goto-char 1)
(while (search-forward-regexp " ́\\(\s\\)?u" nil t) (replace-match "ú"))
(goto-char 1)
(while (search-forward-regexp " ̃\\(\s\\)?n" nil t) (replace-match "ñ"))
;; comillas feas, a comillas latex
(goto-char 1)
(while (search-forward "“" nil t) (replace-match "``"))
(goto-char 1)
(while (search-forward "”" nil t) (replace-match "''"))
))
(defun lazy-spanglish ()
(interactive)
(while (search-forward "'a" nil t) (replace-match "á"))
(goto-char 1)
(while (search-forward "'e" nil t) (replace-match "é"))
(goto-char 1)
(while (search-forward "'i" nil t) (replace-match "í"))
(goto-char 1)
(while (search-forward "'o" nil t) (replace-match "ó"))
(goto-char 1)
(while (search-forward "'u" nil t) (replace-match "ú"))
(goto-char 1)
(while (search-forward "~n" nil t) (replace-match "ñ"))
)
(setq-default indent-tabs-mode nil)
(require 'web-mode)
(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.php\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.[agj]sp\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.shader\\'" . shader-mode))
(defun my-web-mode-hook ()
(setq web-mode-markup-indent-offset 2))
(add-hook 'web-mode-hook 'my-web-mode-hook)
;; js doc
(require 'js-doc)
(add-hook 'js-mode-hook
#'(lambda ()
(define-key js2-mode-map "\C-ci" 'js-doc-insert-function-doc)
(define-key js2-mode-map "@" 'js-doc-insert-tag)))
;; shader mode
(add-to-list 'load-path "C:/Users/VG/.emacs.d/shader-mode.el")
;; tern :O
;; (add-to-list 'load-path "/home/vg/.emacs.d/tern/tern/emacs/")
;; (autoload 'tern-mode "tern.el" nil t)
;; (add-hook 'js-mode-hook (lambda () (tern-mode t)))
;; (eval-after-load 'tern
;; '(progn
;; (require 'tern-auto-complete)
;; (tern-ac-setup)))
;; autocomplete
(global-auto-complete-mode t)
(put 'erase-buffer 'disabled nil)
(prefer-coding-system 'utf-8)
;; don't go away,
;; and leave me there,
;; wondering what my mistake was,
;; wondering if you'll ever remember,
;; anything i said to you on the past.
(global-unset-key "\C-z")
(add-hook 'artist-mode-hook
(lambda ()
(local-set-key (kbd "<f1>") 'org-mode)
(local-set-key (kbd "<f2>") 'artist-select-op-pen-line) ; f2 = pen mode
(local-set-key (kbd "<f3>") 'artist-select-op-line) ; f3 = line
(local-set-key (kbd "<f4>") 'artist-select-op-square) ; f4 = rectangle
(local-set-key (kbd "<f5>") 'artist-select-op-ellipse) ; f5 = ellipse
(local-set-key (kbd "C-z") 'undo)
))
;; ;; squared font for artist mode
;; (add-hook 'artist-mode-hook (lambda ()
;; (setq buffer-face-mode-face '(:family "Topaz-8"))
;; (buffer-face-mode)))
(defun rename-file-and-buffer (new-name)
"Renames both current buffer and file it's visiting to NEW-NAME."
(interactive "sNew name: ")
(let ((name (buffer-name))
(filename (buffer-file-name)))
(if (not filename)
(message "Buffer '%s' is not visiting a file!" name)
(if (get-buffer new-name)
(message "A buffer named '%s' already exists!" new-name)
(progn
(rename-file filename new-name 1)
(rename-buffer new-name)
(set-visited-file-name new-name)
(set-buffer-modified-p nil))))))
(defun close-all-buffers ()
(interactive)
(mapc 'kill-buffer (buffer-list)))
(require 'smooth-scrolling)
(smooth-scrolling-mode 1)
(setq smooth-scroll-margin 5)
(setq lua-child-indent 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment