diff options
Diffstat (limited to 'nvim')
| -rw-r--r-- | nvim/.config/nvim/colors/jellybeans.vim | 2 | ||||
| -rw-r--r-- | nvim/.config/nvim/init.vim | 151 |
2 files changed, 139 insertions, 14 deletions
diff --git a/nvim/.config/nvim/colors/jellybeans.vim b/nvim/.config/nvim/colors/jellybeans.vim index bb57c28..73a0d98 100644 --- a/nvim/.config/nvim/colors/jellybeans.vim +++ b/nvim/.config/nvim/colors/jellybeans.vim | |||
| @@ -88,7 +88,7 @@ endif | |||
| 88 | " - g:jellybeans_use_gui_italics (default = 1) | 88 | " - g:jellybeans_use_gui_italics (default = 1) |
| 89 | " - g:jellybeans_use_term_italics (default = 0) | 89 | " - g:jellybeans_use_term_italics (default = 0) |
| 90 | 90 | ||
| 91 | let s:background_color = "070707" | 91 | let s:background_color = "000000" |
| 92 | 92 | ||
| 93 | if exists("g:jellybeans_overrides") | 93 | if exists("g:jellybeans_overrides") |
| 94 | let s:overrides = g:jellybeans_overrides | 94 | let s:overrides = g:jellybeans_overrides |
diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index c61ef87..ecb1c98 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim | |||
| @@ -35,7 +35,7 @@ set shiftwidth=4 " number of spaces to use for autoindent | |||
| 35 | set expandtab " tabs are space | 35 | set expandtab " tabs are space |
| 36 | set autoindent | 36 | set autoindent |
| 37 | set copyindent " copy indent from the previous line | 37 | set copyindent " copy indent from the previous line |
| 38 | colorscheme jellybeans | 38 | colorscheme bloodbath |
| 39 | "hi Normal ctermbg=16 guibg=#000000 | 39 | "hi Normal ctermbg=16 guibg=#000000 |
| 40 | "hi LineNr ctermbg=16 guibg=#000000 | 40 | "hi LineNr ctermbg=16 guibg=#000000 |
| 41 | 41 | ||
| @@ -112,15 +112,140 @@ map <C-l> <C-w>l | |||
| 112 | nnoremap S :%s//gI<Left><Left><Left> | 112 | nnoremap S :%s//gI<Left><Left><Left> |
| 113 | 113 | ||
| 114 | "statusbar | 114 | "statusbar |
| 115 | hi Comment cterm=italic | 115 | scriptencoding utf-8 |
| 116 | hi CursorLine guibg=#2b2b2b | 116 | |
| 117 | set statusline= | 117 | " statusline |
| 118 | set statusline +=%1*\ %n\ %* "buffer number | 118 | |
| 119 | set statusline +=%5*%{&ff}%* "file format | 119 | let g:currentmode={ |
| 120 | set statusline +=%3*%y%* "file type | 120 | \ 'n' : 'NORMAL ', |
| 121 | set statusline +=%4*\ %<%F%* "full path | 121 | \ 'no' : 'N·OPERATOR PENDING ', |
| 122 | set statusline +=%2*%m%* "modified flag | 122 | \ 'v' : 'VISUAL ', |
| 123 | set statusline +=%1*%=%5l%* "current line | 123 | \ 'V' : 'V·LINE ', |
| 124 | set statusline +=%2*/%L%* "total lines | 124 | \ '' : 'V·BLOCK ', |
| 125 | set statusline +=%1*%4v\ %* "virtual column number | 125 | \ 's' : 'SELECT ', |
| 126 | set statusline +=%2*0x%04B\ %* "character under cursor | 126 | \ 'S' : 'S·LINE ', |
| 127 | \ '' : 'S·BLOCK ', | ||
| 128 | \ 'i' : 'INSERT ', | ||
| 129 | \ 'R' : 'REPLACE ', | ||
| 130 | \ 'Rv' : 'V·REPLACE ', | ||
| 131 | \ 'c' : 'COMMAND ', | ||
| 132 | \ 'cv' : 'VIM EX ', | ||
| 133 | \ 'ce' : 'EX ', | ||
| 134 | \ 'r' : 'PROMPT ', | ||
| 135 | \ 'rm' : 'MORE ', | ||
| 136 | \ 'r?' : 'CONFIRM ', | ||
| 137 | \ '!' : 'SHELL ', | ||
| 138 | \ 't' : 'TERMINAL '} | ||
| 139 | |||
| 140 | hi PrimaryBlock ctermfg=00 ctermbg=6 | ||
| 141 | hi SecondaryBlock ctermfg=07 ctermbg=10 | ||
| 142 | hi Blanks ctermfg=00 ctermbg=11 | ||
| 143 | |||
| 144 | hi User1 ctermfg=01 ctermbg=0 | ||
| 145 | hi User2 ctermfg=02 ctermbg=0 | ||
| 146 | hi User3 ctermfg=03 ctermbg=0 | ||
| 147 | hi User4 ctermfg=04 ctermbg=0 | ||
| 148 | hi User5 ctermfg=05 ctermbg=0 | ||
| 149 | hi User6 ctermfg=06 ctermbg=0 | ||
| 150 | hi User7 ctermfg=07 ctermbg=0 | ||
| 151 | hi User8 ctermfg=08 ctermbg=0 | ||
| 152 | hi User9 ctermfg=09 ctermbg=0 | ||
| 153 | |||
| 154 | highlight EndOfBuffer ctermfg=black ctermbg=black | ||
| 155 | |||
| 156 | function! GitBranch() | ||
| 157 | return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'") | ||
| 158 | endfunction | ||
| 159 | |||
| 160 | function! StatuslineGit() | ||
| 161 | let l:branchname = GitBranch() | ||
| 162 | return strlen(l:branchname) > 0?'* '.l:branchname.' ':'' | ||
| 163 | endfunction | ||
| 164 | |||
| 165 | function! ReadOnly() abort | ||
| 166 | if !&modifiable && &readonly | ||
| 167 | return ' RO' | ||
| 168 | elseif &modifiable && &readonly | ||
| 169 | return 'RO' | ||
| 170 | elseif !&modifiable && !&readonly | ||
| 171 | return '' | ||
| 172 | else | ||
| 173 | return '' | ||
| 174 | endif | ||
| 175 | endfunction | ||
| 176 | |||
| 177 | function! Filepath() abort | ||
| 178 | let l:basename = expand('%:h') | ||
| 179 | let l:filename = expand('%:t') | ||
| 180 | let l:extension = expand('%:e') | ||
| 181 | let l:prefix = (l:basename ==# '' || l:basename ==# '.') ? | ||
| 182 | \ '' : substitute(l:basename . '/', '\C^' . $HOME, '~', '') | ||
| 183 | |||
| 184 | if empty(l:prefix) && empty(l:filename) | ||
| 185 | return printf('%%8*%%f%%*%s %%m%%*', '%8*') | ||
| 186 | elseif empty(l:prefix) | ||
| 187 | return printf('%%8*%%f%%*%s %%m%%*', '%6*') | ||
| 188 | else | ||
| 189 | return printf('%%8*%s%%*%s%s%%*', l:prefix, &modified ? '%6*' : '%8*', l:filename) | ||
| 190 | endif | ||
| 191 | endfunction | ||
| 192 | |||
| 193 | function! LinterStatus() abort | ||
| 194 | let info = get(b:, 'coc_diagnostic_info', {}) | ||
| 195 | if empty(info) | return '' | endif | ||
| 196 | let msgs = [] | ||
| 197 | if get(info, 'error', 0) | ||
| 198 | call add(msgs, printf('%%5*%s×%%*', info['error'])) | ||
| 199 | endif | ||
| 200 | if get(info, 'warning', 0) | ||
| 201 | call add(msgs, printf('%%3*%s!%%*', info['warning'])) | ||
| 202 | endif | ||
| 203 | return join(msgs, ' ') | ||
| 204 | endfunction | ||
| 205 | |||
| 206 | function! StatusLine(mode) abort | ||
| 207 | let l:line='' | ||
| 208 | |||
| 209 | " help or man pages | ||
| 210 | if &filetype ==# 'help' || &filetype ==# 'man' | ||
| 211 | let l:line.=' %#StatusLineNC# ['. &filetype .'] %f ' | ||
| 212 | return l:line | ||
| 213 | endif | ||
| 214 | |||
| 215 | " active | ||
| 216 | if a:mode ==# 'active' | ||
| 217 | let l:line.='%7*%{StatuslineGit()}' | ||
| 218 | let l:line.='%<' | ||
| 219 | let l:line.=Filepath() | ||
| 220 | |||
| 221 | let l:line.='%5*' | ||
| 222 | let l:line.=' %{ReadOnly()} %w%*' | ||
| 223 | let l:line.='%9* %=%*' | ||
| 224 | |||
| 225 | let l:line.='%7* %l,%c %*' | ||
| 226 | let l:line.='%8* %{g:currentmode[mode()]}%*' | ||
| 227 | let l:line.=' ' | ||
| 228 | let l:line.=LinterStatus() | ||
| 229 | let l:line.=' ' | ||
| 230 | let l:line.='%8*'. &filetype | ||
| 231 | |||
| 232 | else | ||
| 233 | " inactive | ||
| 234 | let l:line.='%#Blanks#' | ||
| 235 | let l:line.='%f %5*%m%*' | ||
| 236 | let l:line.='%#Blanks# %=%*' | ||
| 237 | endif | ||
| 238 | |||
| 239 | let l:line.='%*' | ||
| 240 | |||
| 241 | return l:line | ||
| 242 | endfunction | ||
| 243 | |||
| 244 | set statusline=%!StatusLine('active') | ||
| 245 | augroup MyStatusLine | ||
| 246 | autocmd! | ||
| 247 | autocmd WinEnter * setl statusline=%!StatusLine('active') | ||
| 248 | autocmd WinLeave * setl statusline=%!StatusLine('inactive') | ||
| 249 | augroup END | ||
| 250 | |||
| 251 | |||
