|
|
@ -61,25 +61,31 @@ With a prefix ARG always prompt for command to use." |
|
|
(ansi-term (getenv "SHELL"))) |
|
|
(ansi-term (getenv "SHELL"))) |
|
|
"*ansi-term*")) |
|
|
"*ansi-term*")) |
|
|
|
|
|
|
|
|
|
|
|
(defun prelude-search (query-url prompt) |
|
|
|
|
|
"Open the search url constructed with the QUERY-URL. |
|
|
|
|
|
PROMPT sets the `read-string prompt." |
|
|
|
|
|
(browse-url |
|
|
|
|
|
(concat query-url |
|
|
|
|
|
(url-hexify-string |
|
|
|
|
|
(if mark-active |
|
|
|
|
|
(buffer-substring (region-beginning) (region-end)) |
|
|
|
|
|
(read-string prompt)))))) |
|
|
|
|
|
|
|
|
(defun prelude-google () |
|
|
(defun prelude-google () |
|
|
"Googles a query or region if any." |
|
|
"Googles a query or region if any." |
|
|
(interactive) |
|
|
(interactive) |
|
|
(browse-url |
|
|
|
|
|
(concat |
|
|
|
|
|
"http://www.google.com/search?ie=utf-8&oe=utf-8&q=" |
|
|
|
|
|
(url-hexify-string (if mark-active |
|
|
|
|
|
(buffer-substring (region-beginning) (region-end)) |
|
|
|
|
|
(read-string "Google: ")))))) |
|
|
|
|
|
|
|
|
(prelude-search "http://www.google.com/search?q=" "Google: ")) |
|
|
|
|
|
|
|
|
(defun prelude-youtube () |
|
|
(defun prelude-youtube () |
|
|
"Search YouTube with a query or region if any." |
|
|
"Search YouTube with a query or region if any." |
|
|
(interactive) |
|
|
(interactive) |
|
|
(browse-url |
|
|
|
|
|
(concat |
|
|
|
|
|
"http://www.youtube.com/results?search_query=" |
|
|
|
|
|
(url-hexify-string (if mark-active |
|
|
|
|
|
(buffer-substring (region-beginning) (region-end)) |
|
|
|
|
|
(read-string "Search YouTube: ")))))) |
|
|
|
|
|
|
|
|
(prelude-search "http://www.youtube.com/results?search_query=" |
|
|
|
|
|
"Search YouTube: ")) |
|
|
|
|
|
|
|
|
|
|
|
(defun prelude-github () |
|
|
|
|
|
"Search GitHub with a query or region if any." |
|
|
|
|
|
(interactive) |
|
|
|
|
|
(prelude-search "https://github.com/search?q=" "Search GitHub: ")) |
|
|
|
|
|
|
|
|
(defun prelude-indent-rigidly-and-copy-to-clipboard (begin end arg) |
|
|
(defun prelude-indent-rigidly-and-copy-to-clipboard (begin end arg) |
|
|
"Indent region between BEGIN and END by ARG columns and copy to clipboard." |
|
|
"Indent region between BEGIN and END by ARG columns and copy to clipboard." |
|
|
@ -416,6 +422,8 @@ Doesn't mess with special buffers." |
|
|
"Press <jl> quickly to jump to a visible line." |
|
|
"Press <jl> quickly to jump to a visible line." |
|
|
"Press <C-c h> to navigate a project in Helm." |
|
|
"Press <C-c h> to navigate a project in Helm." |
|
|
"Press <C-c g> to search in Google." |
|
|
"Press <C-c g> to search in Google." |
|
|
|
|
|
"Press <C-c G> to search in GitHub." |
|
|
|
|
|
"Press <C-c y> to search in YouTube." |
|
|
"Press <C-c r> to rename the current buffer and file it's visiting." |
|
|
"Press <C-c r> to rename the current buffer and file it's visiting." |
|
|
"Press <C-c t> to open a terminal in Emacs." |
|
|
"Press <C-c t> to open a terminal in Emacs." |
|
|
"Press <C-c k> to kill all the buffers, but the active one." |
|
|
"Press <C-c k> to kill all the buffers, but the active one." |
|
|
|