1

Problem statement :- Tab does not work with vim for me

Description :- I am using vim-awesome for plugin in vim. Now the tab does not work. My expectation is pressing should result in tab being inserted in my file

  • Need more details. You mean Tab was working before you installed the plugin and now it isn't? Are you in insert mode when pressing Tab? – algae May 22 at 4:59
  • Does it insert spaces instead? If yes, see :h 'expandtab'. – Ralf May 22 at 5:10
  • @algae, yes it was working. And yes i am insert mode. Also insert mode, if CTRL-V and TAB it works – Venumadhav Josyula May 22 at 6:40
  • @raif , i did not understand, it shows the manual how the behaviour is – Venumadhav Josyula May 22 at 6:43
  • 1
    @VenumadhavJosyula Welcome to Vi and Vim! I’ve temporarily closed your question because it lacks significant details. If you can edit to clarify, we can reopen the question. (You might want to describe what « not working » means and which plugin you installed that started this behavior. We have a good question on debugging mappings too.) I also recommend the tour and help center if you’re new! – D. Ben Knoble May 22 at 11:02
1

This sounds, as if the option expandtab is set. In this case Vim inserts spaces instead of a tab character.

To check execute set expandtab?. This will either print expandtab ( Vim inserts spaces) or noexpandtab (Vim will insert real tabs).

To get real tabs, you need to execute :set noexpandtab or add it to your vimrc.


So the question remains: Why is expandtab set?

To find the "guilty" part, restart Vim and execute :verbose set expandtab?. This will echo the current state and print where is was last set.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.