Permalink
Browse files

Start building up vimrc again

  • Loading branch information...
1 parent 0d801a5 commit 4741db2738f74bd35128e5d58ef571ab3de22114 @nelstrom committed Jun 7, 2013
Showing with 128 additions and 30 deletions.
  1. +50 −0 bundles.vim
  2. +78 −30 vimrc
View
@@ -0,0 +1,50 @@
+set nocompatible
+filetype off
+
+" Vundle setup
+set rtp+=~/.vim/bundle/vundle/
+call vundle#rc()
+Bundle 'gmarik/vundle'
+filetype plugin indent on
+
+" General enhancements
+Bundle 'tpope/vim-abolish.git'
+Bundle 'tpope/vim-characterize.git'
+Bundle 'tpope/vim-commentary.git'
+Bundle 'tpope/vim-dispatch.git'
+Bundle 'tpope/vim-eunuch.git'
+Bundle 'tpope/vim-fugitive.git'
+Bundle 'tpope/vim-ragtag.git'
+Bundle 'tpope/vim-repeat.git'
+Bundle 'tpope/vim-scriptease.git'
+Bundle 'tpope/vim-sensible.git'
+Bundle 'tpope/vim-sleuth.git'
+Bundle 'tpope/vim-surround.git'
+Bundle 'tpope/vim-tbone.git'
+Bundle 'tpope/vim-unimpaired.git'
+Bundle 'nelstrom/vim-visual-star-search'
+Bundle 'nelstrom/vim-docopen'
+
+" Custom textobjects
+Bundle 'kana/vim-textobj-user.git'
+Bundle 'kana/vim-textobj-entire.git'
+Bundle 'kana/vim-textobj-indent.git'
+Bundle 'kana/vim-textobj-syntax.git'
+Bundle 'kana/vim-textobj-line.git'
+Bundle 'nelstrom/vim-textobj-rubyblock.git'
+
+" Colorschemes
+Bundle 'altercation/vim-colors-solarized.git'
+Bundle 'nelstrom/vim-mac-classic-theme.git'
+Bundle 'nelstrom/vim-blackboard.git'
+
+" Ruby enhancements
+Bundle 'tpope/vim-bundler.git'
+Bundle 'tpope/vim-endwise.git'
+Bundle 'tpope/vim-rails.git'
+Bundle 'tpope/vim-rake.git'
+Bundle 'vim-ruby/vim-ruby'
+
+" Markdown
+Bundle 'tpope/vim-markdown.git'
+Bundle 'nelstrom/vim-markdown-folding.git'
View
108 vimrc
@@ -1,30 +1,78 @@
-set nocompatible
-filetype off
-
-" Vundle setup
-set rtp+=~/.vim/bundle/vundle/
-call vundle#rc()
-Bundle 'gmarik/vundle'
-filetype plugin indent on
-
-" General enhancements
-Bundle 'tpope/vim-abolish.git'
-Bundle 'tpope/vim-characterize.git'
-Bundle 'tpope/vim-commentary.git'
-Bundle 'tpope/vim-dispatch.git'
-Bundle 'tpope/vim-eunuch.git'
-Bundle 'tpope/vim-fugitive.git'
-Bundle 'tpope/vim-markdown.git'
-Bundle 'tpope/vim-ragtag.git'
-Bundle 'tpope/vim-repeat.git'
-Bundle 'tpope/vim-scriptease.git'
-Bundle 'tpope/vim-sensible.git'
-Bundle 'tpope/vim-surround.git'
-Bundle 'tpope/vim-tbone.git'
-Bundle 'tpope/vim-unimpaired.git'
-
-" Ruby enhancements
-Bundle 'tpope/vim-bundler.git'
-Bundle 'tpope/vim-endwise.git'
-Bundle 'tpope/vim-rails.git'
-Bundle 'tpope/vim-rake.git'
+" vim: nowrap fdm=marker
+source ~/dotfiles/bundles.vim
+
+" Personal preferences not set by sensible.vim
+set history=5000
+set showcmd
+" set listchars=tab:▸\ ,eol:¬
+set foldlevelstart=99
+set noswapfile
+if has('mouse')
+ set mouse=nv
+endif
+
+" Colorscheme
+set background=dark
+silent! colorscheme solarized
+
+" Plugin configuration {{{1
+" netrw.vim {{{2
+let g:netrw_banner=0
+" Vim-ruby {{{2
+let ruby_fold=1
+" Markdown {{{2
+let g:markdown_fenced_languages = ['ruby', 'javascript']
+" Solarized {{{2
+let g:solarized_menu=0
+if exists('*togglebg#map')
+ call togglebg#map("<F5>")
+endif
+" Ctlr-P {{{2
+let g:ctrlp_jump_to_buffer = 0
+let g:ctrlp_working_path_mode = 0
+let g:ctrlp_user_command = 'find %s -type f'
+" Ragel {{{2
+let g:ragel_default_subtype='ruby'
+
+" Mappings {{{1
+" File opening {{{2
+cnoremap <expr> %% getcmdtype() == ':' ? escape(expand('%:h'), ' \').'/' : '%%'
+
+map <leader>ew :e %%
+map <leader>es :sp %%
+map <leader>ev :vsp %%
+map <leader>et :tabe %%
+
+" Prompt to open file with same name, different extension
+map <leader>er :e <C-R>=expand("%:r")."."<CR>
+
+" Fix the & command in normal+visual modes {{{2
+nnoremap & :&&<Enter>
+xnoremap & :&&<Enter>
+
+" Strip trailing whitespace {{{2
+function! Preserve(command)
+ " Preparation: save last search, and cursor position.
+ let _s=@/
+ let l = line(".")
+ let c = col(".")
+ " Do the business:
+ execute a:command
+ " Clean up: restore previous search history, and cursor position
+ let @/=_s
+ call cursor(l, c)
+endfunction
+
+nmap _$ :call Preserve("%s/\\s\\+$//e")<CR>
+
+" Visual line repeat {{{2
+xnoremap . :normal .<CR>
+xnoremap @ :<C-u>call ExecuteMacroOverVisualRange()<CR>
+
+function! ExecuteMacroOverVisualRange()
+ echo "@".getcmdline()
+ execute ":'<,'>normal @".nr2char(getchar())
+endfunction
+
+" Experimental mappings {{{2
+nnoremap g" /\v<<C-r>"><CR>

0 comments on commit 4741db2

Please sign in to comment.