GithubHelp home page GithubHelp logo

aka-mj / vim-linux-coding-style Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vivien/vim-linux-coding-style

0.0 0.0 0.0 18 KB

Vim plugin to respect the Linux kernel coding style http://www.vim.org/scripts/script.php?script_id=4369

Vim Script 100.00%

vim-linux-coding-style's Introduction

linuxsty.vim

This plugin is meant to help you respecting the Linux kernel coding style, described at: https://www.kernel.org/doc/Documentation/process/coding-style.rst

It will automatically apply known rules to kernel related files, such as .c, .h, Kconfig and patch files. The main rules are about indentation and syntax error highlighting (like exceeding 80 chars).

If you have any comments, fixes or requests, feel free to contact me or send me a patch. The development also takes place on its official Github repository.

The plugin is also available at vim.org, script ID 4369.

Installation

You can just drop the linuxsty.vim file in your ~/.vim/plugin directory. Alternatively you can use the Git repository with a manager such as Pathogen.

Usage

By default the Linux coding style is enabled for any file known to the Linux project (C files, headers, patches, Kconfig, etc.).

If you prefer a finer control and apply it only on some files, define a "g:linuxsty_patterns" array in your vimrc and the style will be applied only if the buffer's path matches one of the pattern. For instance, you can match only projects under /usr/src/ and /linux with the following:

let g:linuxsty_patterns = [ "/usr/src/", "/linux" ]

If you want to enable the coding style on demand without checking the filetype, you can use the :LinuxCodingStyle command. For instance, you can map it with the following in your vimrc:

nnoremap <silent> <leader>a :LinuxCodingStyle<cr>

License

Copyright (c) Vivien Didelot. Distributed under the same terms as Vim itself. See :help license.

vim-linux-coding-style's People

Contributors

d-k-c avatar gsi-frank avatar joeperches avatar lyude avatar mkvoya avatar vivien 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.