mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
chore(nvim): Neovim config cleanups
- Use newer installation for Lazy.nvim - Treesitter: ensure_install sql, bash, jsonc, python, dockerfile plugins - Completion: Use <ctrl+y> to accept. <enter> to accept was interfering with completions that were suggested at end of the line and you don't want to accept but just want to go to the next line - Snacks: disble the abhorrent *smooth* scrolling - Whichkey: More time before pop-up shows (450ms)
This commit is contained in:
@@ -22,7 +22,13 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
|||||||
lazypath,
|
lazypath,
|
||||||
})
|
})
|
||||||
if vim.v.shell_error ~= 0 then
|
if vim.v.shell_error ~= 0 then
|
||||||
error("Error cloning lazy.nvim:\n" .. out)
|
vim.api.nvim_echo({
|
||||||
|
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||||
|
{ out, "WarningMsg" },
|
||||||
|
{ "\nPress any key to exit..." },
|
||||||
|
}, true, {})
|
||||||
|
vim.fn.getchar()
|
||||||
|
os.exit(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -32,27 +38,11 @@ vim.opt.rtp:prepend(lazypath)
|
|||||||
-- You can also configure plugins after the setup call,
|
-- You can also configure plugins after the setup call,
|
||||||
-- as they will be available in your neovim runtime.
|
-- as they will be available in your neovim runtime.
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
{ import = "plugins" },
|
|
||||||
}, {
|
|
||||||
lockfile = vim.fn.stdpath("data") .. "/lazy/lazy-lock.json",
|
|
||||||
change_detection = {
|
change_detection = {
|
||||||
notify = false,
|
notify = false,
|
||||||
},
|
},
|
||||||
build = {
|
build = {
|
||||||
warn_on_override = true,
|
warn_on_override = true,
|
||||||
},
|
},
|
||||||
performance = {
|
spec = { { import = "plugins" } },
|
||||||
rtp = {
|
|
||||||
-- Disable some rtp plugins
|
|
||||||
disabled_plugins = {
|
|
||||||
"gzip",
|
|
||||||
"matchit",
|
|
||||||
-- "matchparen",
|
|
||||||
"netrwPlugin",
|
|
||||||
"tarPlugin",
|
|
||||||
"tutor",
|
|
||||||
"zipPlugin",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||||||
group = vim.api.nvim_create_augroup("keymaps-javascript", { clear = true }),
|
group = vim.api.nvim_create_augroup("keymaps-javascript", { clear = true }),
|
||||||
pattern = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx", "vue", "svelte", "astro" },
|
pattern = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx", "vue", "svelte", "astro" },
|
||||||
callback = function()
|
callback = function()
|
||||||
-- vim.keymap.set({ "n", "v" }, "<leader>ca", "<cmd>OmniSharpGetCodeActions<CR>", { desc = "Code: Code Actions (C#)" })
|
|
||||||
vim.keymap.set({ "n", "v" }, "<leader>co", function()
|
vim.keymap.set({ "n", "v" }, "<leader>co", function()
|
||||||
vim.lsp.buf.code_action({
|
vim.lsp.buf.code_action({
|
||||||
apply = true,
|
apply = true,
|
||||||
|
|||||||
@@ -20,5 +20,5 @@ vim.g.markdown_recommended_style = 0
|
|||||||
|
|
||||||
vim.g.have_nerd_font = true
|
vim.g.have_nerd_font = true
|
||||||
|
|
||||||
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" }
|
||||||
vim.opt.inccommand = 'split'
|
vim.opt.inccommand = "split"
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ return {
|
|||||||
-- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept
|
-- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept
|
||||||
-- See the full "keymap" documentation for information on defining your own keymap.
|
-- See the full "keymap" documentation for information on defining your own keymap.
|
||||||
keymap = {
|
keymap = {
|
||||||
preset = "enter",
|
preset = "super-tab",
|
||||||
["<C-y>"] = { "select_and_accept" },
|
["<C-y>"] = { "select_and_accept" },
|
||||||
|
|
||||||
["<Tab>"] = { "snippet_forward", "fallback" },
|
["<Tab>"] = { "snippet_forward", "fallback" },
|
||||||
|
|||||||
@@ -439,7 +439,6 @@ return {
|
|||||||
---@diagnostic disable-next-line: missing-fields
|
---@diagnostic disable-next-line: missing-fields
|
||||||
require("nvim-treesitter.configs").setup({
|
require("nvim-treesitter.configs").setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
-- These 2 are required for cmdline
|
|
||||||
"regex",
|
"regex",
|
||||||
"markdown",
|
"markdown",
|
||||||
"markdown_inline",
|
"markdown_inline",
|
||||||
@@ -452,6 +451,11 @@ return {
|
|||||||
"css",
|
"css",
|
||||||
"json5",
|
"json5",
|
||||||
"yaml",
|
"yaml",
|
||||||
|
"sql",
|
||||||
|
"bash",
|
||||||
|
"jsonc",
|
||||||
|
"python",
|
||||||
|
"dockerfile",
|
||||||
},
|
},
|
||||||
|
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ return {
|
|||||||
style = "fancy",
|
style = "fancy",
|
||||||
},
|
},
|
||||||
scroll = {
|
scroll = {
|
||||||
enabled = true,
|
enabled = false,
|
||||||
},
|
},
|
||||||
scratch = {
|
scratch = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
@@ -86,7 +86,7 @@ return {
|
|||||||
function()
|
function()
|
||||||
Snacks.scratch.select()
|
Snacks.scratch.select()
|
||||||
end,
|
end,
|
||||||
desc = "Toggle Scratch Buffer",
|
desc = "Select Scratch Buffer",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>gz",
|
"<leader>gz",
|
||||||
@@ -217,13 +217,15 @@ return {
|
|||||||
"echasnovski/mini.icons",
|
"echasnovski/mini.icons",
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
|
delay = 450,
|
||||||
preset = "helix",
|
preset = "helix",
|
||||||
warning = true,
|
warning = true,
|
||||||
-- Document existing key chains
|
-- Document existing key chains
|
||||||
spec = {
|
spec = {
|
||||||
|
{ "<leader>/", group = "NVIM Scratch Buffer" },
|
||||||
{ "<leader>a", group = "AI" },
|
{ "<leader>a", group = "AI" },
|
||||||
{ "<leader>c", group = "Code", icon = { icon = "", color = "orange" } },
|
|
||||||
{ "<leader>b", group = "Buffer Operations", icon = { icon = "", color = "orange" } },
|
{ "<leader>b", group = "Buffer Operations", icon = { icon = "", color = "orange" } },
|
||||||
|
{ "<leader>c", group = "Code", icon = { icon = "", color = "orange" } },
|
||||||
{ "<leader>d", group = "Diagnostics", icon = { icon = "", color = "orange" } },
|
{ "<leader>d", group = "Diagnostics", icon = { icon = "", color = "orange" } },
|
||||||
{ "<leader>g", group = "Git", icon = { icon = "", color = "orange" } },
|
{ "<leader>g", group = "Git", icon = { icon = "", color = "orange" } },
|
||||||
{ "<leader>h", group = "Help", icon = { icon = "", color = "orange" } },
|
{ "<leader>h", group = "Help", icon = { icon = "", color = "orange" } },
|
||||||
|
|||||||
Reference in New Issue
Block a user