You seem to be asking two questions here:
1. How do I force IntelliJ IDE to input a tab, when it would not do so when I hit tab?
and
2. How do I force IntelliJ IDE to input a space, when it would not do so when I hit space?
I don’t understand how the second case can arise. However, I have provided a solution to it as well.
Case 1. Insert a tab character when an IntelliJ IDE wants to replace it with spaces due to configuration
Solution
Use search and replace.
Details
- Place the cursor where you want the tab to be
- Press the
X
key - Select the
X
you just typed - From the main menu, choose Edit | Find | Replace to bring up the search and replace pane
- Make sure there is an
X
in the search field - Enter
\t
in the replace field - Be sure the option
Regex
is checked - Be sure the option
In Selection
is checked - Click the
Replace
button
Case 2. Insert a space character when an IntelliJ IDE won’t just let you type one (???)
Solution
Use search and replace.
Details
- Place the cursor where you want the space to be
- Press the
X
key - Select the
X
you just typed - From the main menu, choose Edit | Find | Replace to bring up the search and replace pane
- Make sure there is an
X
in the search field - Enter a single space into the replace field
- Be sure the option
In Selection
is checked - Click the
Replace
button