{"id":18613003,"url":"https://github.com/lukoshkin/highlight-whitespace","last_synced_at":"2025-04-10T23:31:45.981Z","repository":{"id":50399677,"uuid":"515324001","full_name":"lukoshkin/highlight-whitespace","owner":"lukoshkin","description":"Highlight unwanted whitespace and more in Vim/Neovim","archived":false,"fork":false,"pushed_at":"2024-10-01T18:25:30.000Z","size":15852,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T06:23:04.648Z","etag":null,"topics":["neovim-lua-plugin","trailing-spaces","vim-markdown","whitespace"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukoshkin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-18T19:59:19.000Z","updated_at":"2025-02-12T09:44:13.000Z","dependencies_parsed_at":"2024-07-13T23:29:15.855Z","dependency_job_id":"96847919-e98a-4986-b783-eaa93d9994a7","html_url":"https://github.com/lukoshkin/highlight-whitespace","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukoshkin%2Fhighlight-whitespace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukoshkin%2Fhighlight-whitespace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukoshkin%2Fhighlight-whitespace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukoshkin%2Fhighlight-whitespace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukoshkin","download_url":"https://codeload.github.com/lukoshkin/highlight-whitespace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248316224,"owners_count":21083407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["neovim-lua-plugin","trailing-spaces","vim-markdown","whitespace"],"created_at":"2024-11-07T03:19:33.197Z","updated_at":"2025-04-10T23:31:44.667Z","avatar_url":"https://github.com/lukoshkin.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Highlight Whitespace\n\nHighlight unwanted whitespace across you project files. The fun part is that\nyou can come up with your own palette of colors used for a specific pattern\nper a filetype!\n\n---\n\nПочитать на [русском :ru:](/README.ru.md)\n\n![demo](./demo.gif)\n\nGo to the [Current Colorscheme](#current-colorscheme) section\nto see what each color stands for.  \n\u003csub\u003e\u003csup\u003e(Unfortunately placing it here breaks syntax\nhighlighting for all multi-line code blocks below it)\u003c/sup\u003e\u003c/sub\u003e\n\n## Installation\n\nWith [**lazy.nvim**](https://github.com/folke/lazy.nvim)\n\n```lua\n{\n  \"lukoshkin/highlight-whitespace\",\n  config=true,\n}\n```\n\nWith [**packer.nvim**](https://github.com/wbthomason/packer.nvim)\n\n```lua\nuse \"lukoshkin/highlight-whitespace\"\n```\n\n\u003c!--\nWith [**vim-plug**](https://github.com/junegunn/vim-plug)\n\n```vim\nPlug 'lukoshkin/highlight-whitespace', { 'branch': 'vimscript' }\n```\n\nOne can adapt the installation code for other plugin managers!\n--\u003e\n\n## Customization\n\n\u003c!--\nTwo ways to configure depending on the selected branch\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cBig\u003e\u003cb\u003evimscript\u003c/b\u003e (obsolete)\u003c/Big\u003e\u003c/summary\u003e\nNote you must specify both \u003ccode\u003ectermbg\u003c/code\u003e and \u003ccode\u003eguibg\u003c/code\u003e values,\neven if you don't care about one of them. \u003cbr\u003e Specifying other than\n\u003ccode\u003ebg\u003c/code\u003e keys has no effect.\n\n```vim\nlet g:tws_pattern = '\\s\\+$'\nlet g:tws_color_md = { 'ctermbg': 138, 'guibg': 'RosyBrown' }\nlet g:tws_color_any = { 'ctermbg': 211, 'guibg': 'PaleVioletRed' }\n```\n\n\u003c/details\u003e\n\n\u003cdetails open\u003e\n\u003csummary\u003e\u003cBig\u003e\u003cb\u003emaster (Lua)\u003c/b\u003e\u003c/Big\u003e\u003c/summary\u003e\nFor the Lua implementation, the functionality is much wider.\u003cbr\u003eOne can\nspecify a color for each pattern and per filetype. It can be a regular color\nname or hex code.\n--\u003e\n\n`tws` keyword - \"main\" pattern for trailing whitespace highlighting  \n`clear_on_bufleave` - boolean opt to clear highlighting in the current buffer\nbefore switching to another\n\n\u003cdetails open\u003e\n\u003csummary\u003elazy.nvim\u003c/summary\u003e\n\n```lua\n{\n  \"lukoshkin/highlight-whitespace\",\n  opts = {\n    tws = \"\\\\s\\\\+$\",\n    clear_on_bufleave = false,\n    palette = {\n      markdown = {\n        tws = 'RosyBrown',\n        ['\\\\S\\\\@\u003c=\\\\s\\\\(\\\\.\\\\|,\\\\)\\\\@='] = 'CadetBlue3',\n        ['\\\\S\\\\@\u003c= \\\\{2,\\\\}\\\\S\\\\@='] = 'SkyBlue1',\n        ['\\\\t\\\\+'] = 'plum4',\n      },\n      other = {\n        tws = 'PaleVioletRed',\n        ['\\\\S\\\\@\u003c=\\\\s,\\\\@='] = 'coral1',\n        ['\\\\S\\\\@\u003c=\\\\(#\\\\|--\\\\)\\\\@\u003c! \\\\{2,3\\\\}\\\\S\\\\@=\\\\(#\\\\|--\\\\)\\\\@!'] = 'LightGoldenrod3',\n        ['\\\\(#\\\\|--\\\\)\\\\@\u003c= \\\\{2,\\\\}\\\\S\\\\@='] = '#3B3B3B',\n        ['\\\\S\\\\@\u003c= \\\\{3,\\\\}\\\\(#\\\\|--\\\\)\\\\@='] = '#3B3B3B',\n        ['\\\\t\\\\+'] = 'plum4',\n      }\n    }\n  }\n}\n```\n\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003epacker.nvim\u003c/summary\u003e\n\n```lua\nuse {\n  'lukoshkin/highlight-whitespace',\n  config = function ()\n    require'highlight-whitespace'.setup {\n      tws = '\\\\s\\\\+$',\n      clear_on_bufleave = false,\n      palette = {\n        markdown = {\n          tws = 'RosyBrown',\n          ['\\\\S\\\\@\u003c=\\\\s\\\\(\\\\.\\\\|,\\\\)\\\\@='] = 'CadetBlue3',\n          ['\\\\S\\\\@\u003c= \\\\{2,\\\\}\\\\S\\\\@='] = 'SkyBlue1',\n          ['\\\\t\\\\+'] = 'plum4',\n        },\n        other = {\n          tws = 'PaleVioletRed',\n          ['\\\\S\\\\@\u003c=\\\\s,\\\\@='] = 'coral1',\n          ['\\\\S\\\\@\u003c=\\\\(#\\\\|--\\\\)\\\\@\u003c! \\\\{2,3\\\\}\\\\S\\\\@=\\\\(#\\\\|--\\\\)\\\\@!'] = 'LightGoldenrod3',\n          ['\\\\(#\\\\|--\\\\)\\\\@\u003c= \\\\{2,\\\\}\\\\S\\\\@='] = '#3B3B3B',\n          ['\\\\S\\\\@\u003c= \\\\{3,\\\\}\\\\(#\\\\|--\\\\)\\\\@='] = '#3B3B3B',\n          ['\\\\t\\\\+'] = 'plum4',\n        }\n      }\n    }\n  end\n}\n```\n\n\u003c/details\u003e\n\n### Ignoring filetypes\n\nIgnoring specific filetypes is possible by setting an empty table next to a\nfiletype in the `palette`.\n\nTo highlight only python and markdown filetypes\n\n```lua\n      palette = {\n        python = {\n          -- some patterns\n        },\n        markdown = {\n          -- some patterns\n        },\n        other = {},\n      }\n```\n\nTo ignore highlighting only in javascript\n\n```lua\n      palette = {\n        javascript = {},\n        other = {\n          -- some patterns\n        },\n      }\n```\n\n## Current Colorscheme\n\nThis section refers to the GIF at the README beginning\n\n---\n\n$$\n{\\color{PaleVioletRed}red}\\text{ color\n─ trailing whitespace in Python (other than md)}\n$$\n\n$$\n{\\color{#3B3B3B}dark\\ gray}\\text{\n─ leading and trailing whitespace in comment sections}\n$$\n\n$${\\color{RosyBrown}brown}\\text{ ─ in markdown}$$\n\n---\n\n$$\n{\\color{#CDBE70}yellow}\\text{ color\n─ redundant (multiple) spaces in Python}\n$$\n\n$${\\color{#87CEFF}blue}\\text{ ─ in markdown}$$\n\n---\n\n$${\\color{#FF7256}orange}\\text{ color ─ a space before a comma in Python}$$\n\n$${\\color{#7AC5CD}\"green\"}\\text{ ─ in markdown}$$\n\n---\n\n$${\\color{#8B668B}purple}\\text{ color ─ tab indents instead of spaces}$$\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukoshkin%2Fhighlight-whitespace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukoshkin%2Fhighlight-whitespace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukoshkin%2Fhighlight-whitespace/lists"}