Compare commits
2 Commits
cace587a09
...
afdefb7dc3
Author | SHA1 | Date | |
---|---|---|---|
afdefb7dc3
|
|||
64afe9c9ee
|
@ -5,38 +5,46 @@ return { "mellow-theme/mellow.nvim",
|
|||||||
vim.g.mellow_variant = "dark"
|
vim.g.mellow_variant = "dark"
|
||||||
local c = require("mellow.colors")[vim.g.mellow_variant]
|
local c = require("mellow.colors")[vim.g.mellow_variant]
|
||||||
|
|
||||||
vim.g.mellow_highlight_overrides = {
|
if vim.g.mellow_variant == "dark" then
|
||||||
-- stop inactive windows from having a darker bg
|
vim.g.mellow_highlight_overrides = {
|
||||||
["NormalNC"] = { link = "Normal" },
|
-- stop inactive windows from having a darker bg
|
||||||
|
["NormalNC"] = { link = "Normal" },
|
||||||
|
|
||||||
-- make splits look cleaner
|
-- revert change with statusline coloring
|
||||||
["WinSeparator"] = { link = "Normal" },
|
["StatusLine"] = { fg = c.white, bg = c.gray01 },
|
||||||
|
["StatusLineNC"] = { fg = c.bg_dark },
|
||||||
|
|
||||||
-- make floats darker
|
-- make splits look cleaner
|
||||||
["NormalFloat"] = { fg = c.fg, bg = "#111111" },
|
["WinSeparator"] = { fg = c.gray01 },
|
||||||
["FloatBorder"] = { link = "NormalFloat" },
|
|
||||||
|
|
||||||
-- make diagnostics have an undercurl
|
-- make floats darker
|
||||||
["DiagnosticUnderlineError"] = { fg = c.red, undercurl = true },
|
["NormalFloat"] = { fg = c.fg, bg = "#111111" },
|
||||||
["DiagnosticUnderlineWarn"] = { fg = c.yellow, undercurl = true },
|
["FloatBorder"] = { link = "NormalFloat" },
|
||||||
["DiagnosticUnderlineInfo"] = { fg = c.blue, undercurl = true },
|
|
||||||
["DiagnosticUnderlineHint"] = { fg = c.cyan, undercurl = true },
|
|
||||||
|
|
||||||
-- make blink actually look nice
|
-- make diagnostics have an undercurl
|
||||||
["BlinkCmpMenu"] = { link = "NormalFloat" },
|
["DiagnosticUnderlineError"] = { fg = c.red, undercurl = true },
|
||||||
["BlinkCmpMenuBorder"] = { link = "BlinkCmpMenu" },
|
["DiagnosticUnderlineWarn"] = { fg = c.yellow, undercurl = true },
|
||||||
["BlinkCmpMenuSelection"] = { bg = c.gray01 },
|
["DiagnosticUnderlineInfo"] = { fg = c.blue, undercurl = true },
|
||||||
["BlinkCmpLabelDeprecated"] = { link = "CmpItemAbbrDeprecated" },
|
["DiagnosticUnderlineHint"] = { fg = c.cyan, undercurl = true },
|
||||||
|
["DiagnosticHint"] = { fg = c.cyan }, -- revert
|
||||||
|
|
||||||
-- telescope styling so I can see when coding outside (real)
|
-- make blink actually look nice
|
||||||
["TelescopeResultsNormal"] = { bg = c.bg_dark },
|
["BlinkCmpMenu"] = { link = "NormalFloat" },
|
||||||
["TelescopeResultsBorder"] = { link = "TelescopeResultsNormal" },
|
["BlinkCmpMenuBorder"] = { link = "BlinkCmpMenu" },
|
||||||
["TelescopeResultsTitle"] = {
|
["BlinkCmpMenuSelection"] = { bg = c.gray01 },
|
||||||
bg = core.color.copyhl("TelescopeResultsNormal").background,
|
["BlinkCmpLabelDeprecated"] = { link = "CmpItemAbbrDeprecated" },
|
||||||
fg = core.color.copyhl("TelescopeResultsNormal").background
|
["BlinkCmpLabelMatch"] = { link = "NormalFloat" }, -- reverted
|
||||||
},
|
|
||||||
["TelescopePreviewNormal"] = { link = "NormalFloat" },
|
-- telescope styling so I can see when coding outside (real)
|
||||||
["TelescopePreviewBorder"] = { link = "TelescopePreviewNormal" }
|
["TelescopeResultsNormal"] = { bg = c.bg_dark },
|
||||||
}
|
["TelescopeResultsBorder"] = { link = "TelescopeResultsNormal" },
|
||||||
|
["TelescopeResultsTitle"] = {
|
||||||
|
bg = core.color.copyhl("TelescopeResultsNormal").background,
|
||||||
|
fg = core.color.copyhl("TelescopeResultsNormal").background
|
||||||
|
},
|
||||||
|
["TelescopePreviewNormal"] = { link = "NormalFloat" },
|
||||||
|
["TelescopePreviewBorder"] = { link = "TelescopePreviewNormal" }
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
@ -1,79 +1,54 @@
|
|||||||
local map, auto = core.misc.map, core.misc.auto
|
local map, auto = core.misc.map, core.misc.auto
|
||||||
|
|
||||||
--- to highlight a buffer or not
|
|
||||||
---@param buf number buffer number
|
|
||||||
---@return boolean to_highlight
|
|
||||||
local function highlight(buf)
|
|
||||||
local ft = vim.api.nvim_get_option_value("ft", { buf = buf })
|
|
||||||
|
|
||||||
-- disable highlighting on big files
|
|
||||||
local ok, stats = pcall(vim.uv.fs_stat, vim.api.nvim_buf_get_name(buf))
|
|
||||||
if ok and stats and stats.size > (1000 * 100 * 10) --[[1MB]] then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
-- fts to stop highlighting in
|
|
||||||
if table.contains({
|
|
||||||
"diff", "tex"
|
|
||||||
}, ft) then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
--- to indent a buffer or not
|
|
||||||
---@param buf number buffer number
|
|
||||||
---@return boolean to_indent
|
|
||||||
local function indent(buf)
|
|
||||||
local ft = vim.api.nvim_get_option_value("ft", { buf = buf })
|
|
||||||
|
|
||||||
-- disable indentation on filetypes
|
|
||||||
if not table.contains({
|
|
||||||
"php"
|
|
||||||
}, ft) then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{ "nvim-treesitter/nvim-treesitter",
|
{ "nvim-treesitter/nvim-treesitter",
|
||||||
branch = "main",
|
disable = not vim.fn.has("nvim-0.10.0"),
|
||||||
disable = not vim.fn.has("nvim-0.11.0"),
|
|
||||||
config = function()
|
config = function()
|
||||||
vim.cmd("TSUpdate")
|
vim.cmd("TSUpdate")
|
||||||
end,
|
end,
|
||||||
load = function()
|
load = function()
|
||||||
local treesitter = require("nvim-treesitter")
|
require("nvim-treesitter.configs").setup {
|
||||||
|
-- good default parsers
|
||||||
|
ensure_installed = { "c", "lua", "vim", "vimdoc", "markdown",
|
||||||
|
"markdown_inline", "java", "bash", "css", "html", "luadoc",
|
||||||
|
"make"
|
||||||
|
},
|
||||||
|
|
||||||
-- seems to not be very async despite the docs saying it is
|
-- indentation
|
||||||
-- default parsers to install
|
indent = {
|
||||||
-- treesitter.install { "c", "lua", "vim", "vimdoc", "markdown",
|
enable = true,
|
||||||
-- "markdown_inline", "java", "bash", "css", "html", "luadoc", "make"
|
|
||||||
-- }
|
|
||||||
|
|
||||||
-- enable highlighting
|
disable = function(lang, _)
|
||||||
auto("FileType", {
|
-- disable indenting in php (it's more broken with than without)
|
||||||
callback = function(e)
|
return table.contains(({
|
||||||
-- I like both treesitter and default highlighting enabled
|
"php"
|
||||||
if highlight(e.buf) then
|
}), lang)
|
||||||
-- stop errors from showing up, I don't care
|
|
||||||
pcall(vim.treesitter.start)
|
|
||||||
vim.bo.syntax = "on"
|
|
||||||
end
|
end
|
||||||
|
},
|
||||||
|
|
||||||
-- indenting
|
-- enable highlighting
|
||||||
if indent(e.buf) then
|
highlight = {
|
||||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
enable = true,
|
||||||
|
-- use vim highlighting in addition to treesitter
|
||||||
|
additional_vim_regex_highlighting = true,
|
||||||
|
|
||||||
|
disable = function(lang, buf)
|
||||||
|
-- disable in some files where vim's builtin highlighting is better
|
||||||
|
if table.contains(({
|
||||||
|
"diff", "tex"
|
||||||
|
}), lang) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
-- disable in big files
|
||||||
|
local ok, stats = pcall(vim.uv.fs_stat,
|
||||||
|
vim.api.nvim_buf_get_name(buf))
|
||||||
|
if ok and stats and stats.size > (1024 * 100 * 10) --[[1MB]] then
|
||||||
|
return true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
}
|
||||||
-- set the folding method
|
}
|
||||||
vim.opt.foldmethod = "expr"
|
|
||||||
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
|
||||||
end
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user