-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
trailing.lua
42 lines (35 loc) · 1.16 KB
/
trailing.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
return {
'johnfrankmorgan/whitespace.nvim',
-- @TODO remove below line after [the issue](https://github.com/johnfrankmorgan/whitespace.nvim/issues/13) fixed.
commit = '406cd69216dd7847b0cb38486603a8ed5c4f8c77',
desc = 'highlight trailing spaces',
highlights = function(config)
return { TrailingWhitespace = { bg = config.colors.grey } }
end,
commands = {
TrailingSpaces = {
function()
require('whitespace-nvim').trim()
end,
{ desc = 'Remove trailing spaces' },
},
},
config = function(config)
require('whitespace-nvim').setup(config.whitespace)
end,
defaultConfig = function(config)
return {
'whitespace',
{
-- `highlight` configures which highlight is used to display trailing whitespace
highlight = 'TrailingWhitespace',
-- `ignored_filetypes` configures which filetypes to ignore when displaying trailing whitespace
ignored_filetypes = config.ignore.fileTypesForSomePlugs,
-- `ignore_terminal` configures whether to ignore terminal buffers
ignore_terminal = true,
-- `return_cursor` configures if cursor should return to previous position after trimming whitespace
return_cursor = true,
},
}
end,
}