# HG changeset patch # User Ludovic Chabant # Date 1323393407 28800 # Node ID 6df571869f4a7485a0e926691800d5eb861afec6 # Parent a6513d65eccfca4de37f9127d3660b5e778908b4 Added statusline and fold-related mappings. diff -r a6513d65eccf -r 6df571869f4a vim/vimrc --- a/vim/vimrc Thu Dec 08 17:13:23 2011 -0800 +++ b/vim/vimrc Thu Dec 08 17:16:47 2011 -0800 @@ -6,6 +6,8 @@ " """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Global Setup {{{ + " Use Vim settings, rather then Vi settings (much better!). " This must be first, because it changes other options as a side effect. set nocompatible @@ -40,6 +42,10 @@ set columns=135 endif +" }}} + +" General Settings {{{ + " Disable modelines. set modelines=0 @@ -131,6 +137,9 @@ " Going left and right let you go to other lines. set whichwrap+=<,>,h,l +" Folds are defined by markers in the text. +set foldmethod=marker + " And now, for some system-dependent settings: " - font to use if $PLATFORM == "windows" @@ -159,10 +168,17 @@ " Enable file type detection. filetype indent plugin on +" }}} + +" Plugin Settings {{{ + " Navigate MiniBufExplorer with CTRL+Tab/CTRL+Shift+Tab. let g:miniBufExplMapCTabSwitchBufs = 1 -" Custom mappings. +" }}} + +" Mappings {{{ + let mapleader="," " Edit & source the VIMRC. @@ -185,11 +201,51 @@ " Simple way to close a buffer without closing the window. nnoremap bd :bprevious:bdelete # -" Abbreviations +" Toggle folds with +nnoremap za + +" Create folds with (in visual mode) +vnoremap zf + +" }}} + +" Abbreviations {{{ + iabbrev @@ ludovic@chabant.com iabbrev ccopy Copyright ©2011 Ludovic Chabant, all rights reserved. iabbrev ssig --l u d o .. 8 0 17 80 +" }}} + +" Status Line {{{ + +set statusline=%f " Path. +set statusline+=%m " Modified flag. +set statusline+=%r " Readonly flag. +set statusline+=%w " Preview window flag. + +set statusline+=\ " Space. + +set statusline+=%#redbar# " Highlight the following as a warning. +set statusline+=%{SyntasticStatuslineFlag()} " Syntastic errors. +set statusline+=%* " Reset highlighting. + +set statusline+=%= " Right align. + +" File format, encoding and type. Ex: "(unix/utf-8/python)" +set statusline+=( +set statusline+=%{&ff} " Format (unix/DOS). +set statusline+=/ +set statusline+=%{strlen(&fenc)?&fenc:&enc} " Encoding (utf-8). +set statusline+=/ +set statusline+=%{&ft} " Type (python). +set statusline+=) + +" Line and column position and counts. +set statusline+=\ (line\ %l\/%L,\ col\ %03c) + +" }}} + " Functions {{{ function! s:ToggleSpellCheck() abort @@ -243,11 +299,6 @@ " set statusline+=%=%-14.(Line:\ %l\ of\ %L\ [%p%%]\ -\ Col:\ %c%V%) "endif -" When started as "evim", evim.vim will already have done these settings. -"if v:progname =~? "evim" -" finish -"endif - " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries " let &guioptions = substitute(&guioptions, "t", "", "g")