-
Notifications
You must be signed in to change notification settings - Fork 14
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
WIP: Suggested improvements #49
base: vim9
Are you sure you want to change the base?
Conversation
97461f4
to
d691460
Compare
Hi @Donaldttt, First, thank you for Fuzzyy, it's a great plugin, I love the aim to have something that just works out of the box, that's exactly what I was looking for after using fzf.vim for years and leaderf for a while recently. I think it's time I asked for your feedback on some of these suggested changes before going much further. They are mostly either minor bug fixes or changes aiming to improve the out of the box experience so it "just works" as expected for new users (as expected being obviously highly subjective). They are driven by my personal use over a couple of weeks and my thoughts on how this should work as a plugin I would recommend to relative newcomers to Vim (I have recommended it btw!). If you have a little time could you take a look at let me know what you think. I don't expect you to agree with every change, but I hope I have explained each one adequately and you can understand why I've made it, if not, please let me know and I'll clarify. Thanks! |
Unnecessary as --vimgrep option ensures column numbers are included
5649c9c
to
2c30337
Compare
cccdccd
to
ba2a73a
Compare
Add cmdhistory, colors, commands, help, and inbuffer keys to window layout dict, with pre-existing hard-coded values for widths and xoffset. Note that as per other keys in this dict, it does not allow complete customisation of the window layout, only overriding of the defaults (e.g. you cannot currently set a height for any of the selectors).
I think this was probably called "user" opts to differentiate it from the subsets of opts extracted from this dict and passed to functions to open the various popup windows, but I found this a confusing name, are these different from other opts dicts, do they come from a user, how? To avoid confusion, just use opts, a conventional name used elsewhere.
63d822e
to
8e28ab0
Compare
This doesn't help readability unless the operators are aligned
Previously only window layout options that had been explicitly specified could be overridden. This change allows any window layout option set in in g:fuzzyy_window_layout to be passed down when creating the windows.
8e28ab0
to
7c466f2
Compare
These should probably generate warnings, but ignoring is at least better than using invalid values for calculating the popup_create() arguments.
By convention this should match the plugin name to avoid name clashes, and to make it clear which plugins autoload functions are loaded from.
Avoid name clashes or naming confusion with other plugins
d349028
to
01589f2
Compare
This makes it easier to deal with multiple options for a selector, like passing both a working directory and search keywords to grep.Start() I want to do this for a custom FuzzyyGrepRoot command, which will require adding an optional cwd argument to grep.Start(). Adding more positional arguments to support new requirements like this is fugly.
This allows abuse like: command! -nargs=? FuzzyGrepRepo call fuzzyy#grep#Start({'cwd': trim(system('git rev-parse --show-toplevel')), 'search': <q-args> }) But that abuse should be considered likely to break, these exported autolood functions are not intended as a public Fuzzyy API (but at some point it would be nice to have a documented API like telescope.nvim)
:FuzzyyMRUFiles
toFuzzyyMru
(shorter, easier to read)g:fuzzyy_mru_project_only
with new:FuzzyyMruCwd
commandTODO: