Guest User

vimrc

a guest
Apr 12th, 2021
46
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. set nocp
  2.  
  3. set rtp=~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after
  4.  
  5. call plug#begin('~/.vim/plugged')
  6.     " colorschemes
  7.     Plug 'bounceme/base.vim'
  8.     Plug 'roosta/vim-srcery'
  9.     Plug 'vim-scripts/twilight256.vim'
  10.     Plug 'vim-scripts/industry.vim'
  11.     Plug 'scwood/vim-hybrid'
  12.     Plug 'carakan/new-railscasts-theme'
  13.     Plug 'ShengYun/vim-dbs-easycolour'
  14.     " Plug 'leafgarland/typescript-vim'
  15.  
  16.     Plug 'vim-scripts/MatlabFilesEdition'
  17.     Plug 'vim-scripts/mlint.vim'
  18.     " Plug 'jelera/vim-javascript-syntax'
  19.     " Plug 'pangloss/vim-javascript'
  20.     Plug 'vim-airline/vim-airline'
  21.     Plug 'vim-airline/vim-airline-themes'
  22.     Plug 'vim-latex/vim-latex'
  23.     Plug 'vim-syntastic/syntastic'
  24.     Plug 'scrooloose/nerdtree'
  25.     Plug 'victorze/foo'
  26.     " Plug 'dpo/ampl-mode/blob/master/vim'
  27.     Plug 'dpo/ampl-mode'
  28.     Plug 'vim-scripts/LargeFile'
  29.     " Plug 'morhetz/gruvbox'
  30.     " Plug 'morhetz/gruvbox_black'
  31.     " Plug 'gcmt/taboo.vim'
  32.  
  33.     " different markdown plugins
  34.     " Plug 'tpope/vim-markdown'
  35.     " Plug 'sheerun/vim-polyglot'
  36.     " Plug 'godlygeek/tabular'
  37.     " Plug 'plasticboy/vim-markdown'
  38.     Plug 'vim-pandoc/vim-pandoc'
  39.     Plug 'vim-pandoc/vim-pandoc-syntax'
  40. call plug#end()
  41.  
  42. if $TERM == "xterm-256color"
  43.   set t_Co=256
  44. endif
  45.  
  46. " activate syntax highlighting
  47. syntax on
  48.  
  49. " A global variable that contains the size of which a file is considered
  50. " large. In this case, it is 5 megabytes.
  51. let g:LargeFile=5
  52. let g:large_file=1024 * 1024 * 5
  53.  
  54. augroup vimrc_autocmd
  55.     autocmd!
  56.     autocmd BufNewFile,BufRead *.jif,*.xtend set syntax=java
  57.     autocmd BufNewFile,BufRead *.babel set syntax=javascript
  58.     autocmd BufNewFile,BufRead *.mod,*.dat,*.ampl,*.run set syntax=ampl
  59.     autocmd BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.md
  60.                                 \ set syntax=markdown |
  61.                                 \ set conceallevel=2
  62.     " This autocmd runs before reading the file into the buffer.  It
  63.     " gets the file that the autocmd is running on by running expand on
  64.     " <afile>, which is short for the path to the file that the autocmd
  65.     " is running on.  Then, it gets the size of the file running
  66.     " getfsize on the file and sees if it is larger than the size
  67.     " specified in g:large_file.  If it is, it disables the swap file.
  68.     autocmd BufReadPre * let f=expand("<afile>") | if getfsize(f)
  69.                 \ > g:large_file | set noswapfile | endif
  70. augroup END
  71. " augroup filetypedetect
  72. " au BufNewFile,BufRead *.mod  setf ampl
  73. " au BufNewFile,BufRead *.dat  setf ampl
  74. " au BufNewFile,BufRead *.ampl setf ampl
  75. " augroup END
  76.  
  77. " tex activate spell check
  78. au FileType tex,txt,markdown setlocal spell spelllang=en_gb
  79.  
  80. " colorscheme hyper
  81. " colorscheme desert
  82. " current colour scheme
  83. " colorscheme slate
  84. " colorscheme koehler
  85. colorscheme base
  86. " colorscheme molokai
  87.  
  88. " set leader key to comma
  89. let mapleader=","
  90.  
  91. " Enable mouse use in all modes
  92. " set mouse=r " r and v give the same options but sometimes (version depending)
  93. " one is to prefer over the other
  94. set mouse=v
  95.  
  96. " autocompletition
  97. set completeopt=menu,menuone,longest
  98. set omnifunc=syntaxcomplete#Complete
  99.  
  100. " Use neocomplete.
  101. let g:neocomplete#enable_at_startup = 1
  102. " Use smartcase.
  103. let g:neocomplete#enable_smart_case = 0
  104. " Set minimum syntax keyword length.
  105. let g:neocomplete#sources#syntax#min_keyword_length = 3
  106. " let g:neocomplete#enable_fuzzy_completion = 0
  107.  
  108. " airline
  109. let g:airline_powerline_fonts = 1
  110. " let g:airline_theme='murmur'
  111. let g:airline_theme='dark'
  112. let g:airline#extensions#whitespace#enabled=0
  113. let g:airline#extensions#wordcount#enabled=0
  114. let g:airline#extensions#syntastic#enabled=1
  115. let g:airline_section_c=''
  116. " let g:airline_section_x=''
  117. let g:airline_skip_empty_sections = 1
  118.  
  119. " tabline configuration
  120. let g:airline#extensions#tabline#enabled=1
  121. let g:airline#extensions#tabline#show_splits=0
  122. let g:airline#extensions#tabline#show_buffers=0
  123. let g:airline#extensions#tabline#show_tabs=1
  124. let g:airline#extensions#tabline#exclude_preview=1
  125. let g:airline#extensions#tabline#show_tab_nr=1
  126. let g:airline#extensions#tabline#tab_nr_type=1
  127. let g:airline#extensions#tabline#show_tab_type=1
  128. " let g:airline#extensions#tabline#formatter='unique_tail_improved'
  129. let g:airline#extensions#tabline#fnamemod=':t'
  130. let g:airline#extensions#tabline#fnamecollapse=1
  131. let g:airline#extensions#tabline#buffer_min_count=0
  132. let g:airline#extensions#tabline#show_close_button=0
  133. " removes leading "tabs>"
  134. let airline#extensions#tabline#tabs_label = ''
  135.  
  136. inoremap <expr><TAB>  pumvisible() ? "\<C-n>" : "\<TAB>"
  137.  
  138. " show incomplete last line
  139. set display=lastline
  140.  
  141. " show existing tab with 4 spaces width
  142. set tabstop=4
  143.  
  144. " when indenting with '>', use 4 spaces width
  145. set shiftwidth=4
  146.  
  147. set softtabstop=0
  148.  
  149. set smarttab
  150.  
  151. " turn on line numbering
  152. set number
  153.  
  154. " Highlight search
  155. set hls
  156.  
  157. " Allow saving of files as sudo when I forgot to start vim using sudo
  158. cmap w!! w !sudo tee > /dev/null %
  159.  
  160. " linebreak for not splitting words
  161. set wrap linebreak nolist
  162.  
  163. set smartindent
  164.  
  165. set autoindent
  166.  
  167. set cindent
  168.  
  169. set breakindent showbreak=..
  170.  
  171. set foldlevelstart=20
  172.  
  173. imap <C-Return> <CR><CR><C-o>k<Tab>
  174.  
  175. " override vim indentng with astyle
  176. au FileType c,cpp,java setlocal equalprg=astyle
  177.  
  178. set grepprg=grep\ -nH\ $*
  179.  
  180. let g:tex_flavor="latex"
  181.  
  182. let g:Tex_ViewRule_pdf='okular'
  183.  
  184. let g:Tex_CompileRule_pdf='pdflatex -interaction=nonstopmode $*'
  185.  
  186. let g:Tex_DefaultTargetFormat='pdf'
  187.  
  188. set fencs=ucs-bom,utf-8,default,latin1
  189. set enc=utf-8
  190. set showmode
  191. set visualbell
  192. set t_vb=
  193. "
  194. set laststatus=2
  195. hi statusline ctermbg=black ctermfg=white
  196. " set statusline=
  197. " set statusline+=%-3.3n\                     " buffer number
  198. " set statusline+=%f\                         " filename
  199. " set statusline+=%h%m%r%w                     " status flags
  200. " set statusline+=\[%{strlen(&ft)?&ft:'none'}] " file type
  201. " set statusline+=%=                           " right align remainder
  202. " set statusline+=0x%-8B                       " character value
  203. " set statusline+=%-14(%l,%c%V%)               " line, character
  204. " set statusline+=%<%P "="" file="" position="" Show="" line="" number,="" cursor="" position.="" set="" ruler="" Display="" incomplete="" commands.="" showcmd="" To="" insert="" timestamp,="" press="" F3.="" nmap=""  a=strftime("%Y-%m-%d %a %I:%M %p")
  205. " vim syntastic
  206. " set statusline+=%#warningmsg#
  207. " set statusline+=%{SyntasticStatuslineFlag()}
  208. " set statusline+=%*
  209.  
  210. let g:syntastic_always_populate_loc_list = 1
  211. let g:syntastic_auto_loc_list = 1
  212. let g:syntastic_check_on_open = 1
  213. let g:syntastic_check_on_wq = 0
  214.  
RAW Paste Data