diff --git a/install.ps1 b/install.ps1 index 3c8aac53..5603877c 100644 --- a/install.ps1 +++ b/install.ps1 @@ -142,7 +142,8 @@ function NvimConfig() Message "install $NVIM_HOME for neovim on windows" TryBackup $env:USERPROFILE\.nvim Start-Process powershell "cmd /c mklink $env:USERPROFILE\.nvim $NVIM_HOME /D" -Verb RunAs -Wait - # lsp management + + # mason-lspconfig.nvim $MasonLspconfigHome = "$NVIM_HOME\lua\configs\williamboman\mason-lspconfig-nvim" $MasonLspconfigEnsureInstalled = "$MasonLspconfigHome\ensure_installed.lua" if (-not(TestReparsePoint $MasonLspconfigEnsureInstalled) -and -not(Test-Path $MasonLspconfigEnsureInstalled)) @@ -154,18 +155,37 @@ function NvimConfig() { Copy-Item -Path "$MasonLspconfigHome\setup_handlers_sample.lua" -Destination "$MasonLspconfigSetupHandlers" } + + # mason-null-ls.nvim + $MasonNulllsHome = "$NVIM_HOME\lua\configs\jay-babu\mason-null-ls-nvim" + $MasonNulllsEnsureInstalled = "$MasonNulllsHome\ensure_installed.lua" + if (-not(TestReparsePoint $MasonNulllsEnsureInstalled) -and -not(Test-Path $MasonNulllsEnsureInstalled)) + { + Copy-Item -Path "$MasonNulllsHome\ensure_installed_sample.lua" -Destination "$MasonNulllsEnsureInstalled" + } + $MasonNulllsSetupHandlers = "$MasonNulllsHome\setup_handlers.lua" + if (-not(TestReparsePoint $MasonNulllsSetupHandlers) -and -not(Test-Path $MasonNulllsSetupHandlers)) + { + Copy-Item -Path "$MasonNulllsHome\setup_handlers_sample.lua" -Destination "$MasonNulllsSetupHandlers" + } + + # conform.nvim $ConformHome = "$NVIM_HOME\lua\configs\stevearc\conform-nvim" $ConformFormattersByFt = "$ConformHome\formatters_by_ft.lua" if (-not(TestReparsePoint $ConformFormattersByFt) -and -not(Test-Path $ConformFormattersByFt)) { Copy-Item -Path "$ConformHome\formatters_by_ft_sample.lua" -Destination "$ConformFormattersByFt" } - $NvimLintHome="$NVIM_HOME\lua\configs\mfussenegger\nvim-lint" - $NvimLintLintersByFt="$NvimLintHome\linters_by_ft.lua" - if (-not(TestReparsePoint $NvimLintLintersByFt) -and -not(Test-Path $NvimLintLintersByFt)) - { - Copy-Item -Path "$NvimLintHome\linters_by_ft_sample.lua" -Destination "$NvimLintLintersByFt" - } + + # nvim-lint + # $NvimLintHome="$NVIM_HOME\lua\configs\mfussenegger\nvim-lint" + # $NvimLintLintersByFt="$NvimLintHome\linters_by_ft.lua" + # if (-not(TestReparsePoint $NvimLintLintersByFt) -and -not(Test-Path $NvimLintLintersByFt)) + # { + # Copy-Item -Path "$NvimLintHome\linters_by_ft_sample.lua" -Destination "$NvimLintLintersByFt" + # } + + # neoconf.nvim $Neoconf = "$NVIM_HOME\neoconf.json" if (-not(TestReparsePoint $Neoconf) -and -not(Test-Path $Neoconf)) { diff --git a/install.sh b/install.sh index f364b545..17c6febd 100755 --- a/install.sh +++ b/install.sh @@ -87,7 +87,8 @@ nvim_config() { mkdir -p $HOME/.config try_backup $HOME/.nvim ln -s $NVIM_HOME $HOME/.nvim - # lsp management + + # mason-lspconfig.nvim local mason_lspconfig_home="$NVIM_HOME/lua/configs/williamboman/mason-lspconfig-nvim" local mason_lspconfig_ensure_installed="$mason_lspconfig_home/ensure_installed.lua" if [ ! -f $mason_lspconfig_ensure_installed ]; then @@ -97,16 +98,33 @@ nvim_config() { if [ ! -f $mason_lspconfig_setup_handlers ]; then cp $mason_lspconfig_home/setup_handlers_sample.lua $mason_lspconfig_setup_handlers fi + + # mason-null-ls.nvim + local mason_null_ls_home="$NVIM_HOME/lua/configs/jay-babu/mason-null-ls-nvim" + local mason_null_ls_ensure_installed="$mason_null_ls_home/ensure_installed.lua" + if [ ! -f $mason_null_ls_ensure_installed ]; then + cp $mason_null_ls_home/ensure_installed_sample.lua $mason_null_ls_ensure_installed + fi + local mason_null_ls_setup_handlers="$mason_null_ls_home/setup_handlers.lua" + if [ ! -f $mason_null_ls_setup_handlers ]; then + cp $mason_null_ls_home/setup_handlers_sample.lua $mason_null_ls_setup_handlers + fi + + # conform.nvim local conform_home="$NVIM_HOME/lua/configs/stevearc/conform-nvim" local conform_formatters_by_ft="$conform_home/formatters_by_ft.lua" if [ ! -f $conform_formatters_by_ft ]; then cp $conform_home/formatters_by_ft_sample.lua $conform_formatters_by_ft fi - local nvim_lint_home="$NVIM_HOME/lua/configs/mfussenegger/nvim-lint" - local nvim_lint_linters_by_ft="$nvim_lint_home/linters_by_ft.lua" - if [ ! -f $nvim_lint_linters_by_ft ]; then - cp $nvim_lint_home/linters_by_ft_sample.lua $nvim_lint_linters_by_ft - fi + + # nvim-lint + # local nvim_lint_home="$NVIM_HOME/lua/configs/mfussenegger/nvim-lint" + # local nvim_lint_linters_by_ft="$nvim_lint_home/linters_by_ft.lua" + # if [ ! -f $nvim_lint_linters_by_ft ]; then + # cp $nvim_lint_home/linters_by_ft_sample.lua $nvim_lint_linters_by_ft + # fi + + # neoconf.nvim local neoconf="$NVIM_HOME/neoconf.json" if [ ! -f $neoconf ]; then cp $NVIM_HOME/neoconf_sample.json $neoconf @@ -156,4 +174,4 @@ npm_dependency guifont_dependency nvim_config -message "install for $OS - done" +message "install for $OS - done" \ No newline at end of file diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index d7e62139..e10d8fca 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -200,22 +200,27 @@ local M = { config = lua_config("williamboman/mason-lspconfig.nvim"), }, { - "stevearc/conform.nvim", + "nvimtools/none-ls.nvim", + event = { VeryLazy, BufReadPre, BufNewFile, CmdlineEnter }, + }, + { + "jay-babu/mason-null-ls.nvim", event = { VeryLazy, BufReadPre, BufNewFile, CmdlineEnter }, dependencies = { "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim", + "nvimtools/none-ls.nvim", }, - config = lua_config("stevearc/conform.nvim"), + config = lua_config("jay-babu/mason-null-ls.nvim"), }, { - "mfussenegger/nvim-lint", + "stevearc/conform.nvim", event = { VeryLazy, BufReadPre, BufNewFile, CmdlineEnter }, dependencies = { "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim", }, - config = lua_config("mfussenegger/nvim-lint"), + config = lua_config("stevearc/conform.nvim"), }, -- Auto-complete engine {