Tuesday, March 26, 2019

Delete All Comments in a File With VS Code

What if you want to delete all comments in a file with VS Code? VS Code has a find and replace feature that support regular expression, so we can use that feature to automatically find line starting with hash (#), Here we go: 1. Press ctrl + f 2. Click on "Use regular expression" button on "find and replace" widget 3. Type the regular expression: ^#.*$\n 4. Leave the "Replace" field empty 5. Click "Replace All" button And all of your comment deleted, actually it is replaced by the empty character. Notes ^#.*$\n : • ^ = matches position just before the first character of the string • # = character that we want to find • . = matches a single character. Does not matter what character it is, except newline • * = matches preceding match zero or more times • $ = matches position just after the last character of the string • \n = Line feed character

7 GNU Screen Commands To Make Your Life Easier

Here 7 GNU Screen commands that could make your life easier:

* ^A ^W - window list
* ^A ^C - create new window
* ^A space - next window
* ^A p - previous window
* ^A ^A - switch to previous screen
* ^A [0-9] - go to window [0-9]
* ^A esc - copy mode