Skip to content

qrutyy/checkpatch.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

checkpatch.nvim

A checkpatch plugin for Neovim. Nothing more. Nothing less.

Installation

lazy.nvim

{
  "qrutyy/checkpatch.nvim",
  -- or: dir = "/absolute/path/to/checkpatch.nvim" for a local checkout
  ft = { "c" },
  cmd = { "Checkpatch" },
  opts = {
    -- you can override default keymaps here
    -- mappings = { run = { keys = "<leader>cp" }, next = { keys = "," }, prev = { keys = "<" } }
  },
  config = function(_, opts)
    require("plugins.checkpatch").setup(opts)
  end,
}

packer.nvim

use {
  "qrutyy/checkpatch.nvim",
  config = function()
    require("plugins.checkpatch").setup({
      -- mappings = { run = { keys = "<leader>cp" } }
    })
  end,
}

vim-plug

Plug 'qrutyy/checkpatch.nvim'
" In your init.vim/init.lua after plug#end():
lua << EOF
require('plugins.checkpatch').setup({
  -- mappings = { run = { keys = '<leader>cp' } }
})
EOF

Supported Neovim versions:

  • NVIM v0.11.1

Dependencies:

  • curl (mandatory) download checkpatch

Usage

Simple ah

:Checkpatch [options]

Example:

:Checkpatch set log strict codespell no-tree diff

Default keymaps (can be overridden in setup):

  • cp: Run :Checkpatch
  • ,: Next checkpatch remark
  • shift + ,: Previous checkpatch remark

Options

  • set - to set & remember the options configuration
  • log - save stdout to file in (~/.local/share/nvim/checkpatch-logs/)
  • no-tree - run outside of kernel source tree
  • codespell - use codespell
  • strict - strict mode
  • quiet - guess what (always on save)
  • diff - check only the diff on the current branch
  • on-save - sets last cfg (in case no set option isn't used) as on-save. Note that this mode is highly recommended to be used with diff option to prevent lags bc of checkpatch work.
  • on-save-off - disables on-save mode.

If you execute it with no options (same with hotkey) - it will use the prev cached config.

About

checkpatch nvim plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages