nickspoons / vim-cs

Official Vim Runtime Files for C#
9 stars 3 forks source link

Add Indent files #3

Closed idbrii closed 5 years ago

idbrii commented 5 years ago

This repo is for the C# runtime files and vim includes three kinds:

Currently only includes syntax, so this PR adds indent. Before @nickspoons took over, Johannes Zellner was the maintainer for syntax, indent, and ftplugin. I hope that means you'll accept maintainership of indent.

Users who have OrangeT/vim-csharp or OmniSharp/omnisharp-vim already have a C# indent, but this one builds on top of what's there. They will need to ensure vim-cs's indent is loaded first. I clone this repo to a name that occurs earlier (~/.vim/bundle/aaa-cs-official) and that works with pathogen. Other plugin managers may have methods for specifying load order.

I've included three tests. The last test is the use case that prompted me to make these changes and it demonstrates how this PR improves on other C# indent.

nickspoons commented 5 years ago

@idbrii I have now created a test/vimrc file which I can use to successfully run the indent tests:

vim -Nu test/vimrc -c 'Vader! test/indent.vader'

The vimrc prepends vim-cs to the runtimepath (rtp^=... instead of rtp+=...), and sets expandtab shiftwidth=4 softtabstop=-1. This works, so I have also updated the .travis.yml file to match. I'm hoping that if you rebase on top of master, a travis build will be triggered that should succeed.

nickspoons commented 5 years ago

I did a quick test of rebasing in a branch and the travis build succeeded, so this is merged. Thanks again @idbrii!