From 709278107208a9ac4d3aef1c192f70f9200785e5 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 25 Mar 2019 00:37:29 +0100 Subject: Added custom marks plugin & fixed submodules --- plugin/KarlMarks.vim | 22 ++++++++++++ plugin/max-fix-colorschemes.vim | 78 ++++++++++++++++++++++------------------- plugin/max-splash.vim | 6 ++++ plugin/statusline.vim | 4 ++- 4 files changed, 73 insertions(+), 37 deletions(-) create mode 100644 plugin/KarlMarks.vim (limited to 'plugin') diff --git a/plugin/KarlMarks.vim b/plugin/KarlMarks.vim new file mode 100644 index 0000000..effb22b --- /dev/null +++ b/plugin/KarlMarks.vim @@ -0,0 +1,22 @@ +let g:markerbar_additional = '$^"^.`{}[]<>()' + +function! KarlMarks() + for c in map(split(g:markerbar_additional, '\zs'), "char2nr(v:val)") + + \ range(char2nr('a'), char2nr('z')) + + \ range(char2nr('A'), char2nr('Z')) + + \ range(char2nr('0'), char2nr('9')) + + let p = getpos("'".nr2char(c)) + + 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 place ".c." name=mark_".c." line=".p[1]." buffer=".winbufnr(0) + endif + endfor +endfunction + +autocmd CursorHold * call KarlMarks() + +" important for distraction free reading while changing windows +set signcolumn=yes diff --git a/plugin/max-fix-colorschemes.vim b/plugin/max-fix-colorschemes.vim index a6fe45e..1c2c674 100644 --- a/plugin/max-fix-colorschemes.vim +++ b/plugin/max-fix-colorschemes.vim @@ -2,54 +2,60 @@ " COLOR SCHEME: "======================================================================================================================= function! ExtendColorTheme() - highlight! Bold cterm=bold gui=bold - highlight! Italic cterm=italic gui=italic - highlight! Underline cterm=underline gui=underline - highlight! BoldUnderline cterm=bold,underline gui=bold,underline - highlight! BoldItalic cterm=bold,Italic gui=Bold,Italic - highlight! Todo cterm=bold gui=bold guibg=#ffffaa guifg=#000000 - 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! Bold cterm=bold gui=bold + highlight! Italic cterm=italic gui=italic + highlight! Underline cterm=underline gui=underline + highlight! BoldUnderline cterm=bold,underline gui=bold,underline + highlight! BoldItalic cterm=bold,Italic gui=bold,italic + highlight! Todo cterm=bold gui=bold guibg=#ffffaa guifg=#000000 + 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 - let w:color=synIDattr(hlID("Normal"), "bg#") - silent! exec 'highlight invisible gui=NONE guifg='.w:color.'guibg='.w:color.' cterm=NONE ctermfg='.w:color.' ctermbg='.w:color + + if has("gui_running") + highlight invisible gui=NONE guifg=background guibg=background + else + let w:color=synIDtrans(synIDattr(hlID("Normal"), "bg")) + silent! exec 'highlight invisible cterm=NONE ctermfg='.w:color.' ctermbg='.w:color + endif - highlight! link EndOfBuffer Invisible - highlight! link qfSeparator Normal | " reserve one space - highlight! link qfLineNr Normal | " informational line numbers should look different + highlight! link EndOfBuffer Invisible - highlight! link SpecialKey NonText | " makes tab stop (see listchars) less disturbing - highlight! link WildMenu Search - highlight! link Convention Error + highlight! link qfSeparator Normal | " reserve one space + highlight! link qfLineNr Normal | " informational line numbers should look different - highlight! link VertSplit LineNr - highlight! link SignColumn LineNr - highlight! link FoldColumn LineNr + highlight! link SpecialKey NonText | " makes tab stop (see listchars) less disturbing + highlight! link WildMenu Search + highlight! link Convention Error - highlight! link PmenuSbar Pmenu - highlight! PmenuThumb cterm=inverse - highlight! MoreMsg cterm=inverse + highlight! link VertSplit LineNr + highlight! link SignColumn LineNr + highlight! link FoldColumn LineNr + + highlight! link PmenuSbar Pmenu + highlight! PmenuThumb cterm=inverse + highlight! MoreMsg cterm=inverse endfunction autocmd ColorScheme * call ExtendColorTheme() -set background=light +set background=dark if filereadable(expand("~/.vimrc_background")) && filereadable(expand("~/.config/base16-shell/colortest")) - let g:base16_shell_path = "~/.config/base16-shell/scripts" - let base16colorspace = 256 - source ~/.vimrc_background + let g:base16_shell_path = "~/.config/base16-shell/scripts" + let base16colorspace = 256 + source ~/.vimrc_background else - let g:PaperColor_Theme_Options = { - \ 'theme': { - \ 'default': { - \ 'transparent_background': 0 - \ } - \ } - \ } - colorscheme PaperColor + let g:PaperColor_Theme_Options = { + \ 'theme': { + \ 'default': { + \ 'transparent_background': 1 + \ } + \ } + \ } + colorscheme PaperColor endif diff --git a/plugin/max-splash.vim b/plugin/max-splash.vim index 5282679..6b5e70d 100644 --- a/plugin/max-splash.vim +++ b/plugin/max-splash.vim @@ -21,3 +21,9 @@ if empty(argv()) \ {_, p->{'filename': fnamemodify(p, ':.')}}) \ }) | lopen | only | setfiletype qf endif + +" http://vimdoc.sourceforge.net/htmldoc/quickfix.html#:caddexpr +" for c in range(char2nr('a'), char2nr('z')) + range(char2nr('A'), char2nr('Z')) + range(0,9) | let p = getpos("'".nr2char(c)) | if (p[1] > 0) | exec "sign define mark_".nr2char(c)." text=".nr2char(c)." linehl=linenr" | exec "sign place ".c." name=mark_".nr2char(c)." line=".p[1] | endif | endfor +" for c in range(char2nr('a'), char2nr('z')) + range(char2nr('A'), char2nr('Z')) + range(0,9) | let p = line("'".nr2char(c)) | if (p > 0) | exec "sign define mark_".nr2char(c)." text=".nr2char(c)." linehl=linenr" | exec "sign place ".c." name=mark_".nr2char(c)." line=".p | endif | endfor +" call sign_unplace('marks') | for c in range(char2nr('a'), char2nr('z')) + range(char2nr('A'), char2nr('Z')) + range(0,9) | let p = line("'".nr2char(c)) | if (p > 0) | call sign_define("mark_".nr2char(c), { "text" : nr2char(c), "linehl": "linenr"}) | call sign_place(c, 'marks', "mark_".nr2char(c), '', {'lnum': p}) | endif | endfor +" call sign_unplace('marks') | for c in range(char2nr('a'), char2nr('z')) + range(char2nr('A'), char2nr('Z')) + range(char2nr('0'), char2nr('9')) | let p = line("'".nr2char(c)) | if (p > 0) | call sign_define("mark_".nr2char(c), { "text" : nr2char(c), "texthl": "linenr"}) | call sign_place(c, 'marks', "mark_".nr2char(c), '', {'lnum': p}) | endif | endfor diff --git a/plugin/statusline.vim b/plugin/statusline.vim index 7bcc963..0dc1040 100644 --- a/plugin/statusline.vim +++ b/plugin/statusline.vim @@ -42,6 +42,8 @@ augroup MAX_FANCYLINE endfunction function! UpdateStatus(highlight_group) + " TODO: make conditional (if devicons plugin is missing) + let l:webdev_ft_icon = WebDevIconsGetFileTypeSymbol('*.'.&filetype) let l:invert_group = CreateInvertGroup(a:highlight_group) let l:mode = get({ \ 'n' : 'normal', @@ -76,7 +78,7 @@ augroup MAX_FANCYLINE \ .g:status_sym_start \ ."%#".a:highlight_group."#" \ ."%{&buftype==''?'':' '.&buftype.' '.g:status_sym_sep_start.' '}" - \ ."%{&filetype==''?'':' '.&filetype.' '.g:status_sym_sep_start.' '}" + \ .l:webdev_ft_icon." %{&filetype==''?'':&filetype.' '.g:status_sym_sep_start.' '}" \ ."%{(&spell\ ?\ &spelllang.' '.g:status_sym_sep_end\ :\ '')}" \ ."%{(&fileencoding=~'^$\\|^utf\-8$'?'':&fileencoding.' '.g:status_sym_sep_end.' ')}" \ ."%{(&fileformat=~'^$\\|^unix$'?'':&fileformat.' '.g:status_sym_sep_end)}" -- cgit v1.2.3