Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CtrlP theme #1489

Open
sassanh opened this issue Nov 13, 2015 · 7 comments
Open

CtrlP theme #1489

sassanh opened this issue Nov 13, 2015 · 7 comments

Comments

@sassanh
Copy link

sassanh commented Nov 13, 2015

Is it possible to have a ctrlp theme for powerline? It'd be great if you could lead me to write one if no one with the knowledge has the time to write it himself.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@ZyX-I
Copy link
Contributor

ZyX-I commented Nov 13, 2015

You need to have at least modifications to three files:

  1. powerline/matchers/vim/plugin/ctrlp.py (take any other file in the same directory as a reference). Note: it would be preferred if you could match against the file type, not against the buffer name, but e.g. with Command-T this was not possible (note: was).
  2. powerline/config_files/themes/vim/plugin_ctrlp.json (see plugin_commandt.json in the same directory for reference)
  3. powerline/config_files/config.json (search for “plugin_commandt”)

Most likely also powerline/segments/vim/plugin/ctrlp.py with contents similar (functionally) to commandt.py in the same directory.

@ZyX-I
Copy link
Contributor

ZyX-I commented Nov 13, 2015

Ah, and also tests/test_ctrlp.vim (see tests/test_commandt.vim). And an update to bot-ci apparently this was already fetched.

@sassanh
Copy link
Author

sassanh commented Nov 13, 2015

Thanks, I were able to implement it and it's functioning alright, now how can I migrate it from "powerline/matchers/vim/plugin/ctrlp.py" to my home directory? I also needed to write a "powerline/segments/vim/plugin/ctrlp.py" for utility functions. but I want these 2 files in my home directory instead of my python's site-packages folder.
Of course I'll apply a pull request but I just wanna know if it's generally possible to have these files in my .config/powerline like thems and colorschemes?

@ZyX-I
Copy link
Contributor

ZyX-I commented Nov 13, 2015

I thought you were going to create a PR. Powerline does not put any restrictions on which modules exactly need to have the matchers and segments, so you could put it in any module, not necessary powerline.matchers.vim.plugin.ctrlp and powerline.segments.vim.plugin.ctlp. Including putting both matcher and segment in one module.

These are not configuration files, so you should not put them into .config/powerline. You can’t do this thing with modules named powerline.*, but if your module was named e.g. powerline_ctrlp you could put it anywhere in sys.path. sys.path may be modified by setting PYTHONPATH, it is usual colon-separated environment variable listing directories like $PATH is.

@sassanh
Copy link
Author

sassanh commented Nov 13, 2015

thanks for info, there's only one thing blocking me to create the pull request. my ctrlp segment module relies on setting ctrlp status function to my custom function, the ctrlp variable that should be set for this purpose is g:ctrlp_status_func, is it alright to set this variable with calling vim.command in my initialize function in ctrlp module or maybe it's an antipattern regarding powerline plugin's guidelines.

@ZyX-I
Copy link
Contributor

ZyX-I commented Nov 13, 2015

@sassanh Cannot say without actually seeing the code. Should be OK assuming that you do not set this variable until ctrlp buffer actually appears.

@sassanh
Copy link
Author

sassanh commented Nov 13, 2015

@ZyX-I I just created the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants