Advertisement
Guest User

Untitled

a guest
Sep 28th, 2010
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 4.93 KB | None | 0 0
  1. " Windows Compatible {
  2.     " On Windows, also use '.vim' instead of 'vimfiles'; this makes synchronization
  3.     " across (heterogeneous) systems easier.
  4.     if has('win32') || has('win64')
  5.       set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/.vim/after
  6.     endif
  7. " }
  8.  
  9. " Setup Bundle Support {
  10. " The next two lines ensure that the ~/.vim/bundle/ system works
  11.     runtime! autoload/pathogen.vim
  12.     silent! call pathogen#runtime_append_all_bundles()
  13. " }
  14. " .vimrc {
  15.     " Source the vimrc file after saving it
  16.     if has("autocmd")
  17.       autocmd bufwritepost .vimrc source $MYVIMRC
  18.     endif
  19.     let mapleader = ","
  20.     nmap <leader>v :tabedit $MYVIMRC<CR>
  21.    
  22. " }
  23.  
  24. " Basics {
  25.     set nocompatible        " must be first line
  26.     set background=dark     " Assume a dark background
  27.     :filetype plugin on
  28. " }
  29.  
  30. " General {
  31.     filetype plugin indent on   " Automatically detect file types.
  32.     syntax on                   " syntax highlighting
  33.     set mouse=a                 " automatically enable mouse usage
  34.     "set autochdir              " always switch to the current file directory..
  35.     set autowrite
  36.     set shortmess+=filmnrxoOtT      " abbrev. of messages (avoids 'hit enter')
  37.     set viewoptions=folds,options,cursor,unix,slash " better unix / windows compatibility
  38.     set virtualedit=onemore         " allow for cursor beyond last character
  39.     set history=1000                " Store a ton of history (default is 20)
  40.     " set spell                     " spell checking on
  41.     " Setting up the directories {
  42.         set backup                      " backups are nice ...
  43.         " Moved to function at bottom of the file
  44.         set backupdir=$HOME/.vimbackup//  " but not when they clog .
  45.         set directory=$HOME/.vimswap//  " Same for swap files
  46.         set viewdir=$HOME/.vimviews//   " same but for view files
  47.  
  48.         "" Creating directories if they don't exist
  49.         silent execute '!mkdir -p $HOME/.vimbackup'
  50.         silent execute '!mkdir -p $HOME/.vimswap'
  51.         silent execute '!mkdir -p $HOME/.vimviews'
  52.         au BufWinLeave * silent! mkview  "make vim save view (state) (folds, cursor, etc)
  53.         au BufWinEnter * silent! loadview "make vim load view (state) (folds, cursor, etc)
  54.     " }
  55. " }
  56.  
  57. " Vim UI {
  58.     color desert                    " load a colorscheme
  59.     set tabpagemax=15               " only show 15 tabs
  60.     set showmode                    " display the current mode
  61.     set cursorline                  " highlight current line
  62.     hi cursorline guibg=#696969     " highlight bg color of current line
  63.     hi CursorColumn guibg=#fbfb00   " highlight cursor
  64.  
  65.     if has('cmdline_info')
  66.         set ruler                   " show the ruler
  67.         set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) " a ruler on steroids
  68.         set showcmd                 " show partial commands in status line and
  69.                                     " selected characters/lines in visual mode
  70.     endif
  71.  
  72.     if has('statusline')
  73.         set laststatus=1            " show statusline only if there are > 1 windows
  74.         " Use the commented line if fugitive isn't installed
  75.         "set statusline=%<%f\ %=\:\b%n%y%m%r%w\ %l,%c%V\ %P " a statusline, also on steroids
  76.         set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
  77.     endif
  78.  
  79.     set backspace=indent,eol,start  " backspace for dummys
  80.     set linespace=0                 " No extra spaces between rows
  81.     set nu                          " Line numbers on
  82.     set showmatch                   " show matching brackets/parenthesis
  83.     set incsearch                   " find as you type search
  84.     set hlsearch                    " highlight search terms
  85.     set winminheight=0              " windows can be 0 line high
  86.     set ignorecase                  " case insensitive search
  87.     set smartcase                   " case sensitive when uc present
  88.     set wildmenu                    " show list instead of just completing
  89.     set wildmode=list:longest,full  " comand <Tab> completion, list matches, then longest common part, then all.
  90.     set whichwrap=b,s,h,l,<,>,[,]   " backspace and cursor keys wrap to
  91.     set scrolljump=5                " lines to scroll when cursor leaves screen
  92.     set scrolloff=3                 " minimum lines to keep above and below cursor
  93.     "set foldenable                 " auto fold code
  94.     set gdefault                    " the /g flag on :s substitutions by default
  95.     " Shortcut to rapidly toggle `set list`
  96.     nmap <leader>l :set list!<CR>
  97.     " Use the same symbols as TextMate for tabstops and EOLs
  98.     set listchars=tab:▸\ ,eol:¬
  99.  
  100. " }
  101.  
  102. " Formatting {
  103.     set nowrap                      " wrap long lines
  104.     set autoindent                  " indent at the same level of the previous line
  105.     set shiftwidth=4                " use indents of 4 spaces
  106.     set noexpandtab                 " tabs are tabs, not spaces
  107.     set tabstop=4                   " an indentation every four columns
  108.     "set matchpairs+=<:>            " match, to be used with %
  109.     set pastetoggle=<F12>           " pastetoggle (sane indentation on pastes)
  110.     "set comments=sl:/*,mb:*,elx:*/  " auto format comment blocks
  111. " }
  112.  
  113. " Key Mappings {
  114. " }
  115.  
  116. " Plugins {
  117.     " Vimblog {
  118.        if !exists('*Wordpress_vim')
  119.          runtime vimblog.vim
  120.        endif
  121.     " }
  122. " }
  123.  
  124. " GUI Settings {
  125.     " GVIM- (here instead of .gvimrc)
  126.     if has('gui_running')
  127.         "set guioptions-=T              " remove the toolbar
  128.         "set lines=40                   " 40 lines of text instead of 24,
  129.     endif
  130. " }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement