Attention! All this is a work in progress.
:help 'include' is set so that Vim recognizes both:
import Foo from 'foo';
| local severity_map = { "E", "W", "I", "H" } | |
| local parse_diagnostics = function(diagnostics) | |
| if not diagnostics then return end | |
| local items = {} | |
| for _, diagnostic in ipairs(diagnostics) do | |
| local fname = vim.fn.bufname() | |
| local position = diagnostic.range.start | |
| local severity = diagnostic.severity | |
| table.insert(items, { |
Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.
If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.
| set noshowmode | |
| set noruler | |
| autocmd ColorScheme * highlight link ModeNFGC StatuslineNC | |
| autocmd ColorScheme * highlight link ModeNFGCS LineNr | |
| autocmd ColorScheme * highlight link ModeIFGC DiffAdd | |
| autocmd ColorScheme * highlight link ModeIFGCS DiffAdded | |
| autocmd ColorScheme * highlight link ModeRFGC Search | |
| autocmd ColorScheme * highlight link ModeRFGCS Repeat | |
| autocmd ColorScheme * highlight link ModeVFGC CursorIM |
| ---Utility for keymap creation. | |
| ---@param lhs string | |
| ---@param rhs string|function | |
| ---@param opts string|table | |
| ---@param mode? string|string[] | |
| local function keymap(lhs, rhs, opts, mode) | |
| opts = type(opts) == 'string' and { desc = opts } | |
| or vim.tbl_extend('error', opts --[[@as table]], { buffer = bufnr }) | |
| mode = mode or 'n' | |
| vim.keymap.set(mode, lhs, rhs, opts) |