Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

How do I configure colours for err, warn, hints etc #21

Open
CallumDowling opened this issue Jan 30, 2021 · 1 comment
Open

How do I configure colours for err, warn, hints etc #21

CallumDowling opened this issue Jan 30, 2021 · 1 comment

Comments

@CallumDowling
Copy link

It is working find but, at them moment it is just normal text, but I would like to colour-code errs as red for example
white_text

    1 call plug#begin('~/.vim/plugged')                                                                                                                                                                              
    2                                                                                                                                                                                                                
    3 " Collection of common configurations for the Nvim LSP client                                                                                                                                                  
    4 Plug 'neovim/nvim-lspconfig'                                                                                                                                                                                   
    5                                                                                                                                                                                                                
    6 " Extensions to built-in LSP, for example, providing type inlay hints                                                                                                                                          
    7 Plug 'tjdevries/lsp_extensions.nvim'                                                                                                                                                                           
    8                                                                                                                                                                                                                
    9 " Autocompletion framework for built-in LSP                                                                                                                                                                    
   10 Plug 'nvim-lua/completion-nvim'                                                                                                                                                                                
   11                                                                                                                                                                                                                
   12 Plug 'preservim/nerdtree'                                                                                                                                                                                      
   13                                                                                                                                                                                                                
   14 " Colours                                                                                                                                                                                                      
   15 Plug 'drewtempelmeyer/palenight.vim'                                                                                                                                                                           
   16 Plug 'arcticicestudio/nord-vim'                                                                                                                                                                                
   17 call plug#end()                                                                                                                                                                                                
   18                                                                                                                                                                                                                
   19                                                                                                                                                                                                                
   20 " Syntax highlighting and file type identification                                                                                                                                                             
   21 syntax enable                                                                                                                                                                                                  
   22 filetype plugin indent on                                                                                                                                                                                      
   23                                                                                                                                                                                                                
   24                                                                                                                                                                                                                
   25 " Set completeopt to have a better completion experience                                                                                                                                                       
   26 " :help completeopt                                                                                                                                                                                            
   27 " menuone: popup even when there's only one match                                                                                                                                                              
   28 " noinsert: Do not insert text until a selection is made                                                                                                                                                       
   29 " noselect: Do not select, force user to select one from the menu                                                                                                                                              
   30 set completeopt=menuone,noinsert,noselect                                                                                                                                                                      
   31                                                                                                                                                                                                                
   32 " Avoid showing extra messages when using completion                                                                                                                                                           
   33 set shortmess+=c                                                                                                                                                                                               
   34                                                                                                                                                                                                                
   35 " Configure LSP                                                                                                                                                                                                
   36 " https://github.com/neovim/nvim-lspconfig#rust_analyzer                                                                                                                                                       
   37 lua <<EOF                                                                                                                                                                                                      
   38                                                                                                                                                                                                                
   39 -- nvim_lsp object                                                                                                                                                                                             
   40 local nvim_lsp = require'lspconfig'                                                                                                                                                                            
   41                                                                                                                                                                                                                
   42 -- function to attach completion when setting up lsp                                                                                                                                                           
   43 local on_attach = function(client)                                                                                                                                                                             
   44     require'completion'.on_attach(client)                                                                                                                                                                      
   45 end                                                                                                                                                                                                            
   46                                                                                                                                                                                                                
   47 -- Enable rust_analyzer                                                                                                                                                                                        
   48 nvim_lsp.rust_analyzer.setup({ on_attach=on_attach })                                                                                                                                                          
   49                                                                                                                                                                                                                
   50 -- Enable diagnostics                                                                                                                                                                                          
   51 vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(                                                                                                                                            
   52   vim.lsp.diagnostic.on_publish_diagnostics, {                                                                                                                                                                 
   53     virtual_text = true,                                                                                                                                                                                       
   54     signs = true,                                                                                                                                                                                              
   55     update_in_insert = true,                                                                                                                                                                                   
   56   }                                                                                                                                                                                                            
   57 )                                                                                                                                                                                                              
   58 EOF  
@jrmoulton
Copy link

I saw that @jonhoo worked something out in his init.vim https://github.com/jonhoo/configs/blob/a19bc3b57a503815ba04eb7c32f9e064ae1c7687/editor/.config/nvim/init.vim#L69

but I am also wondering if there is a more straight forward/simpler way to configure the colors because I can't replicate what @jonhoo has

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants