From a92aa5e070a87377661d869a2dde1cbfcef57e6f Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Mon, 10 Feb 2020 14:30:25 +0100 Subject: [PATCH] nvim: color scheme work --- .config/nvim/colors/dln-dim.vim | 70 +++++++++++++++++++-------------- .config/nvim/init.vim | 35 ++++++++++++++--- 2 files changed, 71 insertions(+), 34 deletions(-) diff --git a/.config/nvim/colors/dln-dim.vim b/.config/nvim/colors/dln-dim.vim index 9981898..032e113 100644 --- a/.config/nvim/colors/dln-dim.vim +++ b/.config/nvim/colors/dln-dim.vim @@ -295,37 +295,49 @@ endfun " FIXME: this is a todo -call hi("MsgArea", s:orange_900, "", "") -call hi("Normal", s:white_1000, "", "") -call hi("Bold", "", "", "bold") -call hi("Italic", "", "", "italic") -call hi("VertSplit", "#112131", s:blue_grey_800, "") -call hi("LineNr", s:grey_800, "", "italic") -call hi("SignColumn", s:blue_grey_500, "transparent", "none") -call hi("Visual", s:cyan_100, s:indigo_900, "") +call hi("Floating", s:blue_grey_400, "", "") +call hi("MsgArea", s:orange_900, "", "") +call hi("Normal", s:white_1000, "", "") +call hi("Bold", "", "", "bold") +call hi("Italic", "", "", "italic") +call hi("VertSplit", "#112131", s:blue_grey_800, "") +call hi("LineNr", s:grey_800, "", "italic") +call hi("NonText", s:blue_grey_900, "", "") +call hi("SignColumn", s:blue_grey_500, "transparent", "none") +call hi("Visual", s:cyan_100, s:indigo_900, "") +call hi("Search", "", s:amber_500, "none") -call hi("Bookmark", s:black_1000, s:yellow_700, "none") -call hi("Todo", s:yellow_100, s:orange_900, "none") +call hi("Bookmark", s:black_1000, s:yellow_700, "none") +call hi("Todo", s:yellow_100, s:orange_900, "none") -call hi("CursorLine", "", "#112131", "") -call hi("CursorLineNR", s:grey_500, "#334455", "") -call hi("Folded", s:purple_200, s:deep_purple_900, "") +call hi("CursorLine", "", "#112131", "") +call hi("CursorLineNR", s:grey_500, "#334455", "") +call hi("Folded", s:purple_200, s:deep_purple_900, "") -call hi("Pmenu", s:blue_grey_200, s:blue_grey_800, "none") -call hi("PmenuSbar", s:blue_grey_500, s:blue_grey_900, "none") -call hi("PmenuThumb", s:blue_grey_400, s:blue_grey_700, "none") -call hi("PmenuSel", s:black_1000, s:amber_300, "") -call hi("CocFloating", s:blue_grey_200, s:blue_grey_900, "none") +call hi("Pmenu", s:blue_grey_500, "#112131", "none") +call hi("PmenuSbar", s:blue_grey_500, "#111c27", "none") +call hi("PmenuThumb", s:blue_grey_400, "#112131", "none") +" call hi("PmenuSel", s:light_blue_100, "#0D3771", "bold") +call hi("PmenuSel", s:amber_100, "#0D3771", "bold") -call hi("ALEErrorSign", s:red_500, "", "none") -call hi("ALEWarningSign", s:orange_500, "", "none") -call hi("Statement", s:blue_grey_200, "", "bold") -call hi("String", s:light_green_400, "", "italic") -call hi("Comment", s:blue_grey_600, "", "italic") -call hi("Type", s:deep_purple_100, "", "none") -call hi("Identifier", s:orange_200, "", "") -call hi("goFunction", s:blue_300, "", "bold") -call hi("goOperator", s:teal_200, "", "") -call hi("Search", "", s:amber_700, "none") +call hi("CocFloating", s:light_blue_100, "#0D3771", "italic") + +call hi("GitGutterAdd", s:light_green_900, "", "italic") +call hi("GitGutterChange", s:light_blue_900, "", "italic") +call hi("GitGutterDelete", s:yellow_900, "", "italic") + +call hi("ALEErrorLine", s:orange_900, "", "italic") +call hi("ALEWarningLine", s:amber_200, "", "italic") +call hi("ALEErrorSign", s:red_700, "", "italic") +call hi("ALEWarningSign", s:amber_200, "", "italic") +call hi("ALEInfoSign", s:blue_grey_500, "", "italic") + +call hi("Statement", s:blue_grey_200, "", "bold") +call hi("String", s:light_green_400, "", "italic") +call hi("Comment", s:blue_grey_600, "", "italic") +call hi("Type", s:deep_purple_100, "", "none") +call hi("Identifier", s:orange_200, "", "") +call hi("goFunction", s:blue_300, "", "bold") +call hi("goOperator", s:teal_200, "", "") +call hi("goSameId", s:yellow_100, "", "underline") -call hi("goSameId", s:yellow_100, "", "underline") diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index b257345..1864e1d 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -165,6 +165,7 @@ set wildmode=list:longest set wildignore=*.swp,*.bak,*.pyc,*.class set splitbelow " Preview window set splitright +set updatetime=150 let mapleader="," @@ -172,7 +173,7 @@ let mapleader="," let g:session_autosave = 'no' "" Fancy status line. -set laststatus=2 +set laststatus=0 "" Powerline "set rtp+=/home/dln/.vim/bundle/powerline/powerline/bindings/vim @@ -493,8 +494,31 @@ au FileType xml \ set errorformat=line\ %l\ column\ %c\ \-\ %m "" fzf +function! CreateCenteredFloatingWindow() + let width = min([&columns - 4, max([80, &columns - 20])]) + let height = min([&lines - 4, max([20, &lines - 20])]) + " let top = ((&lines - height) / 2) - 1 + let top = 1 + let left = (&columns - width) / 2 + let opts = {'relative': 'editor', 'row': top, 'col': left, 'width': width, 'height': height, 'style': 'minimal'} -let g:fzf_layout = { 'up': '~40%' } + let top = "┌" . repeat("─", width - 2) . "┐" + let mid = "│" . repeat(" ", width - 2) . "│" + let bot = "└" . repeat("─", width - 2) . "┘" + let lines = [top] + repeat([mid], height - 2) + [bot] + let s:buf = nvim_create_buf(v:false, v:true) + call nvim_buf_set_lines(s:buf, 0, -1, v:true, lines) + call nvim_open_win(s:buf, v:true, opts) + set winhl=Normal:Floating + let opts.row += 1 + let opts.height -= 2 + let opts.col += 2 + let opts.width -= 4 + call nvim_open_win(nvim_create_buf(v:false, v:true), v:true, opts) + au BufWipeout exe 'bw '.s:buf +endfunction + +let g:fzf_layout = { 'up': '~40%', 'window': 'call CreateCenteredFloatingWindow()' } let g:fzf_colors = \ { 'fg': ['fg', 'Comment'], \ 'bg': ['bg', 'Comment'], @@ -565,11 +589,13 @@ let g:vim_markdown_toml_frontmatter = 1 "" Airline +let g:airline_theme="minimalist" let g:airline_powerline_fonts = 0 let g:airline_skip_empty_sections = 1 let g:airline#parts#ffenc#skip_expected_string='utf-8[unix]' let g:airline_section_x = '' " Hide file type -let g:airline_section_z = "\uf0c9 %l \ufb87 %c" +let g:airline_section_z = "\u2193%l \u2192%c" +" let g:airline_section_z = "%l:%c" let g:airline_mode_map = { \ '__' : '-', \ 'c' : 'C', @@ -610,6 +636,7 @@ let &t_8b = "[48;2;%lu;%lu;%lum" color dln-dim map ,l :color dln-dim + let s:hidden_all = 0 function! ToggleHiddenAll() if s:hidden_all == 0 @@ -618,14 +645,12 @@ function! ToggleHiddenAll() set noruler set laststatus=0 set noshowcmd - set nonumber else let s:hidden_all = 0 set showmode set ruler set laststatus=2 set showcmd - set number endif endfunction nnoremap :call ToggleHiddenAll()