Skip to content

Instantly share code, notes, and snippets.

@stekks
Last active May 15, 2023 09:03
Show Gist options
  • Save stekks/e8c935a81f3e0c0cbffe36e21fd7b87c to your computer and use it in GitHub Desktop.
Save stekks/e8c935a81f3e0c0cbffe36e21fd7b87c to your computer and use it in GitHub Desktop.
Start Neovim with different configs in Powershell
# Start NeoVim (>0.9) with different configurations. See: https://www.youtube.com/watch?v=LkHjJlSgKZY
# Unfortunately aliases are very limited so I opted for a function and it isn't possible to bind hotkeys AFAIK.
#
# Add this to $PROFILE
# in $items add the name of the config directory (in the same root as the orginal 'nvim' directory)
#
# The 'nvim_lazy' function is an 'alias' to directly start an nvim with a configuration.
# The 'nvims' function lets you choose a config using 'fzf'. (be sure to have 'fzf' installed, I use Scoop to install Powershell tools)
#
function nvim_lazy()
{
$env:NVIM_APPNAME="nvim-lazy"
nvim $args
}
function nvims()
{
$items = "default", "nvim-lazy"
$config = $items | fzf --prompt=" Neovim Config  " --height=~50% --layout=reverse --border --exit-0
if ([string]::IsNullOrEmpty($config))
{
Write-Output "Nothing selected"
break
}
if ($config -eq "default")
{
$config = ""
}
$env:NVIM_APPNAME=$config
nvim $args
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment