Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun irony--check-expansion ()
- (save-excursion (if (looking-at "\\_>") t (backward-char 1) (if (looking-at "\\.") t (backward-char 1) (if (looking-at "->") t nil))))) (defun irony--indent-or-complete () "Indent or Complete" (interactive) (cond ((and (not (use-region-p)) (irony--check-expansion)) (message "complete") (company-complete-common)) (t (message "indent") (call-interactively 'c-indent-line-or-region)))) (defun irony-mode-keys () "Modify keymaps used by `irony-mode'." (local-set-key (kbd "TAB") 'irony--indent-or-complete) (local-set-key [tab] 'irony--indent-or-complete)) (add-hook 'c-mode-common-hook 'irony-mode-keys)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement