Skip to content

Commit

Permalink
Revert "feat(none-ls.nvim): migrate from 'nvim-lint' to 'none-ls.nvim' (
Browse files Browse the repository at this point in the history
#263)"

This reverts commit e9cf316.
  • Loading branch information
linrongbin16 committed Oct 3, 2023
1 parent e9cf316 commit 09e2135
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 66 deletions.
34 changes: 7 additions & 27 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ 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

# mason-lspconfig.nvim
# lsp management
$MasonLspconfigHome = "$NVIM_HOME\lua\configs\williamboman\mason-lspconfig-nvim"
$MasonLspconfigEnsureInstalled = "$MasonLspconfigHome\ensure_installed.lua"
if (-not(TestReparsePoint $MasonLspconfigEnsureInstalled) -and -not(Test-Path $MasonLspconfigEnsureInstalled))
Expand All @@ -155,37 +154,18 @@ 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"
}

# 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
$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_HOME\neoconf.json"
if (-not(TestReparsePoint $Neoconf) -and -not(Test-Path $Neoconf))
{
Expand Down
32 changes: 7 additions & 25 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ nvim_config() {
mkdir -p $HOME/.config
try_backup $HOME/.nvim
ln -s $NVIM_HOME $HOME/.nvim

# mason-lspconfig.nvim
# lsp management
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
Expand All @@ -98,33 +97,16 @@ 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

# 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 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
local neoconf="$NVIM_HOME/neoconf.json"
if [ ! -f $neoconf ]; then
cp $NVIM_HOME/neoconf_sample.json $neoconf
Expand Down Expand Up @@ -174,4 +156,4 @@ npm_dependency
guifont_dependency
nvim_config

message "install for $OS - done"
message "install for $OS - done"
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
-- * [null-ls BUILTINS](https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md) and install them from mason.

local ensure_installed = {
-- "luacheck", -- lua
"eslint_d", -- javascript/typescript
"markdownlint", -- markdown
"stylua", -- lua formatter
"prettier", -- js,ts,json,html,css,etc formatter
"eslint", -- js,ts,json,html,css,etc diagnostic
}

return ensure_installed
return ensure_installed
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ local null_ls = require("null-ls")

local setup_handlers = {
-- Custom setup.
stylua = function(source, methods)
null_ls.register(null_ls.builtins.formatting.stylua)
end,
}

return setup_handlers
return setup_handlers
13 changes: 4 additions & 9 deletions lua/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,27 +200,22 @@ local M = {
config = lua_config("williamboman/mason-lspconfig.nvim"),
},
{
"nvimtools/none-ls.nvim",
event = { VeryLazy, BufReadPre, BufNewFile, CmdlineEnter },
},
{
"jay-babu/mason-null-ls.nvim",
"stevearc/conform.nvim",
event = { VeryLazy, BufReadPre, BufNewFile, CmdlineEnter },
dependencies = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"nvimtools/none-ls.nvim",
},
config = lua_config("jay-babu/mason-null-ls.nvim"),
config = lua_config("stevearc/conform.nvim"),
},
{
"stevearc/conform.nvim",
"mfussenegger/nvim-lint",
event = { VeryLazy, BufReadPre, BufNewFile, CmdlineEnter },
dependencies = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
},
config = lua_config("stevearc/conform.nvim"),
config = lua_config("mfussenegger/nvim-lint"),
},
-- Auto-complete engine
{
Expand Down

0 comments on commit 09e2135

Please sign in to comment.