<commit_before>
# Manage vim dotfiles

{%- from 'user/info.sls' import user_info with context %}

include:
  - editors.vim.dotfiles
  - dev.git
  - dev.git.github_com
  - dev.python

clone vundle:
  git.latest:
    - name: https://github.com/gmarik/Vundle.vim.git
    - target: {{ user_info('home') }}/.vim/bundle/Vundle.vim
    - user: {{ user_info('name') }}
    - rev: master
    - require:
      - sls: editors.vim.dotfiles

owner of vundle:
  file.directory:
    - name: {{ user_info('home') }}/.vim/bundle/Vundle.vim
    - user: {{ user_info('uid') }}
    - group: {{ user_info('gid') }}
    - recurse:
      - user
      - group
    - onchanges:
      - git: clone vundle

run plugin install:
  cmd.run:
    - name: vim -E +"PluginInstall" +':let g:session_autosave="no"' +qall
    - runas: {{ user_info('name') }}
    - timeout: 600
    - output_loglevel: quiet
    - onchanges:
      - git: clone vundle
      - sls: editors.vim.dotfiles

install instant-rst:
  cmd.run:
    - name: pip install https://github.com/Rykka/instant-rst.py/archive/master.zip
    - runas: {{ user_info('name') }}
    - unless: python -c "import instant_rst"<commit_msg>Do not display Plugininstall output when running vim<commit_after>
# Manage vim dotfiles

{%- from 'user/info.sls' import user_info with context %}

include:
  - editors.vim.dotfiles
  - dev.git
  - dev.git.github_com
  - dev.python

clone vundle:
  git.latest:
    - name: https://github.com/gmarik/Vundle.vim.git
    - target: {{ user_info('home') }}/.vim/bundle/Vundle.vim
    - user: {{ user_info('name') }}
    - rev: master
    - require:
      - sls: editors.vim.dotfiles

owner of vundle:
  file.directory:
    - name: {{ user_info('home') }}/.vim/bundle/Vundle.vim
    - user: {{ user_info('uid') }}
    - group: {{ user_info('gid') }}
    - recurse:
      - user
      - group
    - onchanges:
      - git: clone vundle

run plugin install:
  cmd.run:
    - name: vim -E +"PluginInstall" +':let g:session_autosave="no"' +qall >& /dev/null
    - runas: {{ user_info('name') }}
    - timeout: 600
    - output_loglevel: quiet
    - onchanges:
      - git: clone vundle
      - sls: editors.vim.dotfiles

install instant-rst:
  cmd.run:
    - name: pip install https://github.com/Rykka/instant-rst.py/archive/master.zip
    - runas: {{ user_info('name') }}
    - unless: python -c "import instant_rst"
{'fraction_non_alphanumeric': 0.16074450084602368, 'fraction_numerical': 0.0025380710659898475, 'mean_word_length': 2.4985207100591715, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 4, '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': '6257238', 'n_tokens_mistral': 899, 'n_tokens_neox': 849, 'n_words': 177}