From aa32996d8f69679e1e5caa34de4e7a391b3ac694 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Fri, 3 Dec 2021 10:49:53 +0000 Subject: Better status --- metals.vim | 1 + vimrc | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/metals.vim b/metals.vim index f482278..8315637 100644 --- a/metals.vim +++ b/metals.vim @@ -22,6 +22,7 @@ nnoremap d lua vim.lsp.diagnostic.set_loclist() " :lua << EOF metals_config = require'metals'.bare_config() + metals_config.init_options.statusBarProvider = "on" metals_config.settings = { showImplicitArguments = true, excludedPackages = { diff --git a/vimrc b/vimrc index 8852748..fa88dde 100644 --- a/vimrc +++ b/vimrc @@ -75,17 +75,30 @@ end call plug#end() " crystaline conf + +" metals status +function! MetalsStatus() abort + return get(g:, 'metals_status', '') +endfunction + function! StatusLine(current, width) let l:s = '' if a:current let l:s .= crystalline#mode() . crystalline#right_mode_sep('') + else + let l:s .= '%#CrystallineInactive#' + endif + let l:s .= ' %<%f%h%w%m%r ' + + if a:current + let l:s .= crystalline#right_sep('', 'Fill') . ' %{fugitive#head()}' endif - let l:s .= '%#Crystalline# %<%f%h%w%m%r %{fugitive#statusline()}' let l:s .= '%=' if a:current - let l:s .= ' %{&paste ?"PASTE ":""}%{&spell?"SPELL ":""}' + let l:s .= ' %{MetalsStatus()} ' + let l:s .= crystalline#left_sep('', 'Fill') . ' %{&paste ?"PASTE ":""}%{&spell?"SPELL ":""}' let l:s .= crystalline#left_mode_sep('') endif if a:width > 80 @@ -188,5 +201,3 @@ highlight link lscDiagnosticWarning GruvboxYellowSign " haskell syntax let g:haskell_classic_highlighting = 1 -" add you lsc_server_commands and lsc_auto_map locally - -- cgit v1.2.3