How can I enter a literal character in IntelliJ/IDEA/PyCharm?

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

  1. Place the cursor where you want the tab to be
  2. Press the X key
  3. Select the X you just typed
  4. From the main menu, choose Edit | Find | Replace to bring up the search and replace pane
  5. Make sure there is an X in the search field
  6. Enter \t in the replace field
  7. Be sure the option Regex is checked
  8. Be sure the option In Selection is checked
  9. 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

  1. Place the cursor where you want the space to be
  2. Press the X key
  3. Select the X you just typed
  4. From the main menu, choose Edit | Find | Replace to bring up the search and replace pane
  5. Make sure there is an X in the search field
  6. Enter a single space into the replace field
  7. Be sure the option In Selection is checked
  8. Click the Replace button

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)