Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

a collection of compilers for ready use by Vim's built-in compiler feature (see :help :compiler)

NotificationsYou must be signed in to change notification settings

Konfekt/vim-compilers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 

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).

Usage and Setup

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.

Convenience Commands

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

Calling a Linter

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

Calling a Compiler

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.

Run as Jobs

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, addlet g:asyncrun_trim = 1 to yourvimrc.Otheroptions, such asg:asyncrun_save might be of interest.

Signpost Locations

The plug-invim-markify marks all found locations by text signs at the side of the window.

Additional Compilers

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2026 Movatter.jp