From 45ba1d9a5474222101ae07edad45d90f9811837c Mon Sep 17 00:00:00 2001 From: Fastidious Date: Sun, 21 Aug 2016 13:10:44 -0400 Subject: [PATCH] Added shortcuts for commonly used editors. --- FAQ.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/FAQ.md b/FAQ.md index 6e80590..e5a4feb 100644 --- a/FAQ.md +++ b/FAQ.md @@ -117,4 +117,18 @@ Use an editor that supports ANSI escape codes. For example: $ printf "\033[91mHello\033[0m world.\n" > motd.txt ``` -Will print "Hello" in red, then "world." in the default color. [More about escape codes here](http://wiki.bash-hackers.org/scripting/terminalcodes). \ No newline at end of file +Will print "Hello" in red, then "world." in the default color. [More about escape codes here](http://wiki.bash-hackers.org/scripting/terminalcodes). + +Shortcuts to insert an Esc code, for commonly used editors (from [LinuxQuestions](http://www.linuxquestions.org/questions/linux-from-scratch-13/add-some-color-and-other-stuff-to-your-lfs-login-4175412484/)): + +If using ```vi```: +```CTRL+v then Esc``` + +If using ```emacs```: +```CTRL+q then Esc``` + +If using ```nano```: +```Esc then v then Esc``` + +Using simply ```bash```: +```echo -e "\x1b"```