How to trim whitespace in SciTE: #1 hack to clean your code!

trim whitespace in SciTE

How to Automatically trim whitespace in SciTE upon file save is super-easy!   A minor tweak to the trim whitespace in SciTEuser.properties will tell SciTE to, automatically, trim spaces, tabs, etc. from the end of each line.

The following example is what I added to have it apply to my AutoHotkey files (which have an extension of .ahk).  If you have file patterns you can achieve the same goal by using something like this:

strip.trailing.spaces.$(file.patterns.yaml)=0

strip.trailing.spaces.*.ahk=1

How to trim whitespace in SciTE upon file save

A green and clear AutoHotkey branded water bottle with a straw lid, shown with callouts for shatter resistance, BPA free, and durability

Use AutoHotkey to get path from Explorer & replace w/UNC path for sharing

path from explorer

Use AutoHotkey to get Path from explorer and shareGroup of coworkers seated around a table in a bright office, talking together with a green reusable water bottle in front of themfull path with others

Working on multiple computers, in multiple environments, and with teams of people can be a challenge when wanting to share files.

I have quite a few network folders that I’ve “mapped” so they look like drives.  This always causes issues when copying the path and sharing with others.   I also have a “b:” drive that I’ve created which, in reality, is a shortcut to the root of where my DropBox folder is located.

Registry settingsThe 1st thing I’m going to recommend is that you backup your registry!!!     After doing so, navigate to this key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices

 

 

Then right click on the right and create a new String.  This is where you’ll put in the letter of the drive you want (for instance I put in B: ).  After you’ve done that, right click on the B: and  add the path to the folder you want mapped.  Here’s an example  “\??\C:\\Dropbox\test\”  Please note the second \ after the c:\   It is not a typo!   For some weird reason you need two there however everywhere else after you just need one!

The next time you boot up you’ll have the new drive (this isn’t creating any sort of copies of files, it is merely giving you a convenient shortcut to a folder)   Here’s a screenshot of my settings.

Mapping network drives are easy and you can follow this guide here.

Okay, now that we’re done setting up our computer, let’s get to the AutoHotkey scriptA close view of a laptop keyboard and touchpad with a small blue USB port and cables visible at the edge, shown in a tech blog post

Copy Path from explorer and replace with UNC (for sharing and to get around security issues)

Here’s a video demonstrating getting the Path from explorer

Woman holding a white water bottle with a green AutoHotkey logo and green cap, sitting on grass