X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d%2Fconfig.org;h=2993e1a6f86d51599fa2e53a1f38fea94bb26baa;hb=efdf06bf08e700de04a908c3a4629703ae69d02c;hp=38c6e74738c618e7bb7bce929d1d693c27c5db7c;hpb=3189e2389e5e52ec4a17bb8aa0aa81437fca89b5;p=dotfiles.git diff --git a/emacs.d/config.org b/emacs.d/config.org index 38c6e74..2993e1a 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -1158,6 +1158,7 @@ extend org-mode's easy templates, refer to [[http://coldnew.github.io/coldnew-em (set-face-attribute face nil :inherit 'fixed-pitch)) (list 'org-code 'org-block 'org-block-background 'org-block-begin-line 'org-block-end-line)) (set-face-attribute 'org-table nil :family "Ubuntu Mono" :height 140) + (set-face-attribute 'org-formula nil :family "Ubuntu Mono" :height 140) ;; org-special-keyword inherited from font-lock-keywork originally; as org is changed to variable-pitch, it cause ;; the font in special-keywords are not monospace (set-face-attribute 'org-special-keyword nil :inherit '(font-lock-keyword-face fixed-pitch)) @@ -2335,6 +2336,26 @@ irony-company (add-hook 'c++-mode-hook 'google-set-c-style)) #+END_SRC +*** Compile and Run the C file +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (defun my-cpp-hook () + (let* ((current-file-name) + (a-dot-out-file)) + (when buffer-file-name + (setq current-file-name (shell-quote-argument buffer-file-name)) + (setq a-dot-out-file (concat (file-name-directory buffer-file-name) "a.out"))) + (setq-local compilation-read-command t) + (set (make-local-variable 'compile-command) + (concat "g++ -Wall " + current-file-name + " && " + a-dot-out-file)) + (local-set-key (kbd "s-r") 'compile))) + + (add-hook 'c-mode-hook 'my-cpp-hook) + (add-hook 'c++-mode-hook 'my-cpp-hook) +#+END_SRC + ** Lua #+BEGIN_SRC emacs-lisp :tangle yes :results silent (use-package lua-mode @@ -2914,15 +2935,6 @@ Use =ESC= to exit minibuffer. Also I map =Super-h= the same as =C-g= (add-to-list 'projectile-globally-ignored-files "GTAGS") (projectile-global-mode t)) - ;; (use-package persp-projectile - ;; :ensure t - ;; :config - ;; (persp-mode) - ;; :bind - ;; ;; (:map projectile-mode-map - ;; ;; ("s-t" . projectile-persp-switch-project)) - ;; ) - ;; change default-directory of scratch buffer to projectile-project-root (defun sd/project-switch-action () "Change default-directory of scratch buffer to current projectile-project-root directory"