remove null-ls

This commit is contained in:
AntoXa PRO 2023-09-29 12:40:41 +03:00
parent 4f44577d1b
commit f0f0a978a0
9 changed files with 88 additions and 78 deletions

View File

@ -1,6 +1,9 @@
-- Encoding.
vim.scriptencoding = 'utf-8'
vim.o.encoding = 'utf-8'
vim.o.fileencoding = 'utf-8'
-- Backups.
vim.o.backup = false
vim.o.swapfile = false
@ -9,14 +12,14 @@ vim.o.number = true
vim.o.relativenumber = true
vim.o.colorcolumn = '79'
vim.o.signcolumn = 'yes'
vim.o.cursorline = true
vim.o.guicursor = ''
-- Tabs.
vim.o.tabstop = 2
vim.o.shiftwidth = 2
-- vim.o.expandtab = true
-- Etc.
vim.o.guicursor = ''
vim.o.clipboard = 'unnamedplus'
-- View.
@ -25,8 +28,8 @@ vim.g.netrw_liststyle = 3
vim.o.list = true
vim.opt.listchars:append 'space:⋅'
vim.opt.listchars:append 'tab:┊ '
-- vim.opt.listchars:append 'eol:↴'
-- vim.opt.listchars:append 'tab:>-'
-- Mappings tabs.
vim.keymap.set('n', '<C-h>', ':-tabmove<CR>')

View File

