Skip to content

Instantly share code, notes, and snippets.

@adaedra
Created March 23, 2018 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adaedra/de2090ad3817239eb6e8b5b531fcd572 to your computer and use it in GitHub Desktop.
Save adaedra/de2090ad3817239eb6e8b5b531fcd572 to your computer and use it in GitHub Desktop.
Vim basic config
" Plugins
call plug#begin('~/.local/share/nvim/plugged')
Plug 'arcticicestudio/nord-vim'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
call plug#end()
" Basic settings
set number
" Appearance
set bg=dark
set noshowmode
set termguicolors
let g:nord_comment_brightness = 20
colorscheme nord
highlight Normal guibg=None
highlight LineNr guibg=None
" Indent settings
set shiftwidth=4 tabstop=8 softtabstop=4
" Status line
let g:SLModeMap = {
\ "n": "%#SLNrm# Nrm %*",
\ "i": "%#SLIns# Ins %*",
\ "R": "%#SLRpl# Rpl %*",
\ "v": "%#SLVis# Vis %*",
\ "V": "%#SLVis# V-L %*",
\ "": "%#SLVis# V-B %*",
\ "t": "%#SLNrm# Ter %*",
\ "c": "%#SLIns# Cmd %*",
\ }
highlight StatusLine guifg=#eceff4
highlight SLNrm guibg=#a3be8c guifg=#2e3440
highlight SLIns guibg=#ebcb8b guifg=#2e3440
highlight SLRpl guibg=#bf616a guifg=#2e3440
highlight SLVis guibg=#eceff4 guifg=#2e3440
highlight SLFileName gui=bold guibg=#4c566a
function SLMode()
return g:SLModeMap[mode()]
endfunction
function SLFileType()
if &filetype != ""
return " (" . &filetype . ", " . &fileencoding . ", " . &ff . ")"
else
return ""
endif
endfunction
function SLBranch()
let branch = fugitive#head()
if branch != ""
return "\ue0a0 " . branch . " │ "
else
return ""
endif
endfunction
function ActiveStatusLine()
return SLMode() . " %n: %#SLFileName#%t%*%{SLFileType()}%=%{SLBranch()}Li %3l ┆ Co %3c "
endfunction
function InactiveStatusLine()
return "%2n: %t"
endfunction
set statusline=%!InactiveStatusLine()
autocmd BufEnter,WinEnter * setlocal statusline=%!ActiveStatusLine()
autocmd WinLeave * setlocal statusline=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment