Last active
May 15, 2023 09:03
-
-
Save stekks/e8c935a81f3e0c0cbffe36e21fd7b87c to your computer and use it in GitHub Desktop.
Start Neovim with different configs in Powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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