droped none-ls

This commit is contained in:
sankalp committed 2024-08-26 08:30:21 +05:45
1 parent c3d41436a1
commit 847238c1bc
17 files changed
+590 -604

No files matched your search

+66 -13
View File
@@ -14,6 +14,64 @@ return {
end,
},
},
{
"mg979/vim-visual-multi",
event = "BufReadPre",
keys = {
{
"<C-S-Down>",
":call vm#commands#add_cursor_down(0, v:count1)<cr>",
desc = "Add Cursor Down",
mode = { "n" },
noremap = true,
silent = true,
},
{
"<C-S-Up>",
":call vm#commands#add_cursor_up(0, v:count1)<cr>",
desc = "Add Cursor Up",
mode = { "n" },
noremap = true,
silent = true,
},
{
"<M-S-j>",
":call vm#commands#add_cursor_down(0, v:count1)<cr>",
desc = "Add Cursor Down",
mode = { "n" },
noremap = true,
silent = true,
},
{
"<M-S-k>",
":call vm#commands#add_cursor_up(0, v:count1)<cr>",
desc = "Add Cursor Down",
mode = { "n" },
noremap = true,
silent = true,
},
{
"<M-d>",
":call vm#commands#ctrln(v:count1)<cr>",
desc = "Multi Edit Next",
mode = { "n" },
noremap = true,
silent = true,
},
},
config = function()
vim.g.VM_default_mappings = 0
vim.g.VM_silent_exit = 1
vim.g.VM_set_statusline = 0
vim.g.VM_maps = {
["Find Under"] = "",
}
vim.g.VM_maps["I BS"] = ""
vim.g.VM_maps["I CtrlC"] = ""
vim.g.VM_maps["I CtrlN"] = ""
end,
},
{
"CRAG666/code_runner.nvim",
config = true,
@@ -65,23 +123,18 @@ return {
},
{
"hrsh7th/nvim-cmp",
event = { "InsertEnter" },
event = { "InsertEnter", "CmdlineEnter" },
dependencies = {
-- autocomplete plugins
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-buffer", -- source for text in buffer
"hrsh7th/cmp-path", -- source for file system paths
"hrsh7th/cmp-cmdline",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-nvim-lua",
"saadparwaiz1/cmp_luasnip",
-- "hrsh7th/cmp-nvim-lsp-signature-help",
-- "hrsh7th/cmp-calc",
-- vscode like icons to autocomplete list
"onsails/lspkind.nvim",
-- snippet plugin
{ "L3MON4D3/LuaSnip", event = { "BufReadPost", "BufNewFile" } },
{ "rafamadriz/friendly-snippets", event = { "BufReadPost", "BufNewFile" } },
"saadparwaiz1/cmp_luasnip", --for autocomplete
"hrsh7th/cmp-nvim-lsp-signature-help",
"onsails/lspkind.nvim", -- vs-code like pictograms
"L3MON4D3/LuaSnip", -- snippets
"rafamadriz/friendly-snippets", -- useful snippets
},
config = function()
require("configs.cmp")
+174
View File
@@ -0,0 +1,174 @@
return {
{
'ThePrimeagen/refactoring.nvim',
config = function()
require('refactoring').setup()
-- vim.keymap.set("x", "<leader>re", ":Refactor extract ")
-- vim.keymap.set("x", "<leader>rf", ":Refactor extract_to_file ")
-- vim.keymap.set("x", "<leader>rv", ":Refactor extract_var ")
-- vim.keymap.set({ "n", "x" }, "<leader>ri", ":Refactor inline_var")
-- vim.keymap.set("n", "<leader>rI", ":Refactor inline_func")
-- vim.keymap.set("n", "<leader>rb", ":Refactor extract_block")
-- vim.keymap.set("n", "<leader>rbf", ":Refactor extract_block_to_file")
-- load refactoring Telescope extension
require('telescope').load_extension('refactoring')
vim.keymap.set({ 'n', 'x' }, '<leader>rr', function()
require('telescope').extensions.refactoring.refactors()
end, { desc = 'Refactor' })
end,
},
{
'zapling/mason-lock.nvim',
cmd = { 'MasonLock', 'MasonLockRestore' },
opts = {},
},
{
'2kabhishek/nerdy.nvim',
dependencies = { 'stevearc/dressing.nvim' },
cmd = 'Nerdy',
},
{
'folke/persistence.nvim',
event = 'BufReadPre',
opts = { options = vim.opt.sessionoptions:get() },
keys = {
{
'<leader>ms',
function()
require('persistence').load()
end,
desc = 'Restore Session',
},
{
'<leader>ml',
function()
require('persistence').load({ last = true })
end,
desc = 'Restore Last Session',
},
{
'<leader>md',
function()
require('persistence').stop()
end,
desc = "Don't Save Current Session",
},
},
},
{
'nvim-lua/plenary.nvim',
lazy = true,
},
{
'iamcco/markdown-preview.nvim',
build = 'cd app && yarn install',
ft = { 'markdown' },
keys = {
{
'<leader>cm',
'<cmd>MarkdownPreviewToggle<CR>',
desc = 'toggle markdown preview',
},
},
},
{
'nvim-pack/nvim-spectre',
build = false,
cmd = 'Spectre',
opts = { open_cmd = 'noswapfile vnew' },
keys = {
{
'<leader>mr',
function()
require('spectre').open()
end,
desc = 'Replace in Files (Spectre)',
},
},
},
{
'szw/vim-maximizer',
keys = {
{ '<leader>mm', '<cmd>MaximizerToggle<CR>', desc = 'Maximize/minimize a split' },
},
},
{
'folke/zen-mode.nvim',
cmd = { 'ZenMode' },
opts = {},
keys = {
{ '<leader>wz', '<cmd>ZenMode<cr>', desc = 'Toggle zen mode' },
},
},
{
'creativenull/dotfyle-metadata.nvim',
cmd = { 'DotfyleGenerate', 'DotfyleOpen' },
},
{
'willothy/flatten.nvim',
priority = 1001,
opts = {
window = {
open = 'alternate',
},
},
},
{
'wakatime/vim-wakatime',
event = { 'VimEnter' },
lazy = false,
},
{
'mvllow/modes.nvim',
event = { 'BufReadPost', 'BufNewFile' },
tag = 'v0.2.0',
config = function()
require('modes').setup({
colors = {
visual = '#f5c359',
delete = '#c75c6a',
copy = '#78ccc5',
insert = '#c5739a',
},
line_opacity = 0.15,
set_cursor = true,
set_cursorline = true,
set_number = true,
ignore_filetypes = { 'NvimTree', 'TelescopePrompt' },
})
end,
},
{
'LunarVim/bigfile.nvim',
event = { 'BufEnter', 'WinEnter' },
opts = {
-- Disables LSP/treesitter, etc for files above 5000 lives (even if they have really long lines)
pattern = function(bufnr, filesize_mib)
if filesize_mib >= 2 then
return true
end
-- you can't use `nvim_buf_line_count` because this runs on BufReadPre
local file_contents = vim.fn.readfile(vim.api.nvim_buf_get_name(bufnr))
local file_length = #file_contents
if file_length > 5000 then
return true
end
return false
end,
},
},
{
'm4xshen/hardtime.nvim',
config = function()
require('hardtime').setup({ enabled = true })
end,
cmd = 'Hardtime',
init = function()
vim.keymap.set('n', '<leader>ch', '<cmd>HardtimeToggle<cr>', { desc = 'Toggle Hardtime' })
end,
},
}
+61 -57
View File
@@ -1,63 +1,67 @@
return {
"stevearc/conform.nvim",
enabled = false,
event = { "BufReadPre", "BufNewFile" },
config = function()
local conform = require("conform")
'stevearc/conform.nvim',
enabled = true,
event = { 'BufReadPre', 'BufNewFile' },
config = function()
local conform = require('conform')
conform.setup({
formatters_by_ft = {
cpp = { "clang-format" },
c = { "clang-format" },
javascript = { "prettier" },
typescript = { "prettier" },
javascriptreact = { "prettier", "biome" },
typescriptreact = { "prettier" },
css = { "prettier" },
html = { "prettier" },
json = { "prettier" },
markdown = { "markdownlint", "prettier" },
lua = { "stylua" },
python = { "isort", "black" },
php = { "php-cs-fixer" },
java = { "google-java-formatter", "trivy" },
graphql = { "prettier" },
},
format_on_save = function(bufnr)
-- Disable with a global or buffer-local variable
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
return {
lsp_fallback = true,
async = false,
timeout_ms = 500,
}
end,
})
conform.setup({
formatters_by_ft = {
cpp = { 'clang-format' },
c = { 'clang-format' },
javascript = { 'prettier' },
typescript = { 'prettier' },
javascriptreact = { 'prettier' },
typescriptreact = { 'prettier' },
css = { 'prettier' },
html = { 'prettier' },
json = { 'prettier' },
yaml = { 'prettier' },
markdown = { 'prettier' },
lua = { 'stylua' },
python = { 'isort', 'black' },
php = { 'php-cs-fixer' },
java = { 'google-java-formatter' },
graphql = { 'prettier' },
liquid = { 'prettier' },
bash = { 'shfmt' },
sh = { 'shfmt' },
},
format_on_save = function(bufnr)
-- Disable with a global or buffer-local variable
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
return {
lsp_fallback = true,
async = false,
timeout_ms = 500,
}
end,
})
vim.keymap.set({ "n", "v" }, "<leader>cf", function()
conform.format({
lsp_fallback = true,
async = true,
timeout_ms = 1000,
})
end, { desc = "Format file or range (in visual mode)" })
vim.keymap.set({ 'n', 'v' }, '<leader>cff', function()
conform.format({
lsp_fallback = true,
async = true,
timeout_ms = 1000,
})
end, { desc = 'Format file or range (in visual mode)' })
vim.keymap.set({ "n" }, "<leader>cfb", function()
vim.b.disable_autoformat = not vim.b.disable_autoformat
vim.notify(
"Buffer auto-format on-save: " .. (vim.b.disable_autoformat and "OFF" or "ON"),
vim.log.levels.INFO
)
end, { desc = "Toggle auto-format on-save for buffer." })
vim.keymap.set({ 'n' }, '<leader>cfb', function()
vim.b.disable_autoformat = not vim.b.disable_autoformat
vim.notify(
'Buffer auto-format on-save: ' .. (vim.b.disable_autoformat and 'OFF' or 'ON'),
vim.log.levels.INFO
)
end, { desc = 'Toggle auto-format on-save for buffer.' })
vim.keymap.set({ "n" }, "<leader>ftg", function()
vim.g.disable_autoformat = not vim.g.disable_autoformat
vim.notify(
"Global auto-format on-save: " .. (vim.g.disable_autoformat and "OFF" or "ON"),
vim.log.levels.INFO
)
end, { desc = "Toggle auto-format on-save globally." })
end,
vim.keymap.set({ 'n' }, '<leader>cft', function()
vim.g.disable_autoformat = not vim.g.disable_autoformat
vim.notify(
'Global auto-format on-save: ' .. (vim.g.disable_autoformat and 'OFF' or 'ON'),
vim.log.levels.INFO
)
end, { desc = 'Toggle auto-format on-save globally.' })
end,
}
+32 -25
View File
@@ -1,27 +1,34 @@
return {
"mfussenegger/nvim-lint",
enabled = false,
event = { "BufReadPre", "BufNewFile" },
opts = {
linters_by_ft = {
lua = { "selene" },
cpp = { "cpplint" },
c = { "cpplint" },
javascript = { "eslint_d" },
typescript = { "eslint_d" },
javascriptreact = { "eslint_d" },
typescriptreact = { "eslint_d" },
python = { "pylint" },
markdown = { "markdownlint" },
java = { "trivy" },
php = { "phpcs" },
},
},
config = function()
local lint = require("lint")
-- TODO create auto command ran after Buffer Wrote
vim.keymap.set("n", "<leader>cl", function()
lint.try_lint()
end, { desc = "Trigger linting for current file" })
end,
'mfussenegger/nvim-lint',
event = { 'BufReadPre', 'BufNewFile' },
opts = {
linters_by_ft = {
lua = { 'selene' },
cpp = { 'cpplint' },
c = { 'cpplint' },
javascript = { 'eslint_d' },
typescript = { 'eslint_d' },
javascriptreact = { 'eslint_d' },
typescriptreact = { 'eslint_d' },
python = { 'ruff', 'mypy' },
markdown = { 'markdownlint' },
java = { 'trivy' },
php = { 'phpcs' },
},
},
config = function()
local lint = require('lint')
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = lint_augroup,
callback = function()
lint.try_lint()
end,
})
vim.keymap.set('n', '<leader>cl', function()
lint.try_lint()
end, { desc = 'Trigger linting for current file' })
end,
}
-24
View File
@@ -1,24 +0,0 @@
return {
{
"williamboman/mason.nvim",
cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUpdate" },
dependencies = {
{ "williamboman/mason-lspconfig.nvim", event = { "BufReadPre", "BufNewFile" } },
{ "WhoIsSethDaniel/mason-tool-installer.nvim" },
{ "zapling/mason-lock.nvim", cmd = { "MasonLock", "MasonLockRestore" }, opts = {} },
},
config = function()
require("mason").setup()
end,
},
{
"nvimtools/none-ls.nvim", -- configure formatters & linters
event = { "BufRead", "FileType" },
dependencies = {
"jay-babu/mason-null-ls.nvim",
},
config = function()
require("configs.none-ls")
end,
},
}
+21
View File
@@ -10,4 +10,25 @@ return {
require('configs.lsp')
end,
},
{
'williamboman/mason.nvim',
cmd = { 'Mason', 'MasonInstall', 'MasonInstallAll', 'MasonUpdate' },
dependencies = {
'williamboman/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim',
},
config = function()
require('mason').setup()
end,
},
-- {
-- "nvimtools/none-ls.nvim", -- configure formatters & linters
-- event = { "BufRead", "FileType" },
-- dependencies = {
-- "jay-babu/mason-null-ls.nvim",
-- },
-- config = function()
-- require("configs.none-ls")
-- end,
-- },
}
-199
View File
@@ -1,199 +0,0 @@
return {
{
"ThePrimeagen/refactoring.nvim",
config = function()
require("refactoring").setup()
-- vim.keymap.set("x", "<leader>re", ":Refactor extract ")
-- vim.keymap.set("x", "<leader>rf", ":Refactor extract_to_file ")
--
-- vim.keymap.set("x", "<leader>rv", ":Refactor extract_var ")
--
-- vim.keymap.set({ "n", "x" }, "<leader>ri", ":Refactor inline_var")
--
-- vim.keymap.set("n", "<leader>rI", ":Refactor inline_func")
--
-- vim.keymap.set("n", "<leader>rb", ":Refactor extract_block")
-- vim.keymap.set("n", "<leader>rbf", ":Refactor extract_block_to_file")
-- load refactoring Telescope extension
require("telescope").load_extension("refactoring")
vim.keymap.set({ "n", "x" }, "<leader>rr", function()
require("telescope").extensions.refactoring.refactors()
end, { desc = "Refactor" })
end,
},
{
"2kabhishek/nerdy.nvim",
dependencies = { "stevearc/dressing.nvim" },
cmd = "Nerdy",
},
{
"folke/persistence.nvim",
event = "BufReadPre",
opts = { options = vim.opt.sessionoptions:get() },
keys = {
{
"<leader>ms",
function()
require("persistence").load()
end,
desc = "Restore Session",
},
{
"<leader>ml",
function()
require("persistence").load({ last = true })
end,
desc = "Restore Last Session",
},
{
"<leader>md",
function()
require("persistence").stop()
end,
desc = "Don't Save Current Session",
},
},
},
{
"nvim-lua/plenary.nvim",
lazy = true,
},
{
"iamcco/markdown-preview.nvim",
build = "cd app && yarn install",
ft = { "markdown" },
keys = {
{
"<leader>cm",
"<cmd>MarkdownPreviewToggle<CR>",
desc = "toggle markdown preview",
},
},
},
{
"nvim-pack/nvim-spectre",
build = false,
cmd = "Spectre",
opts = { open_cmd = "noswapfile vnew" },
keys = {
{
"<leader>mr",
function()
require("spectre").open()
end,
desc = "Replace in Files (Spectre)",
},
},
},
{
"szw/vim-maximizer",
keys = {
{ "<leader>mm", "<cmd>MaximizerToggle<CR>", desc = "Maximize/minimize a split" },
},
},
{
"folke/zen-mode.nvim",
cmd = { "ZenMode" },
opts = {},
keys = {
{ "<leader>wz", "<cmd>ZenMode<cr>", desc = "Toggle zen mode" },
},
},
{
"chrisgrieser/nvim-recorder",
dependencies = { "rcarriga/nvim-notify" },
event = "VeryLazy",
vscode = true,
keys = {
{ "q", desc = "Start Recording" },
{ "Q", desc = "Play Recording" },
{ "<C-q>", desc = "Switch Slot" },
{ "cq", desc = "Edit Macro" },
{ "yq", desc = "Yank Macro" },
{ "dq", desc = "Delete All Macros" },
},
opts = {
useNerdFontsIcons = false,
slots = { "a", "b", "c", "d" },
mapping = {
startStopRecording = "q",
playMacro = "Q",
editMacro = "cq",
switchSlot = "<C-q>",
deleteAllMacros = "dq",
yankMacro = "yq",
},
},
},
{
"creativenull/dotfyle-metadata.nvim",
cmd = { "DotfyleGenerate", "DotfyleOpen" },
},
{
"willothy/flatten.nvim",
priority = 1001,
opts = {
window = {
open = "alternate",
},
},
},
{
"wakatime/vim-wakatime",
event = { "VimEnter" },
lazy = false,
},
{
"mvllow/modes.nvim",
event = { "BufReadPost", "BufNewFile" },
tag = "v0.2.0",
config = function()
require("modes").setup({
colors = {
visual = "#f5c359",
delete = "#c75c6a",
copy = "#78ccc5",
insert = "#c5739a",
},
line_opacity = 0.15,
set_cursor = true,
set_cursorline = true,
set_number = true,
ignore_filetypes = { "NvimTree", "TelescopePrompt" },
})
end,
},
{
"LunarVim/bigfile.nvim",
event = { "BufEnter", "WinEnter" },
opts = {
-- Disables LSP/treesitter, etc for files above 5000 lives (even if they have really long lines)
pattern = function(bufnr, filesize_mib)
if filesize_mib >= 2 then
return true
end
-- you can't use `nvim_buf_line_count` because this runs on BufReadPre
local file_contents = vim.fn.readfile(vim.api.nvim_buf_get_name(bufnr))
local file_length = #file_contents
if file_length > 5000 then
return true
end
return false
end,
},
},
{
"m4xshen/hardtime.nvim",
config = function()
require("hardtime").setup({ enabled = true })
end,
cmd = "Hardtime",
init = function()
vim.keymap.set("n", "<leader>ch", "<cmd>HardtimeToggle<cr>", { desc = "Toggle Hardtime" })
end,
},
}
+2 -1
View File
@@ -37,6 +37,7 @@ return {
'scss',
'lua',
'python',
'liquid',
},
auto_install = true,
playground = {
@@ -74,7 +75,7 @@ return {
{
'nvim-treesitter/nvim-treesitter-context',
event = 'VeryLazy',
config = function(_, opts)
config = function()
require('treesitter-context').setup({ mode = 'cursor', max_lines = 3 })
end,
},