" Balkian set nocompatible " be iMproved filetype off " required! set rtp+=~/.vim/bundle/vundle/ call vundle#rc() " let Vundle manage Vundle " required! Bundle 'gmarik/vundle' Bundle 'LaTeX-Box-Team/LaTeX-Box' Bundle 'tpope/vim-fugitive' Bundle 'scrooloose/nerdtree' Bundle 'taglist.vim' Bundle "MarcWeber/vim-addon-mw-utils" Bundle "tomtom/tlib_vim" Bundle "honza/snipmate-snippets" Bundle "garbas/vim-snipmate" Bundle "SpellCheck" filetype plugin indent on " required! highlight SpecialKey ctermfg=DarkGray set listchars=tab:>-,trail:~ set list set tabstop=4 set shiftwidth=4 autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class autocmd Filetype javascript set ts=4 sts=4 sw=4 expandtab smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class set expandtab set autoindent set smartindent syntax on set ignorecase set smartcase set softtabstop=4 set number "set paste set mouse=a set autochdir set showmatch set incsearch set hlsearch "Better Map Leader let mapleader="," noremap \ , "Latex let g:tex_flavor = "latex" set suffixes+=.log,.aux,.bbl,.blg,.idx,.ilg,.ind,.out,.pdf let g:LatexBox_latexmk_options="-pvc" let g:LatexBox_output_type="pdf" let g:LatexBox_viewer="okular --unique" let tlist_tex_settings = 'latex;l:labels;s:sections;t:subsections;u:subsubsections' " Commenting blocks of code. autocmd FileType c,cpp,java,scala,javascript let b:comment_leader = '// ' autocmd FileType sh,ruby,python let b:comment_leader = '# ' autocmd FileType conf,fstab let b:comment_leader = '# ' autocmd FileType tex let b:comment_leader = '% ' autocmd FileType mail let b:comment_leader = '> ' autocmd FileType vim let b:comment_leader = '" ' noremap ,cc :silent s/^/=escape(b:comment_leader,'\/')/:nohlsearch noremap ,cu :silent s/^\V=escape(b:comment_leader,'\/')//e:nohlsearch imap "+gP noremap :w imap :w "Custom maps noremap n :NERDTreeToggle noremap t :TlistToggle "Omni set completeopt=longest,menuone inoremap pumvisible() ? "\" : "\u\" inoremap pumvisible() ? '' : \ '=pumvisible() ? "\Down>" : ""' inoremap pumvisible() ? '' : \ '=pumvisible() ? "\Down>" : ""' inoremap (pumvisible() ? (col('.') > 1 ? 'i' : 'i') : '') . \ '=pumvisible() ? "\C-n>\C-p>\Down>" : ""' set spell spelllang=en_gb " tab navigation like firefox nnoremap :tabprevious nnoremap :tabnext nnoremap :tabnew inoremap :tabpreviousi inoremap :tabnexti "inoremap :tabnew " Save sessions function! RestoreSession() if argc() == 0 "vim called without arguments execute 'source ~/.vim/Session.vim' end endfunction nmap Sq :mksession! ~/.vim/Session.vim:qa! nmap SQ :mksession! ~/.vim/Session.vim:wqa nmap SO :so ~/.vim/Session.vim "autocmd VimEnter * call RestoreSession() "Make tabs and buffers work better :se switchbuf=usetab,newtab ":tab sball " Color and shit "colo vividchalk "Statusline set statusline=%t%h%m%r%y%{fugitive#statusline()}\%=[%{strlen(&fenc)?&fenc:'none'},%{&ff}]\ \ %c,%l/%L\ %P set laststatus=2 " Forward search " function! PDFForward() " " if filereadable(b:RootFileName.".".b:Ext) " " " silent! call system("okular --unique \"".b:RootFileName.".".b:Ext."\"\#src:".line('.').expand("%")." &") " " silent! call system(g:LatexBox_viewer . " \"".LatexBox_GetOutputFile()."#src:".line('.')."".expand("%:p")."\" &") " " else " " echo "Output file not readable." " " endif " endfunction " Encryption set cm=blowfish " Transparent editing of gpg encrypted files.