- Notifications
You must be signed in to change notification settings - Fork2
Konfekt/vim-compilers
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
The foldercompiler/ contains compiler files that set up compilers (or linters, that is, syntax checkers) for easy use in Vim.Copy them into your Vim configuration folder (~/.vim on Linux and MacOS,%USERPROFILE%/vimfiles on Microsoft Windows).You may also use a plug-in manager such asvim-plug (in this case, addPlug 'konfekt/vim-compilers' to yourvimrc to use them).
Switch to a compiler by:compiler ... and then start it by:make or:lmake.For example, first call:compiler flake8 to switch toflake8, and then lint the current (Python) file by:lmake %:S.In one go::comp flake8 | lmake %:S.
This plug-in provides a command(L)Compiler to set the compiler and call it by(l)make in one go, for example:
LCompiler flake8%:S
achieves the same as:comp flake8 | lmake %:S.Everything following its first argument is passed to(L)Make.
For faster access to this commands, installvim-alias and add aliases such as
AliascmCompilerAlias cmm Compiler\%:S<c-b><c-right>Alias lcm LCompilerAlias lcmm LCompiler\%:S<c-b><c-right>Aliasm MakeAliasmm Make\%:SAliaslmLMakeAlias lmm LMake\%:S
For convenience, define in~/.vim/after/ftplugin/python.vim a command
command!-buffer-bang Lintcompiler flake8 |lmake%:S<bang>
It can then be called to lint the main file by:Lint.
The location-list window that lists all compiler messages can then be opened by:lwindow;their locations can be jumped to by:ln respectively:lp (or usevim-unimpaired's mappings]l and[l.)
To automatically open the location-list window after linting has finished, addautocmd QuickFixCmdPost lmake lwindow to yourvimrc.
To automatically run:Lint after saving the modifications to a source code file, sayPython, add to~/.vim/after/ftplugin/python.vim:
autocmdBufWrite<buffer=abuf> Lint
For a compiler command, such aspython, define in~/.vim/after/ftplugin/python.vim a command
command!-buffer-bang Compilecompilerpython |make<bang>.
that can then be called to compile the main file.For example, if it is the one of the currently open buffer, then:Compile %:S suffices.
The (quickfix) window that lists all compiler messages can then be opened by:cwindow;their locations can be jumped to by:cn respectively:cp (or usevim-unimpaired's mappings]q and[q.).
To automatically open the quickfix window after compilation has finished, addautocmd QuickFixCmdPost make cwindow to yourvimrc.
To run a linter or compiler in the background, use an:(L)Make command (instead of:make or:lmake), such as
that oftasks.vim, or
that ofvim-dispatch, or
that defined by
command!-bang -nargs=* -complete=file Make AsyncRun<bang> -auto=make -program=make-strip<args>
withAsyncRun.vim installed.To avoid empty lines in the quickfix list, add
let g:asyncrun_trim = 1to yourvimrc.Otheroptions, such asg:asyncrun_savemight be of interest.
The plug-invim-markify marks all found locations by text signs at the side of the window.
Vim already comes with many compiler files, see:e $VIMRUNTIME/compiler.
Googling forGitHub Vim compilers yielded compiler files for
Asearch request on GitHub itself yields compiler files for
About
a collection of compilers for ready use by Vim's built-in compiler feature (see :help :compiler)
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Contributors3
Uh oh!
There was an error while loading.Please reload this page.