diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2019-12-07 14:50:01 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2019-12-07 14:50:01 +0100 |
| commit | 38abbb97cc3de9768b1b8fe8c8da20141087b944 (patch) | |
| tree | c051154d81f0a34b528142f16465e181258934df /.emacs | |
| parent | 507426a6c981cf64529687f70b91bb005a112572 (diff) | |
| download | dotfiles-38abbb97cc3de9768b1b8fe8c8da20141087b944.tar.xz | |
Add a bunch of project-wide commands
As well as a function to generate them.
Diffstat (limited to '.emacs')
| -rw-r--r-- | .emacs | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -101,6 +101,14 @@ (call-process-shell-command command nil t) (kill-new (buffer-string)))) +(defun my/make-project-wide (f) + "Make a function which will run F from the project's root directory." + (lambda () + (:documentation (format "Run `%s' from the project's root directory." f)) + (interactive) + (let ((default-directory (my/project-root))) + (call-interactively f)))) + (global-set-key (kbd "C-c c") 'compile) (global-set-key (kbd "C-c e f") 'auto-fill-mode) (global-set-key (kbd "C-c i t") (my/make-toggle-input-method 'TeX)) @@ -109,7 +117,9 @@ (global-set-key (kbd "C-c k |") 'my/kill-ring-pipe-region) (global-set-key (kbd "C-c k !") 'my/kill-ring-shell) (global-set-key (kbd "C-c m") 'man) -(global-set-key (kbd "C-c p c") 'my/project-compile) +(global-set-key (kbd "C-c p c") (my/make-project-wide 'compile)) +(global-set-key (kbd "C-c p !") (my/make-project-wide 'shell-command)) +(global-set-key (kbd "C-c p &") (my/make-project-wide 'async-shell-command)) (global-set-key (kbd "C-c p f") 'project-find-file) (global-set-key (kbd "C-c t") 'toggle-truncate-lines) (global-set-key (kbd "C-c v") 'visual-line-mode) @@ -332,11 +342,6 @@ (let ((project (my/project-name))) (concat (when project (format "[%s] " project)) "%b"))))) -(defun my/project-compile () - (interactive) - (let ((default-directory (my/project-root))) - (call-interactively 'compile))) - (setq-default paragraph-start (concat "[ ]*- \\|" paragraph-start)) ;; TODO: decruftify mode-line (e.g. remove superflous parens) |
