summaryrefslogtreecommitdiff
path: root/utils/vim
diff options
context:
space:
mode:
Diffstat (limited to 'utils/vim')
-rw-r--r--utils/vim/llvm.vim5
-rw-r--r--utils/vim/tablegen.vim2
-rw-r--r--utils/vim/vimrc31
3 files changed, 30 insertions, 8 deletions
diff --git a/utils/vim/llvm.vim b/utils/vim/llvm.vim
index 6e4a207b68eb8..518aa041b8b91 100644
--- a/utils/vim/llvm.vim
+++ b/utils/vim/llvm.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: llvm
" Maintainer: The LLVM team, http://llvm.org/
-" Updated: 2003-06-02
+" Version: $Revision: 97271 $
if version < 600
syntax clear
@@ -52,11 +52,12 @@ syn keyword llvmKeyword x86_stdcallcc x86_fastcallcc
syn keyword llvmKeyword signext zeroext inreg sret nounwind noreturn
syn keyword llvmKeyword nocapture byval nest readnone readonly noalias
syn keyword llvmKeyword inlinehint noinline alwaysinline optsize ssp sspreq
-syn keyword llvmKeyword noredzone noimplicitfloat naked
+syn keyword llvmKeyword noredzone noimplicitfloat naked alignstack
syn keyword llvmKeyword module asm align tail to
syn keyword llvmKeyword addrspace section alias sideeffect c gc
syn keyword llvmKeyword target datalayout triple
syn keyword llvmKeyword blockaddress
+syn keyword llvmKeyword union
" Obsolete keywords.
syn keyword llvmError uninitialized implementation
diff --git a/utils/vim/tablegen.vim b/utils/vim/tablegen.vim
index ad358728e5f8f..11a4d80c49ca4 100644
--- a/utils/vim/tablegen.vim
+++ b/utils/vim/tablegen.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: TableGen
" Maintainer: The LLVM team, http://llvm.org/
-" Updated: 2003-08-11
+" Version: $Revision: 97271 $
if version < 600
syntax clear
diff --git a/utils/vim/vimrc b/utils/vim/vimrc
index 4909f602cff8e..63108f26d0fc3 100644
--- a/utils/vim/vimrc
+++ b/utils/vim/vimrc
@@ -1,4 +1,5 @@
" LLVM coding guidelines conformance for VIM
+" $Revision: 97273 $
"
" Maintainer: The LLVM Team, http://llvm.org
" WARNING: Read before you source in all these commands and macros! Some
@@ -10,17 +11,30 @@
" It's VIM, not VI
set nocompatible
-" Wrap text at 80 cols
-set textwidth=80
-
" A tab produces a 2-space indentation
set softtabstop=2
set shiftwidth=2
set expandtab
-" Highlight trailing whitespace
+" Highlight trailing whitespace and lines longer than 80 columns.
+highlight LongLine ctermbg=DarkYellow guibg=DarkYellow
highlight WhitespaceEOL ctermbg=DarkYellow guibg=DarkYellow
-match WhitespaceEOL /\s\+$/
+if v:version >= 702
+ " Lines longer than 80 columns.
+ au BufWinEnter * let w:m0=matchadd('LongLine', '\%>80v.\+', -1)
+
+ " Whitespace at the end of a line. This little dance suppresses
+ " whitespace that has just been typed.
+ au BufWinEnter * let w:m1=matchadd('WhitespaceEOL', '\s\+$', -1)
+ au InsertEnter * call matchdelete(w:m1)
+ au InsertEnter * let w:m2=matchadd('WhitespaceEOL', '\s\+\%#\@<!$', -1)
+ au InsertLeave * call matchdelete(w:m2)
+ au InsertLeave * let w:m1=matchadd('WhitespaceEOL', '\s\+$', -1)
+else
+ au BufRead,BufNewFile * syntax match LongLine /\%>80v.\+/
+ au InsertEnter * syntax match WhitespaceEOL /\s\+\%#\@<!$/
+ au InsertLeave * syntax match WhitespaceEOL /\s\+$/
+endif
" Enable filetype detection
filetype on
@@ -70,3 +84,10 @@ augroup END
augroup filetype
au! BufRead,BufNewFile *.td set filetype=tablegen
augroup END
+
+" Additional vim features to optionally uncomment.
+"set showcmd
+"set showmatch
+"set showmode
+"set incsearch
+"set ruler