diff options
author | Max Christian Pohle | 2020-06-26 10:13:58 +0200 |
---|---|---|
committer | Max Christian Pohle | 2020-06-26 13:43:27 +0200 |
commit | b68fec17407aa70fdd4cc5c88667ac2d2f49658a (patch) | |
tree | 113528e165b486cbf2069f220bdca949b1dcd18d /plugin | |
parent | dbcaab09f2b1f2b6256364407fa67ee67f3cdc66 (diff) | |
download | vim-b68fec17407aa70fdd4cc5c88667ac2d2f49658a.tar.bz2 vim-b68fec17407aa70fdd4cc5c88667ac2d2f49658a.zip |
Hotfixes to improve compatibility with python
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/KarlMarks.vim | 10 | ||||
-rw-r--r-- | plugin/ale.vim | 8 | ||||
-rw-r--r-- | plugin/fix-pumvisible-no-newline.vim | 1 | ||||
-rw-r--r-- | plugin/max-fix-colorschemes.vim | 8 | ||||
-rw-r--r-- | plugin/max-function-menu.vim | 2 | ||||
-rw-r--r-- | plugin/signify.vim | 2 | ||||
-rw-r--r-- | plugin/statusline.vim | 13 | ||||
-rw-r--r-- | plugin/vimdiff.vim | 4 |
8 files changed, 33 insertions, 15 deletions
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 | |||
8 | let g:markerbar_additional .= "'`" | 8 | let g:markerbar_additional .= "'`" |
9 | 9 | ||
10 | function! KarlMarks() | 10 | function! KarlMarks() |
11 | for c in map(split(g:markerbar_additional, '\zs'), "char2nr(v:val)") + | 11 | for c in map(split(g:markerbar_additional, '\zs'), "char2nr(v:val)") + |
12 | \ range(char2nr('a'), char2nr('z')) + | 12 | \ range(char2nr('a'), char2nr('z')) + |
13 | \ range(char2nr('A'), char2nr('Z')) + | 13 | \ range(char2nr('A'), char2nr('Z')) + |
14 | \ range(char2nr('0'), char2nr('9')) | 14 | \ range(char2nr('0'), char2nr('9')) |
15 | 15 | ||
16 | let p = getpos("'".nr2char(c)) | 16 | let p = getpos("'".nr2char(c)) |
17 | 17 | ||
18 | if (p[0] == 0 || p[0] == winbufnr(0)) && p[1] > 0 | 18 | if (p[0] == 0 || p[0] == winbufnr(0)) && p[1] > 0 |
19 | exec "sign unplace ".c | 19 | exec "sign unplace ".c |
20 | exec "sign define mark_".c." text=".nr2char(c)." texthl=SignColumn" | 20 | exec "sign define mark_".c." text=".nr2char(c)." texthl=SignColumn" |
21 | exec "sign place ".c." name=mark_".c." line=".p[1]." buffer=".winbufnr(0) | 21 | exec "sign place ".c." name=mark_".c." line=".p[1]." buffer=".winbufnr(0) |
22 | endif | 22 | endif |
23 | endfor | 23 | endfor |
24 | endfunction | 24 | endfunction |
25 | 25 | ||
26 | autocmd CursorHold * call KarlMarks() | 26 | 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 @@ | |||
1 | let g:ale_pattern_options = {'\.py$': {'ale_enabled': 1}} | ||
2 | let g:ale_linters = {'python': ['flake8', 'pylint'] } | ||
3 | let g:ale_fixers = | ||
4 | \ { | ||
5 | \ 'python': ['black', 'isort', 'remove_trailing_lines', 'trim_whitespace'], | ||
6 | \ 'bash': ['remove_trailing_lines', 'trim_whitespace'] | ||
7 | \ } | ||
8 | |||
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 <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>" | |||
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() | |||
21 | highlight! link WildMenu Search | 21 | highlight! link WildMenu Search |
22 | highlight! link Convention Error | 22 | highlight! link Convention Error |
23 | highlight! link PmenuSbar Pmenu | 23 | highlight! link PmenuSbar Pmenu |
24 | highlight! link Tabline StatusLine | ||
25 | highlight! link VertSplit LineNr | 24 | highlight! link VertSplit LineNr |
26 | highlight! link SignColumn LineNr | 25 | highlight! link SignColumn LineNr |
27 | highlight! link FoldColumn VertSplit | 26 | highlight! link FoldColumn VertSplit |
28 | " highlight! link Folded LineNr | 27 | " highlight! link Folded LineNr |
29 | highlight! link EndOfBuffer LineNr | 28 | highlight! link EndOfBuffer NonText |
30 | endfunction | 29 | endfunction |
31 | autocmd ColorScheme * call ExtendColorTheme() | 30 | autocmd ColorScheme * call ExtendColorTheme() |
32 | 31 | ||
@@ -36,8 +35,8 @@ else | |||
36 | set termguicolors | 35 | set termguicolors |
37 | endif | 36 | endif |
38 | 37 | ||
39 | if filereadable(expand('~/.vimrc_background')) && filereadable(expand('~/.config/base16-shell/colortest')) | 38 | if filereadable(expand('~/.vimrc_background')) && filereadable(expand('~/.local/share/base16/base16-shell/colortest')) |
40 | let g:base16_shell_path = '~/.config/base16-shell/scripts' | 39 | let g:base16_shell_path = '~/.local/share/base16/base16-shell/scripts' |
41 | let base16colorspace = 256 | 40 | let base16colorspace = 256 |
42 | source ~/.vimrc_background | 41 | source ~/.vimrc_background |
43 | else | 42 | else |
@@ -52,6 +51,7 @@ else | |||
52 | \ } | 51 | \ } |
53 | \ } | 52 | \ } |
54 | colorscheme PaperColor | 53 | colorscheme PaperColor |
54 | set background=dark | ||
55 | endif | 55 | endif |
56 | 56 | ||
57 | 57 | ||
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 | |||
81 | menu &Git.&Display\ recently\ changed\ files\ in\ quickfix\ list | 81 | menu &Git.&Display\ recently\ changed\ files\ in\ quickfix\ list |
82 | \ :call setqflist([], 'r', {'title': 'Recently changed in GIT', 'items':map(systemlist("git show --name-only --pretty=''"), {_, p->{'filename': fnamemodify(p, ':.')}}) })<CR>:copen<CR> | 82 | \ :call setqflist([], 'r', {'title': 'Recently changed in GIT', 'items':map(systemlist("git show --name-only --pretty=''"), {_, p->{'filename': fnamemodify(p, ':.')}}) })<CR>:copen<CR> |
83 | menu &Git.&Display\ last\ changes | 83 | menu &Git.&Display\ last\ changes |
84 | \ :let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f'}<CR>:SignifyRefresh<CR> | 84 | \ :let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f', 'svn': '', 'cvs': ''}<CR>:SignifyRefresh<CR> |
85 | menu &Git.&Display\ unmerged\ files\ in\ location\ list | 85 | menu &Git.&Display\ unmerged\ files\ in\ location\ list |
86 | \ :call setloclist(0, map(systemlist("git diff --name-only --diff-filter=U \| uniq"), {_, p->{'filename': fnamemodify(p, ':.')}}))<CR>:lopen<CR> | 86 | \ :call setloclist(0, map(systemlist("git diff --name-only --diff-filter=U \| uniq"), {_, p->{'filename': fnamemodify(p, ':.')}}))<CR>:lopen<CR> |
87 | menu &Git.&Display\ significance\ of\ changes | 87 | 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 | |||
29 | highlight! link SignifySignDeleteFirstLine SignColumn | 29 | highlight! link SignifySignDeleteFirstLine SignColumn |
30 | endfunction | 30 | endfunction |
31 | 31 | ||
32 | packadd vim-signify | 32 | " packadd vim-signify |
33 | 33 | ||
34 | autocmd VimEnter,ColorScheme * call SignifyColorScheme() | 34 | autocmd VimEnter,ColorScheme * call SignifyColorScheme() |
35 | augroup END | 35 | 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 | |||
14 | if &term ==? 'linux' | 14 | if &term ==? 'linux' |
15 | let g:group_active = 'StatusLineTerm' | 15 | let g:group_active = 'StatusLineTerm' |
16 | let g:group_inactive = 'StatusLineTermNC' | 16 | let g:group_inactive = 'StatusLineTermNC' |
17 | let g:group_tabline = 'StatusLineTerm' | 17 | let g:group_tabline = 'TabLine' |
18 | else | 18 | else |
19 | let g:group_active = 'StatusLine' | 19 | let g:group_active = 'StatusLine' |
20 | let g:group_inactive = 'StatusLineNC' | 20 | let g:group_inactive = 'StatusLineNC' |
21 | " let g:group_tabline = 'TabLine' | 21 | let g:group_tabline = 'TabLine' |
22 | let g:group_tabline = 'StatusLine' | ||
23 | endif | 22 | endif |
24 | 23 | ||
25 | " this function reverts foreground color and background color of a given | 24 | " this function reverts foreground color and background color of a given |
26 | " highlight group and returns the name of a newly created _invert group | 25 | " highlight group and returns the name of a newly created _invert group |
27 | function! CreateInvertGroup(highlight_group) | 26 | function! CreateInvertGroup(highlight_group) |
28 | if(synIDattr(hlID(a:highlight_group), 'reverse')==1) | 27 | if(synIDattr(synIDtrans(hlID(a:highlight_group)), 'reverse', 'cterm')==1) |
29 | let w:color=synIDattr(hlID(a:highlight_group), 'fg#') | 28 | let w:color=synIDattr(hlID(a:highlight_group), 'fg#') |
30 | else | 29 | else |
31 | let w:color=synIDattr(hlID(a:highlight_group), 'bg#') | 30 | let w:color=synIDattr(hlID(a:highlight_group), 'bg#') |
@@ -124,6 +123,12 @@ augroup MAX_FANCYLINE | |||
124 | \ .'%##' | 123 | \ .'%##' |
125 | endfunction | 124 | endfunction |
126 | 125 | ||
126 | |||
127 | if $USER ==? 'root' | ||
128 | let invert_group = CreateInvertGroup("ErrorMsg") | ||
129 | let g:group_tabline = invert_group | ||
130 | endif | ||
131 | |||
127 | function! ApplyColorScheme() | 132 | function! ApplyColorScheme() |
128 | " set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) incompatible with nvim | 133 | " set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) incompatible with nvim |
129 | " set t_ut= | 134 | " 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 @@ | |||
1 | if &diff " only for diff mode/vimdiff | ||
2 | set diffopt=filler,context:1000000 " filler is default and inserts empty lines for sync | ||
3 | set foldmethod=syntax | ||
4 | endif | ||