@ -1,10 +1,8 @@
local status, blankline = pcall(require, 'indent_blankline')
local status, ibl = pcall(require, 'ibl')
if (not status) then return end
blankline.setup {
char = '',
show_trailing_blankline_indent = false,
-- for example, context is off by default, use this to turn it on
-- show_current_context = true,
-- show_current_context_start = true,
ibl.setup {
indent = {
char = ''
}
}

View File

@ -22,14 +22,15 @@ M.list = {
'hrsh7th/cmp-nvim-lsp',
--- Null-ls.
'jose-elias-alvarez/null-ls.nvim',
-- 'jose-elias-alvarez/null-ls.nvim',
'MunifTanjim/prettier.nvim',
-- Autocompletion
'L3MON4D3/LuaSnip',
'hrsh7th/nvim-cmp'
}
M.init = function ()
M.init = function()
-- Etc.
require('axp.plugins.autopairs')
require('axp.plugins.comment')
@ -38,14 +39,15 @@ M.init = function ()
-- View.
require('axp.plugins.nightfox')
-- require('axp.plugins.lualine')
require('axp.plugins.blankline')
-- require('axp.plugins.lualine')
-- Lsp.
require('axp.plugins.lsp')
-- Null-ls.
require('axp.plugins.null-ls')
-- require('axp.plugins.null-ls')
require('axp.plugins.prettier')
-- Autocompletion
require('axp.plugins.luasnip')

View File

@ -15,24 +15,22 @@ local servers = {
lua_ls = {
Lua = {
diagnostics = {
-- Get the language server to recognize the 'vim' global.
globals = { 'vim' }
},
workspace = { checkThirdParty = false },
telemetry = { enable = false },
workspace = {
library = vim.api.nvim_get_runtime_file('', true),
checkThirdParty = false
}
},
},
bashls = {},
clangd = {},
cmake = {},
tsserver = {},
dockerls = {},
volar = {},
astro = {},
html = {},
cssls = {},
tsserver = {},
volar = {},
dockerls = {},
jsonls = {},
pyright = {},
yamlls = {}
}
@ -74,9 +72,9 @@ local on_attach = function(_, bufnr)
end, '[W]orkspace [L]ist Folders')
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
vim.lsp.buf.format()
end, { desc = 'Format current buffer with LSP' })
-- vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
-- vim.lsp.buf.format()
-- end, { desc = 'Format current buffer with LSP' })
end
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
@ -94,10 +92,13 @@ mason_lspconfig.setup {
-- Mason configure servers.
mason_lspconfig.setup_handlers {
function(server_name)
lspconfig[server_name].setup {
capabilities = capabilities,
local config = {
on_attach = on_attach,
capabilities = capabilities,
settings = servers[server_name],
}
lspconfig[server_name].setup(config)
end
}

View File

@ -1,15 +1,16 @@
-- Null-ls.
local status_null_ls, null_ls = pcall(require, 'null-ls')
if (not status_null_ls) then return end
local status, null_ls = pcall(require, 'null-ls')
if (not status) then return end
-- Config.
local prettier_config = vim.fn.stdpath('config') .. '/lua/axp/plugins/null-ls/.prettierrc'
local formatting = null_ls.builtins.formatting
-- local diagnostics = null_ls.builtins.diagnostics
-- Init.
null_ls.setup {
sources = {
formatting.prettier.with({ extra_args = { "--config", prettier_config } })
}
sources = {},
on_attach = function (client, bufnr)
if client.supports_method('textDocument/formatting') then
print('Test textDocument/formatting')
end
end
}

View File

@ -0,0 +1,15 @@
-- Null-ls.
local status_null_ls, null_ls = pcall(require, 'null-ls')
if (not status_null_ls) then return end
-- Config.
local prettier_config = vim.fn.stdpath('config') .. '/lua/axp/plugins/null-ls/.prettierrc'
local formatting = null_ls.builtins.formatting
-- local diagnostics = null_ls.builtins.diagnostics
-- Init.
null_ls.setup {
sources = {
formatting.prettier.with({ extra_args = { "--config", prettier_config } })
}
}

View File

@ -0,0 +1,15 @@
local status, prettier = pcall(require, 'prettier')
if (not status) then return end
prettier.setup {
bin = 'prettier',
filetype = {
'html',
'typescript',
'typescriptreact',
'css',
'sass',
'scss',
'json'
}
}

View File

@ -2,7 +2,6 @@ local status, ts = pcall(require, 'nvim-treesitter.configs')
if (not status) then return end
ts.setup {
-- A list of parser names, or 'all' (the four listed parsers should always be installed)
ensure_installed = {
'dockerfile',
'lua',
@ -10,6 +9,7 @@ ts.setup {
'bash',
'javascript',
'typescript',
'tsx',
'json',
'html',
'pug',
@ -23,42 +23,17 @@ ts.setup {
'astro',
'cmake'
},
-- Install parsers synchronously (only applied to `ensure_installed`)
ignore_install = {},
modules = {},
sync_install = false,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
-- List of parsers to ignore installing (for 'all')
-- ignore_install = { 'javascript' },
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
-- parser_install_dir = '/some/path/to/store/parsers', -- Remember to run vim.opt.runtimepath:append('/some/path/to/store/parsers')!
autotag = { enable = true },
highlight = {
enable = true,
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
-- the name of the parser)
-- list of language that will be disabled
-- disable = { 'c', 'rust' },
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
disable = {},
},
indent = {
enable = true,
disable = {}
}
}

View File

@ -49,8 +49,8 @@ local function save_profiles(threshold)
end
time([[Luarocks path setup]], true)
local package_path_str = "/home/antoxa/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/antoxa/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/antoxa/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/antoxa/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
local install_cpath_pattern = "/home/antoxa/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so"
local package_path_str = "/home/antoxa/.cache/nvim/packer_hererocks/2.1.1694285958/share/lua/5.1/?.lua;/home/antoxa/.cache/nvim/packer_hererocks/2.1.1694285958/share/lua/5.1/?/init.lua;/home/antoxa/.cache/nvim/packer_hererocks/2.1.1694285958/lib/luarocks/rocks-5.1/?.lua;/home/antoxa/.cache/nvim/packer_hererocks/2.1.1694285958/lib/luarocks/rocks-5.1/?/init.lua"
local install_cpath_pattern = "/home/antoxa/.cache/nvim/packer_hererocks/2.1.1694285958/lib/lua/5.1/?.so"
if not string.find(package.path, package_path_str, 1, true) then
package.path = package.path .. ';' .. package_path_str
end
@ -109,11 +109,6 @@ _G.packer_plugins = {
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/nightfox.nvim",
url = "https://github.com/EdenEast/nightfox.nvim"
},
["null-ls.nvim"] = {
loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/null-ls.nvim",
url = "https://github.com/jose-elias-alvarez/null-ls.nvim"
},
["nvim-autopairs"] = {
loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/nvim-autopairs",
@ -144,6 +139,11 @@ _G.packer_plugins = {
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/plenary.nvim",
url = "https://github.com/nvim-lua/plenary.nvim"
},
["prettier.nvim"] = {
loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/prettier.nvim",
url = "https://github.com/MunifTanjim/prettier.nvim"
},
["telescope.nvim"] = {
loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/telescope.nvim",