Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " plugins
- set nocompatible
- filetype off
- let need_to_install_plugins=0
- if empty(system("grep lazy_load ~/.vim/bundle/vundle/autoload/vundle.vim"))
- echo "Installing Vundle..."
- echo ""
- silent !mkdir -p ~/.vim/bundle
- silent !rm -rf ~/.vim/bundle/vundle
- silent !git clone https://github.com/gmarik/vundle ~/.vim/bundle/vundle
- let need_to_install_plugins=1
- endif
- set rtp+=~/.vim/bundle/vundle/
- call vundle#begin()
- Plugin 'gmarik/vundle'
- Plugin 'zeis/vim-kolor.git'
- Plugin 'tpope/vim-surround.git'
- Plugin 'ervandew/supertab.git'
- Plugin 'tpope/vim-sensible.git'
- Plugin 'scrooloose/syntastic.git'
- Plugin 'vim-scripts/The-NERD-tree.git'
- Plugin 'jistr/vim-nerdtree-tabs.git'
- Plugin 'majutsushi/tagbar.git'
- Plugin 'lepture/vim-jinja.git'
- Plugin 'klen/python-mode.git'
- call vundle#end()
- filetype plugin indent on
- syntax on
- set modeline
- set modelines=3
- if need_to_install_plugins==1
- echo "Installing plugins..."
- silent! PluginInstall
- echo "Done!"
- q
- endif
- " always show the status bar
- set laststatus=2
- " enable 256 colors
- set t_Co=256
- " turn on line numbering
- set number
- " sane text files
- set fileformat=unix
- set encoding=utf-8
- set fileencoding=utf-8
- " sane editing
- set tabstop=4
- set shiftwidth=4
- set softtabstop=4
- set colorcolumn=80
- set viminfo='25,\"50,n~/.viminfo
- " word movement
- imap <S-Left> <Esc>bi
- nmap <S-Left> b
- imap <S-Right> <Esc><Right>wi
- nmap <S-Right> w
- " convert all typed tabs to spaces
- set expandtab
- " unindent with shift-tab
- imap <S-Tab> <Esc><<i
- nmap <S-tab> <<
- " color scheme
- syntax on
- colorscheme kolor
- filetype on
- filetype plugin indent on
- " code folding
- set foldmethod=indent
- set foldlevel=99
- " move through split windows
- nmap <leader><Up> :wincmd k<CR>
- nmap <leader><Down> :wincmd j<CR>
- nmap <leader><Left> :wincmd h<CR>
- nmap <leader><Right> :wincmd l<CR>
- " move through buffers
- nmap <leader>[ :bp<CR>
- nmap <leader>] :bn<CR>
- " code completion
- au FileType python set omnifunc=pythoncomplete#Complete
- let g:SuperTabDefaultCompletionType = "context"
- let g:SuperTabNoCompleteAfter = ['^', ',', '\s']
- set completeopt=menuone,longest,preview
- " restore place in file from previous session
- if has("autocmd")
- au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
- endif
- " file browser
- map <leader>n :NERDTreeTabsToggle<CR>
- let NERDTreeIgnore=['\.pyc$', '__pycache__', '\.sqlite$', '\.sqlite3$']
- " tag list
- map <leader>t :TagbarToggle<CR>
- " Add the virtualenv's site-packages to vim path
- py << EOF
- import os.path
- import sys
- import vim
- if 'VIRTUAL_ENV' in os.environ:
- project_base_dir = os.environ['VIRTUAL_ENV']
- sys.path.insert(0, project_base_dir)
- activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
- if os.path.exists(activate_this):
- execfile(activate_this, dict(__file__=activate_this))
- EOF
- " disable autoindent when pasting text
- function! WrapForTmux(s)
- if !exists('$TMUX')
- return a:s
- endif
- let tmux_start = "\<Esc>Ptmux;"
- let tmux_end = "\<Esc>\\"
- return tmux_start . substitute(a:s, "\<Esc>", "\<Esc>\<Esc>", 'g') . tmux_end
- endfunction
- let &t_SI .= WrapForTmux("\<Esc>[?2004h")
- let &t_EI .= WrapForTmux("\<Esc>[?2004l")
- function! XTermPasteBegin()
- set pastetoggle=<Esc>[201~
- set paste
- return ""
- endfunction
- inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement