Comments (11)
We've talked about this recently in some other issue that I can't find. The synopsis, as I remember it, was to have something like NU_LIB_DIRS where script files/modules could be stored and if they are present get sourced on startup. I probably won't support folder named conf.d
and modules.d
because they're way to Linux-y. However, if there was something like NU_AUTO_SOURCE, and it was a list of folders, you could name them anything you want.
from nushell.
Is there an ETA on this? This is one of the most important thing missing for me to switch to nushell. Managing config files in 3rd party tools (part of dotfiles) would be much more easy.
It's just waiting on someone to implement it.
from nushell.
Is there an ETA on this? This is one of the most important thing missing for me to switch to nushell. Managing config files in 3rd party tools (part of dotfiles) would be much more easy.
from nushell.
@ADIX7 I'm not a Rust developer (yet, but I'd love to learn), but it seems to me to be a relatively easy implementation. Might be a "Good First Issue" for someone to work on, but I'll let a Nu team member make that determination.
from nushell.
And I came back over to add that this isn't only for third-party modules.
It's far more easy to just <nano/vi/edit/code> ~/.config/nushell/conf.d/my_function.nu
and edit away than it is to find the function/custom command declaration in a monolithic config.nu
, even with the best of IDE/editors.
from nushell.
Throwing out a ... maybe ... include subdirectories of conf.d
/modules.d
automatically as well? This would allow you to git clone
a module/script directly into the directory ...
The structure of the repo would have to be "just right" though, or would need some convention to specify what to load (and what not to).
Which reminds me, this ultimately goes to a "convention over configuration" mindset, I believe.
from nushell.
Is there an ETA on this? This is one of the most important thing missing for me to switch to nushell. Managing config files in 3rd party tools (part of dotfiles) would be much more easy.
It's just waiting on someone to implement it.
Good first issue for someone, or are there nuances I'm not anticipating?
from nushell.
Good first issue for someone, or are there nuances I'm not anticipating?
Yes, there will be nuances like:
- when should they be loaded, before x file, after y file
- when should they be loaded, with x parameter or with y parameter
- should all of these be merged into the root overlay or should it be a new one
- probably other concerns here too
from nushell.
@fdncred Fair enough
I'll try to experiment with various flavors of this (via hard-coded source
and use
statements in config.nu
for now) to see if I can flesh out the recommended implementation.
For #1, at least, I recommend loading after all default configs are processed (env.nu
, config.nu
, and login.nu
- Is that the complete set?). This allows the conf.d
files to act as overrides on any "default" or pre-existing settings. Again, that's the way other conf.d
implementations tend to go.
The main question on item 1, though, that I'm not sure about is how to choose the ordering of modules vs. source
'd files. Again, I'll experiment.
from nushell.
I recommend loading after all default configs are processed
i agree
number 2 is about nu --parameters
e.g. should it be loaded with nu -c, what about nu -c -l, what about nu --stdin, what about....
that I'm not sure about is how to choose the ordering of modules vs. source'd files.
One thing about ordering, iirc, some linux types do 1.filename 2.filename 3.filename, etc. i'm not sure we need to do that or not and i'm also not sure how that plays with source, source-env, use, overlay, overlay use, etc
from nushell.
If I've understood correctly, this sounds like a great feature to be implemented!
Could this be related to the following? #5682 #8214
from nushell.
Related Issues (20)
- Attention: Nightly build of release binaries failed
- Support "--" in argument parsing to consume the rest of arguments into ...args (or similar) without trying to handle arguments as flags HOT 3
- Is there a way to replace current command line buffer HOT 8
- Incomplete parser of boolean expressions ending with bracket HOT 3
- Msys2 & POSIX compatibility layer HOT 7
- Bash keyboard shortcuts compatibility HOT 1
- Add ability to access record via variable HOT 3
- Cannot delete sqlite history
- timeit captures stdout but not stderr HOT 3
- from ssv does not ignore lines starting with a comment #
- Attention: Nightly build of release binaries failed
- ls with recursive glob pattern can output empty results HOT 27
- `to md` ignores columns with empty header HOT 1
- Add `random ulid`
- into sqlite expects column order to be the same thoughout the data HOT 2
- Selecting a Ctrl+R entry should clear any already-typed text HOT 3
- The mv command performs a copy even if the source and destination are on the same device. HOT 4
- Make `mv` command fallback to copy only if the src and dst are on different device.
- Using `start` command to open url may end up opening multiple tabs with error message
- How to get the process ID occupying a certain network port ? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nushell.