1 "
  2 " $HOME/.vimrc -- a configuration file for Vi IMproved
  3 "
  4 
  5 " General settings:
  6 set nocompatible                  " Disable Vi-compatible mode.
  7 set magic                         " Use classic regular expressions.
  8 set noignorecase                  " Be case sensitive.
  9 set wrapscan                      " Search across multiple lines.
 10 set backupcopy=no                 " Do not create backup copies.
 11 set formatoptions=tcqr            " Adjust automatic formatting.
 12 set backspace=indent,eol,start    " Specify the backspace behavior.
 13 set history=1000                  " Specify the number of possible undos.
 14 set helplang=en                   " Specify the help language.
 15 set spelllang=en_us               " Specify the spell checking language.
 16 set nospell                       " Disable spell checking by default.
 17 filetype on                       " Enable file type detection.
 18 filetype plugin on                " Enable file type plug-ins.
 19 
 20 " Environment settings:
 21 set ruler                         " Display the ruler.
 22 set showcmd                       " Display commands.
 23 set showmode                      " Display the current mode.
 24 set number                        " Display line numbers.
 25 set hlsearch                      " Highlight all matching patterns.
 26 set incsearch                     " Highlight matching text while typing.
 27 syntax on                         " Highlight the syntax.
 28 
 29 " Editing settings:
 30 set textwidth=0                   " Do not set the default text width.
 31 set wrap                          " Wrap the displayed text.
 32 set linebreak                     " Break lines at a word boundary.
 33 set expandtab                     " Replace tabulators with spaces.
 34 set tabstop=2                     " Set the number of spaces for a tabulator.
 35 set shiftwidth=2                  " Set the number of spaces for indentation.
 36 set autoindent                    " Automatically insert line breaks.
 37 set nojoinspaces                  " Do not insert a second space after
 38                                   " a sentence when joining lines.
 39 
 40 " -------------------------------------------------------------------------
 41 "                       Plug-in Configuration: Vundle
 42 " -------------------------------------------------------------------------
 43 
 44 " Start the configuration:
 45 set rtp+=~/.vim/bundle/Vundle.vim/
 46 call vundle#begin()
 47 
 48 " Configure bundles:
 49 Plugin 'VundleVim/Vundle.vim'
 50 Plugin 'SirVer/ultisnips'
 51 Plugin 'scrooloose/nerdtree'
 52 Plugin 'majutsushi/tagbar'
 53 Plugin 'emender/emender-vim'
 54 Plugin 'jhradilek/vim-docbk'
 55 Plugin 'jhradilek/vim-mallard'
 56 Plugin 'jhradilek/vim-rng'
 57 Plugin 'jhradilek/vim-snippets'
 58 Plugin 'pondrejk/vim-readability'
 59 
 60 " Finish the configuration:
 61 call vundle#end()
 62 
 63 
 64 " -------------------------------------------------------------------------
 65 "                     Plug-in Configuration: NERDTree
 66 " -------------------------------------------------------------------------
 67 
 68 " Configure window placement:
 69 let g:NERDTreeWinPos = 'left'
 70 let g:NERDTreeWinSize = 25
 71 
 72 " Map keys:
 73 nmap <silent> <F11> :NERDTreeToggle<CR>
 74 imap <silent> <F11> <ESC>:NERDTreeToggle<CR>
 75 cmap <silent> <F11> <ESC>:NERDTreeToggle<CR>
 76 
 77 
 78 " -------------------------------------------------------------------------
 79 "                      Plug-in Configuration: Tagbar
 80 " -------------------------------------------------------------------------
 81 
 82 " Configure the window placement:
 83 let g:tagbar_left = 0
 84 let g:tagbar_width = 40
 85 
 86 " Map keys:
 87 nmap <silent> <F12> :TagbarToggle<CR>
 88 imap <silent> <F12> <ESC>:TagbarToggle<CR>
 89 cmap <silent> <F12> <ESC>:TagbarToggle<CR>
 90 
 91 
 92 " -------------------------------------------------------------------------
 93 "                    Plug-in Configuration: UltiSnips
 94 " -------------------------------------------------------------------------
 95 
 96 " Remap keys:
 97 let g:UltiSnipsEditSplit = 'vertical'
 98 let g:UltiSnipsExpandTrigger = '<s-tab>'
 99 let g:UltiSnipsJumpForwardTrigger = '<s-tab>'
100 let g:UltiSnipsJumpBackwardTrigger = '<c-s-tab>'
101 
102 
103 " -------------------------------------------------------------------------
104 "                              Miscellaneous
105 " -------------------------------------------------------------------------
106 
107 " Enhance the vertical movement over wrapped text:
108 noremap k gk
109 noremap j gj
110 noremap <Up> g<Up>
111 noremap <Down> g<Down>
112 inoremap <Up> <Esc>g<Up>a
113 inoremap <Down> <Esc>g<Down>a
114 
115 " Customize file type recognition:
116 au BufNewFile,BufRead *.page.stub set ft=mallard
117 au BufNewFile,BufRead *.contentspec set ft=contentspec
118 au BufNewFile,BufRead *.md set ft=markdown
119 au FileType vim,help setlocal keywordprg=:help
120 au FileType markdown,python set ts=4 sw=4 expandtab
121 au FileType gitcommit set spell
122 au FileType mail set tw=75
123 au FileType xml set ft=docbk