Browse Source

Add prelude-find-shell-init-file

custom
Bozhidar Batsov 12 years ago
parent
commit
3c8f0c7f98
  1. 10
      core/prelude-core.el
  2. 1
      core/prelude-mode.el

10
core/prelude-core.el

@ -538,5 +538,15 @@ This follows freedesktop standards, should work in X servers."
(interactive)
(find-file-other-window user-init-file))
(defun prelude-find-shell-init-file ()
"Edit the shell init file in another window."
(interactive)
(let* ((shell (car (reverse (s-split "/" (getenv "SHELL")))))
(shell-init-file (cond
((s-equals? "zsh" shell) ".zshrc")
((s-equals? "bash" shell) ".bashrc")
(t (error "Unknown shell")))))
(find-file-other-window (expand-file-name shell-init-file (getenv "HOME")))))
(provide 'prelude-core)
;;; prelude-core.el ends here

1
core/prelude-mode.el

@ -65,6 +65,7 @@
(define-key map (kbd "C-c +") 'prelude-increment-integer-at-point)
(define-key map (kbd "C-c -") 'prelude-decrement-integer-at-point)
(define-key map (kbd "C-c I") 'prelude-find-user-init-file)
(define-key map (kbd "C-c S") 'prelude-find-shell-init-file)
;; make some use of the Super key
(define-key map [?\s-d] 'projectile-find-dir)
(define-key map [?\s-p] 'projectile-switch-project)

Loading…
Cancel
Save