Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set t_Co=256
- set nocompatible " be iMproved
- filetype off " required!
- set shell=/bin/bash
- set rtp+=~/.vim/bundle/Vundle.vim
- set tags+=~/.ctags
- call vundle#begin()
- " let Vundle manage Vundle
- " required!
- Plugin 'gmarik/Vundle.vim'
- Plugin 'digitaltoad/vim-jade'
- Plugin 'rodjek/vim-puppet'
- Plugin 'elzr/vim-json'
- Plugin 'scrooloose/syntastic'
- Plugin 'elixir-lang/vim-elixir'
- Plugin 'flazz/vim-colorschemes'
- Plugin 'scrooloose/nerdtree'
- Plugin 'tpope/vim-rails'
- Plugin 'tpope/vim-endwise'
- Plugin 'tpope/vim-rvm'
- Plugin 'tpope/vim-bundler'
- Plugin 'vim-ruby/vim-ruby'
- Plugin 'tpope/vim-haml'
- Plugin 'vim-scripts/YankRing.vim'
- Plugin 'Yggdroot/indentLine'
- Plugin 'geekjuice/vim-spec'
- Plugin 'derekwyatt/vim-scala'
- Plugin 'tpope/vim-fugitive'
- Plugin 'ervandew/supertab'
- Plugin 'zeis/vim-kolor'
- Plugin 'mileszs/ack.vim'
- Plugin 'Arkham/vim-quickfixdo'
- Plugin 'heartsentwined/vim-ember-script'
- Plugin 'shime/vim-livedown'
- Plugin 'AndrewRadev/splitjoin.vim'
- Plugin 'scrooloose/nerdcommenter'
- Plugin 'ntpeters/vim-better-whitespace'
- Plugin 'airblade/vim-gitgutter'
- Plugin 'godlygeek/tabular'
- Plugin 'ntpeters/vim-indent-guides'
- Plugin 'bling/vim-airline'
- Plugin 'bling/vim-bufferline'
- Plugin 'sheerun/vim-yardoc'
- Plugin 'ryanss/vim-hackernews'
- "gS and gJ
- call vundle#end()
- filetype plugin indent on " required!
- "
- "" Brief help
- " :PluginList - list configured bundles
- " :PluginInstall(!) - install(update) bundles
- " " :PluginSearch(!) foo - search(or refresh cache first) for foo
- " :PluginClean(!) - confirm(or auto-approve) removal of unused bundles
- "
- " see :h vundle for more details or wiki for FAQ
- " NOTE: comments after Plugin command are not allowed..
- syntax on
- colorscheme grb256
- let g:indentLine_char = '┊'
- let g:indentLine_enabled = 1
- let g:indentLine_color_term = 239
- au VimEnter * ToggleStripWhitespaceOnSave
- " Change the mapleader from \ to ,
- let mapleader=","
- let maplocalleader="\\"
- " Editing behaviour {{{
- set showmode " always show what mode we're currently editing in
- set tabstop=2 " a tab is four spaces
- set softtabstop=2 " when hitting <BS>, pretend like a tab is removed, even if spaces
- set expandtab " expand tabs by default (overloadable per file type later)
- set shiftwidth=2 " number of spaces to use for autoindenting
- set shiftround " use multiple of shiftwidth when indenting with '<' and '>'
- set backspace=indent,eol,start " allow backspacing over everything in insert mode
- set autoindent " always set autoindenting on
- set copyindent " copy the previous indentation on autoindenting
- set number " always show line numbers
- set showmatch " set show matching parenthesis
- set smartcase " ignore case if search pattern is all lowercase,
- " case-sensitive otherwise
- set smarttab " insert tabs on the start of a line according to
- " shiftwidth, not tabstop
- set scrolloff=4 " keep 4 lines off the edges of the screen when scrolling
- set virtualedit=all " allow the cursor to go in to "invalid" places
- set hlsearch " highlight search terms
- set incsearch " show search matches as you type
- set gdefault " search/replace "globally" (on a line) by default
- set listchars=tab:▸\ ,trail:·,extends:#,nbsp:·
- set nolist " don't show invisible characters by default,
- " but it is enabled for some file types (see later)
- set pastetoggle=<F2> " when in insert mode, press <F2> to go to
- " paste mode, where you can paste mass data
- " that won't be autoindented
- set mouse=a " enable using the mouse if terminal emulator
- " supports it (xterm does)
- set fileformats="unix,dos,mac"
- set formatoptions+=1 " When wrapping paragraphs, don't end lines
- " with 1-letter words (looks stupid)
- set nrformats= " make <C-a> and <C-x> play well with
- " zero-padded numbers (i.e. don't consider
- " them octal or hex)
- " Toggle show/hide invisible chars
- nnoremap <leader>i :set list!<cr>
- " Toggle line numbers
- nnoremap <leader>N :setlocal number!<cr>
- " Editor layout {{{
- set termencoding=utf-8
- set encoding=utf-8
- set lazyredraw " don't update the display while executing macros
- " }}}
- " Vim behaviour {{{
- set hidden " hide buffers instead of closing them this
- " means that the current buffer can be put
- " to background without being written; and
- " that marks and undo history are preserved
- set switchbuf=useopen " reveal already opened files from the
- " quickfix window instead of opening new
- " buffers
- set history=1000 " remember more commands and search history
- set undolevels=1000 " use many muchos levels of undo
- if v:version >= 730
- set undofile " keep a persistent backup file
- set undodir=~/.vim/.undo,~/tmp,/tmp
- endif
- set nobackup " do not keep backup files, it's 70's style cluttering
- set noswapfile " do not write annoying intermediate swap files,
- " who did ever restore from swap files anyway?
- set directory=~/.vim/.tmp,~/tmp,/tmp
- " store swap files in one of these directories
- " (in case swapfile is ever turned on)
- set viminfo='20,\"80 " read/write a .viminfo file, don't store more
- " than 80 lines of registers
- set wildmenu " make tab completion for files/buffers act like bash
- set wildmode=list:full " show a list when pressing tab and complete
- " first full match
- set wildignore=*.swp,*.bak,*.pyc,*.class
- set title " change the terminal's title
- set visualbell " don't beep
- set noerrorbells " don't beep
- set showcmd " show (partial) command in the last line of the screen
- " this also shows visual selection info
- set nomodeline " disable mode lines (security measure)
- "set ttyfast " always use a fast terminal
- " }}}
- if &t_Co > 2 || has("gui_running")
- syntax on " switch syntax highlighting on, when the terminal has colors
- endif
- " }}}
- " Enable shift movement for Mac OX X
- if has("gui_macvim")
- let macvim_hig_shift_movement = 1
- endif
- " Shortcut mappings {{{
- " Since I never use the ; key anyway, this is a real optimization for almost
- " all Vim commands, as I don't have to press the Shift key to form chords to
- " enter ex mode.
- nnoremap ; :
- nnoremap <leader>; ;
- " Avoid accidental hits of <F1> while aiming for <Esc>
- noremap! <F1> <Esc>
- " Quickly close the current window
- nnoremap <leader>q :q<CR>
- " Use Q for formatting the current paragraph (or visual selection)
- vnoremap Q gq
- nnoremap Q gqap
- " make p in Visual mode replace the selected text with the yank register
- vnoremap p <Esc>:let current_reg = @"<CR>gvdi<C-R>=current_reg<CR><Esc>
- " Shortcut to make
- nnoremap mk :make<CR>
- " Swap implementations of ` and ' jump to markers
- " By default, ' jumps to the marked line, ` jumps to the marked line and
- " column, so swap them
- nnoremap ' `
- nnoremap ` '
- " Run current file in ruby
- imap <Leader>rr <ESC>:!ruby %<CR>
- nmap <Leader>rr :!ruby %<CR>
- " Use the damn hjkl keys
- noremap <up> <nop>
- noremap <down> <nop>
- noremap <left> <nop>
- noremap <right> <nop>
- " Remap j and k to act as expected when used on long, wrapped, lines
- " nnoremap j gj
- " nnoremap k gk
- " Easy window navigation
- noremap <C-h> <C-w>h
- noremap <C-j> <C-w>j
- noremap <C-k> <C-w>k
- noremap <C-l> <C-w>l
- nnoremap <leader>w <C-w>v<C-w>l
- " RSpec mappings
- map <Leader>t :call RunCurrentSpecFile()<CR>
- map <Leader>s :call RunNearestSpec()<CR>
- map <Leader>l :call RunLastSpec()<CR>
- map <Leader>a :call RunAllSpecs()<CR>
- " Complete whole filenames/lines with a quicker shortcut key in insert mode
- inoremap <C-f> <C-x><C-f>
- inoremap <C-l> <C-x><C-l>
- " Use ,d (or ,dd or ,dj or 20,dd) to delete a line without adding it to the
- " yanked stack (also, in visual mode)
- nnoremap <silent> <leader>d "_d
- vnoremap <silent> <leader>d "_d
- " Quick yanking to the end of the line
- nnoremap Y y$
- " Yank/paste to the OS clipboard with ,y and ,p
- set clipboard=unnamed
- nnoremap <leader>y "+y
- nnoremap <leader>Y "+yy
- nnoremap <leader>p "+p
- nnoremap <leader>P "+P
- " YankRing stuff
- let g:yankring_history_dir = '$HOME/.vim/.tmp'
- nnoremap <leader>r :YRShow<CR>
- " Edit the vimrc file
- nnoremap <silent> <leader>ev :e $MYVIMRC<CR>
- nnoremap <silent> <leader>sv :so $MYVIMRC<CR>
- " Clears the search register
- nnoremap <silent> <leader>/ :nohlsearch<CR>
- " Pull word under cursor into LHS of a substitute (for quick search and
- " replace)
- nnoremap <leader>z :%s#\<<C-r>=expand("<cword>")<CR>\>#
- " Quickly get out of insert mode without your fingers having to leave the
- " home row (either use 'jj' or 'jk')
- inoremap jj <Esc>
- nnoremap <leader>q :q!
- " Quick alignment of text
- nnoremap <leader>al :left<CR>
- nnoremap <leader>ar :right<CR>
- nnoremap <leader>ac :center<CR>
- " Sudo to write
- cnoremap w!! w !sudo tee % >/dev/null
- " Jump to matching pairs easily, with Tab
- nnoremap <Tab> %
- vnoremap <Tab> %
- " Folding
- nnoremap <Space> za
- vnoremap <Space> za
- " Ack for the word under cursor
- "nnoremap <leader>a :Ack<Space>
- nnoremap <leader>a :Ack<Space><c-r><c-W>
- " Reselect text that was just pasted with ,v
- nnoremap <leader>v V`]
- " NERDTree settings {{{
- " Put focus to the NERD Tree with F3 (tricked by quickly closing it and
- " immediately showing it again, since there is no :NERDTreeFocus command)
- " nnoremap <leader>n :NERDTreeClose<CR>:NERDTreeToggle<CR>
- map <Leader>n :NERDTreeToggle<CR>
- nnoremap <leader>m :NERDTreeClose<CR>:NERDTreeFind<CR>
- nnoremap <leader>N :NERDTreeClose<CR>
- " Store the bookmarks file
- let NERDTreeBookmarksFile=expand("$HOME/.vim/NERDTreeBookmarks")
- " Show the bookmarks table on startup
- let NERDTreeShowBookmarks=1
- " Show hidden files, too
- let NERDTreeShowFiles=1
- let NERDTreeShowHidden=1
- " Quit on opening files from the tree
- let NERDTreeQuitOnOpen=1
- " Highlight the selected entry in the tree
- let NERDTreeHighlightCursorline=1
- " Use a single click to fold/unfold directories and a double click to open
- " files
- let NERDTreeMouseMode=2
- " Don't display these kinds of files
- let NERDTreeIgnore=[ '\.pyc$', '\.pyo$', '\.py\$class$', '\.obj$',
- \ '\.o$', '\.so$', '\.egg$', '^\.git$' ]
- " vim-flake8 default configuration
- let g:flake8_max_line_length=120
- " Conflict markers {{{
- " highlight conflict markers
- match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$'
- " shortcut to jump to next conflict marker
- nnoremap <silent> <leader>c /^\(<\\|=\\|>\)\{7\}\([^=].\+\)\?$<CR>
- " }}}
- " should markdown preview get shown automatically upon opening markdown buffer
- let g:livedown_autorun = 0
- " should the browser window pop-up upon previewing
- let g:livedown_open = 1
- " the port on which Livedown server will run
- let g:livedown_port = 1337
- map gm :call LivedownPreview()<CR>
- let g:toggleTabs = 1
- " Synatstic Settings
- set statusline+=%#warningmsg#
- set statusline+=%{SyntasticStatuslineFlag()}
- set statusline+=%*
- let g:syntastic_always_populate_loc_list = 1
- let g:syntastic_auto_loc_list = 1
- let g:syntastic_check_on_open = 1
- let g:syntastic_check_on_wq = 0
- let g:syntastic_mode_map = { 'mode': 'passive', 'active_filetypes': [],'passive_filetypes': [] }
- nnoremap <C-w>E :SyntasticCheck<CR> :SyntasticToggleMode<CR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement