Table-like formatting#11
Open
mg979 wants to merge 2 commits into
Open
Conversation
mg979
commented
Feb 13, 2018
| path_to_commands = path_to_script.replace('cmdpalette.vim', 'internal_commands.txt') | ||
| with open(path_to_commands) as commands_file: | ||
| internal_commands = [l.strip() for l in commands_file.readlines()] | ||
| internal_commands = [l.rstrip() for l in commands_file.readlines()] |
Author
There was a problem hiding this comment.
I left 2 leading spaces, because ctrlp adds 2, so 4 make a tab. It made it easier(if not possible) to align the rest of the table.
|
|
||
| # convert to list, remove empties, discard 4 first columns and take first word | ||
| custom_commands = [x[4:].split()[0] + '\t(custom command)' | ||
| custom_commands = [' ' + x[4:].split()[0] + ' *' |
Author
There was a problem hiding this comment.
2 leading spaces also here. I replaced (custom command) with an asterisk, because that string cannot be aligned, and it makes the table less readable.
| redraw | ||
| call feedkeys(':', 'n') | ||
| call feedkeys(split(a:str, '\t')[0], 'n') | ||
| call feedkeys(strpart(split(a:str, '\t')[0], 2), 'n') |
Author
There was a problem hiding this comment.
The leading spaces are removed here, before the command is inserted in the command line.
Owner
|
Nice! I'll test it and merge it today :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I edited mostly the text file, so that it looks like a 3-columns table in vim. First tab is still there, so fuzzy search works as before. It needed 3 small changes in the plugin too.