This commit is contained in:
sankalp committed 2024-08-26 10:11:28 +05:45
1 parent 847238c1bc
commit 35a8122396
13 files changed
+363 -146

No files matched your search

+5 -1
View File
@@ -21,7 +21,11 @@ return {
{
'zapling/mason-lock.nvim',
cmd = { 'MasonLock', 'MasonLockRestore' },
opts = {},
config = function()
require('mason-lock').setup({
lockfile_path = vim.fn.stdpath('config') .. '/lua/mason-lock.json', -- (default)
})
end,
},
{
'2kabhishek/nerdy.nvim',
+22 -3
View File
@@ -1,10 +1,27 @@
-- Define conform.nvim formatting servers here
local formatting_servers = {
'prettier',
'isort',
'clang-format',
'black',
'stylua',
'shfmt',
'php-cs-fixer',
'google-java-formatter',
'codespell',
}
return {
'stevearc/conform.nvim',
enabled = true,
dependencies = { 'zapling/mason-conform.nvim' },
event = { 'BufReadPre', 'BufNewFile' },
cmd = { 'ConformInfo' },
config = function()
local conform = require('conform')
require('mason-conform').setup({
ensure_installed = formatting_servers,
automatic_installation = true,
})
conform.setup({
formatters_by_ft = {
cpp = { 'clang-format' },
@@ -17,7 +34,7 @@ return {
html = { 'prettier' },
json = { 'prettier' },
yaml = { 'prettier' },
markdown = { 'prettier' },
markdown = { 'prettier', 'markdownlint' },
lua = { 'stylua' },
python = { 'isort', 'black' },
php = { 'php-cs-fixer' },
@@ -26,6 +43,8 @@ return {
liquid = { 'prettier' },
bash = { 'shfmt' },
sh = { 'shfmt' },
['*'] = { 'codespell' },
['_'] = { 'trim_whitespace' },
},
format_on_save = function(bufnr)
-- Disable with a global or buffer-local variable
+26 -7
View File
@@ -1,8 +1,30 @@
-- Define nvim-lint linters here
local linting_servers = {
'cpplint',
'eslint_d',
'cspell',
'ruff',
'mypy',
'trivy',
'phpcs',
'markdownlint',
}
return {
'mfussenegger/nvim-lint',
dependencies = {
'rshkarin/mason-nvim-lint',
},
event = { 'BufReadPre', 'BufNewFile' },
opts = {
linters_by_ft = {
config = function()
local lint = require('lint')
require('mason-nvim-lint').setup({
ensure_installed = linting_servers,
automatic_installation = true,
})
lint.linters_by_ft = {
lua = { 'selene' },
cpp = { 'cpplint' },
c = { 'cpplint' },
@@ -14,12 +36,9 @@ return {
markdown = { 'markdownlint' },
java = { 'trivy' },
php = { 'phpcs' },
},
},
config = function()
local lint = require('lint')
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
}
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = lint_augroup,
callback = function()
+14 -5
View File
@@ -5,6 +5,7 @@ return {
dependencies = {
'hrsh7th/cmp-nvim-lsp',
{ 'antosha417/nvim-lsp-file-operations', config = true },
'williamboman/mason-lspconfig.nvim',
},
config = function()
require('configs.lsp')
@@ -13,12 +14,20 @@ return {
{
'williamboman/mason.nvim',
cmd = { 'Mason', 'MasonInstall', 'MasonInstallAll', 'MasonUpdate' },
dependencies = {
'williamboman/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim',
},
config = function()
require('mason').setup()
-- import mason
local mason = require('mason')
-- enable mason and configure icons
mason.setup({
ui = {
icons = {
package_installed = '✓',
package_pending = '➜',
package_uninstalled = '✗',
},
},
})
end,
},
-- {
+5 -7
View File
@@ -72,12 +72,10 @@ return {
end,
},
{
{
'nvim-treesitter/nvim-treesitter-context',
event = 'VeryLazy',
config = function()
require('treesitter-context').setup({ mode = 'cursor', max_lines = 3 })
end,
},
'nvim-treesitter/nvim-treesitter-context',
event = 'VeryLazy',
config = function()
require('treesitter-context').setup({ mode = 'cursor', max_lines = 3 })
end,
},
}