Skip to content

Commit

Permalink
Disable auto-indent in C/C++ mode after typing ::
Browse files Browse the repository at this point in the history
  • Loading branch information
Maverobot committed Apr 11, 2024
1 parent 8fb76e3 commit b473e7a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spacemacs.org
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ This function is called at the very end of Spacemacs initialization after
layers configuration. You are free to put any user code.
#+end_quote
** IDE config
*** Disable auto-indent in C/C++ mode after typing ~::~
#+BEGIN_SRC emacs-lisp :tangle user-config.el
;; Disable electric indentation in C and C++ modes
(defun my-disable-electric-indent-mode ()
(setq-local c-electric-flag nil))

;; Hook this function to C mode and C++ mode
(add-hook 'c-mode-hook 'my-disable-electric-indent-mode)
(add-hook 'c++-mode-hook 'my-disable-electric-indent-mode)
#+END_SRC
*** MacOS
#+BEGIN_SRC emacs-lisp :tangle user-config.el
; Use Command key as meta in emacs
Expand Down

0 comments on commit b473e7a

Please sign in to comment.