Skip to content

Instantly share code, notes, and snippets.

@inlinechan
Created December 16, 2016 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inlinechan/13d8713ee5156d0a87b2ebd6fbab3458 to your computer and use it in GitHub Desktop.
Save inlinechan/13d8713ee5156d0a87b2ebd6fbab3458 to your computer and use it in GitHub Desktop.
Find class definition in chromium
(defun hc/search-class-decl ()
(interactive)
(let ((pattern "^\'*class ?\\([A-Z_]+\\)? ?[A-Za-z0-9_]+"))
(isearch-forward-regexp nil 1)
(setq isearch-regexp t
isearch-string pattern
isearch-yank-flag t)
(isearch-search-and-update)))
(add-hook 'c++-mode-hook
(lambda ()
(define-key c-mode-base-map (kbd "C-c r d") 'hc/search-class-decl)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment