Add basename option

Closes #903
This commit is contained in:
Zachary Yedidia
2018-01-02 22:25:55 -05:00
parent df44f538fd
commit c32f5a4859
4 changed files with 12 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@@ -202,6 +202,7 @@ func DefaultGlobalSettings() map[string]interface{} {
return map[string]interface{}{
"autoindent": true,
"autosave": false,
"basename": false,
"colorcolumn": float64(0),
"colorscheme": "default",
"cursorline": true,
@@ -244,6 +245,7 @@ func DefaultLocalSettings() map[string]interface{} {
return map[string]interface{}{
"autoindent": true,
"autosave": false,
"basename": false,
"colorcolumn": float64(0),
"cursorline": true,
"eofnewline": false,

View File

@@ -1,6 +1,7 @@
package main
import (
"path"
"strconv"
)
@@ -22,6 +23,9 @@ func (sline *Statusline) Display() {
y := sline.view.Height + sline.view.y
file := sline.view.Buf.GetName()
if sline.view.Buf.Settings["basename"].(bool) {
file = path.Base(file)
}
// If the buffer is dirty (has been modified) write a little '+'
if sline.view.Buf.Modified() {

View File

@@ -20,6 +20,11 @@ Here are the options that you can set:
default value: `off`
* `basename`: in the infobar, show only the basename of the file being edited
rather than the full path.
default value: `off`
* `colorcolumn`: if this is not set to 0, it will display a column at the
specified column. This is useful if you want column 80 to be highlighted
special for example.