Skip to content
Browse files

add support for local bundles, general .vimrc and readme cleanup

  • Loading branch information...
1 parent 4f9e620 commit c9e09d2d5992f2c184bed14305738aa52f034568 @spf13 committed Jan 28, 2012
Showing with 66 additions and 16 deletions.
  1. +45 −10 .vimrc
  2. +21 −6 README.markdown
View
55 .vimrc
@@ -37,6 +37,12 @@
Bundle 'tomtom/tlib_vim'
Bundle 'mileszs/ack.vim'
+ " Use local bundles if available {
+ if filereadable(expand("~/.vimrc.bundles.local"))
+ source ~/.vimrc.bundles.local
+ endif
+ " }
+
" General
Bundle 'scrooloose/nerdtree'
Bundle 'altercation/vim-colors-solarized'
@@ -132,12 +138,16 @@
" Vim UI {
color solarized " load a colorscheme
+ let g:solarized_termtrans=1
+ let g:solarized_termcolors=256
+ let g:solarized_contrast="high"
+ let g:solarized_visibility="high"
set tabpagemax=15 " only show 15 tabs
set showmode " display the current mode
set cursorline " highlight current line
- hi cursorline guibg=#333333 " highlight bg color of current line
- hi CursorColumn guibg=#333333 " highlight cursor
+ "hi cursorline guibg=#333333 " highlight bg color of current line
+ "hi CursorColumn guibg=#333333 " highlight cursor
if has('cmdline_info')
set ruler " show the ruler
@@ -165,7 +175,7 @@
set showmatch " show matching brackets/parenthesis
set incsearch " find as you type search
set hlsearch " highlight search terms
- set winminheight=0 " windows can be 0 line high
+ set winminheight=0 " windows can be 0 line high
set ignorecase " case insensitive search
set smartcase " case sensitive when uc present
set wildmenu " show list instead of just completing
@@ -203,13 +213,11 @@
" Making it so ; works like : for commands. Saves typing and eliminates :W style typos due to lazy holding shift.
nnoremap ; :
-
" Easier moving in tabs and windows
map <C-J> <C-W>j<C-W>_
map <C-K> <C-W>k<C-W>_
map <C-L> <C-W>l<C-W>_
map <C-H> <C-W>h<C-W>_
- map <C-K> <C-W>k<C-W>_
" Wrapped lines goes down/up to next row, rather than next line in file.
nnoremap j gj
@@ -264,6 +272,17 @@
" For when you forget to sudo.. Really Write the file.
cmap w!! w !sudo tee % >/dev/null
+
+ " Some helpers to edit mode
+ " http://vimcasts.org/e/14
+ cnoremap %% <C-R>=expand('%:h').'/'<cr>
+ map <leader>ew :e %%
+ map <leader>es :sp %%
+ map <leader>ev :vsp %%
+ map <leader>et :tabe %%
+
+ " Adjust viewports to the same size
+ map <Leader>= <C-w>=
" }
" Plugins {
@@ -405,8 +424,8 @@
vmap <Leader>a:: :Tabularize /:\zs<CR>
nmap <Leader>a, :Tabularize /,<CR>
vmap <Leader>a, :Tabularize /,<CR>
- nmap <Leader>a| :Tabularize / |<CR>
- vmap <Leader>a| :Tabularize / |<CR>
+ nmap <Leader>a| :Tabularize / |<CR>
+ vmap <Leader>a| :Tabularize / |<CR>
" The following function automatically aligns when typing a
" supported character
@@ -444,8 +463,23 @@
g:pymode_lint_checker = "pyflakes"
" }
- " ctrlp {
+ " ctrlp {
let g:ctrlp_working_path_mode = 2
+ nnoremap <silent> <D-t> :CtrlP<CR>
+ nnoremap <silent> <D-r> :CtrlPMRU<CR>
+ "}
+
+ " TagBar {
+ nnoremap <silent> <leader>tt :TagbarToggle<CR>
+ "}
+
+ " Fugitive {
+ nnoremap <silent> <leader>gs :Gstatus<CR>
+ nnoremap <silent> <leader>gd :Gdiff<CR>
+ nnoremap <silent> <leader>gc :Gcommit<CR>
+ nnoremap <silent> <leader>gb :Gblame<CR>
+ nnoremap <silent> <leader>gl :Glog<CR>
+ nnoremap <silent> <leader>gp :Git push<CR>
"}
" neocomplcache {
@@ -468,7 +502,7 @@
inoremap <expr><C-g> neocomplcache#undo_completion()
inoremap <expr><C-l> neocomplcache#complete_common_string()
- " <CR>: close popup
+ " <CR>: close popup
" <s-CR>: close popup and save indent.
inoremap <expr><CR> neocomplcache#close_popup()
inoremap <expr><s-CR> neocomplcache#close_popup() . "\<CR>"
@@ -505,14 +539,15 @@
" }
+
" }
" GUI Settings {
" GVIM- (here instead of .gvimrc)
if has('gui_running')
set guioptions-=T " remove the toolbar
set lines=40 " 40 lines of text instead of 24,
- set guifont=Andale\ Mono\ Regular:h16,Menlo\ Regular:h15, Courier\ New\ Regular:h18
+ set guifont=Andale\ Mono\ Regular:h16,Menlo\ Regular:h15,Consolas\ Regular:h16,Courier\ New\ Regular:h18
if has('gui_macvim')
set transparency=5 " Make the window slightly transparent
endif
View
27 README.markdown
@@ -1,6 +1,10 @@
# spf13-vim : Steve Francia's Vim Distribution
-spf13-vim is a distribution of vim plugins and resources intended to be run on top of VIM. It is a good starting point for anyone intending to use VIM for development.
+spf13-vim is a distribution of vim plugins and resources for Vim, Gvim and MacVim.
+
+It is a good starting point for anyone intending to use VIM for development running equally well on Windows, Linux, *nix and Mac.
+
+The distribution is completely customisable using a `~/.vimrc.local` and `~/.vimrc.bundles.local` Vim RC files.
Unlike traditional VIM plugin structure, which similar to UNIX throws all files into common directories, making updating or disabling plugins a real mess, spf13-vim 3 uses [Vundle] to have a well organized vim directory (Similar to mac's app folders). Vundle also ensures that the latest versions of your plugins are installed and makes it easy to keep them up to date.
@@ -25,7 +29,7 @@ spf13-vim is built to be completely cross platform. It works equally well on con
spf13-vim is dependent on a semi-recent version of VIM and should work well on anything above VIM 7.0.
-[Git] is required for installation. Certain plugins require python or ruby support to be compiled into VIM.
+[Git] is required for installation. Certain plugins may require python or ruby support to be compiled into VIM.
To check if you have python or ruby support run
@@ -37,34 +41,41 @@ If it returns 1 your vim supports ruby.
### Easy Installation (\*nix only)
+```bash
curl http://j.mp/spf13-vim3 -o - | sh
+```
or
### Manual Installation
#### Backup existing vim configuration
+
+```bash
today=`date +%Y%m%d`
for i in $HOME/.vim $HOME/.vimrc $HOME/.gvimrc; do [ -e $i ] && mv $i $i.$today; done
+```
#### Clone spf13-vim from github
+```bash
endpath="$HOME/.spf13-vim-3"
git clone --recursive -b 3.0 git://github.com/spf13/spf13-vim.git $endpath
mkdir -p $endpath/.vim/bundle
ln -s $endpath/.vimrc ~/.vimrc
ln -s $endpath/.vim ~/.vim
+```
_Use ln -s on mac/unix or mklink on windows._
#### Installing Vundle
+```bash
git clone http://github.com/gmarik/vundle.git $HOME/.vim/bundle/vundle
+```
#### Install plugins using Vundle
+```bash
vim +BundleInstall! +BundleClean +q
-
-#### Optionally build Command-t
- cd $HOME/.vim/bundle/Command-t
- (rake make) || warn "Ruby compilation failed. Ruby, GCC or rake not installed?"
+```
## Installing on Windows
@@ -115,9 +126,11 @@ The easiest way is to download and run the spf13-vim-windows-install.cmd file.
## Updating to the latest version
+```bash
cd /path/to/spf13-vim/
git pull
vim +BundleInstall! +BundleClean +q
+```
## Customization
@@ -126,8 +139,10 @@ customizations.
For example, to override the default color schemes:
+```bash
echo color desert > ~/.vimrc.local
echo color molokai > ~/.gvimrc.local
+```
### Fork me on GitHub

0 comments on commit c9e09d2

Please sign in to comment.
Something went wrong with that request. Please try again.