forked from gcc-mirror/gcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Local Vim config with GNU formatting.
2014-12-09 Laurynas Biveinis <laurynas.biveinis@gmail.com> Yury Gribov <y.gribov@samsung.com> / * .gitignore: Added .local.vimrc and .lvimrc. * Makefile.tpl (vimrc, .lvimrc, .local.vimrc): New targets. * Makefile.in: Regenerate. contrib/ * vimrc: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218514 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
ygribov
committed
Dec 9, 2014
1 parent
1e25901
commit d10a337
Showing
6 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,9 @@ POTFILES | |
TAGS | ||
TAGS.sub | ||
|
||
.local.vimrc | ||
.lvimrc | ||
|
||
.gdbinit | ||
.gdb_history | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
" Code formatting settings for Vim. | ||
" | ||
" To enable this for GCC files by default, you can either source this file | ||
" in your .vimrc via autocmd: | ||
" :au BufNewFile,BufReadPost path/to/gcc/* :so path/to/gcc/contrib/vimrc | ||
" or source the script manually for each newly opened file: | ||
" :so contrib/vimrc | ||
" You could also use numerous plugins that enable local vimrc e.g. | ||
" mbr's localvimrc or thinca's vim-localrc (but note that the latter | ||
" is much less secure). To install local vimrc config, run | ||
" $ make vimrc | ||
" from GCC build folder. | ||
" | ||
" Copyright (C) 2014 Free Software Foundation, Inc. | ||
" | ||
" This program is free software; you can redistribute it and/or modify | ||
" it under the terms of the GNU General Public License as published by | ||
" the Free Software Foundation; either version 3 of the License, or | ||
" (at your option) any later version. | ||
" | ||
" This program is distributed in the hope that it will be useful, | ||
" but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
" GNU General Public License for more details. | ||
" | ||
" You should have received a copy of the GNU General Public License | ||
" along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
function! SetStyle() | ||
let l:fname = expand("%:p") | ||
if stridx(l:fname, 'libsanitizer') != -1 | ||
return | ||
endif | ||
let l:ext = fnamemodify(l:fname, ":e") | ||
let l:c_exts = ['c', 'h', 'cpp', 'cc', 'C', 'H', 'def', 'java'] | ||
if index(l:c_exts, l:ext) != -1 | ||
setlocal cindent | ||
setlocal softtabstop=2 | ||
setlocal cinoptions=>4,n-2,{2,^-2,:2,=2,g0,f0,h2,p4,t0,+2,(0,u0,w1,m0 | ||
setlocal textwidth=80 | ||
setlocal formatoptions-=ro formatoptions+=cqlt | ||
endif | ||
endfunction | ||
|
||
call SetStyle() |