This commit is contained in:
Henrik Bakken
2023-09-07 01:09:32 +02:00
parent fbb0ea717b
commit 949b47423d
2 changed files with 70 additions and 24 deletions
+38 -13
View File
@@ -527,7 +527,7 @@ require("lazy").setup({
typescript = { "eslint_d" }, typescript = { "eslint_d" },
html = { "tidy", "eslint_d" }, html = { "tidy", "eslint_d" },
} }
vim.api.nvim_create_autocmd({ "BufWritePost" }, { vim.api.nvim_create_autocmd({ "BufWritePost", "TextChanged" }, {
callback = function() callback = function()
require("lint").try_lint() require("lint").try_lint()
end, end,
@@ -543,11 +543,32 @@ require("lazy").setup({
local opts = { silent = true, noremap = true } local opts = { silent = true, noremap = true }
map("n", "<leader>f", ":Format<cr>", opts) map("n", "<leader>f", ":Format<cr>", opts)
map("n", "<leader>F", ":FormatWrite<cr>", opts) map("n", "<leader>F", ":FormatWrite<cr>", opts)
local eslint_d = function()
return {
exe = "eslint_d",
args = {
"--stdin",
"--debug",
"--stdin-filename",
util.escape_path(util.get_current_buffer_file_path()),
"--fix-to-stdout",
},
stdin = true,
try_node_modules = true,
ignore_exitcode = true,
}
end
local prettierd = function()
return {
exe = "prettierd",
args = { util.escape_path(util.get_current_buffer_file_path()) },
stdin = true,
}
end
-- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands -- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands
require("formatter").setup({ require("formatter").setup({
logging = true, logging = true,
log_level = vim.log.levels.WARN, log_level = vim.log.levels.DEBUG,
filetype = { filetype = {
python = { python = {
require("formatter.filetypes.python").black, require("formatter.filetypes.python").black,
@@ -604,18 +625,22 @@ require("lazy").setup({
end, end,
}, },
sh = { require("formatter.filetypes.sh").shfmt }, sh = { require("formatter.filetypes.sh").shfmt },
typescript = { require("formatter.filetypes.typescript").eslint_d }, typescript = {
javascript = { require("formatter.filetypes.javascript").eslint_d }, eslint_d,
},
javascript = {
prettierd,
eslint_d,
},
html = { html = {
-- require("formatter.filetypes.html").prettierd, prettierd,
require("formatter.filetypes.html").tidy, -- eslint_d,
require("formatter.filetypes.javascript").eslint_d,
}, },
css = { css = {
require("formatter.filetypes.css").prettierd, prettierd,
require("formatter.filetypes.css").eslint_d, eslint_d,
}, },
markdown = { require("formatter.filetypes.markdown").prettierd }, markdown = { prettierd },
json = { require("formatter.filetypes.json").jq }, json = { require("formatter.filetypes.json").jq },
["*"] = { require("formatter.filetypes.any").remove_trailing_whitespace }, ["*"] = { require("formatter.filetypes.any").remove_trailing_whitespace },
}, },
@@ -689,7 +714,7 @@ require("lazy").setup({
telemetry = { enable = false }, telemetry = { enable = false },
diagnostics = { diagnostics = {
-- Get the language server to recognize the `vim` global in init.lua -- Get the language server to recognize the `vim` global in init.lua
globals = { "vim" }, globals = { "vim", "core" },
}, },
format = { enable = false }, format = { enable = false },
}, },
@@ -759,7 +784,7 @@ require("lazy").setup({
lsp_doc_border = false, -- add a border to hover docs and signature help lsp_doc_border = false, -- add a border to hover docs and signature help
}, },
messages = { messages = {
enabled = false, enabled = true,
}, },
}) })
end, end,
+32 -11
View File
@@ -23,21 +23,16 @@ settings:
tm: tab-move tm: tab-move
to: tab-focus to: tab-focus
ø: 'set-cmd-text :' ø: 'set-cmd-text :'
colors.hints.bg: J: tab-prev
global: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 247, 133, 1.0), K: tab-next
stop:1 rgba(255, 197, 66, 1.0))
colors.webpage.darkmode.enabled: colors.webpage.darkmode.enabled:
global: true global: false
content.register_protocol_handler: content.register_protocol_handler:
https://mail.google.com?extsrc=mailto&url=%25s: true https://mail.google.com?extsrc=mailto&url=%25s: true
content.tls.certificate_errors: content.tls.certificate_errors:
global: ask global: ask-block-thirdparty
fonts.hints:
global: default_size default_family
fonts.statusbar:
global: 15px default_family
messages.timeout: messages.timeout:
global: 5000 global: 500
scrolling.bar: scrolling.bar:
global: always global: always
session.lazy_restore: session.lazy_restore:
@@ -58,6 +53,18 @@ settings:
- scroll - scroll
- history - history
- progress - progress
tabs.focus_stack_size:
global: 10
tabs.indicator.width:
global: 3
tabs.last_close:
global: close
tabs.max_width:
global: 8000
tabs.min_width:
global: -1
tabs.mode_on_change:
global: persist
tabs.padding: tabs.padding:
global: global:
bottom: 2 bottom: 2
@@ -65,7 +72,7 @@ settings:
right: 5 right: 5
top: 2 top: 2
tabs.position: tabs.position:
global: left global: top
tabs.show: tabs.show:
global: always global: always
tabs.show_switching_delay: tabs.show_switching_delay:
@@ -83,3 +90,17 @@ settings:
sh: https://explainshell.com/explain?cmd={} sh: https://explainshell.com/explain?cmd={}
url.start_pages: url.start_pages:
global: https://www.hjarl.com/tt-rss global: https://www.hjarl.com/tt-rss
fonts.statusbar:
global: 20px default_family
fonts.tabs.selected:
global: 10pt sans-serif
fonts.tabs.unselected:
global: 10pt sans-serif
colors.tabs.even.bg:
global: cyan
colors.tabs.odd.bg:
global: cyan
colors.tabs.even.fg:
global: black
colors.tabs.odd.fg:
global: black