vimrc revision 10952
12568SN/A" Copyright (c) 2015 Advanced Micro Devices, Inc. 22568SN/A" All rights reserved. 32568SN/A" 42568SN/A" The license below extends only to copyright in the software and shall 52568SN/A" not be construed as granting a license to any other intellectual 62568SN/A" property including but not limited to intellectual property relating 72568SN/A" to a hardware implementation of the functionality of the software 82568SN/A" licensed hereunder. You may use the software subject to the license 92568SN/A" terms below provided that you ensure that this notice is replicated 102568SN/A" unmodified and in its entirety in all distributions of the software, 112568SN/A" modified or unmodified, in source code or in binary form. 122568SN/A" 132568SN/A" Redistribution and use in source and binary forms, with or without 142568SN/A" modification, are permitted provided that the following conditions are 152568SN/A" met: redistributions of source code must retain the above copyright 162568SN/A" notice, this list of conditions and the following disclaimer; 172568SN/A" redistributions in binary form must reproduce the above copyright 182568SN/A" notice, this list of conditions and the following disclaimer in the 192568SN/A" documentation and/or other materials provided with the distribution; 202568SN/A" neither the name of the copyright holders nor the names of its 212568SN/A" contributors may be used to endorse or promote products derived from 222568SN/A" this software without specific prior written permission. 232568SN/A" 242568SN/A" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 252568SN/A" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 262568SN/A" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 272665Ssaidi@eecs.umich.edu" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 282665Ssaidi@eecs.umich.edu" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 292665Ssaidi@eecs.umich.edu" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 302568SN/A" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 312568SN/A" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 322568SN/A" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 332568SN/A" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 342568SN/A" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 352568SN/A" 362568SN/A" Authors: Anthony Gutierrez 372590SN/A 382568SN/A 392568SN/A" this vimrc file helps users follow the gem5 style guide see: 402641Sstever@eecs.umich.edu" www.gem5.org/Coding_Style 412641Sstever@eecs.umich.edu" it highlights extraneaous whitespace and tabs (so you can easily remove 422641Sstever@eecs.umich.edu" them), sets column length to a max of 78 characters, expands tabs, and sets 432641Sstever@eecs.umich.edu" a tab width of 4 spaces. 442641Sstever@eecs.umich.edu 452641Sstever@eecs.umich.edu" *NOTE 1* this doesn't guarantee that your code with fit the style guidelines, 462641Sstever@eecs.umich.edu" so you should still to double check everything, but it helps with a lot of 472641Sstever@eecs.umich.edu" tedious stuff. 482641Sstever@eecs.umich.edu 492641Sstever@eecs.umich.edu" *NOTE 2* if you do actually NEED to use a tab, e.g., in a Makefile, enter 502641Sstever@eecs.umich.edu" insert mode and type ctrl-v first, which will make tabs behave as expected 512641Sstever@eecs.umich.edu 522641Sstever@eecs.umich.edufiletype indent on "auto indenting 532641Sstever@eecs.umich.eduset tabstop=4 "tabs = 4 spaces 542641Sstever@eecs.umich.eduset shiftwidth=4 "auto indent = 4 spaces 552641Sstever@eecs.umich.eduset expandtab "expand tabs to spaces 562641Sstever@eecs.umich.eduset tw=78 "max cols is 78 572641Sstever@eecs.umich.edu 582641Sstever@eecs.umich.edu" highlight extrawhite space with light blue background 592592SN/Ahighlight ExtraWhitespace ctermbg=lightblue guibg=lightblue 602592SN/Amatch ExtraWhitespace /\s\+$\|\t/ 612592SN/A 622592SN/A" stuff to prevent the light blue highlighting from showing up at the end of 632641Sstever@eecs.umich.edu" lines when you're in insert mode. i.e., everytime you enter a space as you're 642641Sstever@eecs.umich.edu" entering text the highlighting will kick in, which can be annoying. this will 652592SN/A" make the highlighting only show up if you finish editing and leave some extra 662592SN/A" whitespace 672592SN/Aautocmd BufWinEnter * match ExtraWhitespace /\s\+$\|\t/ 682592SN/Aautocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$\|\t\%#\@<!/ 692592SN/Aautocmd InsertLeave * match ExtraWhitespace /\s\+$\|\t/ 702592SN/Aautocmd BufWinLeave * call clearmatches() 712592SN/A 722592SN/A 732592SN/A" optionally set a vertical line on column 79. anything on, or after the line 742592SN/A" is over the limit. this can be useful as set tw=78 won't breakup existing 752592SN/A" lines that are over the limit, and the user can also do certain things to 762592SN/A" make lines go past the set textwidth, e.g., joining a line (shift-j or J) 772641Sstever@eecs.umich.edu 782641Sstever@eecs.umich.edu"if exists('+colorcolumn') 792592SN/A" set colorcolumn=79 802592SN/A"endif 812592SN/A 822592SN/A 832592SN/A" optionally set spell checking 842641Sstever@eecs.umich.edu"set spell 852592SN/A 862592SN/A" optionally highlight whitespace with specified characters. tab for trailing 872592SN/A" tabs, trail for trailing whitespace, extends for lines that extend beyond 882592SN/A" screen when wrap is off, and non-breakable white spaces. list must be set 892641Sstever@eecs.umich.edu" for these characters to display. 902641Sstever@eecs.umich.edu"set list 912641Sstever@eecs.umich.edu"set listchars=tab:›\ ,trail:•,extends:#,nbsp:. 922641Sstever@eecs.umich.edu