17 lines
584 B
Lua
17 lines
584 B
Lua
local filename = vim.fn.shellescape(vim.api.nvim_buf_get_name(0))
|
|
|
|
-- Indentation & Layout
|
|
vim.opt_local.colorcolumn = "100"
|
|
vim.opt_local.textwidth = 100
|
|
vim.opt_local.tabstop = 4
|
|
vim.opt_local.shiftwidth = 4
|
|
vim.opt_local.softtabstop = 4
|
|
|
|
-- Formatting Behavior
|
|
vim.opt_local.formatoptions:remove("t") -- Don't autowrap while typing
|
|
vim.opt_local.formatoptions:append("j") -- Remove comment markers when joining lines
|
|
|
|
-- gq Formatters (Prettier fallback, LSP primary)
|
|
vim.bo.formatprg = "npx prettier --stdin-filepath " .. filename
|
|
vim.bo.formatexpr = "v:lua.vim.lsp.formatexpr()"
|