Git Product home page Git Product logo

vim-project-lint's Introduction

Vim project lint

Project level lint status right in your favorite file explorer.

Tested on:

  • Neovim 0.3.1+ - Linux
  • Vim 8.0+ - Linux

File explorers

NERDTree

project-lint-nerdtree

defx.nvim

project-lint-defx

vimfiler.vim

project-lint-vimfiler

Requirements

  • Vim or Neovim with "jobs" feature
  • One of these file explorers:
  1. NERDTree
  2. Defx.nvim
  3. Vimfiler.vim

Optional, but highly recommended for best performance:

Installation

Choose your favorite package manager. If you don't have one, i recommend vim-packager

function! PackagerInit()
packadd vim-packager
call packager#add('kristijanhusak/vim-packager', {'type': 'opt'})
call packager#add('kristijanhusak/vim-project-lint')

"File explorers. Choose your favorite.
"NERDTree
call packager#add('scrooloose/nerdtree')

"Defx.nvim
call packager#add('Shougo/defx.nvim')

"Vimfiler
call packager#add('Shougo/unite.vim')
call packager#add('Shougo/vimfiler.vim')
endfunction
command! PackagerInstall call PackagerInit() | call packager#install()

"NERDTree
nnoremap <Leader>n :NERDTree<CR>

"vimfiler.vim
let g:vimfiler_explorer_columns = 'project_lint:type'
nnoremap <Leader>n :VimfilerExplorer

"defx.nvim
nnoremap <Leader>n :Defx -columns=project_lint:mark:filename:type<CR>

Configuration

This is the default configuration:

"Styling
let g:project_lint#error_icon = ''
let g:project_lint#warning_icon = ''
let g:project_lint#error_icon_color = 'guifg=#fb4934 ctermfg=167'
let g:project_lint#warning_icon_color = 'ctermfg=214 guifg=#fabd2f'

"Linter settings
"example:
" let g:project_lint#enabled_linters = {'javascript': ['eslint'], 'python': ['mypy']}
" If there's no setting provided for filetype, all available linters are used.
" If provided an empty array fora filetype, no linting is done for it.
let g:project_lint#enabled_linters = {}

"example:
"let g:project_lint#linter_args = {'mypy': '--ignore-missing-imports'}
let g:project_lint#linter_args = {}

"Folder settings
"Lint status is cached for each project in this folder.
let g:project_lint#cache_dir = '~/.cache/vim-project-lint'

" When this is left empty, all folders from $HOME and above are ignored and not linted:
" example of empty value: `['/home/kristijan', '/home', '/']`
" To allow linting these folders (not recommended), set this value to `v:false`
" Or use your own list of folders. When non-empty value is provided, above defaults are not added.
let g:project_lint#ignored_folders = []

"Other
" Echo linting progress in command line. Another way to get the progress info is to use statusline.
" example:
" set statusline+=project_lint#statusline()
let g:project_lint#echo_progress = v:true

" Prints all calls to linter commands and their responses. Mostly useful for development.
let g:project_lint#debug = v:false

Available linters

Language Linters
Python mypy, flake8
Javascript eslint
Go golint, go vet, revive
Css, Sass, Scss stylelint
Lua luac, luacheck
php php -l
Ruby ruby, rubocop
Rust rustc
Vim vint
Typescript eslint, tslint

LICENSE

MIT

vim-project-lint's People

Contributors

kristijanhusak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.