25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

43 satır
2.2 KiB

  1. ((nil . ((eval . (progn
  2. (defvar context-mode-map (make-sparse-keymap)
  3. "Keymap while context-mode is active.")
  4. (define-minor-mode context-mode
  5. "A temporary minor mode to be activated only specific to a buffer."
  6. nil
  7. :lighter " [f2]-Context"
  8. context-mode-map)
  9. (context-mode 1)
  10. ;; additional scripts
  11. (defun save-and-find-test-script-and-compile ()
  12. (interactive)
  13. (let ((build-script-name "test.bat"))
  14. (save-and-find-build-script-and-compile)))
  15. (defun save-and-find-run-script-and-compile ()
  16. (interactive)
  17. (let ((build-script-name "run.bat"))
  18. (save-and-find-build-script-and-compile)))
  19. (defun save-and-find-debug-script-and-compile ()
  20. (interactive)
  21. (let ((build-script-name "debug.bat"))
  22. (save-and-find-build-script-and-compile)))
  23. (defhydra hydra-context (context-mode-map "<f2>")
  24. "Context Actions:"
  25. ("b" save-and-find-build-script-and-compile "build" :color blue)
  26. ("r" save-and-find-run-script-and-compile "run" :color blue)
  27. ("d" save-and-find-debug-script-and-compile "debug" :color blue)
  28. ("t" save-and-find-test-script-and-compile "test" :color blue)
  29. ("o" browse-file-directory "open" :color blue)
  30. ("q" nil "quit" :color blue))
  31. (define-key context-mode-map (kbd "<f2>") 'hydra-context/body)
  32. (font-lock-add-keywords 'c++-mode
  33. '(("\\<\\(if_debug\\|if_windows\\|if_linux\\|defer\\|proc\\)\\>" .
  34. font-lock-keyword-face)))))))
  35. (c++-mode . ((eval . (company-clang-set-prefix "main.cpp"))
  36. (eval . (flycheck-mode 0))
  37. (eval . (rainbow-mode 0))
  38. )))