-1

I am writing some HTML code for fast copy-paste to google spreadsheets.

I have settings to remove tab characters \t and replace it with four white-space character.

Now for Google Spreadsheets to recognize cells I need to write \t. But N++ is replacing it with white-spaces.

Is it possible to tell N++ to keep some special character (or maybe there is way to insert some special characters without keyboard)?

Text example:

someData    t2.micro    12348   y
Justinas
  • 41,402
  • 5
  • 66
  • 96
  • When is Notepad++ doing this replacement? At the time of opening or at the time of saving? – Tim Biegeleisen Jun 09 '16 at 06:36
  • @TimBiegeleisen At the time of writing. – Justinas Jun 09 '16 at 06:43
  • Have a look [here](http://stackoverflow.com/questions/455037/convert-tabs-to-spaces-in-notepad). Your problem may be easily solved by adjusting the settings of your Notepad++. – Tim Biegeleisen Jun 09 '16 at 06:46
  • @TimBiegeleisen The problem is - I don't want to edit current settings as I am programming with N++ and I need tabs only for this particular place. – Justinas Jun 09 '16 at 06:50
  • Couldn't you in menu `Edit > Spaces management >Transform tabs into spaces` this will act only for current file. I haven't an english version of Npp, so the menu may differ. – Toto Jun 09 '16 at 07:17

4 Answers4

3

Here is what I did.

  1. Open the Character Panel (Edit->Character Panel)
  2. Record a Macro (Macro->Record New Macro)
  3. Insert a tab character from the Character Panel
  4. Stop recording the macro (Macro->Stop Recording)
  5. Save the macro (Macro->Save Current Recorded Macro)
  6. Assign the macro to a keyboard shortcut (I chose ctrl+tab. This conflicts with shortcut 163-Switch to next document, but I personally never use that shortcut)

Now anytime I want an actual tab character I can simply hit ctrl+tab instead of tab.

Sam Drost
  • 61
  • 2
  • 1
    This is a great idea! Just to close the loop on step #6: if you want to remove the conflict, just find it in the Shortcut Mapper (Macro->Modify Shortcut/Delete Macro). It was #164 for me, I just set it to to Ctrl+~ because I never used that command any way. – Austin Cory Bart Nov 04 '18 at 20:16
3

I found that if I enter the tab character on the number pad, it does not get converted to spaces. The ascii code for a tab is hex 09. To enter it on the number pad:

  • Press and hold the Alt key
  • On the number keypad, press the "+" key
  • On the number keypad, press the "9" key
  • Release the Alt key
2

Solution I found was to copy-paste tab symbol from somewhere else (e.g. Windows Notepad). Saving, editing, re-opening file does not overwrites this.

Justinas
  • 41,402
  • 5
  • 66
  • 96
1

OS: Windows 11 Notepad++: v8.3.2

Settings > Preferences... > Language > Tab Settings > Replace by space

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 04 '22 at 22:58