merge laptop branch features into customize
- Add detailed SQL formatter config (pg_format, sqlfluff with args) - Add Mason plugin for installing formatters - Add conform keybinding (g+w) for manual formatting - Add gitsigns blame keybinding (<leader>gb) - Add comments to organize plugin sections - Keep vscode_dark theme and generic home paths Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
9b578f964b
commit
59e9fe7923
@ -1,15 +1,25 @@
|
|||||||
local options = {
|
local options = {
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { "stylua" },
|
lua = { "stylua" },
|
||||||
|
sql = { "pg_format", "sqlfluff" }, -- pg_format first, fallback to sqlfluff
|
||||||
|
json = { "jq" },
|
||||||
|
markdown = { "mdformat" },
|
||||||
-- css = { "prettier" },
|
-- css = { "prettier" },
|
||||||
-- html = { "prettier" },
|
-- html = { "prettier" },
|
||||||
},
|
},
|
||||||
|
-- no format_on_save (manual-only)
|
||||||
-- format_on_save = {
|
formatters = {
|
||||||
-- -- These options will be passed to conform.format()
|
pg_format = {
|
||||||
-- timeout_ms = 500,
|
prepend_args = {
|
||||||
-- lsp_fallback = true,
|
"--keyword-case", "2", -- 1 = UPPER, 2 = lower
|
||||||
-- },
|
"--function-case", "2", -- 2 = lower
|
||||||
|
"--spaces", "4",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
sqlfluff = {
|
||||||
|
args = { "fix", "--force", "--dialect", "postgres", "-" },
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
return options
|
return options
|
||||||
|
|||||||
@ -57,3 +57,6 @@ vim.keymap.set('x', '<leader>"', function()
|
|||||||
local text = vim.fn.getreg('"') -- Get the visually selected text
|
local text = vim.fn.getreg('"') -- Get the visually selected text
|
||||||
vim.cmd('normal! c"' .. text .. '"')
|
vim.cmd('normal! c"' .. text .. '"')
|
||||||
end, { desc = "Wrap selected text in double quotes" })
|
end, { desc = "Wrap selected text in double quotes" })
|
||||||
|
|
||||||
|
-- Gitsigns blame current line
|
||||||
|
vim.keymap.set("n", "<leader>gb", ":Gitsigns blame_line<CR>", { noremap = true, silent = true, desc = "Git blame line" })
|
||||||
|
|||||||
@ -1,10 +1,25 @@
|
|||||||
return {
|
return {
|
||||||
|
-- Conform (formatter)
|
||||||
{
|
{
|
||||||
"stevearc/conform.nvim",
|
"stevearc/conform.nvim",
|
||||||
-- event = 'BufWritePre', -- uncomment for format on save
|
lazy = false,
|
||||||
opts = require "configs.conform",
|
cmd = { "ConformInfo", "ConformFormat" }, -- enables :ConformInfo before load
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"g+w",
|
||||||
|
function()
|
||||||
|
require("conform").format({ async = false, lsp_fallback = true })
|
||||||
|
end,
|
||||||
|
mode = "n",
|
||||||
|
desc = "Format file (Conform)",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("conform").setup(require "configs.conform")
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- LSP
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
config = function()
|
config = function()
|
||||||
@ -12,11 +27,13 @@ return {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- File explorer
|
||||||
{
|
{
|
||||||
"nvim-tree/nvim-tree.lua",
|
"nvim-tree/nvim-tree.lua",
|
||||||
opts = require "configs.nvimtree",
|
opts = require "configs.nvimtree",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Telescope
|
||||||
{
|
{
|
||||||
'nvim-telescope/telescope.nvim',
|
'nvim-telescope/telescope.nvim',
|
||||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
@ -24,14 +41,14 @@ return {
|
|||||||
require "configs.telescope"
|
require "configs.telescope"
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Treesitter
|
||||||
{
|
{
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
build = ':TSUpdate',
|
build = ':TSUpdate',
|
||||||
config = function()
|
config = function()
|
||||||
require'nvim-treesitter.configs'.setup {
|
require'nvim-treesitter.configs'.setup {
|
||||||
-- Enable Treesitter syntax highlighting
|
ensure_installed = { "markdown", "sql", "vim", "lua", "vimdoc", "html", "css" },
|
||||||
ensure_installed = { "markdown", "sql","vim",
|
|
||||||
"lua", "vimdoc", "html", "css" }, -- add other languages if needed
|
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
additional_vim_regex_highlighting = { "markdown" },
|
additional_vim_regex_highlighting = { "markdown" },
|
||||||
@ -39,10 +56,21 @@ return {
|
|||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Transparent
|
||||||
{
|
{
|
||||||
'xiyaowong/transparent.nvim',
|
'xiyaowong/transparent.nvim',
|
||||||
lazy = false
|
lazy = false
|
||||||
}
|
},
|
||||||
|
|
||||||
|
-- Mason (to install formatters like pgformatter/sqlfluff)
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
cmd = { "Mason", "MasonInstall", "MasonUpdate" },
|
||||||
|
config = function()
|
||||||
|
require("mason").setup()
|
||||||
|
end,
|
||||||
|
},
|
||||||
-- {
|
-- {
|
||||||
-- "nvim-treesitter/nvim-treesitter",
|
-- "nvim-treesitter/nvim-treesitter",
|
||||||
-- opts = {
|
-- opts = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user