mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
chore(neovim):
- Keymap: remove <tab> to switch buffer - Completion: Remove mini.completion plugins - conflicting - Completion: Use luasnip buffer for completion - Lua: Use lazydev for better nvim lua diagnostics
This commit is contained in:
@@ -41,12 +41,6 @@ vim.keymap.set("i", ".", ".<C-g>u", { desc = "Auto add undo breakpoints on '.'"
|
||||
vim.keymap.set("i", ";", ";<C-g>u", { desc = "Auto add undo breakpoints on ';'" })
|
||||
vim.keymap.set("i", "\r", "\r<C-g>u", { desc = "Auto add undo breakpoints on new lines" })
|
||||
|
||||
-- Traverse Buffer
|
||||
if require("config.util").is_not_vscode() then
|
||||
vim.keymap.set("n", "<Tab>", "<cmd>bnext<CR>", { desc = "Switch to next buffer" })
|
||||
vim.keymap.set("n", "<S-Tab>", "<cmd>bprevious<CR>", { desc = "Switch to previous buffer" })
|
||||
end
|
||||
|
||||
-- Save file
|
||||
vim.keymap.set({ "i", "x", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })
|
||||
vim.keymap.set({ "i", "x", "n", "s" }, "<C-q>", "<cmd>wqa<cr><esc>", { desc = "Save all files and Quit Neovim" })
|
||||
|
||||
@@ -100,8 +100,8 @@ return {
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
{ { name = "buffer" } },
|
||||
},
|
||||
sorting = defaults.sorting,
|
||||
})
|
||||
|
||||
@@ -160,7 +160,7 @@ return {
|
||||
require("mini.comment").setup()
|
||||
|
||||
require("mini.pairs").setup()
|
||||
require("mini.completion").setup()
|
||||
-- require("mini.completion").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
|
||||
@@ -194,6 +194,7 @@ return {
|
||||
-- Add other tools here that you want Mason to install for you
|
||||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
vim.list_extend(ensure_installed, {
|
||||
"shfmt",
|
||||
"stylua",
|
||||
"codespell",
|
||||
"bash-language-server",
|
||||
@@ -205,6 +206,7 @@ return {
|
||||
})
|
||||
require("mason-tool-installer").setup({ ensure_installed = ensure_installed })
|
||||
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
require("mason-lspconfig").setup({
|
||||
handlers = {
|
||||
function(server_name)
|
||||
|
||||
@@ -106,4 +106,26 @@ return {
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua", -- only load on lua files
|
||||
opts = {
|
||||
library = {
|
||||
-- See the configuration section for more details
|
||||
-- Load luvit types when the `vim.uv` word is found
|
||||
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
opts = function(_, opts)
|
||||
opts.sources = opts.sources or {}
|
||||
table.insert(opts.sources, {
|
||||
name = "lazydev",
|
||||
group_index = 0, -- set group index to 0 to skip loading LuaLS completions
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user