From b68fec17407aa70fdd4cc5c88667ac2d2f49658a Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Fri, 26 Jun 2020 10:13:58 +0200 Subject: Hotfixes to improve compatibility with python --- .gitmodules | 4 ++-- UPDATING | 3 +++ ftdetect/univention-template.vim | 11 ----------- ftplugin/univention-template.vim | 4 ---- pack/_all/opt/nerdtree | 2 +- pack/_all/opt/tagbar | 2 +- pack/_all/opt/ultisnips | 2 +- pack/_all/opt/vim-signify | 2 +- pack/_all/opt/vim-snippets | 2 +- pack/_all/start/papercolor-theme | 2 +- pack/_all/start/vim-fugitive | 2 +- pack/neovim/opt/LanguageClient-neovim | 2 +- pack/neovim/opt/ale | 2 +- pack/neovim/opt/deoplete.nvim | 2 +- pack/neovim/opt/echodoc.vim | 2 +- pack/vim/opt/YouCompleteMe | 2 +- pack/vim/opt/syntastic | 2 +- pack/vim/opt/vimtex | 2 +- plugin/KarlMarks.vim | 10 +++++----- plugin/ale.vim | 8 ++++++++ plugin/fix-pumvisible-no-newline.vim | 1 + plugin/max-fix-colorschemes.vim | 8 ++++---- plugin/max-function-menu.vim | 2 +- plugin/signify.vim | 2 +- plugin/statusline.vim | 13 +++++++++---- plugin/vimdiff.vim | 4 ++++ utils/Xresources | 5 ++--- utils/default-font.conf | 29 ++++++++++++++++++----------- vimrc-common | 4 +++- 29 files changed, 75 insertions(+), 61 deletions(-) create mode 100644 UPDATING delete mode 100644 ftdetect/univention-template.vim delete mode 100644 ftplugin/univention-template.vim create mode 100644 plugin/ale.vim create mode 100644 plugin/fix-pumvisible-no-newline.vim create mode 100644 plugin/vimdiff.vim diff --git a/.gitmodules b/.gitmodules index 95820b4..eeca4e1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -43,7 +43,7 @@ branch = next [submodule "pack/neovim/opt/ale"] path = pack/neovim/opt/ale - url = https://github.com/w0rp/ale.git + url = https://github.com/dense-analysis/ale.git [submodule "pack/vim/opt/syntastic"] path = pack/vim/opt/syntastic url = https://github.com/vim-syntastic/syntastic.git @@ -61,4 +61,4 @@ url = https://github.com/Valloric/YouCompleteMe.git [submodule "pack/vim/opt/vimtex"] path = pack/vim/opt/vimtex - url = https://github.com/lervag/vimtex + url = https://github.com/lervag/vimtex diff --git a/UPDATING b/UPDATING new file mode 100644 index 0000000..4359a5b --- /dev/null +++ b/UPDATING @@ -0,0 +1,3 @@ + git submodule sync --recursive + git submodule update --remote + vim -c ':UpdateRemotePlugins' diff --git a/ftdetect/univention-template.vim b/ftdetect/univention-template.vim deleted file mode 100644 index add6348..0000000 --- a/ftdetect/univention-template.vim +++ /dev/null @@ -1,11 +0,0 @@ -au BufRead,BufNewFile */base/univention* set ft=univention-template -au BufRead,BufNewFile */services/univention* set ft=univention-template -au BufRead,BufNewFile */container/univention* set ft=univention-template -au BufRead,BufNewFile */virtualization/univention* set ft=univention-template -au BufRead,BufNewFile */management/univention* set ft=univention-template -au BufRead,BufNewFile */packaging/univention* set ft=univention-template -au BufRead,BufNewFile */mail/univention* set ft=univention-template -au BufRead,BufNewFile */saml/univention* set ft=univention-template -au BufRead,BufNewFile */nagios/univention* set ft=univention-template -au BufRead,BufNewFile /etc/univention/* set ft=univention-template - diff --git a/ftplugin/univention-template.vim b/ftplugin/univention-template.vim deleted file mode 100644 index 9071bcd..0000000 --- a/ftplugin/univention-template.vim +++ /dev/null @@ -1,4 +0,0 @@ -setlocal foldtext=getline(v:foldstart).printf('\ [%d\ lines]\ \ \ \',\ v:foldend-v:foldstart) -setlocal foldmethod=syntax -setlocal foldenable - diff --git a/pack/_all/opt/nerdtree b/pack/_all/opt/nerdtree index e67324f..6571452 160000 --- a/pack/_all/opt/nerdtree +++ b/pack/_all/opt/nerdtree @@ -1 +1 @@ -Subproject commit e67324fdea7a192c7ce1b4c6b3c3b9f82f11eee7 +Subproject commit 6571452857fd1b14f15a3886f9fffc113c36bbac diff --git a/pack/_all/opt/tagbar b/pack/_all/opt/tagbar index 679a9d9..d7063c7 160000 --- a/pack/_all/opt/tagbar +++ b/pack/_all/opt/tagbar @@ -1 +1 @@ -Subproject commit 679a9d9ac9579bd18225409d85ed4870fb6c9c62 +Subproject commit d7063c7484f0f99bfa182b02defef7f412a9289c diff --git a/pack/_all/opt/ultisnips b/pack/_all/opt/ultisnips index e910b4f..e83c820 160000 --- a/pack/_all/opt/ultisnips +++ b/pack/_all/opt/ultisnips @@ -1 +1 @@ -Subproject commit e910b4fb9e276d18ed140fc492f30967ef9ace59 +Subproject commit e83c82099d9bd43dc7895e3cb5b114ee5a2a07c6 diff --git a/pack/_all/opt/vim-signify b/pack/_all/opt/vim-signify index 56db16f..c3d450e 160000 --- a/pack/_all/opt/vim-signify +++ b/pack/_all/opt/vim-signify @@ -1 +1 @@ -Subproject commit 56db16f8d3825c4d066c2faf05315c2b208cd5f5 +Subproject commit c3d450eb5f5e76d99d23b10493d4e08c5bb1ae71 diff --git a/pack/_all/opt/vim-snippets b/pack/_all/opt/vim-snippets index 28ad634..900bf93 160000 --- a/pack/_all/opt/vim-snippets +++ b/pack/_all/opt/vim-snippets @@ -1 +1 @@ -Subproject commit 28ad6344e1ce59d11c095405e1e76c0183142de5 +Subproject commit 900bf93c6680e38ce568dba26c3f48b4365ac730 diff --git a/pack/_all/start/papercolor-theme b/pack/_all/start/papercolor-theme index ddd0986..c657f5c 160000 --- a/pack/_all/start/papercolor-theme +++ b/pack/_all/start/papercolor-theme @@ -1 +1 @@ -Subproject commit ddd09867ed4e020b3ba2eb47dc3ef365da5b0fed +Subproject commit c657f5c2d5964bbae633f8a42c16f8316f6d6733 diff --git a/pack/_all/start/vim-fugitive b/pack/_all/start/vim-fugitive index e06005a..27a5c3a 160000 --- a/pack/_all/start/vim-fugitive +++ b/pack/_all/start/vim-fugitive @@ -1 +1 @@ -Subproject commit e06005a742714a4293f1928bca0aca7c9e383383 +Subproject commit 27a5c3abd211c2784513dab4db082fa414ad0967 diff --git a/pack/neovim/opt/LanguageClient-neovim b/pack/neovim/opt/LanguageClient-neovim index 222e250..4b35f5d 160000 --- a/pack/neovim/opt/LanguageClient-neovim +++ b/pack/neovim/opt/LanguageClient-neovim @@ -1 +1 @@ -Subproject commit 222e2503666e463a5c55edc52f140fde2bb76a96 +Subproject commit 4b35f5d6859ab3d42546192cbede9add59a7435a diff --git a/pack/neovim/opt/ale b/pack/neovim/opt/ale index 8f7ccdc..834d6f9 160000 --- a/pack/neovim/opt/ale +++ b/pack/neovim/opt/ale @@ -1 +1 @@ -Subproject commit 8f7ccdc5e95302223c516a0113f5af7e075dc041 +Subproject commit 834d6f9c48ce349a4c3d72e98bd0de81aaa84042 diff --git a/pack/neovim/opt/deoplete.nvim b/pack/neovim/opt/deoplete.nvim index e5a7e3b..e7f4c20 160000 --- a/pack/neovim/opt/deoplete.nvim +++ b/pack/neovim/opt/deoplete.nvim @@ -1 +1 @@ -Subproject commit e5a7e3bc029505176c58fd7d8bf4efeeb8fb458f +Subproject commit e7f4c206287e867fe4991f6de76a12107fa14593 diff --git a/pack/neovim/opt/echodoc.vim b/pack/neovim/opt/echodoc.vim index cd9beff..4719626 160000 --- a/pack/neovim/opt/echodoc.vim +++ b/pack/neovim/opt/echodoc.vim @@ -1 +1 @@ -Subproject commit cd9beff92b52990d991a0b6a0f4d20aa600e570c +Subproject commit 4719626bfd477f1189dd9992614ff452d3ea3caf diff --git a/pack/vim/opt/YouCompleteMe b/pack/vim/opt/YouCompleteMe index 94cfacd..f9906f8 160000 --- a/pack/vim/opt/YouCompleteMe +++ b/pack/vim/opt/YouCompleteMe @@ -1 +1 @@ -Subproject commit 94cfacd11ff97643a32409671fed072e3b1412d6 +Subproject commit f9906f804b02e6b7e70a7f1a6f949e905784b5b9 diff --git a/pack/vim/opt/syntastic b/pack/vim/opt/syntastic index f376653..140f516 160000 --- a/pack/vim/opt/syntastic +++ b/pack/vim/opt/syntastic @@ -1 +1 @@ -Subproject commit f3766538720116f099a8b1517f76ae2f094afd20 +Subproject commit 140f516eaeae855b3d57068e6e66c8f40fd45295 diff --git a/pack/vim/opt/vimtex b/pack/vim/opt/vimtex index 3ccc174..49bc335 160000 --- a/pack/vim/opt/vimtex +++ b/pack/vim/opt/vimtex @@ -1 +1 @@ -Subproject commit 3ccc17480c7b887ed9dcc0c223e250bdd784fd03 +Subproject commit 49bc335fffa40a7b7b84b6110b57ebcbaaf019ea diff --git a/plugin/KarlMarks.vim b/plugin/KarlMarks.vim index 3340dad..f0699e1 100644 --- a/plugin/KarlMarks.vim +++ b/plugin/KarlMarks.vim @@ -8,19 +8,19 @@ let g:markerbar_additional .= "^" " insert mode stopped let g:markerbar_additional .= "'`" function! KarlMarks() - for c in map(split(g:markerbar_additional, '\zs'), "char2nr(v:val)") + + 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)) + let p = getpos("'".nr2char(c)) - if (p[0] == 0 || p[0] == winbufnr(0)) && p[1] > 0 + if (p[0] == 0 || p[0] == winbufnr(0)) && p[1] > 0 exec "sign unplace ".c 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 + endif + endfor endfunction autocmd CursorHold * call KarlMarks() diff --git a/plugin/ale.vim b/plugin/ale.vim new file mode 100644 index 0000000..ba07343 --- /dev/null +++ b/plugin/ale.vim @@ -0,0 +1,8 @@ +let g:ale_pattern_options = {'\.py$': {'ale_enabled': 1}} +let g:ale_linters = {'python': ['flake8', 'pylint'] } +let g:ale_fixers = + \ { + \ 'python': ['black', 'isort', 'remove_trailing_lines', 'trim_whitespace'], + \ 'bash': ['remove_trailing_lines', 'trim_whitespace'] + \ } + diff --git a/plugin/fix-pumvisible-no-newline.vim b/plugin/fix-pumvisible-no-newline.vim new file mode 100644 index 0000000..ad27182 --- /dev/null +++ b/plugin/fix-pumvisible-no-newline.vim @@ -0,0 +1 @@ +imap pumvisible() ? "\" : "\" diff --git a/plugin/max-fix-colorschemes.vim b/plugin/max-fix-colorschemes.vim index b9c7657..c0f091d 100644 --- a/plugin/max-fix-colorschemes.vim +++ b/plugin/max-fix-colorschemes.vim @@ -21,12 +21,11 @@ function! ExtendColorTheme() highlight! link WildMenu Search highlight! link Convention Error highlight! link PmenuSbar Pmenu - highlight! link Tabline StatusLine highlight! link VertSplit LineNr highlight! link SignColumn LineNr highlight! link FoldColumn VertSplit " highlight! link Folded LineNr - highlight! link EndOfBuffer LineNr + highlight! link EndOfBuffer NonText endfunction autocmd ColorScheme * call ExtendColorTheme() @@ -36,8 +35,8 @@ else set termguicolors endif -if filereadable(expand('~/.vimrc_background')) && filereadable(expand('~/.config/base16-shell/colortest')) - let g:base16_shell_path = '~/.config/base16-shell/scripts' +if filereadable(expand('~/.vimrc_background')) && filereadable(expand('~/.local/share/base16/base16-shell/colortest')) + let g:base16_shell_path = '~/.local/share/base16/base16-shell/scripts' let base16colorspace = 256 source ~/.vimrc_background else @@ -52,6 +51,7 @@ else \ } \ } colorscheme PaperColor + set background=dark endif diff --git a/plugin/max-function-menu.vim b/plugin/max-function-menu.vim index 6c7308a..b981997 100644 --- a/plugin/max-function-menu.vim +++ b/plugin/max-function-menu.vim @@ -81,7 +81,7 @@ augroup MAX_FUNCTION_MENU menu &Git.&Display\ recently\ changed\ files\ in\ quickfix\ list \ :call setqflist([], 'r', {'title': 'Recently changed in GIT', 'items':map(systemlist("git show --name-only --pretty=''"), {_, p->{'filename': fnamemodify(p, ':.')}}) }):copen menu &Git.&Display\ last\ changes - \ :let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f'}:SignifyRefresh + \ :let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f', 'svn': '', 'cvs': ''}:SignifyRefresh menu &Git.&Display\ unmerged\ files\ in\ location\ list \ :call setloclist(0, map(systemlist("git diff --name-only --diff-filter=U \| uniq"), {_, p->{'filename': fnamemodify(p, ':.')}})):lopen menu &Git.&Display\ significance\ of\ changes diff --git a/plugin/signify.vim b/plugin/signify.vim index 5eeb2b0..9edc3c5 100644 --- a/plugin/signify.vim +++ b/plugin/signify.vim @@ -29,7 +29,7 @@ augroup SIGNIFY highlight! link SignifySignDeleteFirstLine SignColumn endfunction - packadd vim-signify + " packadd vim-signify autocmd VimEnter,ColorScheme * call SignifyColorScheme() augroup END diff --git a/plugin/statusline.vim b/plugin/statusline.vim index e6f175d..57fbfa4 100644 --- a/plugin/statusline.vim +++ b/plugin/statusline.vim @@ -14,18 +14,17 @@ augroup MAX_FANCYLINE if &term ==? 'linux' let g:group_active = 'StatusLineTerm' let g:group_inactive = 'StatusLineTermNC' - let g:group_tabline = 'StatusLineTerm' + let g:group_tabline = 'TabLine' else let g:group_active = 'StatusLine' let g:group_inactive = 'StatusLineNC' - " let g:group_tabline = 'TabLine' - let g:group_tabline = 'StatusLine' + let g:group_tabline = 'TabLine' endif " this function reverts foreground color and background color of a given " highlight group and returns the name of a newly created _invert group function! CreateInvertGroup(highlight_group) - if(synIDattr(hlID(a:highlight_group), 'reverse')==1) + if(synIDattr(synIDtrans(hlID(a:highlight_group)), 'reverse', 'cterm')==1) let w:color=synIDattr(hlID(a:highlight_group), 'fg#') else let w:color=synIDattr(hlID(a:highlight_group), 'bg#') @@ -124,6 +123,12 @@ augroup MAX_FANCYLINE \ .'%##' endfunction + + if $USER ==? 'root' + let invert_group = CreateInvertGroup("ErrorMsg") + let g:group_tabline = invert_group + endif + function! ApplyColorScheme() " set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) incompatible with nvim " set t_ut= diff --git a/plugin/vimdiff.vim b/plugin/vimdiff.vim new file mode 100644 index 0000000..ffd9f46 --- /dev/null +++ b/plugin/vimdiff.vim @@ -0,0 +1,4 @@ +if &diff " only for diff mode/vimdiff + set diffopt=filler,context:1000000 " filler is default and inserts empty lines for sync + set foldmethod=syntax +endif diff --git a/utils/Xresources b/utils/Xresources index 5723999..08969ac 100644 --- a/utils/Xresources +++ b/utils/Xresources @@ -1,6 +1,5 @@ -! #include "/home/max/.config/base16-xresources/xresources/base16-tomorrow-night.Xresources" -! #include "/home/max/.config/base16-xresources/xresources/base16-google-light.Xresources" -#include "/home/max/.local/share/base16/base16-xresources/xresources/base16-tomorrow.Xresources" +#include "/home/max/.local/share/base16/base16-xresources/xresources/base16-tomorrow-night.Xresources" +! #include "/home/max/.local/share/base16/base16-xresources/xresources/base16-tomorrow.Xresources" urxvt.scrollBar: false urxvt.background: base00 diff --git a/utils/default-font.conf b/utils/default-font.conf index cf01d6d..d7b43e2 100644 --- a/utils/default-font.conf +++ b/utils/default-font.conf @@ -1,24 +1,31 @@ - + - monospace - Hack Nerd Font Mono - Hack - emoji - emojione - FuraCode Nerd Font Mono Medium + monospace + + Hack Nerd Font Mono + Hack + emoji + emojione + FuraCode Nerd Font Mono Medium + FiraCode Retina Retina + italic bold - serif - Noto Serif + serif + + Noto Serif + - sans-serif - Noto Sans + sans-serif + + Noto Sans + 102 diff --git a/vimrc-common b/vimrc-common index 6415842..30752fb 100644 --- a/vimrc-common +++ b/vimrc-common @@ -203,7 +203,9 @@ if has("autocmd") autocmd BufWinEnter * if &previewwindow | setlocal nonumber nolist signcolumn=no filetype=c nobuflisted | endif " Workaround: Allows Vim to yank text within wayland - if $XDG_SESSION_TYPE ==# 'wayland' && !has('nvim') + " XDG_SESSION_TYPE is only set if a login manager was used + " WAYLAND_DISPLAY should always work + if ($XDG_SESSION_TYPE ==# 'wayland' || ! empty($WAYLAND_DISPLAY)) && !has('nvim') autocmd TextYankPost * call system("wl-copy", getreg('+')) endif -- cgit v1.2.3