Massive Updates

This commit is contained in:
sankalp committed 2024-01-09 14:05:16 +05:45
1 parent 28d3a2c1d2
commit e19a04e930
29 files changed
+462 -193

No files matched your search

@@ -7,6 +7,8 @@ return {
{ "am", ft = { "markdown", "toml" }, mode = { "o", "x" }, function() require("various-textobjs").mdlink("outer") end, desc = "Markdown Link" },
{ "iC", ft = { "markdown" }, mode = { "o", "x" }, function() require("various-textobjs").mdFencedCodeBlock("inner") end, desc = "CodeBlock" },
{ "aC", ft = { "markdown" }, mode = { "o", "x" }, function() require("various-textobjs").mdFencedCodeBlock("outer") end, desc = "CodeBlock" },
{ "ie", ft = { "markdown" }, mode = { "o", "x" }, function() require("various-textobjs").mdEmphasis("inner") end, desc = "Emphasis" },
{ "ae", ft = { "markdown" }, mode = { "o", "x" }, function() require("various-textobjs").mdEmphasis("outer") end, desc = "Emphasis" },
{ "gd", mode = { "o", "x" }, function() require("various-textobjs").diagnostics() end, desc = "Diagnostics" },
{ "iy", ft = { "python" }, mode = { "o", "x" }, function() require("various-textobjs").pyTripleQuotes("inner") end, desc = "Triple Quotes" },
{ "ay", ft = { "python" }, mode = { "o", "x" }, function() require("various-textobjs").pyTripleQuotes("outer") end, desc = "Triple Quotes" },
@@ -1,19 +0,0 @@
return {
"mrjones2014/smart-splits.nvim",
build = "./kitty/install-kittens.bash",
-- stylua: ignore
keys = {
{ "<C-A-Left>", function() require("smart-splits").resize_left() end, desc = "Resize left", mode = "n" },
{ "<C-A-Down>", function() require("smart-splits").resize_down() end, desc = "Resize down", mode = "n" },
{ "<C-A-Up>", function() require("smart-splits").resize_up() end, desc = "Resize up", mode = "n" },
{ "<C-A-Right>", function() require("smart-splits").resize_right() end, desc = "Resize right", mode = "n" },
{ "<C-h>", function() require("smart-splits").move_cursor_left() end, desc = "Move cursor left", mode = "n" },
{ "<C-j>", function() require("smart-splits").move_cursor_down() end, desc = "Move cursor down", mode = "n" },
{ "<C-k>", function() require("smart-splits").move_cursor_up() end, desc = "Move cursor up", mode = "n" },
{ "<C-l>", function() require("smart-splits").move_cursor_right() end, desc = "Move cursor right", mode = "n" },
{ "<C-A-h>", function() require("smart-splits").swap_buf_left() end, desc = "Swap buffer left", mode = "n" },
{ "<C-A-j>", function() require("smart-splits").swap_buf_down() end, desc = "Swap buffer down", mode = "n" },
{ "<C-A-k>", function() require("smart-splits").swap_buf_up() end, desc = "Swap buffer up", mode = "n" },
{ "<C-A-l>", function() require("smart-splits").swap_buf_right() end, desc = "Swap buffer right", mode = "n" },
},
}
@@ -0,0 +1,60 @@
return {
{
"williamboman/mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "biome" })
end,
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
biome = {
root_dir = require("lspconfig").util.root_pattern("biome.json"),
single_file_support = false,
},
},
},
},
{
"stevearc/conform.nvim",
opts = function(_, opts)
--- Extend the conform plugin config and add given formatters
---@param tbl table<string, conform.FormatterUnit[]> Table of filetype to formatters mappings
local function add_formatters(tbl)
for ft, formatters in pairs(tbl) do
if opts.formatters_by_ft[ft] == nil then
opts.formatters_by_ft[ft] = formatters
else
vim.list_extend(opts.formatters_by_ft[ft], formatters)
end
end
end
add_formatters({
["jsonc"] = { "biome" },
["json"] = { "biome" },
["javascript"] = { "biome" },
["typescript"] = { "biome" },
["typescriptreact"] = { "biome" },
["javascriptreact"] = { "biome" },
})
opts.formatters = {
biome = {
condition = function(self, ctx)
return vim.fs.find({ "biome.json" }, { path = ctx.filename, upward = true })[1]
end,
},
prettier = {
condition = function(self, ctx)
return not vim.fs.find({ "biome.json" }, { path = ctx.filename, upward = true })[1]
end,
},
}
return opts
end,
},
}
@@ -9,8 +9,24 @@ return {
{
"mfussenegger/nvim-lint",
opts = function(_, opts)
opts.linters_by_ft.go = opts.linters_by_ft.go or {}
table.insert(opts.linters_by_ft.go, "golangcilint")
--- Extend the conform plugin config and add given formatters
---@param tbl table<string, conform.FormatterUnit[]> Table of filetype to formatters mappings
local function add_formatters(tbl)
for ft, formatters in pairs(tbl) do
if opts.formatters_by_ft[ft] == nil then
opts.formatters_by_ft[ft] = formatters
else
vim.list_extend(opts.formatters_by_ft[ft], formatters)
end
end
end
add_formatters({
["go"] = { "golangcilint" },
["gomod"] = { "golangcilint" },
["gowork"] = { "golangcilint" },
})
return opts
end,
},
@@ -1,11 +1,88 @@
local map = vim.keymap.set
return {
"declancm/cinnamon.nvim",
event = "VeryLazy",
opts = {
default_keymaps = true,
extra_keymaps = true,
extended_keymaps = true,
override_keymaps = true,
default_delay = 3,
},
config = function()
require("cinnamon").setup({
default_keymaps = true,
extra_keymaps = true,
extended_keymaps = true,
override_keymaps = true,
default_delay = 2,
})
-- DEFAULT_KEYMAPS:
-- Half-window movements:
map({ "n", "x" }, "<C-u>", "<Cmd>lua Scroll('<C-u>', 1, 1)<CR>")
map({ "n", "x" }, "<C-d>", "<Cmd>lua Scroll('<C-d>', 1, 1)<CR>")
-- Page movements:
map({ "n", "x" }, "<C-b>", "<Cmd>lua Scroll('<C-b>', 1, 1)<CR>")
map({ "n", "x" }, "<C-f>", "<Cmd>lua Scroll('<C-f>', 1, 1)<CR>")
map({ "n", "x" }, "<PageUp>", "<Cmd>lua Scroll('<C-b>', 1, 1)<CR>")
map({ "n", "x" }, "<PageDown>", "<Cmd>lua Scroll('<C-f>', 1, 1)<CR>")
-- EXTRA_KEYMAPS:
-- Start/end of file and line number movements:
map({ "n", "x" }, "gg", "<Cmd>lua Scroll('gg')<CR>")
map({ "n", "x" }, "G", "<Cmd>lua Scroll('G', 0, 1)<CR>")
-- Start/end of line:
map({ "n", "x" }, "0", "<Cmd>lua Scroll('0')<CR>")
map({ "n", "x" }, "^", "<Cmd>lua Scroll('^')<CR>")
map({ "n", "x" }, "$", "<Cmd>lua Scroll('$', 0, 1)<CR>")
-- Paragraph movements:
map({ "n", "x" }, "{", "<Cmd>lua Scroll('{')<CR>")
map({ "n", "x" }, "}", "<Cmd>lua Scroll('}')<CR>")
-- Previous/next search result:
map("n", "n", "<Cmd>lua Scroll('n', 1)<CR>")
map("n", "N", "<Cmd>lua Scroll('N', 1)<CR>")
map("n", "*", "<Cmd>lua Scroll('*', 1)<CR>")
map("n", "#", "<Cmd>lua Scroll('#', 1)<CR>")
map("n", "g*", "<Cmd>lua Scroll('g*', 1)<CR>")
map("n", "g#", "<Cmd>lua Scroll('g#', 1)<CR>")
-- Previous/next cursor location:
map("n", "<C-o>", "<Cmd>lua Scroll('<C-o>', 1)<CR>")
map("n", "<C-i>", "<Cmd>lua Scroll('1<C-i>', 1)<CR>")
-- Screen scrolling:
map("n", "zz", "<Cmd>lua Scroll('zz', 0, 1)<CR>")
map("n", "zt", "<Cmd>lua Scroll('zt', 0, 1)<CR>")
map("n", "zb", "<Cmd>lua Scroll('zb', 0, 1)<CR>")
map("n", "z.", "<Cmd>lua Scroll('z.', 0, 1)<CR>")
map("n", "z<CR>", "<Cmd>lua Scroll('zt^', 0, 1)<CR>")
map("n", "z-", "<Cmd>lua Scroll('z-', 0, 1)<CR>")
map("n", "z^", "<Cmd>lua Scroll('z^', 0, 1)<CR>")
map("n", "z+", "<Cmd>lua Scroll('z+', 0, 1)<CR>")
map("n", "<C-y>", "<Cmd>lua Scroll('<C-y>', 0, 1)<CR>")
map("n", "<C-e>", "<Cmd>lua Scroll('<C-e>', 0, 1)<CR>")
-- Horizontal screen scrolling:
map("n", "zH", "<Cmd>lua Scroll('zH')<CR>")
map("n", "zL", "<Cmd>lua Scroll('zL')<CR>")
map("n", "zs", "<Cmd>lua Scroll('zs')<CR>")
map("n", "ze", "<Cmd>lua Scroll('ze')<CR>")
map("n", "zh", "<Cmd>lua Scroll('zh', 0, 1)<CR>")
map("n", "zl", "<Cmd>lua Scroll('zl', 0, 1)<CR>")
-- EXTENDED_KEYMAPS:
-- Up/down movements:
map({ "n", "x" }, "k", "<Cmd>lua Scroll('k', 0, 1)<CR>")
map({ "n", "x" }, "j", "<Cmd>lua Scroll('j', 0, 1)<CR>")
map({ "n", "x" }, "<Up>", "<Cmd>lua Scroll('k', 0, 1)<CR>")
map({ "n", "x" }, "<Down>", "<Cmd>lua Scroll('j', 0, 1)<CR>")
-- Left/right movements:
map({ "n", "x" }, "h", "<Cmd>lua Scroll('h', 0, 1)<CR>")
map({ "n", "x" }, "l", "<Cmd>lua Scroll('l', 0, 1)<CR>")
map({ "n", "x" }, "<Left>", "<Cmd>lua Scroll('h', 0, 1)<CR>")
map({ "n", "x" }, "<Right>", "<Cmd>lua Scroll('l', 0, 1)<CR>")
end,
}
@@ -14,6 +14,7 @@ return {
"markdown",
"python",
"lua",
"html",
},
},
}
@@ -0,0 +1,39 @@
--[[
Enable project-specific plugin specs.
File .lazy.lua:
is read when present in the current working directory
should return a plugin spec
has to be manually trusted for each instance of the file
This extra should be the last plugin spec added to lazy.nvim
See:
:h 'exrc'
:h :trust
--]]
local filepath = vim.fn.fnamemodify(".lazy.lua", ":p")
local file = vim.secure.read(filepath)
if not file then
return {}
end
vim.api.nvim_create_autocmd("User", {
pattern = "VeryLazy",
once = true,
callback = function()
local Config = require("lazy.core.config")
local Util = require("lazyvim.util")
local lazyrc_idx = Util.plugin.extra_idx("lazyrc")
if lazyrc_idx and lazyrc_idx ~= #Config.spec.modules then
Util.warn({
"The `lazyrc` extra must be the last plugin spec added to **lazy.nvim**. ",
"",
"Add `{ import = 'lazyvim.plugins.extras.lazyrc' }` to file `config.lazy`. ",
"Do not use the `LazyExtras` command. ",
}, { title = "LazyVim", once = true })
end
end,
})
return loadstring(file)()
@@ -0,0 +1,19 @@
return {
"mrjones2014/smart-splits.nvim",
build = "./kitty/install-kittens.bash",
-- stylua: ignore
keys = {
{ "<C-A-Left>", function() require("smart-splits").resize_left() end, desc = "Resize left" },
{ "<C-A-Down>", function() require("smart-splits").resize_down() end, desc = "Resize down" },
{ "<C-A-Up>", function() require("smart-splits").resize_up() end, desc = "Resize up" },
{ "<C-A-Right>", function() require("smart-splits").resize_right() end, desc = "Resize right" },
{ "<C-h>", function() require("smart-splits").move_cursor_left() end, desc = "Move cursor left" },
{ "<C-j>", function() require("smart-splits").move_cursor_down() end, desc = "Move cursor down" },
{ "<C-k>", function() require("smart-splits").move_cursor_up() end, desc = "Move cursor up" },
{ "<C-l>", function() require("smart-splits").move_cursor_right() end, desc = "Move cursor right" },
{ "<C-A-h>", function() require("smart-splits").swap_buf_left() end, desc = "Swap buffer left" },
{ "<C-A-j>", function() require("smart-splits").swap_buf_down() end, desc = "Swap buffer down" },
{ "<C-A-k>", function() require("smart-splits").swap_buf_up() end, desc = "Swap buffer up" },
{ "<C-A-l>", function() require("smart-splits").swap_buf_right() end, desc = "Swap buffer right" },
},
}
@@ -0,0 +1,5 @@
return {
"aserowy/tmux.nvim",
event = "VeryLazy",
opts = {},
}
@@ -12,6 +12,10 @@ local map = vim.keymap.set
local enabled = {
"flash.nvim",
"lazy.nvim",
"dial.nvim",
"mini.align",
"comment-box.nvim",
"text-case.nvim",
"mini.ai",
"mini.comment",
"mini.pairs",
@@ -22,6 +26,7 @@ local enabled = {
"nvim-ts-context-commentstring",
"vim-repeat",
"highlight-undo.nvim",
"ts-node-action",
"LazyVim",
}