vim: replace trailing whitespace plugin
This commit is contained in:
parent
1495563e96
commit
a29ab8a546
3 changed files with 26 additions and 11 deletions
23
config/nvim/lua/fs/config/vim-better-whitespace.lua
Normal file
23
config/nvim/lua/fs/config/vim-better-whitespace.lua
Normal 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 }
|
||||
|
|
@ -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 }
|
||||
|
|
@ -38,8 +38,9 @@ local plugins = function(use)
|
|||
|
||||
-- Editing ----------------------------------------------------------------
|
||||
use {
|
||||
'bronson/vim-trailing-whitespace',
|
||||
config = function() require'fs.config.vim-trailing-whitespace'.config() end,
|
||||
'ntpeters/vim-better-whitespace',
|
||||
setup = function() require'fs.config.vim-better-whitespace'.setup() end,
|
||||
config = function() require'fs.config.vim-better-whitespace'.config() end,
|
||||
}
|
||||
use 'godlygeek/tabular'
|
||||
use 'tpope/vim-commentary'
|
||||
|
|
Loading…
Add table
Reference in a new issue