Guest User

Untitled

a guest
Dec 18th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.02 KB | None | 0 0
  1. set nocompatible
  2. set hidden
  3.  
  4. set rtp+=~/.vim/bundle/Vundle.vim
  5. call vundle#begin()
  6.  
  7. " Plugins
  8. Plugin 'VundleVim/Vundle.vim'
  9. Plugin 'vim-airline/vim-airline'
  10. Plugin 'vim-ctrlspace/vim-ctrlspace'
  11. Plugin 'ajmwagar/vim-deus'
  12. Plugin 'vim-airline/vim-airline-themes'
  13. Plugin 'vim-latex/vim-latex'
  14. Plugin 'scrooloose/nerdtree'
  15. Plugin 'leafgarland/typescript-vim'
  16. Plugin 'ianks/vim-tsx'
  17.  
  18. call vundle#end() " required
  19. filetype plugin indent on " required
  20.  
  21.  
  22. if v:progname =~? "evim"
  23. finish
  24. endif
  25. if exists('skip_defaults_vim')
  26. finish
  27. endif
  28.  
  29.  
  30. " Allow backspacing over everything in insert mode.
  31. set backspace=indent,eol,start
  32.  
  33. set history=200 " keep 200 lines of command line history
  34. set ruler " show the cursor position all the time
  35. set showcmd " display incomplete commands
  36. set wildmenu " display completion matches in a status line
  37.  
  38. set ttimeout " time out for key codes
  39. set ttimeoutlen=100 " wait up to 100ms after Esc for special key
  40.  
  41. " Show @@@ in the last line if it is truncated.
  42. set display=truncate
  43.  
  44. " Show a few lines of context around the cursor. Note that this makes the
  45. " text scroll if you mouse-click near the start or end of the window.
  46. set scrolloff=5
  47.  
  48. " Do incremental searching when it's possible to timeout.
  49. if has('reltime')
  50. set incsearch
  51. endif
  52.  
  53. " Do not recognize octal numbers for Ctrl-A and Ctrl-X, most users find it
  54. " confusing.
  55. set nrformats-=octal
  56.  
  57. " Don't use Ex mode, use Q for formatting.
  58. " Revert with ":unmap Q".
  59. map Q gq
  60.  
  61. " CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo,
  62. " so that you can undo CTRL-U after inserting a line break.
  63. " Revert with ":iunmap <C-U>".
  64. inoremap <C-U> <C-G>u<C-U>
  65.  
  66. " In many terminal emulators the mouse works just fine. By enabling it you
  67. " can position the cursor, Visually select and scroll with the mouse.
  68. if has('mouse')
  69. set mouse=a
  70. endif
  71.  
  72. " Switch syntax highlighting on when the terminal has colors or when using the
  73. " GUI (which always has colors).
  74. if &t_Co > 2 || has("gui_running")
  75. " Revert with ":syntax off".
  76. syntax on
  77.  
  78. " I like highlighting strings inside C comments.
  79. " Revert with ":unlet c_comment_strings".
  80. let c_comment_strings=1
  81. endif
  82.  
  83. " Only do this part when compiled with support for autocommands.
  84. if has("autocmd")
  85.  
  86. " Enable file type detection.
  87. " Use the default filetype settings, so that mail gets 'tw' set to 72,
  88. " 'cindent' is on in C files, etc.
  89. " Also load indent files, to automatically do language-dependent indenting.
  90. " Revert with ":filetype off".
  91. filetype plugin indent on
  92.  
  93. " Put these in an autocmd group, so that you can revert them with:
  94. " ":augroup vimStartup | au! | augroup END"
  95. augroup vimStartup
  96. au!
  97.  
  98. " When editing a file, always jump to the last known cursor position.
  99. " Don't do it when the position is invalid, when inside an event handler
  100. " (happens when dropping a file on gvim) and for a commit message (it's
  101. " likely a different one than last time).
  102. autocmd BufReadPost *
  103. \ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
  104. \ | exe "normal! g`\""
  105. \ | endif
  106.  
  107. augroup END
  108.  
  109. endif " has("autocmd")
  110.  
  111. " Convenient command to see the difference between the current buffer and the
  112. " file it was loaded from, thus the changes you made.
  113. " Only define it when not defined already.
  114. " Revert with: ":delcommand DiffOrig".
  115. if !exists(":DiffOrig")
  116. command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
  117. \ | wincmd p | diffthis
  118. endif
  119.  
  120. if has('langmap') && exists('+langremap')
  121. " Prevent that the langmap option applies to characters that result from a
  122. " mapping. If set (default), this may break plugins (but it's backward
  123. " compatible).
  124. set nolangremap
  125. endif
  126.  
  127. set tabstop=4
  128. set shiftwidth=4
  129. set softtabstop=4
  130. set noexpandtab
  131.  
  132. let g:airline_powerline_fonts = 1
  133. let g:airline#extensions#tabline#enabled = 1
  134. let g:airline#extensions#tabline#formatter = 'unique_tail'
  135.  
  136. " Colorscheme
  137. set t_Co=256
  138. colorscheme deus
  139.  
  140. if &term =~ "xterm\\|rxvt\\|rxvt-unicode"
  141. " use an orange cursor in insert mode
  142. let &t_SI = "\<Esc>]12;#61afef\x7"
  143. " use a red cursor otherwise
  144. let &t_EI = "\<Esc>]12;#98c379\x7"
  145. " reset cursor when vim exits
  146. autocmd VimLeave * silent !echo -ne "\003]12;gray\007"
  147. " use \003]12;gray\007 for gnome-terminal and rxvt up to version 9.21
  148. endif
  149.  
  150. " Colorcolumn
  151. set colorcolumn=80
  152. highlight ColorColumn ctermbg=0
  153.  
  154. " Spellcheck
  155. setlocal spell spelllang=en_us
  156.  
  157. " Vim-Latex Config
  158. let g:tex_flavor='latex'
  159. let g:Tex_DefaultTargetFormat = 'pdf'
  160. let g:Tex_MultipleCompileFormats='pdf, aux'
  161. autocmd BufNewFile,BufRead *.tex map <f2> :w<cr><leader>ll
  162.  
  163. " Buffer thingies
  164. nnoremap <F5> :buffers<CR>:buffer<Space>
  165.  
  166. nmap <F6> :NERDTreeToggle<CR>
  167.  
  168. " Line numbers
  169. set number relativenumber
  170.  
  171. augroup numbertoggle
  172. autocmd!
  173. autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
  174. autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
  175. augroup END
  176.  
  177. set tw=79
  178.  
  179. function! WC()
  180. let filename = expand("%")
  181. let cmd = "detex " . filename . " | wc -w | tr -d [:space:]"
  182. let result = system(cmd)
  183. echo result . " words"
  184. endfunction
  185.  
  186. command WC call WC()
Add Comment
Please, Sign In to add comment