]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - vimrc
vimrc: Don't use abbreviated commands (:bprev -> :bprevious).
[config/dotfiles.git] / vimrc
diff --git a/vimrc b/vimrc
index 3b1ca66256af8e87d772eaf2dc6b94e533f3d804..6c3e292145226b121326a392c6103c7d3be84944 100644 (file)
--- a/vimrc
+++ b/vimrc
@@ -88,6 +88,23 @@ if has('autocmd')
 endif
 
 
+" HELPER FUNCTIONS
+
+" Check if the given syntax group is available. Thanks to bairui in #vim on
+" Freenode (2012-02-19 01:15 CET) for the try/catch silent highlight idea.
+if has('eval')
+    function! s:HasSyntaxGroup(group)
+        try
+            execute 'silent highlight ' . a:group
+        " \a = [A-Za-z]
+        catch /^Vim\%((\a\+)\)\=:E411/ " 'highlight group not found'
+            return 0
+        endtry
+        return 1
+    endfunction
+endif
+
+
 " EDIT SETTINGS
 
 " Enable automatic file detection, plugin and indention support.
@@ -348,7 +365,7 @@ nmap - <C-B>
 " Go to next and previous buffer. Thanks to elik in #vim on Freenode
 " (2010-05-16 18:38 CEST) for this idea.
 nnoremap <silent> gb :bnext<CR>
-nnoremap <silent> gB :bprev<CR>
+nnoremap <silent> gB :bprevious<CR>
 
 " Fast access to buffers.
 nnoremap <silent> <Leader>1 :1buffer<CR>
@@ -486,8 +503,8 @@ endif
 " ABBREVIATIONS
 
 " Fix some of my spelling mistakes.
-iabbrev relle reelle
-iabbrev reele reelle
+inoreabbrev relle reelle
+inoreabbrev reele reelle
 
 
 " SYNTAX SETTINGS
@@ -527,7 +544,13 @@ if has('syntax')
 " <antoine.mechelynck@gmail.com> from the Vim mailing list. It can easily be
 " disabled when necessary with :2match (in Vim >= 700).
         if !&diff && exists(':2match')
-            2match Todo /\%>78v./
+            " Use ColorColumn for overlong lines if available and my color
+            " scheme is used.
+            if &t_Co == 256 && <SID>HasSyntaxGroup('ColorColumn')
+                2match ColorColumn /\%>78v./
+            else
+                2match Todo /\%>78v./
+            endif
         elseif !&diff
             match Todo /\%>78v./
         endif
@@ -552,6 +575,11 @@ if has('syntax')
             execute '  for l:x in l:spaces'
                   \ '|     call matchadd("Error", "\\%u" . l:x)'
                   \ '| endfor'
+
+" Reduce visibility of tabs in contrast to normal SpecialKeys.
+            if &t_Co == 256 && <SID>HasSyntaxGroup('specialKeyTab')
+                call matchadd('specialKeyTab', '\t')
+            endif
         endif
     endfunction
 " Enable highlights for the current and all new windows. Thanks to bairui in