Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,37 @@ automatically enabled anytime you edit a `.ts` file.
Indenting
---------

This plugin includes a custom indenter (based on `indent/java.vim`), it works
pretty well but there are cases where it fails. If these bother you or want to
use other indent settings you can disable it by setting a flag in your
This plugin includes a custom indenter (based on [pangloss/vim-javascript's
indenter](https://github.com/pangloss/vim-javascript/blob/master/indent/javascript.vim)),
it works pretty well but there are cases where it fails. If these bother you or
want to use other indent settings you can disable it by setting a flag in your
`.vimrc`:

```vim
let g:typescript_indent_disable = 1
```

If you want the indenter to automatically indent chained method calls as you type.

```typescript
something
.foo()
.bar();
```

Then add something like `setlocal indentkeys+=0.` to your `.vimrc`, see `:help
'indentkeys'` in vim for more information.

If you use the `=` operator to re-indent code it will always indent
chained method calls - this can be disabled by changing the regex the
indent script uses to identify indented lines. In this case removing '.'
from the regex means that it wont indent lines starting with '.'. Note,
this is not ideal as the regex may change making your setting out of date.

```vim
let g:typescript_opfirst='\%([<>=,?^%|*/&]\|\([-:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)'
```

Compiler settings
-----------------

Expand Down
Loading