瀏覽代碼

default statusline added to vimrc

master
Dirk Alders 1 年之前
父節點
當前提交
f3196f8cb2
共有 1 個文件被更改,包括 27 次插入0 次删除
  1. 27
    0
      .vimrc

+ 27
- 0
.vimrc 查看文件

@@ -65,6 +65,33 @@ set wrap
65 65
 "
66 66
 " Always display the status bar.
67 67
 set laststatus=2
68
+" Statusline color
69
+" highlight mode color
70
+highlight NormalColor ctermbg=10 ctermfg=0
71
+highlight InsertColor ctermbg=14 ctermfg=0
72
+highlight VisualColor ctermbg=9 ctermfg=0
73
+highlight CommandColor ctermbg=15 ctermfg=0
74
+set statusline=
75
+set statusline+=%#NormalColor#%{(mode()=='n')?'\ \ NORMAL\ \ ':''}
76
+set statusline+=%#InsertColor#%{(mode()=='i')?'\ \ INSERT\ \ ':''}
77
+set statusline+=%#VisualColor#%{(mode()=='v')?'\ \ VISUAL\ \ ':''}
78
+set statusline+=%#CommandColor#%{(mode()=='c')?'\ \ COMMAND\ ':''}
79
+set statusline+=%#NormalColor#
80
+
81
+set statusline+=%f                           " file name
82
+set statusline+=[%{strlen(&fenc)?&fenc:'none'}, "file encoding
83
+set statusline+=%{&ff}] "file format
84
+set statusline+=%y      "filetype
85
+set statusline+=%h      "help file flag
86
+set statusline+=[%{getbufvar(bufnr('%'),'&mod')?'modified':'saved'}]
87
+"modified flag
88
+set statusline+=%r      "read only flag
89
+set statusline+=\ %=                        " align left
90
+set statusline+=Line:%l/%L[%p%%]            " line X of Y [percent of file]
91
+set statusline+=\ Col:%c                    " current column
92
+"set statusline+=\ Buf:%n                    " Buffer number
93
+set statusline+=\ [0x%B]\               " ASCII and byte code under cursor
94
+
68 95
 " Always show cursor position.
69 96
 "set ruler
70 97
 " Display command line's tab complete options as a menu.

Loading…
取消
儲存