summaryrefslogtreecommitdiff
path: root/py/roles.py
blob: 8f7f1611ff068b87eeee7fd21dcbcc2526f6c571 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import vim
import os
import configparser

roles_config_path = os.path.expanduser('~/.vim/roles.ini') # TODO configure
roles = configparser.ConfigParser()
roles.read(roles_config_path)

role_names = [name for name in roles.sections() if not '.' in name]

role_list = [f'"{name}"' for name in role_names]
role_list = ", ".join(role_list)

role_list = f"[{role_list}]"

vim.command(f'let l:role_list = {role_list}')