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. -- Encoding.
vim.scriptencoding = 'utf-8'
vim.o.encoding = 'utf-8' vim.o.encoding = 'utf-8'
vim.o.fileencoding = 'utf-8' vim.o.fileencoding = 'utf-8'
-- Backups.
vim.o.backup = false vim.o.backup = false
vim.o.swapfile = false vim.o.swapfile = false
@ -9,14 +12,14 @@ vim.o.number = true
vim.o.relativenumber = true vim.o.relativenumber = true
vim.o.colorcolumn = '79' vim.o.colorcolumn = '79'
vim.o.signcolumn = 'yes' vim.o.signcolumn = 'yes'
vim.o.cursorline = true
vim.o.guicursor = ''
-- Tabs. -- Tabs.
vim.o.tabstop = 2 vim.o.tabstop = 2
vim.o.shiftwidth = 2 vim.o.shiftwidth = 2
-- vim.o.expandtab = true
-- Etc. -- Etc.
vim.o.guicursor = ''
vim.o.clipboard = 'unnamedplus' vim.o.clipboard = 'unnamedplus'
-- View. -- View.
@ -25,8 +28,8 @@ vim.g.netrw_liststyle = 3
vim.o.list = true vim.o.list = true
vim.opt.listchars:append 'space:⋅' vim.opt.listchars:append 'space:⋅'
vim.opt.listchars:append 'tab:┊ '
-- vim.opt.listchars:append 'eol:↴' -- vim.opt.listchars:append 'eol:↴'
-- vim.opt.listchars:append 'tab:>-'
-- Mappings tabs. -- Mappings tabs.
vim.keymap.set('n', '<C-h>', ':-tabmove<CR>') 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 if (not status) then return end
blankline.setup { ibl.setup {
char = '', indent = {
show_trailing_blankline_indent = false, char = ''
-- for example, context is off by default, use this to turn it on }
-- show_current_context = true,
-- show_current_context_start = true,
} }

View File

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

View File

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

View File

@ -1,15 +1,16 @@
-- Null-ls. -- Null-ls.
local status_null_ls, null_ls = pcall(require, 'null-ls') local status, null_ls = pcall(require, 'null-ls')
if (not status_null_ls) then return end if (not status) then return end
-- Config.
local prettier_config = vim.fn.stdpath('config') .. '/lua/axp/plugins/null-ls/.prettierrc' local prettier_config = vim.fn.stdpath('config') .. '/lua/axp/plugins/null-ls/.prettierrc'
local formatting = null_ls.builtins.formatting local formatting = null_ls.builtins.formatting
-- local diagnostics = null_ls.builtins.diagnostics
-- Init. -- Init.
null_ls.setup { null_ls.setup {
sources = { sources = {},
formatting.prettier.with({ extra_args = { "--config", prettier_config } }) 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 if (not status) then return end
ts.setup { ts.setup {
-- A list of parser names, or 'all' (the four listed parsers should always be installed)
ensure_installed = { ensure_installed = {
'dockerfile', 'dockerfile',
'lua', 'lua',
@ -10,6 +9,7 @@ ts.setup {
'bash', 'bash',
'javascript', 'javascript',
'typescript', 'typescript',
'tsx',
'json', 'json',
'html', 'html',
'pug', 'pug',
@ -23,42 +23,17 @@ ts.setup {
'astro', 'astro',
'cmake' 'cmake'
}, },
ignore_install = {},
-- Install parsers synchronously (only applied to `ensure_installed`) modules = {},
sync_install = false, 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, auto_install = true,
autotag = { enable = 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')!
highlight = { highlight = {
enable = true, enable = true,
disable = {},
-- 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 indent = {
-- the name of the parser) enable = true,
-- list of language that will be disabled disable = {}
-- 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,
} }
} }

View File

@ -49,8 +49,8 @@ local function save_profiles(threshold)
end end
time([[Luarocks path setup]], true) 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 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.0-beta3/lib/lua/5.1/?.so" 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 if not string.find(package.path, package_path_str, 1, true) then
package.path = package.path .. ';' .. package_path_str package.path = package.path .. ';' .. package_path_str
end end
@ -109,11 +109,6 @@ _G.packer_plugins = {
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/nightfox.nvim", path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/nightfox.nvim",
url = "https://github.com/EdenEast/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"] = { ["nvim-autopairs"] = {
loaded = true, loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/nvim-autopairs", 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", path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/plenary.nvim",
url = "https://github.com/nvim-lua/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"] = { ["telescope.nvim"] = {
loaded = true, loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/telescope.nvim", path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/telescope.nvim",