diff --git a/flake.lock b/flake.lock index 0dab586..1baace8 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1612396114, - "narHash": "sha256-W9B49pT2/Zzjd5GsGmjxCHcWdmBDTUVKdLrocGxA/Sc=", + "lastModified": 1612561117, + "narHash": "sha256-UEB+5KCINGyaAfkgqWeUhUwyBxTrlTLO+FjbYCG4exk=", "owner": "nix-community", "repo": "home-manager", - "rev": "3f2f7f8efa57cb820d947b07a5a513764a45b462", + "rev": "d4202875831a2d1b9dd3002d89b8c794af9e5a43", "type": "github" }, "original": { diff --git a/home/init.vim b/home/init.vim index 0cb4b79..68de668 100644 --- a/home/init.vim +++ b/home/init.vim @@ -7,7 +7,6 @@ set hlsearch set ignorecase set incsearch - set laststatus=2 set mouse=a set nocompatible set noswapfile @@ -21,6 +20,31 @@ set tabstop=2 set wildmenu + +" Custom statusline +function! GitBranch() + return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'") +endfunction + +function! StatuslineGit() + let l:branchname = GitBranch() + return strlen(l:branchname) > 0?' '.l:branchname.' ':'' +endfunction + +set statusline= +set statusline+=%#PmenuSel# +set statusline+=%{StatuslineGit()} +set statusline+=%#LineNr# +set statusline+=\ %f +set statusline+=%m +set statusline+=%= +set statusline+=%#CursorColumn# +set statusline+=\ %y +set statusline+=\ %{&fileencoding?&fileencoding:&encoding} +set statusline+=\[%{&fileformat}\] +set statusline+=\ %p%% +set statusline+=\ %l:%c + " Remember line number au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif