Skip to content

Snippets

not edited this page Jan 27, 2023 · 19 revisions

Neovim

Snippets can be found in the lilvim wiki.

Elvish

use str

# Clone remote repository and change to created directory
#
# @usage
# clone mvllow/colorish
# clone rose-pine/neovim rose-pine-neovim
fn clone {|repo @rest|
	var _ name = (str:split / $repo)
	git clone [email protected]:$repo.git $@rest
	cd (coalesce $@rest $name)
}

Zsh

# Clone remote repository and change to created directory
#
# @usage
# clone mvllow/colorish
# clone rose-pine/neovim rose-pine-neovim
clone() {
	repo=$1
	name=${repo#*/}

	git clone [email protected]:$repo.git ${@:2}

	if [ -n "$2" ]; then
		cd $2
	else
		cd $name
	fi
}
Clone this wiki locally