diff options
Diffstat (limited to 'emacs.d/core/core-defun.el')
-rw-r--r-- | emacs.d/core/core-defun.el | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/emacs.d/core/core-defun.el b/emacs.d/core/core-defun.el index a2fb02f..5180e68 100644 --- a/emacs.d/core/core-defun.el +++ b/emacs.d/core/core-defun.el @@ -1,12 +1,4 @@ -(defun fcuny-terminal () - "Switch to terminal. Launch if nonexistent." - (interactive) - (if (get-buffer "*ansi-term*") - (switch-to-buffer "*ansi-term*") - (ansi-term "/bin/bash")) - (get-buffer-process "*ansi-term*")) - -(defun switch-to-scratch () +(defun fcuny/switch-to-scratch () "Switch to scratch, grab the region if it's active." (interactive) (let ((contents @@ -19,7 +11,7 @@ (goto-char (buffer-end 1)) (insert contents))))) -(defun rename-this-buffer-and-file () +(defun fcuny/rename-this-buffer-and-file () "Renames current buffer and file it is visiting." (interactive) (let ((name (buffer-name)) @@ -37,4 +29,14 @@ (set-buffer-modified-p nil) (message "File '%s' successfully renamed to '%s'" name (file-name-nondirectory new-name)))))))) +(defun fcuny/visit-term-buffer () + "Create or visit a terminal buffer." + (interactive) + (if (not (get-buffer "*ansi-term*")) + (progn + (split-window-sensibly (selected-window)) + (other-window 1) + (ansi-term (getenv "SHELL"))) + (switch-to-buffer-other-window "*ansi-term*"))) + (provide 'core-defun) |