Skip to content

Commit

Permalink
More updates
Browse files Browse the repository at this point in the history
  • Loading branch information
anildigital committed Jul 12, 2015
1 parent 558247b commit 8b24b3a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
30 changes: 29 additions & 1 deletion anil/defuns.el
Expand Up @@ -28,10 +28,38 @@


(defun stabby-lambda()
(interactive)
"Convert lambda to stabby lambda"
(interactive)
;; (replace-regexp "lambda" "->" (match-string 1))
(replace-regexp "lambda[\s]*{ *|\\([^|]*\\)|" "-> (\\1) {" (match-string 1))
(replace-regexp "lambda[\s]*{" "-> {" (match-string 1))

)

(defun revert-all-buffers ()
"Refreshes all open buffers from their respective files."
(interactive)
(dolist (buf (buffer-list))
(with-current-buffer buf
(when (and (buffer-file-name) (not (buffer-modified-p)))
(revert-buffer t t t))))
(message "Refreshed open files."))


;; Function to launch a google search
(defun google-search ()
"googles a query or a selected region"
(interactive)
(browse-url
(concat
"http://www.google.com/search?q="
(if mark-active
(buffer-substring (region-beginning) (region-end))
(read-string "Google: ")))))


(defun eshell/clear ()
"Clear the eshell buffer."
(let ((inhibit-read-only t))
(erase-buffer)
(eshell-send-input)))
9 changes: 6 additions & 3 deletions anil/key-bindings.el
Expand Up @@ -41,7 +41,11 @@

(global-set-key "\C-c \C-l" 'stabby-lambda)

;; Ace jump
(define-key global-map (kbd "C-c j") 'ace-jump-mode)
(global-set-key (kbd "C-c SPC") 'ace-jump-char-mode)
(global-set-key (kbd "C-<return>") 'ace-jump-line-mode)


(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)

Expand Down Expand Up @@ -70,6 +74,8 @@

;; helm M-x
(global-set-key (kbd "M-x") 'helm-M-x)
(global-set-key "\C-x\C-m" 'helm-M-x)
(global-set-key "\C-c\C-m" 'helm-M-x)

;; browse kill ring
(global-set-key "\C-cy" 'browse-kill-ring)
Expand All @@ -84,9 +90,6 @@
(define-key global-map "\M-3" #'insert-pound))


(global-set-key (kbd "C-c SPC") 'ace-jump-char-mode)
(global-set-key (kbd "C-<return>") 'ace-jump-line-mode)


(provide 'key-bindings)
;;; key-bindings.el ends here
3 changes: 3 additions & 0 deletions anil/preferences.el
Expand Up @@ -62,6 +62,9 @@
(setq ediff-diff-options "-w")


;; query replace regex
(defalias 'qrr 'query-replace-regexp)

;;(setq-default indent-tabs-mode nil)
(defalias 'list-buffers 'ibuffer)

Expand Down

0 comments on commit 8b24b3a

Please sign in to comment.