mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-19 07:15:34 -04:00
statusline: Provide overwrite
mode indicator
This commit is contained in:
parent
c61670e86f
commit
57a6e81ddb
@ -93,7 +93,7 @@ var defaultCommonSettings = map[string]interface{}{
|
|||||||
"softwrap": false,
|
"softwrap": false,
|
||||||
"splitbottom": true,
|
"splitbottom": true,
|
||||||
"splitright": true,
|
"splitright": true,
|
||||||
"statusformatl": "$(filename) $(modified)($(line),$(col)) $(status.paste)| ft:$(opt:filetype) | $(opt:fileformat) | $(opt:encoding)",
|
"statusformatl": "$(filename) $(modified)$(overwrite)($(line),$(col)) $(status.paste)| ft:$(opt:filetype) | $(opt:fileformat) | $(opt:encoding)",
|
||||||
"statusformatr": "$(bind:ToggleKeyMenu): bindings, $(bind:ToggleHelp): help",
|
"statusformatr": "$(bind:ToggleKeyMenu): bindings, $(bind:ToggleHelp): help",
|
||||||
"statusline": true,
|
"statusline": true,
|
||||||
"syntax": true,
|
"syntax": true,
|
||||||
|
@ -47,6 +47,12 @@ var statusInfo = map[string]func(*buffer.Buffer) string{
|
|||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
},
|
},
|
||||||
|
"overwrite": func(b *buffer.Buffer) string {
|
||||||
|
if b.OverwriteMode && !b.Type.Readonly {
|
||||||
|
return "[ovwr] "
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
},
|
||||||
"lines": func(b *buffer.Buffer) string {
|
"lines": func(b *buffer.Buffer) string {
|
||||||
return strconv.Itoa(b.LinesNum())
|
return strconv.Itoa(b.LinesNum())
|
||||||
},
|
},
|
||||||
|
@ -415,11 +415,11 @@ Here are the available options:
|
|||||||
* `statusformatl`: format string definition for the left-justified part of the
|
* `statusformatl`: format string definition for the left-justified part of the
|
||||||
statusline. Special directives should be placed inside `$()`. Special
|
statusline. Special directives should be placed inside `$()`. Special
|
||||||
directives include: `filename`, `modified`, `line`, `col`, `lines`,
|
directives include: `filename`, `modified`, `line`, `col`, `lines`,
|
||||||
`percentage`, `opt`, `bind`.
|
`percentage`, `opt`, `overwrite`, `bind`.
|
||||||
The `opt` and `bind` directives take either an option or an action afterward
|
The `opt` and `bind` directives take either an option or an action afterward
|
||||||
and fill in the value of the option or the key bound to the action.
|
and fill in the value of the option or the key bound to the action.
|
||||||
|
|
||||||
default value: `$(filename) $(modified)($(line),$(col)) $(status.paste)|
|
default value: `$(filename) $(modified)$(overwrite)($(line),$(col)) $(status.paste)|
|
||||||
ft:$(opt:filetype) | $(opt:fileformat) | $(opt:encoding)`
|
ft:$(opt:filetype) | $(opt:fileformat) | $(opt:encoding)`
|
||||||
|
|
||||||
* `statusformatr`: format string definition for the right-justified part of the
|
* `statusformatr`: format string definition for the right-justified part of the
|
||||||
@ -578,7 +578,7 @@ so that you can see what the formatting should look like.
|
|||||||
"splitbottom": true,
|
"splitbottom": true,
|
||||||
"splitright": true,
|
"splitright": true,
|
||||||
"status": true,
|
"status": true,
|
||||||
"statusformatl": "$(filename) $(modified)($(line),$(col)) $(status.paste)| ft:$(opt:filetype) | $(opt:fileformat) | $(opt:encoding)",
|
"statusformatl": "$(filename) $(modified)$(overwrite)($(line),$(col)) $(status.paste)| ft:$(opt:filetype) | $(opt:fileformat) | $(opt:encoding)",
|
||||||
"statusformatr": "$(bind:ToggleKeyMenu): bindings, $(bind:ToggleHelp): help",
|
"statusformatr": "$(bind:ToggleKeyMenu): bindings, $(bind:ToggleHelp): help",
|
||||||
"statusline": true,
|
"statusline": true,
|
||||||
"sucmd": "sudo",
|
"sucmd": "sudo",
|
||||||
|
Loading…
Reference in New Issue
Block a user