From 450d847e42582ef2734015869c59c7d1fdd6b208 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 10 Jun 2019 23:40:23 +0200 Subject: Improved color schemes, indentation, autocompletion for text --- after/indent/yaml.vim | 18 ++++++++++++++++++ ftplugin/text.vim | 15 ++++++++++++++- pack/_all/start/base16-vim | 2 +- pack/vim/opt/YouCompleteMe | 2 +- plugin/KarlMarks.vim | 2 +- plugin/max-fix-colorschemes.vim | 8 +++++--- plugin/max-highlight-word-under-cursor.vim | 8 +++++++- 7 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 after/indent/yaml.vim diff --git a/after/indent/yaml.vim b/after/indent/yaml.vim new file mode 100644 index 0000000..3027571 --- /dev/null +++ b/after/indent/yaml.vim @@ -0,0 +1,18 @@ +set colorcolumn=80 +set textwidth=80 + +let g:yaml_schema = "pyyaml" + + + +function! YamlFix() + if(match(getline(v:lnum), ':$') > -1) + return -1 + elseif(match(getline(v:lnum), '^[^ ].*:$\|^\s*\.\.\.\|^\s*---\') > -1) + return 0 + else + return GetYAMLIndent(v:lnum) + endif +endfunction +setlocal indentexpr=YamlFix() + diff --git a/ftplugin/text.vim b/ftplugin/text.vim index 2095ef5..0336a13 100644 --- a/ftplugin/text.vim +++ b/ftplugin/text.vim @@ -5,4 +5,17 @@ autocmd InsertLeave * syntax match Convention /\v<(\w+)\_s+\1>/ containedin=ALL set autoindent nosmartindent nocindent set formatoptions+=n " When formatting text, recognize numbered lists. -set formatoptions+=a " Automatic formatting of paragraphs. +set formatoptions+=1 " do not break after a one letter word +set formatoptions+=p " Don't break lines at single spaces that follow periods. + +set formatoptions+=aw " Automatic formatting of paragraphs (w=only if space in the end) + + +set noexpandtab +set spell +set complete+=kspell + +inoremap + +" nnoremap :normal +" autocmd CursorHoldI * normal s diff --git a/pack/_all/start/base16-vim b/pack/_all/start/base16-vim index 2073e2d..6191622 160000 --- a/pack/_all/start/base16-vim +++ b/pack/_all/start/base16-vim @@ -1 +1 @@ -Subproject commit 2073e2dd9fa0172ccdba92b3f0df25642a69f7db +Subproject commit 6191622d5806d4448fa2285047936bdcee57a098 diff --git a/pack/vim/opt/YouCompleteMe b/pack/vim/opt/YouCompleteMe index d691404..25ebc0b 160000 --- a/pack/vim/opt/YouCompleteMe +++ b/pack/vim/opt/YouCompleteMe @@ -1 +1 @@ -Subproject commit d691404ae2f7c79ec5d053f2c22a4c775b4bf915 +Subproject commit 25ebc0b9abb1b135c809ee850085a0305cbc5533 diff --git a/plugin/KarlMarks.vim b/plugin/KarlMarks.vim index a36ecab..6e5a408 100644 --- a/plugin/KarlMarks.vim +++ b/plugin/KarlMarks.vim @@ -16,7 +16,7 @@ function! KarlMarks() if (p[0] == 0 || p[0] == winbufnr(0)) && p[1] > 0 exec "sign unplace ".c - exec "sign define mark_".c." text=".nr2char(c)." texthl=linenr" + exec "sign define mark_".c." text=".nr2char(c)." texthl=SignColumn" exec "sign place ".c." name=mark_".c." line=".p[1]." buffer=".winbufnr(0) endif endfor diff --git a/plugin/max-fix-colorschemes.vim b/plugin/max-fix-colorschemes.vim index 87c9efe..7dda5bf 100644 --- a/plugin/max-fix-colorschemes.vim +++ b/plugin/max-fix-colorschemes.vim @@ -11,7 +11,8 @@ function! ExtendColorTheme() highlight! Error cterm=NONE ctermbg=NONE gui=NONE guibg=NONE highlight! SpellBad cterm=NONE gui=undercurl guibg=NONE guifg=red highlight! Ignore cterm=NONE ctermbg=NONE ctermfg=NONE gui=NONE guibg=NONE guifg=NONE - highlight! Folded cterm=NONE ctermbg=NONE + highlight! LineNr cterm=bold,italic,inverse ctermbg=NONE ctermfg=fg + " highlight! VertSplit ctermbg=252 ctermfg=252 @@ -37,6 +38,7 @@ function! ExtendColorTheme() highlight! link VertSplit LineNr highlight! link SignColumn LineNr highlight! link FoldColumn LineNr + highlight! link Folded LineNr highlight! link PmenuSbar Pmenu highlight! PmenuThumb cterm=inverse @@ -48,7 +50,7 @@ endfunction autocmd ColorScheme * call ExtendColorTheme() -set background=dark +" set background=light if filereadable(expand("~/.vimrc_background")) && filereadable(expand("~/.config/base16-shell/colortest")) let g:base16_shell_path = "~/.config/base16-shell/scripts" let base16colorspace = 256 @@ -57,7 +59,7 @@ else let g:PaperColor_Theme_Options = { \ 'theme': { \ 'default': { - \ 'transparent_background': 1 + \ 'transparent_background': 0 \ } \ } \ } diff --git a/plugin/max-highlight-word-under-cursor.vim b/plugin/max-highlight-word-under-cursor.vim index 2e7f5a0..c6d6964 100644 --- a/plugin/max-highlight-word-under-cursor.vim +++ b/plugin/max-highlight-word-under-cursor.vim @@ -11,7 +11,13 @@ function! HighlightWordUnderCursor() let l:currentword = escape(expand(''), '.') if(strlen(l:currentword) > 0) let w:m1=100 - silent! call matchadd('Underline', '\<'.l:currentword.'\>', -1, w:m1) + if(match(expand(''), '^#\x\{6\}') == 0) + exec 'highlight! CurrentColor guibg='.expand('') + hi CurrentColor + " silent! call matchadd('CurrentColor', escape(expand(''), '.'), -1, w:m1) + else + silent! call matchadd('Underline', '\<'.l:currentword.'\>', -1, w:m1) + endif endif endfunction -- cgit v1.2.3