<commit_before>= Formatting to Astyle in Neovim

In general the Solar Car Team will be formatting code in astyle.
In neovim there are commands to format your file into astyle.

== Installing Autoformat to use with Astyle
First install Astyle following the guide outlined in the Style Guide.

You will need to add python support for neovim.  Make sure the plugin is installed by running 

[source, c++]
----
pip install neovim
----

Open init.vim through

[source,c++]
----
nvim ~/.config/nvim/init.vim
----

Add the code in the general section to get python support.

[source,c++]
----
let g:python_host_prog = '/path/to/python2.7'
----

Next in the Vim-Plug section at the code

[source,c++]
----
Plug 'chiel92/vim-autoformat'
----

and run the commands in neovim

[source,c++]
----
:source %
:PlugInstall
----

Now at any time running this command in neovim will format your code into Astyle.

[source,c++]
----
:Autoformat
----

== Using the Autoformat plugin as an auto command
Open your init.vim file by running the command in terminal.

[source,c++]
----
nvim ~/.config/nvim/init.vim
----

To run the Autoformat command everytime you save, add the following code to the general section of your init.vim file.  

[source,c++]
----
augroup autocom
    autocmd!
    :au BufWrite * :Autoformat
augroup END
----<commit_msg>Autoformat plugin should now use astylerc.  Also added reference for plugin documentation<commit_after>= Formatting to Astyle in Neovim

In general the Solar Car Team will be formatting code in astyle.
In neovim there are commands to format your file into astyle.

== Installing Autoformat to use with Astyle
First install Astyle following the guide outlined in the Style Guide.

Be sure to create the astylerc and know the file path to it.

You will need to add python support for neovim.  Make sure the plugin is installed by running 

[source, c++]
----
pip install neovim
----

Open init.vim through

[source,c++]
----
nvim ~/.config/nvim/init.vim
----

Add the code in the general section to get python support.

[source,c++]
----
let g:python_host_prog = '/path/to/python2.7'
----

Next in the Vim-Plug section at the code

[source,c++]
----
Plug 'chiel92/vim-autoformat'
----

and run the commands in neovim

[source,c++]
----
:source %
:PlugInstall
----

Now at any time running this command in neovim will format your code into Astyle.

[source,c++]
----
:Autoformat
----

To use Autoformat with our astylerc we need to add the code

[source,c++]
----
let b:formatdef_custom_c='"astyle --mode=c --suffix=none --options=/file/path/to/astylerc"'
let b:formatters_c = ['custom_c']
----

Change this file path to be to where your astylerc is saved to.

== Using the Autoformat plugin as an auto command
Open your init.vim file by running the command in terminal.

[source,c++]
----
nvim ~/.config/nvim/init.vim
----

To run the Autoformat command everytime you save, add the following code to the general section of your init.vim file.  

[source,c++]
----
augroup autocom
    autocmd!
    :au BufWrite * :Autoformat
augroup END
----

== Autoformat Plugin
For more information on the Autoformat plugin, consult the page 

http://vimawesome.com/plugin/vim-autoformat
{'fraction_non_alphanumeric': 0.1142767689417658, 'fraction_numerical': 0.002504696305572949, 'mean_word_length': 3.2771084337349397, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3425374', 'n_tokens_mistral': 1020, 'n_tokens_neox': 978, 'n_words': 423}