comparison .elisp/settings/90.keybindings.el @ 398:1cda3348f36b

emacs f4 dwim: bind rust files to running tests with cargo
author Augie Fackler <raf@durin42.com>
date Mon, 25 Jul 2016 23:12:48 -0400
parents b9c8655f12f0
children 11fdb5a60eee
comparison
equal deleted inserted replaced
397:98484e1f564f 398:1cda3348f36b
21 21
22 (global-set-key [f3] 'next-error) 22 (global-set-key [f3] 'next-error)
23 (defun af-dwim-f4 () (interactive) 23 (defun af-dwim-f4 () (interactive)
24 (cond ((string-match "\\.t$" buffer-file-name) 24 (cond ((string-match "\\.t$" buffer-file-name)
25 (textmate-start-compile-in-root 25 (textmate-start-compile-in-root
26 (concat "make " (file-name-nondirectory buffer-file-name)))))) 26 (concat "make " (file-name-nondirectory buffer-file-name))))
27 ((string-match "\\.rs$" buffer-file-name)
28 (textmate-start-compile-in-root "cargo test"))
29 ))
27 (global-set-key [f4] 'af-dwim-f4) 30 (global-set-key [f4] 'af-dwim-f4)
28 (global-set-key [f5] 'diff-apply-hunk) 31 (global-set-key [f5] 'diff-apply-hunk)
29 32
30 ;; M-j for jump to function definition 33 ;; M-j for jump to function definition
31 (global-set-key [(meta j)] 'textmate-goto-symbol) 34 (global-set-key [(meta j)] 'textmate-goto-symbol)