oh my fish, bass and nvm
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
set -gx EDITOR vim
|
set -gx EDITOR vim
|
||||||
|
load_nvm
|
||||||
|
|||||||
16
.config/fish/functions/load_nvm.fish
Normal file
16
.config/fish/functions/load_nvm.fish
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
function load_nvm --on-variable="PWD"
|
||||||
|
set -l default_node_version (nvm version default)
|
||||||
|
set -l node_version (nvm version)
|
||||||
|
set -l nvmrc_path (nvm_find_nvmrc)
|
||||||
|
if test -n "$nvmrc_path"
|
||||||
|
set -l nvmrc_node_version (nvm version (cat $nvmrc_path))
|
||||||
|
if test "$nvmrc_node_version" = "N/A"
|
||||||
|
nvm install (cat $nvmrc_path)
|
||||||
|
else if test nvmrc_node_version != node_version
|
||||||
|
nvm use $nvmrc_node_version
|
||||||
|
end
|
||||||
|
else if test "$node_version" != "$default_node_version"
|
||||||
|
echo "Reverting to default Node version"
|
||||||
|
nvm use default
|
||||||
|
end
|
||||||
|
end
|
||||||
3
.config/fish/functions/nvm.fish
Normal file
3
.config/fish/functions/nvm.fish
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
function nvm
|
||||||
|
bass source ~/.nvm/nvm.sh --no-use ';' nvm $argv
|
||||||
|
end
|
||||||
3
.config/fish/functions/nvm_find_nvmrc.fish
Normal file
3
.config/fish/functions/nvm_find_nvmrc.fish
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
function nvm_find_nvmrc
|
||||||
|
bass source ~/.nvm/nvm.sh --no-use ';' nvm_find_nvmrc
|
||||||
|
end
|
||||||
@@ -10,4 +10,8 @@ if [[ ! -f "/usr/bin/fish" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
chsh -s /usr/bin/fish
|
chsh -s /usr/bin/fish
|
||||||
|
/usr/bin/fish
|
||||||
|
curl -L https://get.oh-my.fish | fish
|
||||||
|
omf install cbjohnson
|
||||||
|
omf theme cbjohnson
|
||||||
|
omf install bass
|
||||||
|
|||||||
2
.config/install-scripts/005-nvm.sh
Normal file
2
.config/install-scripts/005-nvm.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
|
||||||
|
|
||||||
Reference in New Issue
Block a user