initial commit
This commit is contained in:
parent
dc5408f1a2
commit
9889f6c4ee
35 changed files with 1302 additions and 0 deletions
39
lua/pika/plugins/formatting.lua
Normal file
39
lua/pika/plugins/formatting.lua
Normal file
|
@ -0,0 +1,39 @@
|
|||
return {
|
||||
'stevearc/conform.nvim',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
local conform = require 'conform'
|
||||
|
||||
conform.setup {
|
||||
formatters_by_ft = {
|
||||
javascript = { 'prettier' },
|
||||
typescript = { 'prettier' },
|
||||
javascriptreact = { 'prettier' },
|
||||
typescriptreact = { 'prettier' },
|
||||
svelte = { 'prettier' },
|
||||
css = { 'prettier' },
|
||||
html = { 'prettier' },
|
||||
json = { 'prettier' },
|
||||
yaml = { 'prettier' },
|
||||
markdown = { 'prettier' },
|
||||
graphql = { 'prettier' },
|
||||
liquid = { 'prettier' },
|
||||
lua = { 'stylua' },
|
||||
-- python = { "isort", "black" },
|
||||
},
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 1000,
|
||||
},
|
||||
}
|
||||
|
||||
vim.keymap.set({ 'n', 'v' }, '<leader>mp', function()
|
||||
conform.format {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 1000,
|
||||
}
|
||||
end, { desc = 'Format file or range (in visual mode)' })
|
||||
end,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue