Comments (13)
Thanks for reporting the issue I will take a look during the weekend.
from fish-nvm.
Thanks.
Just wanted to let you know that if I install omf
nvm, it works well.
Also, I tried installing only bass
, following the advice from here nvm-sh/nvm#303 (comment)
function nvm
bass source ~/.nvm/nvm.sh ';' nvm $argv
end
was enough to make everything work without the whole nvm package.
from fish-nvm.
You don't need this plugin at all, as you said just putting that on your config.fish is enough. What I don't like is if you do that slows your shell initiation by a couple of seconds, because it sources nvm everytime. That's why I created this plugin, to only source nvm when you use npm, or node or nvm
from fish-nvm.
If I add this as a new file, nvm.fish
in the functions directory, shouldn't it do the same - source nvm only when the command is actually called?
from fish-nvm.
@nomaed Do you really have to use nvm?
Some people have to use nvm, so this exists, but as you can see setting it up requires knowledge and some work which is why fnm also exists.
from fish-nvm.
@BRJ I want to use nvm. I need to test stuff on different node versions and it makes the job much easier than I would be otherwise.
Edit: I looked into fnm, and I'll give it a try. I need stuff that can work outside of fish as well.
from fish-nvm.
So, I installed fnm (fisher install fnm
), got the latest node.
Now I'm getting this as an output for npm<Tab>
on Ubuntu 16.04:
╰▶ npm
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 2\>/dev/null\)\)\ \|\|\ return\ \$\?
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ COMP_LINE=\"\$COMP_LINE\"\ \\
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ COMP_POINT=\"\$COMP_POINT\"\ \\
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ npm\ completion\ --\ \"\$\{words\[@\]\}\"\ \\
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 2\>/dev/null\)\)\ \|\|\ return\ \$\?
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ COMP_LINE=\"\$line\"\ \\
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ COMP_POINT=\"\$point\"\ \\
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ npm\ completion\ --\ \"\$\{words\[@\]\}\"\ \\
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 2\>/dev/null\)
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ COMP_LINE=\$BUFFER\ \\
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ COMP_POINT=0\ \\
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ npm\ completion\ --\ \"\$\{words\[@\]\}\"\ \\
\ \ \ \ \ \ _get_comp_words_by_ref\ -n\ =\ -n\ @\ -w\ words\ -i\ cword
\ \ \ \ \ \ cword=\"\$COMP_CWORD\"
\ \ \ \ \ \ words=\(\"\$\{COMP_WORDS\[@\]\}\"\)
\ \ \ \ compadd\ --\ \$\(COMP_CWORD=\$\(\(CURRENT-1\)\)\ \\
\ \ \ \ else
\ \ \ \ fi
\ \ \ \ if\ type\ _get_comp_words_by_ref\ \&\>/dev/null\;\ then
\ \ \ \ IFS=\"\$si\"
\ \ \ \ IFS=\$\'\\n\'\ COMPREPLY=\(\$\(COMP_CWORD=\"\$cword\"\ \\
\ \ \ \ IFS=\$\'\\n\'\ reply=\(\$\(COMP_CWORD=\"\$cword\"\ \\
\ \ \ \ IFS=\$si
\ \ \ \ let\ cword-=1
\ \ \ \ local\ cword\ line\ point\ words\ si
\ \ \ \ local\ si=\"\$IFS\"
\ \ \ \ local\ si=\$IFS
\ \ \ \ local\ words\ cword
\ \ \ \ read\ -Ac\ words
\ \ \ \ read\ -cn\ cword
\ \ \ \ read\ -l\ line
\ \ \ \ read\ -ln\ point
\ \ \ \ si=\"\$IFS\"
\ \ _npm_completion\ \(\)\ \{
\ \ _npm_completion\(\)\ \{
\ \ compctl\ -K\ _npm_completion\ npm
\ \ compdef\ _npm_completion\ npm
\ \ complete\ -o\ default\ -F\ _npm_completion\ npm
\ \ \}
\#
\#\ Installation:\ npm\ completion\ \>\>\ \~/.bashrc\ \ \(or\ \~/.zshrc\)
\#\ npm\ command\ completion\ script
\#\ Or,\ maybe:\ npm\ completion\ \>\ /usr/local/etc/bash_completion.d/npm
\#\#\#-begin-npm-completion-\#\#\#
\#\#\#-end-npm-completion-\#\#\#
add-user (Add a registry user account)
adduser (Add a registry user account)
bin (Display npm bin folder)
bugs (Bugs for a package in a web browser maybe)
c (Manage the npm configuration files)
cache (Manipulates package's cache)
config (Manage the npm configuration files)
ddp (Reduce duplication)
dedupe (Reduce duplication)
deprecate (Deprecate a version of a package)
docs (Docs for a package in a web browser maybe)
edit (Edit an installed package)
elif\ type\ compctl\ \&\>/dev/null\;\ then
elif\ type\ compdef\ \&\>/dev/null\;\ then
explore (Browse an installed package)
faq (Frequently Asked Questions)
fi
find (Search for packages)
find-dupes (Reduce duplication)
get (Echo the config value to stdout)
help-search (Search npm help documentation)
home (Docs for a package in a web browser maybe)
i (install a package)
if\ type\ complete\ \&\>/dev/null\;\ then
info (View registry info)
install (install a package)
isntall (install a package)
issues (Bugs for a package in a web browser maybe)
la (List installed packages)
link (Symlink a package folder)
list (List installed packages)
ll (List installed packages)
╰
fish, version 2.3.0
╰
fnm v1.8.0
╰
fisherman version 2.10.0 ~/.config/fish/functions/fisher.fish
╰
3.10.1
╰
No command 'nvm' found
from fish-nvm.
Btw fnm has nothing to do with nvm.
Now, I was able to repro the problem with npm completions.
npm completions work okay with verman (which is what I use now).
Would you mind trying out verman also to see if npm completions work fine for you? That would help me determine this is a problem with how fnm creates the npm shim or npm (completions) itself.
https://github.com/fisherman/verman
from fish-nvm.
With verman
from fish-nvm.
I think the problem may be simply that fnm's npm shim is not inheriting npm completions. This should be doable adding --wraps=npm
to the function definition, maybe.
from fish-nvm.
I think it has to do with fish-shell npm completions https://github.com/fish-shell/fish-shell/blob/master/share/completions/npm.fish
As soon I renamed the file /usr/share/fish/completions/npm.fish
there's no more auto complete with "garbage". So now I need to discover if the problem is with Bass or with this plugin
from fish-nvm.
@nomaed It seems after all that the problem was not with the plugin, but with the official completions from fish shell, you can read more about it here fish-shell/fish-shell#3159
And the commit that fixes it fish-shell/fish-shell@10661bb :
The next release of fish shell will have the completions fixed but until then you can fix them manually by doing this:
wget https://raw.githubusercontent.com/fish-shell/fish-shell/master/share/completions/npm.fish
and then do sudo mv npm.fish /usr/share/fish/completions/
from fish-nvm.
That is great, thank you for following it up!
from fish-nvm.
Related Issues (20)
- Infinite loop / infinite recursion HOT 16
- Can't launch node REPL anymore HOT 8
- Error: Cannot find module 'prompt' HOT 2
- Fish nvm: 'node' is currently not installed, try running npm i -g node HOT 7
- Breaks `which`? HOT 11
- Autocomplete is very slow HOT 3
- Update Docs HOT 2
- Breaks reverse search plugin
- Quesiton about lazy loading and the`init_nvm` event HOT 2
- nvm.sh must be linked/copied to $HOME/.nvm HOT 1
- Usage with "fundle"
- Node prints all output first when quitting the program HOT 2
- Error when using any nvm's node HOT 3
- Autocomplete very slow. HOT 1
- type: Invalid combination of options HOT 8
- How to uninstall? HOT 1
- Fish 3.2.2 update issue HOT 3
- Auto nvm use when detecting .nvmrc ? HOT 3
- .nvmrc should be searched by traversing the directory tree up HOT 1
- alias command is not defined HOT 1
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 fish-nvm.