Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set nocompatible
- set hidden
- set rtp+=~/.vim/bundle/Vundle.vim
- call vundle#begin()
- " Plugins
- Plugin 'VundleVim/Vundle.vim'
- Plugin 'vim-airline/vim-airline'
- Plugin 'vim-ctrlspace/vim-ctrlspace'
- Plugin 'ajmwagar/vim-deus'
- Plugin 'vim-airline/vim-airline-themes'
- Plugin 'vim-latex/vim-latex'
- Plugin 'scrooloose/nerdtree'
- Plugin 'leafgarland/typescript-vim'
- Plugin 'ianks/vim-tsx'
- call vundle#end() " required
- filetype plugin indent on " required
- if v:progname =~? "evim"
- finish
- endif
- if exists('skip_defaults_vim')
- finish
- endif
- " Allow backspacing over everything in insert mode.
- set backspace=indent,eol,start
- set history=200 " keep 200 lines of command line history
- set ruler " show the cursor position all the time
- set showcmd " display incomplete commands
- set wildmenu " display completion matches in a status line
- set ttimeout " time out for key codes
- set ttimeoutlen=100 " wait up to 100ms after Esc for special key
- " Show @@@ in the last line if it is truncated.
- set display=truncate
- " Show a few lines of context around the cursor. Note that this makes the
- " text scroll if you mouse-click near the start or end of the window.
- set scrolloff=5
- " Do incremental searching when it's possible to timeout.
- if has('reltime')
- set incsearch
- endif
- " Do not recognize octal numbers for Ctrl-A and Ctrl-X, most users find it
- " confusing.
- set nrformats-=octal
- " Don't use Ex mode, use Q for formatting.
- " Revert with ":unmap Q".
- map Q gq
- " CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo,
- " so that you can undo CTRL-U after inserting a line break.
- " Revert with ":iunmap <C-U>".
- inoremap <C-U> <C-G>u<C-U>
- " In many terminal emulators the mouse works just fine. By enabling it you
- " can position the cursor, Visually select and scroll with the mouse.
- if has('mouse')
- set mouse=a
- endif
- " Switch syntax highlighting on when the terminal has colors or when using the
- " GUI (which always has colors).
- if &t_Co > 2 || has("gui_running")
- " Revert with ":syntax off".
- syntax on
- " I like highlighting strings inside C comments.
- " Revert with ":unlet c_comment_strings".
- let c_comment_strings=1
- endif
- " Only do this part when compiled with support for autocommands.
- if has("autocmd")
- " Enable file type detection.
- " Use the default filetype settings, so that mail gets 'tw' set to 72,
- " 'cindent' is on in C files, etc.
- " Also load indent files, to automatically do language-dependent indenting.
- " Revert with ":filetype off".
- filetype plugin indent on
- " Put these in an autocmd group, so that you can revert them with:
- " ":augroup vimStartup | au! | augroup END"
- augroup vimStartup
- au!
- " When editing a file, always jump to the last known cursor position.
- " Don't do it when the position is invalid, when inside an event handler
- " (happens when dropping a file on gvim) and for a commit message (it's
- " likely a different one than last time).
- autocmd BufReadPost *
- \ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
- \ | exe "normal! g`\""
- \ | endif
- augroup END
- endif " has("autocmd")
- " Convenient command to see the difference between the current buffer and the
- " file it was loaded from, thus the changes you made.
- " Only define it when not defined already.
- " Revert with: ":delcommand DiffOrig".
- if !exists(":DiffOrig")
- command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
- \ | wincmd p | diffthis
- endif
- if has('langmap') && exists('+langremap')
- " Prevent that the langmap option applies to characters that result from a
- " mapping. If set (default), this may break plugins (but it's backward
- " compatible).
- set nolangremap
- endif
- set tabstop=4
- set shiftwidth=4
- set softtabstop=4
- set noexpandtab
- let g:airline_powerline_fonts = 1
- let g:airline#extensions#tabline#enabled = 1
- let g:airline#extensions#tabline#formatter = 'unique_tail'
- " Colorscheme
- set t_Co=256
- colorscheme deus
- if &term =~ "xterm\\|rxvt\\|rxvt-unicode"
- " use an orange cursor in insert mode
- let &t_SI = "\<Esc>]12;#61afef\x7"
- " use a red cursor otherwise
- let &t_EI = "\<Esc>]12;#98c379\x7"
- " reset cursor when vim exits
- autocmd VimLeave * silent !echo -ne "\003]12;gray\007"
- " use \003]12;gray\007 for gnome-terminal and rxvt up to version 9.21
- endif
- " Colorcolumn
- set colorcolumn=80
- highlight ColorColumn ctermbg=0
- " Spellcheck
- setlocal spell spelllang=en_us
- " Vim-Latex Config
- let g:tex_flavor='latex'
- let g:Tex_DefaultTargetFormat = 'pdf'
- let g:Tex_MultipleCompileFormats='pdf, aux'
- autocmd BufNewFile,BufRead *.tex map <f2> :w<cr><leader>ll
- " Buffer thingies
- nnoremap <F5> :buffers<CR>:buffer<Space>
- nmap <F6> :NERDTreeToggle<CR>
- " Line numbers
- set number relativenumber
- augroup numbertoggle
- autocmd!
- autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
- autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
- augroup END
- set tw=79
- function! WC()
- let filename = expand("%")
- let cmd = "detex " . filename . " | wc -w | tr -d [:space:]"
- let result = system(cmd)
- echo result . " words"
- endfunction
- command WC call WC()
Add Comment
Please, Sign In to add comment