Repository navigation
Expand file tree
/
Copy pathmini-trailspace.txt
More file actions
95 lines (72 loc) · 3.92 KB
/
Copy pathmini-trailspace.txt
File metadata and controls
95 lines (72 loc) · 3.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
8000
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
==============================================================================
------------------------------------------------------------------------------
*mini.trailspace*
*MiniTrailspace*
Work with trailing whitespace
Features:
- Highlighting is done only in modifiable buffer by default, only in Normal
mode, and stops in Insert mode and when leaving window.
- Trim all trailing whitespace with |MiniTrailspace.trim()|.
- Trim all trailing empty lines with |MiniTrailspace.trim_last_lines()|.
# Setup~
This module needs a setup with `require('mini.trailspace').setup({})`
(replace `{}` with your `config` table). It will create global Lua table
`MiniTrailspace` which you can use for scripting or manually (with
`:lua MiniTrailspace.*`).
See |MiniTrailspace.config| for `config` structure and default values.
You can override runtime config settings locally to buffer inside
`vim.b.minitrailspace_config` which should have same structure as
`MiniTrailspace.config`. See |mini.nvim-buffer-local-config| for more details.
# Highlight groups~
* `MiniTrailspace` - highlight group for trailing space.
To change any highlight group, modify it directly with |:highlight|.
# Disabling~
To disable, set `g:minitrailspace_disable` (globally) or
`b:minitrailspace_disable` (for a buffer) to `v:true`. Considering high
number of different scenarios and customization intentions, writing exact
rules for disabling module's functionality is left to user. See
|mini.nvim-disabling-recipes| for common recipes. Note: after disabling
there might be highlighting left; it will be removed after next
highlighting update (see |events| and `MiniTrailspace` |augroup|).
------------------------------------------------------------------------------
*MiniTrailspace.setup()*
`MiniTrailspace.setup`({config})
Module setup
Parameters~
{config} `(table)` Module config table. See |MiniTrailspace.config|.
Usage~
`require('mini.trailspace').setup({})` (replace `{}` with your `config` table)
------------------------------------------------------------------------------
*MiniTrailspace.config*
`MiniTrailspace.config`
Module config
Default values:
>
MiniTrailspace.config = {
-- Highlight only in normal buffers (ones with empty 'buftype'). This is
-- useful to not show trailing whitespace where it usually doesn't matter.
only_in_normal_buffers = true,
}
<
------------------------------------------------------------------------------
*MiniTrailspace.highlight()*
`MiniTrailspace.highlight`()
Highlight trailing whitespace in current window
------------------------------------------------------------------------------
*MiniTrailspace.unhighlight()*
`MiniTrailspace.unhighlight`()
Unhighlight trailing whitespace in current window
------------------------------------------------------------------------------
*MiniTrailspace.trim()*
`MiniTrailspace.trim`()
Trim trailing whitespace
------------------------------------------------------------------------------
*MiniTrailspace.trim_last_lines()*
`MiniTrailspace.trim_last_lines`()
Trim last blank lines
------------------------------------------------------------------------------
*MiniTrailspace.track_normal_buffer()*
`MiniTrailspace.track_normal_buffer`()
Track normal buffer
Designed
30C6
to be used with |autocmd|. No need to use it directly.
vim:tw=78:ts=8:noet:ft=help:norl: