1

I've been using MacVim for my main editor for a while now. I mainly use it for javascript, express.js to be specific, and one thing that is bothering me is the indentation of it.

I want the indentation to do this:

app.get('/', function(req, res) {
    res.send("Hello, world!");  
});

But right now it's doing this:

app.get('/', function(req, res) {
        res.send("Hello, world!");
            });

I don't know why it's doing this. And for extra information, this is my .vimrc:

execute pathogen#infect()
set tabstop=4
set smartindent
set autoindent

I also have this installed via Pathogen. Please help me. Thank you.

3
  • 3
    Add filetype plugin indent on to your vimrc. Commented Aug 15, 2016 at 23:38
  • What is the filetype or file extension. Are you sure the editor knows it is a Javascript file? Commented Aug 16, 2016 at 0:32
  • Thank you @dNitro! The problem is now fixed after I added filetype plugin indent to my vimrc. Commented Aug 18, 2016 at 18:11

1 Answer 1

2

Add filetype plugin indent on to your vimrc.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.