commit 1a05aa6ee80bf49b9e463903619c7ef5c8d14013
parent b9f45d66a9947d2bd6aedbcdf3295e17c66985dc
Author: Gabriel G. de Brito <me@gboncoffee.dev.br>
Date: Sun, 22 Mar 2026 21:52:48 -0300
Open once, go anywhere.
Diffstat:
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/.bashrc b/.bashrc
@@ -43,4 +43,12 @@ export GPG_TTY=$(tty)
alias make='make -j12'
+emacs() {
+ if command -v prime-run >/dev/null 2>&1; then
+ prime-run command emacs "$@"
+ else
+ command emacs "$@"
+ fi
+}
+
PS1="\n\[\e[32m\]\h\[\e[m\]:\[\e[34m\]\w\[\e[m\]>"
diff --git a/emacs/init.el b/emacs/init.el
@@ -23,6 +23,7 @@
(display-fill-column-indicator-mode t)))
(set-face-attribute 'default nil :font "Hack-11")
+(set-face-attribute 'variable-pitch nil :font "Noto Sans-14")
(set-frame-font "Hack-11" nil t)
(setq scroll-step 1)
@@ -46,6 +47,18 @@
;; Interface.
;;
+(defun open-dir (dir)
+ (interactive (list (read-directory-name "Open directory: " nil nil t)))
+ (let ((dir (file-name-as-directory
+ (expand-file-name dir))))
+ (setq-default default-directory dir)
+ (setq default-directory dir)
+ (setenv "PWD" dir)
+ (dired dir)
+ (message "New working directory: %s" dir)))
+
+(global-set-key (kbd "C-c o") #'open-dir)
+
(defalias 'yes-or-no-p 'y-or-n-p)
(setopt use-short-answers t)
(windmove-default-keybindings 'meta)
@@ -83,9 +96,6 @@
(global-set-key (kbd "C-c c") #'compile)
-(add-hook 'find-file-hook
- (lambda () (setq default-directory command-line-default-directory)))
-
;; Stolen from (http://endlessparentheses.com/ansi-colors-in-the-compilation-buffer-output.html)
(require 'ansi-color)
(defun colorize-compilation ()