mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
- Testing setup through neotest plugin - Spellcheck enabled on markdown and text files - Diagnosis summary through trouble plugin - Code completion keybindings improved - Auto-formatting through conform plugin - Reactjs context aware commenting through nvim-ts-context-commentstring - Auto HTML tag completion through nvim-ts-autotag - CSS color highlight through nvim-highlight-colors - Lualine: breadcrumbs, git status, single line - Auto restore neovim sessions - Better keyboard maps Shell - Aliases now load from .bashrc or .zshrc - Bash & zsh shortcuts to easy open and create projects - zoxide instead of cd when installed - bootstrap.sh shellhardened
52 lines
1.9 KiB
Lua
52 lines
1.9 KiB
Lua
return {
|
|
{
|
|
"stevearc/conform.nvim",
|
|
lazy = true,
|
|
event = { "BufReadPre", "BufNewFile" },
|
|
config = function()
|
|
local conform = require("conform")
|
|
|
|
conform.setup({
|
|
formatters_by_ft = {
|
|
javascript = { { "prettierd", "prettier" } },
|
|
typescript = { { "prettierd", "prettier" } },
|
|
javascriptreact = { { "prettierd", "prettier" } },
|
|
typescriptreact = { { "prettierd", "prettier" } },
|
|
svelte = { { "prettierd", "prettier" } },
|
|
css = { { "prettierd", "prettier" } },
|
|
html = { { "prettierd", "prettier" } },
|
|
json = { { "prettierd", "prettier" } },
|
|
yaml = { { "prettierd", "prettier" } },
|
|
markdown = { { "prettierd", "prettier" } },
|
|
graphql = { { "prettierd", "prettier" } },
|
|
lua = { "stylua" },
|
|
python = { "black" },
|
|
sh = { "shfmt", "shellharden" },
|
|
bash = { "shfmt", "shellharden" },
|
|
zsh = { "shfmt", "shellharden" },
|
|
["*"] = { "codespell" },
|
|
["_"] = { "trim_whitespace" },
|
|
},
|
|
format_on_save = {
|
|
lsp_fallback = true,
|
|
async = false,
|
|
timeout_ms = 1000,
|
|
},
|
|
formatters = {
|
|
shfmt = {
|
|
prepend_args = { "-i", "4" },
|
|
},
|
|
},
|
|
})
|
|
|
|
vim.keymap.set({ "n", "v" }, "<leader>cf", function()
|
|
conform.format({
|
|
lsp_fallback = true,
|
|
async = false,
|
|
timeout_ms = 1000,
|
|
})
|
|
end, { desc = "[C]ode [F]ormat (visual selection)" })
|
|
end,
|
|
},
|
|
}
|