Skip to content

Instantly share code, notes, and snippets.

@russellmcc
Created August 23, 2022 03:29
Show Gist options
  • Save russellmcc/56e48c90da4b832b658e9478bbd8acb8 to your computer and use it in GitHub Desktop.
Save russellmcc/56e48c90da4b832b658e9478bbd8acb8 to your computer and use it in GitHub Desktop.

Here’s a handy key-binding I use to open a vterm at the current directory

(global-set-key
 "\C-ct"
 (lambda (&optional new-vterm) (interactive "P")
   (let ((dir (expand-file-name default-directory)))
     (vterm new-vterm)
     (if
         (string= (expand-file-name default-directory) dir)
         ()
       (vterm-send-string (concat " cd " (shell-quote-argument dir)) t)
       (vterm-send-return)
       ))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment