summaryrefslogtreecommitdiff
path: root/nvim
diff options
context:
space:
mode:
authorShubham Saini <pryr@pryr.xyz>2020-07-12 17:00:55 +0000
committerShubham Saini <pryr@pryr.xyz>2020-07-12 17:00:55 +0000
commita282280614117d85378aab776543e967e8160376 (patch)
treeadca0cf399061ce37530e808600e0836310597a6 /nvim
parentbbbdafee9c0688cb9b22dc15ba9e1eef18c1045f (diff)
rolling a light theme
Diffstat (limited to 'nvim')
-rw-r--r--nvim/.config/nvim/init.vim137
1 files changed, 20 insertions, 117 deletions
diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim
index d071c83..26e74cf 100644
--- a/nvim/.config/nvim/init.vim
+++ b/nvim/.config/nvim/init.vim
@@ -5,7 +5,6 @@ Plug 'Shougo/deoplete-clangx'
5Plug 'deoplete-plugins/deoplete-jedi' 5Plug 'deoplete-plugins/deoplete-jedi'
6Plug 'Shougo/deol.nvim' 6Plug 'Shougo/deol.nvim'
7Plug 'ap/vim-css-color' 7Plug 'ap/vim-css-color'
8Plug 'luochen1990/rainbow'
9Plug 'tpope/vim-eunuch' 8Plug 'tpope/vim-eunuch'
10Plug 'tpope/vim-commentary' 9Plug 'tpope/vim-commentary'
11Plug 'scrooloose/nerdtree' 10Plug 'scrooloose/nerdtree'
@@ -20,7 +19,7 @@ call plug#end()
20set guicursor= 19set guicursor=
21set number relativenumber 20set number relativenumber
22set mouse=a 21set mouse=a
23set background=dark 22set background=light
24syntax enable 23syntax enable
25set cursorline 24set cursorline
26set ignorecase 25set ignorecase
@@ -35,7 +34,7 @@ set shiftwidth=4 " number of spaces to use for autoindent
35set expandtab " tabs are space 34set expandtab " tabs are space
36set autoindent 35set autoindent
37set copyindent " copy indent from the previous line 36set copyindent " copy indent from the previous line
38colorscheme bloodbath 37colorscheme pencil
39"hi Normal ctermbg=16 guibg=#000000 38"hi Normal ctermbg=16 guibg=#000000
40"hi LineNr ctermbg=16 guibg=#000000 39"hi LineNr ctermbg=16 guibg=#000000
41 40
@@ -56,9 +55,6 @@ let g:gitgutter_sign_removed = '-'
56let g:gitgutter_sign_removed_first_line = '^' 55let g:gitgutter_sign_removed_first_line = '^'
57let g:gitgutter_sign_modified_removed = '#' 56let g:gitgutter_sign_modified_removed = '#'
58 57
59" rainbow
60let g:rainbow_active = 1
61
62" vim-markdown 58" vim-markdown
63let g:vim_markdown_no_default_key_mappings=1 59let g:vim_markdown_no_default_key_mappings=1
64let g:vim_markdown_toml_frontmatter=1 60let g:vim_markdown_toml_frontmatter=1
@@ -92,6 +88,12 @@ hi Comment cterm=italic
92scriptencoding utf-8 88scriptencoding utf-8
93 89
94" statusline 90" statusline
91hi PrimaryBlock ctermbg=NONE ctermfg=8
92hi ModeBlock ctermbg=NONE ctermfg=2
93hi SecondaryBlock ctermbg=NONE ctermfg=8
94hi TeritaryBlock ctermbg=NONE ctermfg=9
95hi Blanks ctermbg=NONE
96hi statusline ctermbg=NONE
95let g:currentmode={ 97let g:currentmode={
96 \ 'n' : 'NORMAL ', 98 \ 'n' : 'NORMAL ',
97 \ 'no' : 'N·OPERATOR PENDING ', 99 \ 'no' : 'N·OPERATOR PENDING ',
@@ -112,114 +114,15 @@ let g:currentmode={
112 \ 'r?' : 'CONFIRM ', 114 \ 'r?' : 'CONFIRM ',
113 \ '!' : 'SHELL ', 115 \ '!' : 'SHELL ',
114 \ 't' : 'TERMINAL '} 116 \ 't' : 'TERMINAL '}
115 117set statusline=
116hi PrimaryBlock ctermfg=00 ctermbg=6 118set statusline+=%#ModeBlock#
117hi SecondaryBlock ctermfg=07 ctermbg=10 119set statusline+=\ %{g:currentmode[mode()]}
118hi Blanks ctermfg=00 ctermbg=11 120set statusline+=%#TeritaryBlock#
119 121set statusline+=\ %f\
120hi User1 ctermfg=01 ctermbg=0 122set statusline+=%M\
121hi User2 ctermfg=02 ctermbg=0 123set statusline+=%#Blanks#
122hi User3 ctermfg=03 ctermbg=0 124set statusline+=%=
123hi User4 ctermfg=04 ctermbg=0 125set statusline+=%#PrimaryBlock#
124hi User5 ctermfg=05 ctermbg=0 126set statusline+=\ %Y\
125hi User6 ctermfg=06 ctermbg=0 127set statusline+=%#SecondaryBlock#
126hi User7 ctermfg=07 ctermbg=0 128set statusline+=\ %P\
127hi User8 ctermfg=08 ctermbg=0
128hi User9 ctermfg=09 ctermbg=0
129
130highlight EndOfBuffer ctermfg=black ctermbg=black
131
132function! GitBranch()
133 return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
134endfunction
135
136function! StatuslineGit()
137 let l:branchname = GitBranch()
138 return strlen(l:branchname) > 0?'* '.l:branchname.' ':''
139endfunction
140
141function! ReadOnly() abort
142 if !&modifiable && &readonly
143 return ' RO'
144 elseif &modifiable && &readonly
145 return 'RO'
146 elseif !&modifiable && !&readonly
147 return ''
148 else
149 return ''
150 endif
151endfunction
152
153function! Filepath() abort
154 let l:basename = expand('%:h')
155 let l:filename = expand('%:t')
156 let l:extension = expand('%:e')
157 let l:prefix = (l:basename ==# '' || l:basename ==# '.') ?
158 \ '' : substitute(l:basename . '/', '\C^' . $HOME, '~', '')
159
160 if empty(l:prefix) && empty(l:filename)
161 return printf('%%8*%%f%%*%s %%m%%*', '%8*')
162 elseif empty(l:prefix)
163 return printf('%%8*%%f%%*%s %%m%%*', '%6*')
164 else
165 return printf('%%8*%s%%*%s%s%%*', l:prefix, &modified ? '%6*' : '%8*', l:filename)
166 endif
167endfunction
168
169function! LinterStatus() abort
170 let info = get(b:, 'coc_diagnostic_info', {})
171 if empty(info) | return '' | endif
172 let msgs = []
173 if get(info, 'error', 0)
174 call add(msgs, printf('%%5*%s×%%*', info['error']))
175 endif
176 if get(info, 'warning', 0)
177 call add(msgs, printf('%%3*%s!%%*', info['warning']))
178 endif
179 return join(msgs, ' ')
180endfunction
181
182function! StatusLine(mode) abort
183 let l:line=''
184
185 " help or man pages
186 if &filetype ==# 'help' || &filetype ==# 'man'
187 let l:line.=' %#StatusLineNC# ['. &filetype .'] %f '
188 return l:line
189 endif
190
191 " active
192 if a:mode ==# 'active'
193 let l:line.='%7*%{StatuslineGit()}'
194 let l:line.='%<'
195 let l:line.=Filepath()
196
197 let l:line.='%5*'
198 let l:line.=' %{ReadOnly()} %w%*'
199 let l:line.='%9* %=%*'
200
201 let l:line.='%7* %l,%c %*'
202 let l:line.='%8* %{g:currentmode[mode()]}%*'
203 let l:line.=' '
204 let l:line.=LinterStatus()
205 let l:line.=' '
206 let l:line.='%8*'. &filetype
207
208 else
209 " inactive
210 let l:line.='%#Blanks#'
211 let l:line.='%f %5*%m%*'
212 let l:line.='%#Blanks# %=%*'
213 endif
214
215 let l:line.='%*'
216
217 return l:line
218endfunction
219
220set statusline=%!StatusLine('active')
221augroup MyStatusLine
222 autocmd!
223 autocmd WinEnter * setl statusline=%!StatusLine('active')
224 autocmd WinLeave * setl statusline=%!StatusLine('inactive')
225augroup END