Skip to content

Commit 18e2f32

Browse files
committed
config(ansi): Add two interactive functions to apply ANSI color
1 parent 6906416 commit 18e2f32

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

spacemacs.org

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,19 @@ This function is called at the very end of Spacemacs initialization after
8787
layers configuration. You are free to put any user code.
8888
#+end_quote
8989
** IDE config
90+
*** Apply ANSI Color codes for buffer and region
91+
#+BEGIN_SRC emacs-lisp :tangle user-config.el
92+
(defun apply-ansi-color-codes-to-region (beginning end)
93+
"Apply ANSI color codes to the selected region."
94+
(interactive "r")
95+
(ansi-color-apply-on-region beginning end))
96+
97+
(defun apply-ansi-color-codes-to-buffer ()
98+
"Apply ANSI color codes to the whole buffer."
99+
(interactive)
100+
(apply-ansi-color-codes-to-region (point-min) (point-max)))
101+
#+END_SRC
102+
90103
*** Disable auto-indent in C/C++ mode after typing ~::~
91104
#+BEGIN_SRC emacs-lisp :tangle user-config.el
92105
;; Disable electric indentation in C and C++ modes

0 commit comments

Comments
 (0)