Skip to content

Commit 35962fd

Browse files
authored
Merge pull request #8 from dtor/override-text-width
Allow overriding default text width for C files
2 parents 19aad49 + 1a21aac commit 35962fd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

plugin/linuxsty.vim

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,22 @@
1717
"
1818
" If you want to save the current file's directory and automatically call
1919
" LinuxCodingStyle next time, you can define the following option in your
20-
" vimrc.
20+
" vimrc:
2121
"
2222
" let g:linuxsty_save_path = 1
23+
"
24+
" To override the default text width for C kernel files define the following
25+
" option in your vimrc:
26+
"
27+
" let g:linuxsty_text_width = 80
2328

2429
if exists("g:loaded_linuxsty")
2530
finish
2631
endif
2732
let g:loaded_linuxsty = 1
2833

2934
let g:linuxsty_save_path = get(g:, 'linuxsty_save_path', 0)
35+
let g:linuxsty_text_width = get(g:, 'linuxsty_text_width', 100)
3036

3137
set wildignore+=*.ko,*.mod.c,*.order,modules.builtin
3238

@@ -74,7 +80,7 @@ function s:LinuxFormatting()
7480
setlocal tabstop=8
7581
setlocal shiftwidth=8
7682
setlocal softtabstop=8
77-
setlocal textwidth=100
83+
execute "setlocal textwidth=" . g:linuxsty_text_width
7884
setlocal noexpandtab
7985

8086
setlocal cindent

0 commit comments

Comments
 (0)