vim: replace trailing whitespace plugin

This commit is contained in:
Fernando Schauenburg 2022-02-14 10:06:42 +01:00
parent 1495563e96
commit a29ab8a546
3 changed files with 26 additions and 11 deletions

View file

@ -0,0 +1,23 @@
local util = require'fs.util'
local nmap = util.nmap
local colors = util.colors()
local highlight = util.highlight
local setup = function()
vim.g.better_whitespace_filetypes_blacklist = {
'diff', 'git', 'gitcommit', 'help', 'fugitive'
}
end
local config = function()
highlight('ExtraWhitespace') { fg = colors.orange, bg = colors.orange }
-- fix whitespace
nmap { '<leader>w', '<cmd>StripWhitespace<cr>' }
-- show/hide whitespace
nmap { '<leader>sw', '<cmd>ToggleWhitespace<cr>' }
end
return { config = config, setup = setup }

View file

@ -1,9 +0,0 @@
local nmap = require'fs.util'.nmap
local config = function()
-- fix whitespace
nmap { '<leader>w', '<cmd>FixWhitespace<cr>' }
end
return { config = config }

View file

@ -38,8 +38,9 @@ local plugins = function(use)
-- Editing ---------------------------------------------------------------- -- Editing ----------------------------------------------------------------
use { use {
'bronson/vim-trailing-whitespace', 'ntpeters/vim-better-whitespace',
config = function() require'fs.config.vim-trailing-whitespace'.config() end, setup = function() require'fs.config.vim-better-whitespace'.setup() end,
config = function() require'fs.config.vim-better-whitespace'.config() end,
} }
use 'godlygeek/tabular' use 'godlygeek/tabular'
use 'tpope/vim-commentary' use 'tpope/vim-commentary'