From 20e515d9971897a21b21efa355d43d2e3df24cdd Mon Sep 17 00:00:00 2001 From: John Freeman Date: Sat, 29 Sep 2018 09:09:18 -0500 Subject: [PATCH 1/3] Update to new vim-javascript indent file --- indent/typescript.vim | 620 +++++++++++++++++++++++++----------------- 1 file changed, 368 insertions(+), 252 deletions(-) diff --git a/indent/typescript.vim b/indent/typescript.vim index 8137398..d9463d6 100644 --- a/indent/typescript.vim +++ b/indent/typescript.vim @@ -1,359 +1,475 @@ " Vim indent file -" Language: Typescript -" Acknowledgement: Almost direct copy from https://github.com/pangloss/vim-javascript +" Language: Javascript +" Maintainer: Chris Paul ( https://github.com/bounceme ) +" URL: https://github.com/pangloss/vim-javascript +" Last Change: December 4, 2017 " Only load this indent file when no other was loaded. -if exists('b:did_indent') || get(g:, 'typescript_indent_disable', 0) +if exists('b:did_indent') finish endif let b:did_indent = 1 " Now, set up our indentation expression and keys that trigger it. -setlocal indentexpr=GetTypescriptIndent() +setlocal indentexpr=GetJavascriptIndent() setlocal autoindent nolisp nosmartindent setlocal indentkeys+=0],0) +" Testable with something like: +" vim -eNs "+filetype plugin indent on" "+syntax on" "+set ft=javascript" \ +" "+norm! gg=G" '+%print' '+:q!' testfile.js \ +" | diff -uBZ testfile.js - let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<' " Only define the function once. -if exists('*GetTypescriptIndent') +if exists('*GetJavascriptIndent') finish endif let s:cpo_save = &cpo set cpo&vim +" indent correctly if inside