Skip to content

Commit 678fc65

Browse files
committed
Change i3 provider
1 parent aad3df9 commit 678fc65

File tree

8 files changed

+358
-146
lines changed

8 files changed

+358
-146
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ If you need full functionality of any plugin, please use it directly with your p
8585
- [haskell](https://github.com/neovimhaskell/haskell-vim) (syntax, indent, ftplugin)
8686
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax)
8787
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin)
88-
- [i3](https://github.com/PotatoesMaster/i3-vim-syntax) (syntax, ftplugin)
88+
- [i3](https://github.com/mboughaba/i3config.vim) (syntax, ftplugin)
8989
- [jasmine](https://github.com/glanotte/vim-jasmine) (syntax)
9090
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, compiler, ftplugin, extras)
9191
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (syntax, indent)
@@ -119,7 +119,7 @@ If you need full functionality of any plugin, please use it directly with your p
119119
- [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin)
120120
- [puppet](https://github.com/voxpupuli/vim-puppet) (syntax, indent, ftplugin)
121121
- [purescript](https://github.com/purescript-contrib/purescript-vim) (syntax, indent, ftplugin)
122-
- [python-compiler](https://github.com/aliev/vim-compiler-python) ()
122+
- [python-compiler](https://github.com/aliev/vim-compiler-python) (compiler, autoload)
123123
- [python-ident](https://github.com/Vimjas/vim-python-pep8-indent) (indent)
124124
- [python](https://github.com/vim-python/python-syntax) (syntax)
125125
- [qml](https://github.com/peterhoeg/vim-qml) (syntax, indent, ftplugin)

autoload/python/utils.vim

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'python-compiler') == -1
2+
3+
" Sometimes Python issues debugging messages
4+
" which don't belong to a call stack context
5+
" this function filters these messages
6+
function! python#utils#fix_qflist() " {{{
7+
let l:traceback = []
8+
let l:qflist = getqflist()
9+
10+
for l:item in l:qflist
11+
if !empty(l:item.type)
12+
call add(l:traceback, l:item)
13+
endif
14+
endfor
15+
16+
if !empty(l:traceback)
17+
call setqflist(l:traceback)
18+
endif
19+
endfunction " }}}
20+
21+
endif

build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ PACKS="
194194
haskell:neovimhaskell/haskell-vim
195195
haxe:yaymukund/vim-haxe
196196
html5:othree/html5.vim
197-
i3:PotatoesMaster/i3-vim-syntax
197+
i3:mboughaba/i3config.vim
198198
jasmine:glanotte/vim-jasmine
199199
javascript:pangloss/vim-javascript:_JAVASCRIPT
200200
jenkins:martinda/Jenkinsfile-vim-syntax

compiler/python.vim

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'python-compiler') == -1
2+
3+
" Vim compiler file
4+
" Compiler: Unit testing tool for Python
5+
" Maintainer: Ali Aliev <[email protected]>
6+
" Last Change: 2015 Nov 2
7+
8+
if exists("current_compiler")
9+
finish
10+
endif
11+
12+
let current_compiler = "python"
13+
14+
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
15+
command -nargs=* CompilerSet setlocal <args>
16+
endif
17+
18+
" Disable Python warnings
19+
if !exists('$PYTHONWARNINGS')
20+
let $PYTHONWARNINGS="ignore"
21+
endif
22+
23+
" For Flake8 first
24+
CompilerSet efm =%E%f:%l:\ could\ not\ compile,
25+
CompilerSet efm +=%-Z%p^,
26+
CompilerSet efm +=%A%f:%l:%c:\ %t%n\ %m,
27+
CompilerSet efm +=%A%f:%l:\ %t%n\ %m,
28+
29+
" Python errors are multi-lined. They often start with 'Traceback', so
30+
" we want to capture that (with +G) and show it in the quickfix window
31+
" because it explains the order of error messages.
32+
33+
CompilerSet efm +=%+GTraceback%.%#,
34+
35+
" The error message itself starts with a line with 'File' in it. There
36+
" are a couple of variations, and we need to process a line beginning
37+
" with whitespace followed by File, the filename in "", a line number,
38+
" and optional further text. %E here indicates the start of a multi-line
39+
" error message. The %\C at the end means that a case-sensitive search is
40+
" required.
41+
CompilerSet efm +=%E\ \ File\ \"%f\"\\,\ line\ %l\\,%m%\\C,
42+
CompilerSet efm +=%E\ \ File\ \"%f\"\\,\ line\ %l%\\C,
43+
44+
" The possible continutation lines are idenitifed to Vim by %C. We deal
45+
" with these in order of most to least specific to ensure a proper
46+
" match. A pointer (^) identifies the column in which the error occurs
47+
" (but will not be entirely accurate due to indention of Python code).
48+
CompilerSet efm +=%C%p^,
49+
50+
" Any text, indented by more than two spaces contain useful information.
51+
" We want this to appear in the quickfix window, hence %+.
52+
CompilerSet efm +=%+C\ \ \ \ %.%#,
53+
CompilerSet efm +=%+C\ \ %.%#,
54+
55+
" The last line (%Z) does not begin with any whitespace. We use a zero
56+
" width lookahead (\&) to check this. The line contains the error
57+
" message itself (%m)
58+
CompilerSet efm +=%Z%\\S%\\&%m,
59+
60+
" We can ignore any other lines (%-G)
61+
CompilerSet efm +=%-G%.%#
62+
63+
if filereadable("Makefile")
64+
CompilerSet makeprg=make
65+
else
66+
CompilerSet makeprg=python
67+
endif
68+
69+
" vim:foldmethod=marker:foldlevel=0
70+
71+
endif

ftdetect/polyglot.vim

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,11 @@ endif
458458

459459
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'i3') == -1
460460
augroup filetypedetect
461-
" i3, from i3.vim in PotatoesMaster/i3-vim-syntax
462-
augroup i3_ftdetect
463-
au!
464-
au BufRead,BufNewFile *i3/config,*sway/config set ft=i3
465-
augroup END
461+
" i3, from i3config.vim in mboughaba/i3config.vim
462+
aug i3config#ft_detect
463+
au!
464+
au BufNewFile,BufRead .i3.config,i3.config,*.i3config,*.i3.config set filetype=i3config
465+
aug end
466466
augroup end
467467
endif
468468

@@ -827,6 +827,18 @@ au FileType purescript let &l:commentstring='{--%s--}'
827827
augroup end
828828
endif
829829

830+
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'python-compiler') == -1
831+
augroup filetypedetect
832+
" python-compiler, from python.vim in aliev/vim-compiler-python
833+
" Vim compiler file
834+
" Compiler: Unit testing tool for Python
835+
" Maintainer: Ali Aliev <[email protected]>
836+
" Last Change: 2015 Nov 2
837+
838+
autocmd FileType python compiler python
839+
augroup end
840+
endif
841+
830842
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
831843
augroup filetypedetect
832844
" qml, from qml.vim in peterhoeg/vim-qml
File renamed without changes.

syntax/i3.vim

Lines changed: 0 additions & 138 deletions
This file was deleted.

0 commit comments

Comments
 (0)