Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: 0.1
Fetching contributors…

Cannot retrieve contributors at this time

49 lines (39 sloc) 1.344 kb
" Vim plugin to fit the Linux kernel coding style and help kernel development
" Last Change: 2012 Dec 24
" Maintainer: Vivien Didelot <>
" License: Distributed under the same terms as Vim itself.
" This script is inspired from an article written by Bart:
" and various user comments.
if exists("g:loaded_linuxsty")
let g:loaded_linuxsty = 1
set wildignore+=*.ko,*.mod.c,*.order,modules.builtin
augroup linuxsty
autocmd FileType c,cpp call s:LinuxFormatting()
autocmd FileType c,cpp call s:LinuxKeywords()
autocmd FileType c,cpp call s:LinuxHighlighting()
autocmd FileType diff,kconfig setlocal tabstop=8
augroup END
function s:LinuxFormatting()
setlocal tabstop=8
setlocal shiftwidth=8
setlocal textwidth=80
setlocal noexpandtab
setlocal cindent
setlocal formatoptions=tcqlron
setlocal cinoptions=:0,l1,t0,g0
function s:LinuxKeywords()
syn keyword cOperator likely unlikely
syn keyword cType u8 u16 u32 u64 s8 s16 s32 s64
function s:LinuxHighlighting()
highlight default link LinuxError ErrorMsg
match LinuxError " \+\t" " spaces before tab
match LinuxError "\s\+$" " trailing whitespaces
match LinuxError /\%81v.\+/ " virtual column 81 and more
Jump to Line
Something went wrong with that request. Please try again.