- set nocompatible " Be improved
- " I like Vundle for plugin management:
- " git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
- filetype off
- set rtp+=~/.vim/bundle/vundle
- call vundle#rc()
- " Let Vundle manage Vundle. Required!
- Bundle 'gmarik/vundle'
- " Original repos on GitHub
- Bundle 'altercation/vim-colors-solarized'
- Bundle 'scrooloose/nerdtree'
- Bundle 'scrooloose/nerdcommenter'
- Bundle 'MarcWeber/vim-addon-mw-utils'
- Bundle 'tomtom/tlib_vim'
- Bundle 'honza/snipmate-snippets'
- Bundle 'garbas/vim-snipmate'
- Bundle 'kchmck/vim-coffee-script'
- Bundle 'groenewege/vim-less'
- Bundle 'digitaltoad/vim-jade'
- Bundle 'skammer/vim-css-color'
- Bundle 'plasticboy/vim-markdown'
- Bundle 'tpope/vim-rvm'
- Bundle 'itspriddle/vim-jquery'
- Bundle 'othree/html5.vim'
- " vim-scripts repos
- Bundle 'nginx.vim'
- " We now resume regular programming...
- filetype plugin indent on
- " GUI-specific stuff
- if has("gui_running")
- set guifont=DejaVu\ Sans\ Mono\ 11 " I like big fonts and I cannot lie
- "set guifont=Terminus\ 11
- set guioptions=aiA " Hide toolbar, menus and scrollbar
- endif
- " Visual effects
- " I like the Solarized colour scheme
- " http://ethanschoonover.com/solarized
- " I set <F12> to switch between light and dark (see below)
- syntax on
- colorscheme solarized
- set background=dark
- set cursorline " Highlight the current line
- set number " Show line numbers
- set scrolloff=3 " Keep 3 lines above and below the cursor
- set showmatch " Show matching brackets
- " Whitespace
- set expandtab " Tab becomes spaces
- set tabstop=2 " Spaces for a tab
- set shiftwidth=2 " Spaces used for (auto)indent
- set shiftround " Indent to nearest tabstop
- set autoindent " Carry indent over from last line
- set smartindent " Detect indentation
- set backspace=indent,eol,start " Make backspace work as expected
- set virtualedit=all " Cursor can go anywhere
- " Errors and warnings
- set noerrorbells " No bloody beeping!
- set novisualbell " No screen flashing either!
- set t_vb= " As above
- " Files
- set nobackup " Don't use back-ups
- set noswapfile " ...or swap files
- set autoread " Automatically load modified files
- " Searches
- " I set ,<space> to clear highlights (see below)
- set hlsearch " Highlight matched search patterns
- set incsearch " Start searching as soon as you type
- set ignorecase " Do case insensitive matching
- set smartcase " ...unless case sensitivity makes sense
- " History
- set history=50
- " Buffers
- set hidden " OK to hide buffers with changes
- " Status line
- set showcmd " Show partial commands in statusline
- set laststatus=2 " Always show the status line
- " Statusline looks like: .vimrc [VIM (unix)] [ruby-1.9.2-p290] (depends on RVM)
- set statusline=%t\ [%Y\ (%{&ff})]\ %{rvm#statusline()}
- " Custom mappings
- " Save a couple of key-strokes
- nnoremap ; :
- " Change leader to comma
- let mapleader=","
- " Make movement commands behave on wrapped lines
- nnoremap j gj
- nnoremap k gk
- " Easier window navigation
- map <C-h> <C-w>h
- map <C-j> <C-w>j
- map <C-k> <C-w>k
- map <C-l> <C-w>l
- " F2 toggles NERDTree
- map <silent> <F2> :NERDTreeToggle<CR>
- " F12 toggles between light and dark backgrounds
- map <silent> <F12> :if &background == "light"<CR>
- \set background=dark<CR>
- \else<CR>
- \set background=light<CR>
- \endif<CR>
- " <leader><space> clears highlighted search results
- nmap <silent> <leader><space> :nohlsearch<CR>
- " <leader>ev to edit .vimrc
- nnoremap <leader>ev :e! $MYVIMRC<CR>
- " Auto-commands
- if has('autocmd')
- " Re-source .vimrc on save
- autocmd! BufWritePost .vimrc source %
- " Recompile CoffeeScript files on save (depends on Node CoffeeScript module)
- autocmd! BufWritePost *.coffee silent CoffeeMake! -b
- " Recompile Jade files on save (depends on Node Jade module)
- autocmd! BufWritePost *.jade silent :!jade %
- " Recompile Less files on save (depends on Node Less module)
- autocmd! BufWritePost *.less silent :!lessc %:r.less > %:r.css
- " Remove trailing white space on save
- autocmd! BufWritePre * :%s/\s\+$//e
- " Syntax highlighting for Nginx config files (adjust your paths accordingly!)
- autocmd! BufRead,BufNewFile /opt/nginx/conf/* set ft=nginx
- autocmd! BufRead,BufNewFile /media/Collateral/Dropbox/Configs/Nginx/* set ft=nginx
- endif
Posted by safetycopy on Sun 27th Nov 06:01 (modification of post by view diff)
download | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.