Posts

Showing posts from April, 2023

How to see logs with out Esc and other gibberish stuff in logs ?

 So when you are trying to read logs, sometimes they look like this, using vim is okay at-least some readability, but less will show awful results.  ESC[34m2023-04-15 04:33:57ESC[0m ESC[33m  TRACEESC[0m [ESC[36mApplicationESC[0m] ESC[37mpid: 562425ESC[0m ESC[34m2023-04-15 04:33:57ESC[0m ESC[35m  DEBUGESC[0m [ESC[36mApplicationESC[0m] ESC[37minteractive: falseESC[0m ESC[34m2023-04-15 04:33:57ESC[0m ESC[35m  DEBUGESC[0m [ESC[36mFileResolverESC[0m] ESC[37mSearching: /server/files ESC[0m if you want to read logs clearly, then you can still use less command with -R flag. less -R <log_file_name> Hope it helps. Thanks. Raja

VIM: Binding a shortcut

 All this time, I do not know how to create my own VIM Bindings. And yes, trying yourself is the only way you learn anything. I want to explain what I have learnt on creating a vim shortcut, so you might get a good headstart. The command I am going to explain is as below map <C-b> :w\|!ruby spec/example_spec.rb <cr> so map: is like you are mapping <custome_key> <series of actions> <C-b>: this stands for CTRL+b  If you want to use Shift, Alt, Cmd(Mac), yes VIM have options for all of that. ``` S-...> shift-key * shift * * <S- * <C-...> control-key * control * * ctrl * * <C- * <M-...> alt-key or meta-key * meta * * alt * * <M- * <A-...> same as <M-...> * <A- * <D-...> command-key (Macintosh only) * <D- * ``` Vim documentation: intro (sourceforge.net) Then :w\|!ruby spec/example_spec.rb<cr> :w is save \|: is like you are joining this command with with another action. !ruby spec/example_spe