I'm getting started with vim for markdown.

* Level 1 text
* On pressing enter it comes here
*     On pressing tab it comes here

What I want is, I want to modify (increase or decrease) the level of bullet point using keys. (In other text editors, Tab increases the intent level and Shift+Tab decreases it)

* Level 1 bullet. On pressing Enter,
* It comes here. On pressing Enter and then Tab,
    * I want it to come here. To go to the previous level, on pressing Enter and then Enter/Shift+Tab,
* I want it to come here.

This was the behaviour in VS Code.

Upon searching I added set ai and filetype indent on to my empty .vimrc (Just installed Vundle as in the instructions) but I was not successful.

How can I get this work done?

Possible duplicate: How can I indent multiple lines, and indent "backwards", in gvim?


Vim has a different philosophy.

In normal mode, press >> to add indentation and << to remove. To do this for multiple lines, enter visual mode with v and select the lines, then press >> or <<.

In insert mode, you can press ctrl-d to remove indentation.

set ai doesn't work here because vim can't guess what indentation you want in markdown in comparison to code.


After some research, I found out this Vim plugin which does the expected behaviour for markdown files.

Here is a link to the same: gabrielelana

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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