mirror of
https://github.com/dag/vim-fish
synced 2024-09-16 13:44:02 +02:00
syntax checking using vim's compiler architecture
This commit is contained in:
parent
ad16f711f9
commit
525e2b47b7
4 changed files with 17 additions and 2 deletions
|
@ -17,6 +17,7 @@ Features aplenty
|
|||
* Searching for definitions including sourced files using commands like `[i`.
|
||||
* Keyword lookup that includes pages for fish builtins using the `K` command.
|
||||
* Completions from fish using the `^X^O` command.
|
||||
* Syntax checking with quickfix using the `:make` command.
|
||||
* Improved `funced` experience to instantly start typing commands in the
|
||||
function body.
|
||||
* Mimics `funced` when manually creating new functions.
|
||||
|
@ -29,6 +30,9 @@ some Vim features turned on:
|
|||
syntax enable
|
||||
filetype plugin indent on
|
||||
|
||||
" Set up :make to use fish for syntax checking.
|
||||
compiler! fish
|
||||
|
||||
" Set this to have long lines wrap inside comments.
|
||||
set textwidth=79
|
||||
|
||||
|
|
|
@ -60,3 +60,7 @@ function! fish#Complete(findstart, base)
|
|||
return l:results
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! fish#errorformat()
|
||||
return '%Afish: %m,%-Z%f (line %l):%s'
|
||||
endfunction
|
||||
|
|
7
compiler/fish.vim
Normal file
7
compiler/fish.vim
Normal file
|
@ -0,0 +1,7 @@
|
|||
if exists('current_compiler')
|
||||
finish
|
||||
endif
|
||||
let current_compiler = 'fish'
|
||||
|
||||
CompilerSet makeprg=fish\ --no-execute\ %
|
||||
execute 'CompilerSet errorformat='.escape(fish#errorformat(), ' ')
|
|
@ -11,8 +11,8 @@ function! SyntaxCheckers_fish_fish_GetLocList()
|
|||
let l:makeprg = syntastic#makeprg#build({'exe': 'fish',
|
||||
\'args': '--no-execute',
|
||||
\'subchecker': 'fish'})
|
||||
let l:errorformat = '%Afish: %m,%-Z%f (line %l):%s'
|
||||
return SyntasticMake({'makeprg': l:makeprg, 'errorformat': l:errorformat})
|
||||
return SyntasticMake({'makeprg': l:makeprg,
|
||||
\'errorformat': fish#errorformat()})
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({'filetype': 'fish',
|
||||
|
|
Loading…
Reference in a new issue