Compare commits
No commits in common. "9f20f42d3840928553f7a84989d39bed20ce58ee" and "dac783e4034abe2ad5d6732f8758e7c18882a430" have entirely different histories.
9f20f42d38
...
dac783e403
2 changed files with 4 additions and 23 deletions
|
@ -144,8 +144,8 @@ map('x', '>', '>gv|', { desc = 'Indent Left and Re-select' })
|
||||||
-- Arrows to move identation in normal mode
|
-- Arrows to move identation in normal mode
|
||||||
map('n', '<LEFT>', '<<', { desc = 'Indent Right and Re-select' })
|
map('n', '<LEFT>', '<<', { desc = 'Indent Right and Re-select' })
|
||||||
map('n', '<RIGHT>', '>>', { desc = 'Indent Left and Re-select' })
|
map('n', '<RIGHT>', '>>', { desc = 'Indent Left and Re-select' })
|
||||||
map('v', '<LEFT>', '>gv|', { desc = 'Indent Right and Re-select' })
|
map('v', '<LEFT>', '<', { desc = 'Indent Right and Re-select' })
|
||||||
map('v', '<RIGHT>', '<gv', { desc = 'Indent Left and Re-select' })
|
map('v', '<RIGHT>', '>', { desc = 'Indent Left and Re-select' })
|
||||||
|
|
||||||
-- Use tab for indenting in visual/select mode
|
-- Use tab for indenting in visual/select mode
|
||||||
map('x', '<Tab>', '>gv|', { desc = 'Indent Left' })
|
map('x', '<Tab>', '>gv|', { desc = 'Indent Left' })
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
-- This is part of LazyVim's code, with my modifications.
|
-- This is part of LazyVim's code, with my modifications.
|
||||||
-- See: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/plugins/extras/formatting/prettier.lua
|
-- See: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/plugins/extras/formatting/prettier.lua
|
||||||
|
|
||||||
local util = require("formatter.util")
|
|
||||||
local defaults = require("formatter.defaults")
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -24,6 +21,8 @@ return {
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
local filetypes = {
|
local filetypes = {
|
||||||
|
-- FIXME:add more filetypes
|
||||||
|
json = { require("formatter.defaults.prettierd") },
|
||||||
rust = {
|
rust = {
|
||||||
rustfmt = function()
|
rustfmt = function()
|
||||||
return {
|
return {
|
||||||
|
@ -33,28 +32,10 @@ return {
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
cpp = { require("formatter.filetypes.cpp").clangformat },
|
|
||||||
css = { require("formatter.filetypes.css").prettierd },
|
|
||||||
html = { require("formatter.filetypes.html").prettierd },
|
|
||||||
java = { require("formatter.filetypes.java").clangformat() },
|
|
||||||
javascript = { require("formatter.filetypes.javascript").prettierd },
|
|
||||||
json = { require("formatter.filetypes.json").prettierd },
|
|
||||||
cmake = { require("formatter.filetypes.cmake") },
|
|
||||||
latex = { require("formatter.filetypes.latex").latexindent },
|
|
||||||
markdown = { require("formatter.filetypes.markdown").prettierd },
|
|
||||||
php = { require("formatter.filetypes.php").phpcbf },
|
|
||||||
python = { require("formatter.filetypes.python").autopep8() },
|
|
||||||
sh = { require("formatter.filetypes.sh").shfmt() },
|
|
||||||
sql = { require("formatter.filetypes.sql").pgformat() },
|
|
||||||
toml = { require("formatter.filetypes.toml").taplo() },
|
|
||||||
go = { require("formatter.filetypes.go").gofmt() },
|
|
||||||
yaml = { require("formatter.filetypes.yaml").prettierd },
|
|
||||||
c = { require("formatter.filetypes.c").clangformat },
|
|
||||||
["*"] = {
|
["*"] = {
|
||||||
-- "formatter.filetypes.any" defines default configurations for any
|
-- "formatter.filetypes.any" defines default configurations for any
|
||||||
-- filetype
|
-- filetype
|
||||||
require("formatter.filetypes.any").remove_trailing_whitespace,
|
require("formatter.filetypes.any").remove_trailing_whitespace,
|
||||||
require("formatter.defaults.prettierd")
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
opts.filetype = vim.tbl_extend("keep", opts.filetype or {}, filetypes)
|
opts.filetype = vim.tbl_extend("keep", opts.filetype or {}, filetypes)
|
||||||
|
|
Loading…
Add table
Reference in a new issue