mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
nvim/lsp: move out non-lsp formatting bindings
This commit is contained in:
parent
a644f3c688
commit
ce5e5610e1
4 changed files with 19 additions and 26 deletions
5
.config/nvim/ftplugin/bash.lua
Normal file
5
.config/nvim/ftplugin/bash.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
vim.keymap.set("n", "<leader>f", function()
|
||||
local saved = vim.fn.winsaveview()
|
||||
vim.cmd([[silent exec "%!shfmt"]])
|
||||
vim.fn.winrestview(saved)
|
||||
end, { desc = "ft(bash): Format with shfmt" })
|
||||
6
.config/nvim/ftplugin/lua.lua
Normal file
6
.config/nvim/ftplugin/lua.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
vim.keymap.set("n", "<leader>f", function()
|
||||
local saved = vim.fn.winsaveview()
|
||||
vim.cmd([[silent exec "!stylua %"]])
|
||||
vim.fn.winrestview(saved)
|
||||
end, { desc = "ft(lua): Format with stylua" })
|
||||
|
|
@ -1,3 +1,9 @@
|
|||
vim.bo.shiftwidth = 2
|
||||
vim.bo.tabstop = 2
|
||||
vim.bo.textwidth = 100
|
||||
|
||||
vim.keymap.set("n", "<leader>f", function()
|
||||
local saved = vim.fn.winsaveview()
|
||||
vim.cmd([[silent exec "%!typstyle -c 100"]])
|
||||
vim.fn.winrestview(saved)
|
||||
end, { desc = "ft(typst): Format with typstyle" })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue