From e9d4d95144a7937a61c4c1dd1e3c8cdedada0082 Mon Sep 17 00:00:00 2001 From: Akos Horvath Date: Fri, 18 Aug 2023 19:32:46 +0200 Subject: [PATCH] add autocmd to highlight trailing whitespace --- init.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index 7c73326..e76e35e 100644 --- a/init.lua +++ b/init.lua @@ -254,11 +254,16 @@ mason_lspconfig.setup_handlers { -- Turn on lsp status information require('fidget').setup() --- vim.g.coq_settings = { --- auto_start = true, --- } --- --- vim.cmd([[COQnow -s]]) +-- highlight trailing whitespace +vim.cmd([[ + autocmd VimEnter * autocmd WinEnter * let w:created=1 + autocmd VimEnter * let w:created=1 + highlight WhitespaceEOL ctermbg=red ctermfg=white guibg=#592929 + autocmd BufWritePost * + \ if !exists('w:created') | call matchadd('WhitespaceEOL', '\s\+$') | endif + call matchadd('WhitespaceEOL', '\s\+$') +]]) + local hop = require('hop') local directions = require('hop.hint').HintDirection