Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. (c-add-style "cts"
  2. '("gnu"
  3. (c-offsets-alist . ((substatement-open . 0)))
  4. (c-basic-offset . 4)))
  5.  
  6. (defconst cts-c-regexp
  7. (concat "/c/\\(VK-GL-CTS\\|Vulkan-LoaderAndValidationLayers\\)/.*\\(?:c\\|cc\\|h\\|cpp\\|hpp\\)\\'"))
  8.  
  9. (defun maybe-set-cts-c-style ()
  10. (when (and (buffer-file-name)
  11. (string-match cts-c-regexp (buffer-file-name)))
  12. (c-set-style "cts")
  13. (setq tab-width 4)
  14. (setq indent-tabs-mode t)))
  15.  
  16. (add-hook 'c-mode-hook 'maybe-set-cts-c-style)
  17. (add-hook 'c++-mode-hook 'maybe-set-cts-c-style)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement