Insert Non-breaking Space

In legal, we use the non-breaking space feature in Word a lot (Ctrl+Shift+Spacebar).  Anybody figured out a hack to use this in GDocs?

Solved Solved
1 42 12.9K
3 ACCEPTED SOLUTIONS

Look at the very end of your Downloads folder! The folder is called "MSKLC" too. It has a "modified" datestamp of 1st October 2020.

You can just start typing "msklc" in the Downloads folder and it should show you the folder.

Farran_0-1689246895052.png

Open the folder and run setup.exe to install it:)

Creating the layout

1. Once it's installed and you've opened the program, go to File โ†’ Load existing keyboard...

Farran_1-1689247092477.png

2. Select your keyboard layout. I'm assuming you're using the US layout but choose accordingly. 

Farran_2-1689247142126.png

3. Click on the spacebar in the layout view.

Farran_3-1689247222179.png

4. A window will appear, titled "VK_SPACE". If the 'Advanced View' checkbox isn't marked, tick it to open the advanced view. The box near the bottom, labelled "shift+ctrl+<Key>" is where you're gonna put the nbsp character.

Farran_5-1689247341024.png

5. Paste this:   U+00a0   into the box, like so, then press OK.

Farran_6-1689247526430.png

6. To check that the non-breaking space character saved properly, tick the Shift and Ctrl boxes in the left-hand panel. They toggle different states of the keyboard, and will show what each key does in that state. Hover your mouse cursor over the spacebar and it should show a popup that reads "U+00A0 NO-BREAK SPACE", like so:

Farran_7-1689247626124.png

7. Click the Project menu and open Properties.

Farran_8-1689249012472.png

8. Name your layout, and give it a description.

8a) The name has to be 8 characters max, and I recommend including "01" so that you can create additional versions if there is a problem or if you decide to add more custom characters to your keyboard. (If you like customization, it can get addictive!)

Farran_9-1689249192637.png

8b) The description is what you'll see in the popup menu when you cycle through keyboard layouts with Win+Space (or whatever your shortcut is set to).

Farran_10-1689249277561.png

9. Test the keyboard layout. Go to Project โ†’ Test Keyboard Layout.

Farran_11-1689249428923.png

9a) Type lots of 'm's (because they're the widest character) until they overflow one line.

Farran_12-1689249468686.png

9b) Use Ctrl+Shift+Space to insert a non-breaking space near the end of the row of 'm's. You should find that the row does not break:)

Farran_13-1689249530731.png

10. Project โ†’ Validate Layout. As long as you haven't done anything else, you should be greeted with this successful verification message:

Farran_14-1689249626705.png

11. Project โ†’ Build DLL and Setup Package. This will create the keyboard layout file and the installer for it.

Farran_16-1689249702297.png

Click yes to open the folder where it saved the setup files.

Farran_15-1689249681366.png

Installing the layout

12. Run setup.exe. Windows will ask you for administrator privileges in the fullscreen user account control thing that Windows does.

Farran_17-1689249811960.png

13. The installer will just install the keyboard layout immediately. Hopefully it succeeded!

Farran_18-1689249916135.png

14. Open the language settings in Windows settings. (You can just type "language" in the Start menu search.) Click on Keyboard.

Farran_21-1689250231035.png

15. You should see the "Override for default input method" section at the top. From the drop-down menu, choose your new keyboard layout.

Farran_22-1689250300545.png

16. The new layout will probably not appear at the top of the list, so we need to select the layout that we want to be the primary layout.

 

Farran_24-1689250350792.png

(As you can see from my list, my custom layout is at the top. I did some hacky stuff a couple of years ago to achieve this and I honestly can't remember how, but it definitely involved tweaking the registry. I don't recommend that at all. I think that just setting it as the override in this settings panel should be fine.)

17. Finally, you probably have to log out and in again, or perhaps even reboot.

You may need to fiddle with Windows's settings a bunch of times before it will stick.

________________________________________

Honestly, Windows's handling of custom keyboard layouts is a nightmare. If you need to uninstall it, that can sometimes be a headache too.

I'll try to outline the steps here...

Uninstallating the layout 

1. Run the setup.exe file again, and choose "Remove the keyboard layout." Then click Finish. Seems simple enough, and sometimes that does the trick!

Farran_25-1689250844785.png

If that, for some reason, didn't work, you'll have to go another route. 

2. Open Programs and Features in the traditional Control Panel. You can get to it quickly by pasting this address into the address bar of a file explorer window: 

Control Panel\All Control Panel Items\Programs and Features

3. Sort the list by the "Installed On" column to show the most recent at the top. If the keyboard layout really hasn't uninstalled, you will see it at the top of the list. 
(Please excuse the appearance of this screenshot, Windows's dark mode is buggy.)

Farran_26-1689251103469.png

4. Click Uninstall at the top of the list. That should be all there is to it.

The reason that I strongly recommend including a version number in the layout name is because sometimes the layout uninstaller leaves remnants in the registry. Installing future versions of a layout with the same name is often impossible, even if you have uninstalled the previous layout completely. I had to trawl though my registry to clean out all traces of the original layout name. Like I said, Windows does not handle custom keyboard layouts well, at all!

 

Ok I hope that guide is detailed enough! 

Let me know if there's any other issues. There doesn't seem to be much information or guidance on the web about how to use this application. I guess that not many people in the world really care about custom keyboard layouts:)

View solution in original post

Oh.  My.  Gawd!  This worked!  I can now use Ctrl+Shift+Space after installing the keyboard.  I just tried it on the following text at the end of a line - "Exhibit A" between the "t" and the "A" and it pulled everything to the next row; keeping Exhibit A from separating!

Where do I send flowers?  Chocolate?  Wine?

My wish has been satisfied.  I am accepting your solution, Farran!

View solution in original post

Ah I'm so glad it worked! And happy that I could help you with this ๐Ÿ™‚ 

I'm living in Viet Nam so sending anything here would be rather complicated ๐Ÿ˜… I'll just enjoy the feeling of being useful. This is the first time that my keyboard customization knowledge has been useful for someone else! 

By the way, if you need this on multiple computers, you should be able to simply install the same layout on each of them โ€“ as long as they're using the same layout as the original one on your computer.

Happy lawing! 

 

View solution in original post

42 REPLIES 42

Though I haven't checked, it would be a good candidate for a new Feature Idea suggesting that capability!

In the meantime, you can use Insert -> Special characters. Search for "space" and several options for various space character insertions will result, including a few non-breaking space characters.

You could also memorize the Unicode for the NBSP character you need and then use the appropriate Unicode insert key-sequence for your platform, (Alt for Windows, Shift-Option-Hyphen on Mac, Ctrl-shift-u on ChromeOS). For example: ctrl-shift-u, then 00a0 --> inserts NBSP on a Chromebook.

 

@dalkesm You can take @bill_pier3's suggestion a step further: Create an automatic text substitution for the desired NBSP unicode character (in Google Docs under Tools > Preferences > Substitutions (just be sure to check the box for Automatic Substitution after you add it to the list).

Then, for example, every time you type nbsp Google Docs will insert the unicode NBSP character.

Just tested it out and it worked like a charm ๐Ÿ’ซ

So - like a macro! I'll give it a try! Ty!


[image: Larimer County]

Shawna Dalke

Admin Specialist II

Economic and Workforce Development

200 W Oak St, Fort Collins, CO, 80521 | 5th Flr

W: (970) 498-6698 |

sdalke@larimer.org | http://larimer.org/ewd

This communication may contain confidential and privileged information that
is for the sole use of the intended recipient. Any viewing, copying or
distribution of or reliance on this message by unintended recipients is
strictly prohibited. If you have received this message in error, please
notify us immediately by replying to the message and deleting it from your
computer.

Warning: Although the agency has taken reasonable precautions to ensure no
viruses are present in this email, the agency cannot accept responsibility
for any loss or damage arising from the use of this email or attachments.

Yes and you can create auto-replacements for all your legal lingo, too ๐Ÿ˜Ž

Well Bill.  I was unable to accomplish my goal.  Nothing is working to insert nbsp.  And after some sleuthing it appears I cannot use Unicodes b/c I do not have a numeric keypad on my keyboard.  B/c I do not use a numeric keypad for my job, I purchased a keyboard that doesn't have the keypad, so that my mouse is closer and I don't have to extend my arm to use it.  But now this lovely fix has made it impossible to use ASCII codes.  I can't figure out how to program the nbsp and get it to work.  Bummed:(

Well Christian.  I was unable to accomplish my goal.  Nothing is working to insert nbsp.  And after some sleuthing it appears I cannot use Unicodes b/c I do not have a numeric keypad on my keyboard.  B/c I do not use a numeric keypad for my job, I purchased a keyboard that doesn't have the keypad, so that my mouse is closer and I don't have to extend my arm to use it.  But now this lovely fix has made it impossible to use ASCII codes.  I can't figure out how to program the nbsp and get it to work.  Bummed:(

@dalkesm you don't need to use a numeric keypad to insert a no-break space.  In a Google Doc use the Insert menu then Special Characters. In the search enter no-break space and you have three to choose from: click on the first and it will get inserted into your document, then copy this character and you can paste it in the substitution tool.

Yes this will work... or if that fails, search for nbsp unicode and copy/paste it.

I've copied and pasted numerous times.  It's not working.  Maybe I'm doing it incorrectly?  My research shows a Unicode of Alt+255.  Is this how I paste it?  Exactly?  Ty for sticking with me ๐Ÿ™‚  I'm trying to figure this out, as I can use the substitution for a number of other items as well once I figure this out.

Did you follow the instructions I gave to get the special characters? From the insert menu?

Yes.  It works from there.  Appreciate it.  Still looking for keystrokes as well if you ever come across that info.  The convenience of Ctrl+Shift+Spacebar in Word, would be nice if available in GDocs.

Did you set it as a text replacement (based on keystrokes such as 'nbsp')? This way, it can be just as, or more convenient, than CTRL+Shift+Space.

Sure did.  Nothing happened.

Tested it for you, and it worked like a charm for me. Did you remember to check the automatic substitution box to the left of the one you created? Did you remember to refresh the doc after you created the substitution?

What did you put in the "blank" to the right of "nbsp"? Here's a screenshot of what I'm looking at . . . nbsp screenshot.png

I pasted in the nbsp Unicode character (which Iโ€™d copied from the document, placed there via insert)

Just "255" or "Alt+255"?  I'm trying to get information here.  Please be specific.

Neither.

1. Insert the non-breaking space unicode character to the document (as @StephenHind described above)

2. Select the unicode character that was inserted, and copy it.

3. Open the substitutions preferences.

4. On a new line, enter your desired shortcut (using characters only, no operations keys) e.g. nbsp in the left (Replace) column

5. Paste the unicode character you copied into the right (With) column.

6. Ensure there's a check in the box to the left of the Replace column.

7. Click OK

8. Refresh the document

Type nbsp (or whatever shortcut you created) and it will be replaced with the desired character.

That works.  But doesn't work.  And here's why. 

In order for typing "nbsp" (or any other abbreviation) to work for inserting the "non-breaking space" that I have created in substitutions, it has to be typed separately from the previous or subsequent text. 

So for instance, if I don't want "Exhibit "A"" which is located at the end of a sentence to separate between the "t" and the "A", I want to insert a non-breaking space.  When I type the word "Exhibit", I have to insert a space after the "t" in order for typing "nbsp" to insert my non-breaking space.  Then I end up with two spaces!  I printed the page to see what it did, and sure enough, there are two spaces between "Exhibit" and "A".  Which completely defeats the purpose of having a non-breaking space, as the words still separate between lines. 

In short - in order to have my substitution work, it has to be separate from the text before and after; otherwise it doesn't work. In fact, all of the substitutions must include a space before and after in order to work.  For instance, when typing c/o and expecting โ„…, one has to have a space prior to and after "c/o" in order for it to work. 

Quite a conundrum when one is expecting a non-breaking space substitution to work, and ironically, one has to insert a space before it will work:)

I found that to be the case as well.

But the key-based insert does work for me, using a Chromebook: ctrl-shift-u <NBSP code>.

Have you tried the insert key method?

You could also type it on MacOS by first enabling Unicode Hex Input... but yes, much more accessible on ChromeOS.

Not sure about Windows.

@dalkesm did you try key-based input mentioned by @bill_pier3 and/or OS-level input (alternate keyboards)? 

Yet another option could be a unicode Google Docs add-on such as this or chrome extension (there are several on the Chrome Web Store).

Yes to the first question.

And just tried Bjorn's but it doesn't have nbsp capabilities.

Ty for sending the info tho:)

Key-based or OS-level input (alternative keyboard) did the trick? @bill_pier3 had the ChromeOS solution, I used Unicode Hex on Mac which also worked. 

Key-based doesn't work as you have to have a space before using key-based, which inserts two spaces.  And I can't use Unicode b/c I don't have a numeric keypad.

If you don't have a numeric keypad you can accomplish the same via num lock

See this article

Nope.  No numeric keyboard=no num lock

If no num lock then hold down Fn along with Alt when you type the number sequence... this should have the same result.

Are you ChromeOS, MacOS or Windows?

Windows.  Not sure what I would use as a "Fn" key on my particular keyboard.

Often in the very bottom left. Upload a picture of your keyboard? ๐Ÿ˜…

I've tried over and over to upload and send a photo of my keyboard, but this messaging system is preventing with no explanation as to why โ˜น๏ธ

If you want to jump on a Google Meet to figure out a solution, send me a DM - happy to help. As with anything, there are probably multiple possible ways to resolve this... it's just one character! ๐Ÿ˜œ

I too have been trying to get this to work for at least 8 years, to no avail. I have a couple other things to try before I beg for help ๐Ÿ™‚ but I just wanted to chime in to express solidarity with dalkesm.

I am so happy!  Ty for letting me know!  I don't see it yet on my end; but don't anticipate it will happen for me until January 23rd. 

I hope this feature will include the ability to view the "contents" of these non-printing characters . . .

Hi there! I have a solution for you, but depending on your workplace setup, it may not be viable.

I see that you are using Windows. I have used Microsoft Keyboard Layout Creator to add the non-breaking space character to my custom keyboard layout, under Ctrl+Shift+Space.

I don't think this interferes with any default Google Docs shortcuts, but I'm not sure. 

This method gives you access to the non-breaking space *everywhere*, not only in a word processor application!

But it will only be available on any computer that you can install the customized keyboard layout. If you primarily work on your *personal* computer, and/or your company has only a few office-based shared computers, then this should be fine for you.

However, to do it this way is a bit involved.

You have to learn a bit about creating keyboard layouts, duplicate your existing layout, make sure it's set as the right language (cos word processors tend to use the keyboard input language as the text language), make sure it's the layout file is named correctly, test it, export it, install it, select it in the Windows settings, try to set it as the default keyboard layout... Those things sound simple enough but sometimes it just doesn't work right.

And you might have to uninstall it if it doesn't work right, edit the layout again, change the version number (because Windows has horrible management of keyboard layout versions), export it again, try to install it again, etc etc. You get the picture, it is a headache.

But, since I got the hang of creating these custom keyboard layouts, I actually use two custom layouts regularly, one as my default input layout all the time.

If this non-breaking space has no other solution, then perhaps the faff of getting this set up is worth it.

 

Edit: if this method is too complicated and/or you can't find how-tos online, but seems to be just what you need, let me know and I'll write a step-by-step guide for you. I'm busy for the next few days but I will get back to you after this project is done ๐Ÿ™‚

I began the download process for MSKLC and the zip download kept extracting to itself in the downloads folder.  It just never goes anywhere and opens nothing.  I'm confused:)

Look at the very end of your Downloads folder! The folder is called "MSKLC" too. It has a "modified" datestamp of 1st October 2020.

You can just start typing "msklc" in the Downloads folder and it should show you the folder.

Farran_0-1689246895052.png

Open the folder and run setup.exe to install it:)

Creating the layout

1. Once it's installed and you've opened the program, go to File โ†’ Load existing keyboard...

Farran_1-1689247092477.png

2. Select your keyboard layout. I'm assuming you're using the US layout but choose accordingly. 

Farran_2-1689247142126.png

3. Click on the spacebar in the layout view.

Farran_3-1689247222179.png

4. A window will appear, titled "VK_SPACE". If the 'Advanced View' checkbox isn't marked, tick it to open the advanced view. The box near the bottom, labelled "shift+ctrl+<Key>" is where you're gonna put the nbsp character.

Farran_5-1689247341024.png

5. Paste this:   U+00a0   into the box, like so, then press OK.

Farran_6-1689247526430.png

6. To check that the non-breaking space character saved properly, tick the Shift and Ctrl boxes in the left-hand panel. They toggle different states of the keyboard, and will show what each key does in that state. Hover your mouse cursor over the spacebar and it should show a popup that reads "U+00A0 NO-BREAK SPACE", like so:

Farran_7-1689247626124.png

7. Click the Project menu and open Properties.

Farran_8-1689249012472.png

8. Name your layout, and give it a description.

8a) The name has to be 8 characters max, and I recommend including "01" so that you can create additional versions if there is a problem or if you decide to add more custom characters to your keyboard. (If you like customization, it can get addictive!)

Farran_9-1689249192637.png

8b) The description is what you'll see in the popup menu when you cycle through keyboard layouts with Win+Space (or whatever your shortcut is set to).

Farran_10-1689249277561.png

9. Test the keyboard layout. Go to Project โ†’ Test Keyboard Layout.

Farran_11-1689249428923.png

9a) Type lots of 'm's (because they're the widest character) until they overflow one line.

Farran_12-1689249468686.png

9b) Use Ctrl+Shift+Space to insert a non-breaking space near the end of the row of 'm's. You should find that the row does not break:)

Farran_13-1689249530731.png

10. Project โ†’ Validate Layout. As long as you haven't done anything else, you should be greeted with this successful verification message:

Farran_14-1689249626705.png

11. Project โ†’ Build DLL and Setup Package. This will create the keyboard layout file and the installer for it.

Farran_16-1689249702297.png

Click yes to open the folder where it saved the setup files.

Farran_15-1689249681366.png

Installing the layout

12. Run setup.exe. Windows will ask you for administrator privileges in the fullscreen user account control thing that Windows does.

Farran_17-1689249811960.png

13. The installer will just install the keyboard layout immediately. Hopefully it succeeded!

Farran_18-1689249916135.png

14. Open the language settings in Windows settings. (You can just type "language" in the Start menu search.) Click on Keyboard.

Farran_21-1689250231035.png

15. You should see the "Override for default input method" section at the top. From the drop-down menu, choose your new keyboard layout.

Farran_22-1689250300545.png

16. The new layout will probably not appear at the top of the list, so we need to select the layout that we want to be the primary layout.

 

Farran_24-1689250350792.png

(As you can see from my list, my custom layout is at the top. I did some hacky stuff a couple of years ago to achieve this and I honestly can't remember how, but it definitely involved tweaking the registry. I don't recommend that at all. I think that just setting it as the override in this settings panel should be fine.)

17. Finally, you probably have to log out and in again, or perhaps even reboot.

You may need to fiddle with Windows's settings a bunch of times before it will stick.

________________________________________

Honestly, Windows's handling of custom keyboard layouts is a nightmare. If you need to uninstall it, that can sometimes be a headache too.

I'll try to outline the steps here...

Uninstallating the layout 

1. Run the setup.exe file again, and choose "Remove the keyboard layout." Then click Finish. Seems simple enough, and sometimes that does the trick!

Farran_25-1689250844785.png

If that, for some reason, didn't work, you'll have to go another route. 

2. Open Programs and Features in the traditional Control Panel. You can get to it quickly by pasting this address into the address bar of a file explorer window: 

Control Panel\All Control Panel Items\Programs and Features

3. Sort the list by the "Installed On" column to show the most recent at the top. If the keyboard layout really hasn't uninstalled, you will see it at the top of the list. 
(Please excuse the appearance of this screenshot, Windows's dark mode is buggy.)

Farran_26-1689251103469.png

4. Click Uninstall at the top of the list. That should be all there is to it.

The reason that I strongly recommend including a version number in the layout name is because sometimes the layout uninstaller leaves remnants in the registry. Installing future versions of a layout with the same name is often impossible, even if you have uninstalled the previous layout completely. I had to trawl though my registry to clean out all traces of the original layout name. Like I said, Windows does not handle custom keyboard layouts well, at all!

 

Ok I hope that guide is detailed enough! 

Let me know if there's any other issues. There doesn't seem to be much information or guidance on the web about how to use this application. I guess that not many people in the world really care about custom keyboard layouts:)

Oh.  My.  Gawd!  This worked!  I can now use Ctrl+Shift+Space after installing the keyboard.  I just tried it on the following text at the end of a line - "Exhibit A" between the "t" and the "A" and it pulled everything to the next row; keeping Exhibit A from separating!

Where do I send flowers?  Chocolate?  Wine?

My wish has been satisfied.  I am accepting your solution, Farran!

Top Solution Authors