Commit d36747ee authored by Franciszek Madej's avatar Franciszek Madej 🤞

Git and Prettier in Neovim

parent 197d968d
{
"coc.preferences.formatOnSaveFiletypes": [
"css",
"Markdown",
"html",
"javascript",
"javascript.jsx",
"jsx",
"javascriptreact",
"json"
]
}
call dein#add('RRethy/vim-hexokinase')
call dein#add('tpope/vim-fugitive')
call dein#add('mhinz/vim-signify')
call dein#add('christoomey/vim-tmux-navigator')
call dein#add('junegunn/fzf')
......
......@@ -22,3 +22,4 @@ let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
" Default event to trigger and update
let g:Hexokinase_refreshEvents = ['BufWritePost']
command! -nargs=0 Prettier :call CocAction('runCommand', 'prettier.formatFile')
......@@ -27,6 +27,26 @@ function! StatusDiagnostic() abort
return 'e' . get(info, 'error', 0) . ' ' . 'w' . get(info, 'warning', 0)
endfunction
function! GitStatus()
let symbols = ['+', '-', '~']
let [added, modified, removed] = sy#repo#get_stats()
let stats = [added, removed, modified] " reorder
let hunkline = ''
for i in range(3)
if stats[i] > 0
let hunkline .= printf('%s%s ', symbols[i], stats[i])
endif
endfor
if !empty(hunkline)
let hunkline = printf('[%s]', hunkline[:-2])
endif
return hunkline
endfunction
set noshowcmd
set noshowmode
set noruler
......@@ -38,6 +58,8 @@ set statusline+=%*\ %t%m\
set statusline+=%{ReadOnly()}%1*
set statusline+=
set statusline+=%=
set statusline+=%{FugitiveHead()}%1*\
set statusline+=%{GitStatus()}%1*\
set statusline+=%*\ %{StatusDiagnostic()}\ %1*
" hi User1 ctermbg=#2B303B ctermfg=#C0C5CE guibg=#2B303B guifg=#C0C5CE
......
......@@ -20,6 +20,9 @@ local color0D='#8fa1b3'
local color0E='#b48ead'
local color0F='#ab7967'
# Setting fd as the default source for fzf
export FZF_DEFAULT_COMMAND='fd --type f'
export FZF_DEFAULT_OPTS="
--color=bg+:$color01,bg:$color00,spinner:$color0C,hl:$color0D
--color=fg:$color04,header:$color0D,info:$color0A,pointer:$color0C
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment