insect
insect copied to clipboard
Command to list user defined variables
You should see the user-defined variables when typing list
or ls
.
Yes but i thought a feature to list only user-defined variable would be helpful
Ok - sounds like a reasonable request.
I made an attempt to implement this feature, what keyword could be used for this command?
vars
is the best option i can think of right now, maybe in documentation list
information should use 'defines' instead of variables to distinguish between them?
Another idea could be to use the slightly longer ls user
or ls variables
or ls vars
. This way, ls
could maybe show everything and ls user
/ls builtin
could show the subsets.
If we are discussing this anyway, we might also think about printing (builtin and user) functions. Functions can already be printed by typing their name, but there is no way to list them all.
Another idea could be to use the slightly longer
ls user
orls variables
orls vars
. This way,ls
could maybe show everything andls user
/ls builtin
could show the subsets.
I like the idea that ls
/ list
shows everything defined from variables to functions, but ls variables
is too long IMO
What do you think about defines
for non-user variables and vars
/variables
for user defined?
If we are discussing this anyway, we might also think about printing (builtin and user) functions. Functions can already be printed by typing their name, but there is no way to list them all.
I like builtins
for non-user functions but user functions.. hmm can't think of anything other than functions
right now
Just throwing ideas around, i want to know your thoughts
@sharkdp What do you think of just splitting user defined and system defined stuff when running list
? That would reduce a lot of the work and no need for news commands and stuff
That sounds good to me! We should probably list the user variables at the bottom such that they are better visible (if the list is too long)
maybe ls
for easiest to implement option, ls -u
filters for user, ls -b
filters for built-ins
Maybe I'm just being stupid, but are user and built-ins stored separately? I know I'm missing something, I just don't know what 😅
but are user and built-ins stored separately?
No, this was meant to allow you to see your defined vars easier by visually separating user defined ones from predefined ones but was never done and i stopped using insect
Yeah, I don't see why separating them would be useful enough to warrant a rewrite of the variable system. As long as you can see the variables with list (which you can), I don't see an issue.
Yeah, I don't see why separating them would be useful enough to warrant a rewrite of the variable system. As long as you can see the variables with list (which you can), I don't see an issue.
It was never meant to be fully separated, just visually so you could see which ones are which
If someone thinks this is still important, please report a follow-up ticket in the Numbat project (the successor project of Insect): https://github.com/sharkdp/numbat