diff --git a/emacs/.spacemacs b/emacs/.spacemacs index 08bd5b4..1ff8787 100644 --- a/emacs/.spacemacs +++ b/emacs/.spacemacs @@ -367,7 +367,7 @@ It should only modify the values of Spacemacs settings." ;; text-mode ;; :size-limit-kb 1000) ;; (default nil) - dotspacemacs-line-numbers t + dotspacemacs-line-numbers t ;; Code folding method. Possible values are `evil' and `origami'. ;; (default 'evil) @@ -447,18 +447,21 @@ If you are unsure, try setting them in `dotspacemacs/user-config' first." ) (defun dotspacemacs/user-config () - (org-babel-do-load-languages - 'org-babel-load-languages - '((scheme . t) - (ruby . t) - (python . t) - (sh . t))) "Configuration for user code: This function is called at the very end of Spacemacs startup, after layer configuration. Put your configuration code here, except for variables that should be set before packages are loaded." - + (org-babel-do-load-languages + 'org-babel-load-languages + '((scheme . t) + (ruby . t) + (python . t) + (shell . t) + (awk . t) + (gnuplot . t) + (sql . t) + (http . t))) ) ;; Do not write anything past this comment. This is where Emacs will ;; auto-generate custom variable definitions. @@ -474,11 +477,73 @@ This function is called at the very end of Spacemacs initialization." ;; If there is more than one, they won't work right. '(package-selected-packages (quote - (zenburn-theme zen-and-art-theme white-sand-theme underwater-theme ujelly-theme twilight-theme twilight-bright-theme twilight-anti-bright-theme toxi-theme tao-theme tangotango-theme tango-plus-theme tango-2-theme sunny-day-theme sublime-themes subatomic256-theme subatomic-theme spacegray-theme soothe-theme solarized-theme soft-stone-theme soft-morning-theme soft-charcoal-theme smyx-theme seti-theme reverse-theme rebecca-theme railscasts-theme purple-haze-theme professional-theme planet-theme phoenix-dark-pink-theme phoenix-dark-mono-theme organic-green-theme omtose-phellack-theme oldlace-theme occidental-theme obsidian-theme noctilux-theme naquadah-theme mustang-theme monokai-theme monochrome-theme molokai-theme moe-theme minimal-theme material-theme majapahit-theme madhat2r-theme lush-theme light-soap-theme kaolin-themes jbeans-theme jazz-theme ir-black-theme inkpot-theme heroku-theme hemisu-theme hc-zenburn-theme gruvbox-theme gruber-darker-theme grandshell-theme gotham-theme gandalf-theme flatui-theme flatland-theme farmhouse-theme eziam-theme exotica-theme espresso-theme dracula-theme doom-themes django-theme darktooth-theme autothemer darkokai-theme darkmine-theme darkburn-theme dakrone-theme cyberpunk-theme confluence xml-rpc color-theme-sanityinc-tomorrow color-theme-sanityinc-solarized clues-theme cherry-blossom-theme busybee-theme bubbleberry-theme birds-of-paradise-plus-theme badwolf-theme apropospriate-theme anti-zenburn-theme ample-zen-theme ample-theme alect-themes afternoon-theme yasnippet-snippets yapfify xterm-color ws-butler winum which-key web-mode web-beautify volatile-highlights vi-tilde-fringe uuidgen use-package unfill toc-org tagedit symon string-inflection spaceline-all-the-icons smeargle slim-mode shell-pop scss-mode sass-mode rvm ruby-tools ruby-test-mode ruby-refactor ruby-hash-syntax rubocop rspec-mode robe restclient-helm restart-emacs rbenv rake rainbow-delimiters pyvenv pytest pyenv-mode py-isort pug-mode popwin pippel pipenv pip-requirements persp-mode password-generator paradox ox-reveal ox-gfm overseer orgit org-projectile org-present org-pomodoro org-mime org-journal org-download org-bullets org-brain open-junk-file ob-restclient ob-http neotree nameless mwim multi-term move-text mmm-mode minitest markdown-toc magit-svn magit-gitflow macrostep lorem-ipsum livid-mode live-py-mode link-hint json-navigator json-mode js2-refactor js-doc indent-guide importmagic impatient-mode hungry-delete hl-todo highlight-parentheses highlight-numbers highlight-indentation helm-xref helm-themes helm-swoop helm-pydoc helm-purpose helm-projectile helm-mode-manager helm-make helm-gitignore helm-flx helm-descbinds helm-css-scss helm-company helm-c-yasnippet helm-ag google-translate golden-ratio gnuplot gitignore-templates gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link git-gutter-fringe git-gutter-fringe+ gh-md geiser fuzzy font-lock+ flycheck-pos-tip flx-ido fill-column-indicator fancy-battery eyebrowse expand-region evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-surround evil-org evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-magit evil-lisp-state evil-lion evil-indent-plus evil-iedit-state evil-goggles evil-exchange evil-escape evil-cleverparens evil-args evil-anzu eval-sexp-fu eshell-z eshell-prompt-extras esh-help emmet-mode elisp-slime-nav editorconfig dumb-jump dotenv-mode diminish diff-hl define-word cython-mode counsel-projectile company-web company-tern company-statistics company-restclient company-anaconda column-enforce-mode clean-aindent-mode chruby centered-cursor-mode bundler browse-at-remote auto-yasnippet auto-highlight-symbol auto-compile aggressive-indent ace-window ace-link ace-jump-helm-line ac-ispell)))) + (zenburn-theme zen-and-art-theme yapfify white-sand-theme web-mode web-beautify underwater-theme ujelly-theme twilight-theme twilight-bright-theme twilight-anti-bright-theme toxi-theme tao-theme tangotango-theme tango-plus-theme tango-2-theme tagedit sunny-day-theme sublime-themes subatomic256-theme subatomic-theme spacegray-theme soothe-theme solarized-theme soft-stone-theme soft-morning-theme soft-charcoal-theme smyx-theme slim-mode seti-theme scss-mode sass-mode rvm ruby-tools ruby-test-mode ruby-refactor ruby-hash-syntax rubocop rspec-mode robe reverse-theme rebecca-theme rbenv rake railscasts-theme pyvenv pytest pyenv-mode py-isort purple-haze-theme pug-mode professional-theme planet-theme pippel pipenv pip-requirements phoenix-dark-pink-theme phoenix-dark-mono-theme ox-reveal ox-gfm organic-green-theme org-journal omtose-phellack-theme oldlace-theme occidental-theme obsidian-theme noctilux-theme naquadah-theme mustang-theme monokai-theme monochrome-theme molokai-theme moe-theme minitest minimal-theme material-theme majapahit-theme madhat2r-theme lush-theme livid-mode skewer-mode live-py-mode light-soap-theme kaolin-themes json-navigator hierarchy json-mode json-snatcher json-reformat js2-refactor multiple-cursors js2-mode js-doc jbeans-theme jazz-theme ir-black-theme inkpot-theme importmagic epc ctable concurrent deferred impatient-mode simple-httpd heroku-theme hemisu-theme helm-pydoc helm-css-scss hc-zenburn-theme haml-mode gruvbox-theme gruber-darker-theme grandshell-theme gotham-theme geiser gandalf-theme flatui-theme flatland-theme farmhouse-theme eziam-theme exotica-theme espresso-theme emmet-mode dracula-theme doom-themes django-theme darktooth-theme autothemer darkokai-theme darkmine-theme darkburn-theme dakrone-theme cython-mode cyberpunk-theme confluence xml-rpc company-web web-completion-data company-tern dash-functional tern company-anaconda color-theme-sanityinc-tomorrow color-theme-sanityinc-solarized clues-theme chruby cherry-blossom-theme busybee-theme bundler inf-ruby bubbleberry-theme birds-of-paradise-plus-theme badwolf-theme apropospriate-theme anti-zenburn-theme anaconda-mode pythonic ample-zen-theme ample-theme alect-themes afternoon-theme yasnippet-snippets xterm-color ws-butler winum which-key volatile-highlights vi-tilde-fringe uuidgen use-package unfill toc-org symon string-inflection spaceline-all-the-icons smeargle shell-pop restclient-helm restart-emacs rainbow-delimiters popwin persp-mode pcre2el password-generator paradox overseer orgit org-projectile org-present org-pomodoro org-mime org-download org-bullets org-brain open-junk-file ob-restclient ob-http neotree nameless mwim multi-term move-text mmm-mode markdown-toc magit-svn magit-gitflow macrostep lorem-ipsum link-hint indent-guide hungry-delete htmlize hl-todo highlight-parentheses highlight-numbers highlight-indentation helm-xref helm-themes helm-swoop helm-purpose helm-projectile helm-mode-manager helm-make helm-gitignore helm-flx helm-descbinds helm-company helm-c-yasnippet helm-ag google-translate golden-ratio gnuplot gitignore-templates gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link git-gutter-fringe git-gutter-fringe+ gh-md fuzzy font-lock+ flycheck-pos-tip flx-ido fill-column-indicator fancy-battery eyebrowse expand-region evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-surround evil-org evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-magit evil-lisp-state evil-lion evil-indent-plus evil-iedit-state evil-goggles evil-exchange evil-escape evil-cleverparens evil-args evil-anzu eval-sexp-fu eshell-z eshell-prompt-extras esh-help elisp-slime-nav editorconfig dumb-jump dotenv-mode diminish diff-hl define-word counsel-projectile company-statistics company-restclient column-enforce-mode clean-aindent-mode centered-cursor-mode browse-at-remote auto-yasnippet auto-highlight-symbol auto-compile aggressive-indent ace-window ace-link ace-jump-helm-line ac-ispell)))) (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 (:background nil))))) ) + +(defun open-localhost () + (interactive) + (ansi-term "bash" "localhost")) + +(defun wikipedia-search () + (interactive) + (let* ((term (read-from-minibuffer "Search Term:")) + (buffer (generate-new-buffer (concat "*Wikipedia*" term)))) + + (shell-command (concat "/home/booboy/bin/wikipedia_search.rb" " '" term "'")buffer))) + +(defun owasp-search () + (interactive) + (let* ((term (read-from-minibuffer "Search Term: ")) + (buffer (generate-new-buffer (concat "*Owasp*" term)))) + + (shell-command (concat "/home/booboy/bin/owasp_search.rb" " '" term "'")buffer))) + +(defun url-decode-region (start end) + "Replace a region with the same contents, only URL decoded." + (interactive "r") + (let ((text (url-unhex-string (buffer-substring start end)))) + (delete-region start end) + (insert text))) + +(defun encode-percent-encoded-url () + "Percent encode URL under cursor or selection. +Example: + http://en.wikipedia.org/wiki/Saint_Jerome_in_His_Study_(Dürer) +becomes + http://en.wikipedia.org/wiki/Saint_Jerome_in_His_Study_(D%C3%BCrer) +Example: + http://zh.wikipedia.org/wiki/文本编辑器 +becomes + http://zh.wikipedia.org/wiki/%E6%96%87%E6%9C%AC%E7%BC%96%E8%BE%91%E5%99%A8 +URL `http://ergoemacs.org/emacs/elisp_decode_uri_percent_encoding.html' +Version 2015-09-14." + (interactive) + (let ($boundaries $p1 $p2 $input-str) + (if (use-region-p) + (progn + (setq $p1 (region-beginning)) + (setq $p2 (region-end))) + (progn + (setq $boundaries (bounds-of-thing-at-point 'url)) + (setq $p1 (car $boundaries)) + (setq $p2 (cdr $boundaries)))) + (setq $input-str (buffer-substring-no-properties $p1 $p2)) + (require 'url-util) + (delete-region $p1 $p2) + (insert (url-encode-url $input-str)))) + +(defun url-encode-region (start end) +"Replace a region with the same contents, only URL encoded." + (interactive "r") + (let ((text (url-hexify-string (buffer-substring start end)))) + (delete-region start end) + (insert text))) + +;; bind f8 to open new terminal in new buffer +( global-set-key ( kbd "") 'open-localhost)