Skip to content

Instantly share code, notes, and snippets.

@evandrocoan
Last active February 17, 2020 02:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evandrocoan/197b5d0ba0290d07a2195b3e2331af72 to your computer and use it in GitHub Desktop.
Save evandrocoan/197b5d0ba0290d07a2195b3e2331af72 to your computer and use it in GitHub Desktop.
# Remove Trailing Whitespaces from Project.md
# Copyright (c) 2019 Evandro Coan
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

Remove Trailing Whitespaces from Project

To do this changes fast I used a Sublime Text vanilla install, set the settings:

{
  "ensure_newline_at_eof_on_save": true,
  "trim_trailing_white_space_on_save": true,
}

Then do a Replace all Ctrl+Shif+F with the:

  1. Regex search ^\A(.*)$
  2. Folder Packages\latextools
  3. Replace by \1

image

It will open all files from LatexTools with the buffer dirt, but not modification, then you just do the File -> Save All command. And Sublime Text will save all files trimming the whitespaces and ensuring a new line at the end of the file.

See also:

  1. https://stackoverflow.com/questions/22529265/sublime-text-3-convert-spaces-to-tabs/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment