1" Copyright (c) 2015 Advanced Micro Devices, Inc.
2" All rights reserved.
3"
4" The license below extends only to copyright in the software and shall
5" not be construed as granting a license to any other intellectual
6" property including but not limited to intellectual property relating
7" to a hardware implementation of the functionality of the software
8" licensed hereunder.  You may use the software subject to the license
9" terms below provided that you ensure that this notice is replicated
10" unmodified and in its entirety in all distributions of the software,
11" modified or unmodified, in source code or in binary form.
12"
13" Redistribution and use in source and binary forms, with or without
14" modification, are permitted provided that the following conditions are
15" met: redistributions of source code must retain the above copyright
16" notice, this list of conditions and the following disclaimer;
17" redistributions in binary form must reproduce the above copyright
18" notice, this list of conditions and the following disclaimer in the
19" documentation and/or other materials provided with the distribution;
20" neither the name of the copyright holders nor the names of its
21" contributors may be used to endorse or promote products derived from
22" this software without specific prior written permission.
23"
24" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35"
36" Authors: Anthony Gutierrez
37
38
39" this vimrc file helps users follow the gem5 style guide see:
40" www.gem5.org/Coding_Style
41" it highlights extraneaous whitespace and tabs (so you can easily remove
42" them), sets column length to a max of 78 characters, expands tabs, and sets
43" a tab width of 4 spaces.
44
45" *NOTE 1* this doesn't guarantee that your code with fit the style guidelines,
46" so you should still to double check everything, but it helps with a lot of
47" tedious stuff.
48
49" *NOTE 2* if you do actually NEED to use a tab, e.g., in a Makefile, enter
50" insert mode and type ctrl-v first, which will make tabs behave as expected
51
52filetype indent on "auto indenting
53set tabstop=4 "tabs = 4 spaces
54set shiftwidth=4 "auto indent = 4 spaces
55set expandtab "expand tabs to spaces
56set tw=78 "max cols is 78
57
58" highlight extrawhite space with light blue background
59highlight ExtraWhitespace ctermbg=lightblue guibg=lightblue
60match ExtraWhitespace /\s\+$\|\t/
61
62" stuff to prevent the light blue highlighting from showing up at the end of
63" lines when you're in insert mode. i.e., everytime you enter a space as you're
64" entering text the highlighting will kick in, which can be annoying. this will
65" make the highlighting only show up if you finish editing and leave some extra
66" whitespace
67autocmd BufWinEnter * match ExtraWhitespace /\s\+$\|\t/
68autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$\|\t\%#\@<!/
69autocmd InsertLeave * match ExtraWhitespace /\s\+$\|\t/
70autocmd BufWinLeave * call clearmatches()
71
72
73" optionally set a vertical line on column 79. anything on, or after the line
74" is over the limit. this can be useful as set tw=78 won't breakup existing
75" lines that are over the limit, and the user can also do certain things to
76" make lines go past the set textwidth, e.g., joining a line (shift-j or J)
77
78"if exists('+colorcolumn')
79"    set colorcolumn=79
80"endif
81
82
83" optionally set spell checking
84"set spell
85
86" optionally highlight whitespace with specified characters. tab for trailing
87" tabs, trail for trailing whitespace, extends for lines that extend beyond
88" screen when wrap is off, and non-breakable white spaces. list must be set
89" for these characters to display.
90"set list
91"set listchars=tab:›\ ,trail:•,extends:#,nbsp:.
92