Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.33 KB | None | 0 0
  1. set nocompatible " be iMproved
  2. filetype off " required!
  3.  
  4. set rtp+=~/.vim/bundle/Vundle.vim
  5. call vundle#begin()
  6.  
  7. "" Plugin Manager
  8. Plugin 'gmarik/Vundle.vim'
  9.  
  10. "" Meta/Navigation
  11. Plugin 'scrooloose/nerdtree'
  12. Plugin 'ctrlp.vim'
  13. Plugin 'vim-scripts/closetag.vim'
  14. Plugin 'godlygeek/tabular'
  15. Plugin 'plasticboy/vim-markdown'
  16. Plugin 'fugitive.vim' " Git bindings
  17. Plugin 'browsereload-mac.vim'
  18. Plugin 'WebAPI.vim'
  19. Plugin 'Gist.vim' " Create git gists from buffer, need WebAPI
  20. Plugin 'lrvick/Conque-Shell' " Open Shells in buffer
  21. Plugin 'Rainbow-Parenthesis'
  22. Plugin 'matchit.zip' " Better support of % jumping
  23. Plugin 'tpope/vim-repeat' "Support repetition of macros
  24. Plugin 'tpope/vim-vinegar' "Enhance netrw
  25. Plugin 'itchyny/lightline.vim'
  26.  
  27. "" Auto Completion/Less Typing
  28. Plugin 'comments.vim'
  29. Plugin 'Raimondi/delimitMate'
  30. Plugin 'xptemplate'
  31. "Plugin 'derekprior/vim-trimmer'
  32. Plugin 'UltiSnips'
  33. Plugin 'tpope/vim-surround'
  34.  
  35. " Snippet collections
  36. Plugin 'tommorris/scala-vim-snippets'
  37. Plugin 'honza/vim-snippets'
  38.  
  39. "" Language/Syntax Plugins
  40. Plugin 'fatih/vim-go'
  41. Plugin 'coffee.vim'
  42. Plugin 'vim-coffee-script'
  43. Plugin 'derekwyatt/vim-scala'
  44. Plugin 'Syntastic' " Syntax Checker
  45. Plugin 'ensime/ensime-vim' "extensive scala integration"
  46. Plugin 'mxw/vim-jsx'
  47.  
  48. """ Productivity
  49. "Plugin 'journal.vim'
  50. "" Misc. Unknown
  51. Plugin 'severin-lemaignan/vim-minimap'
  52. Plugin 'goyo.vim'
  53. "Plugin 'koron/minimap-vim'
  54. Plugin 'pydave/AsyncCommand' "Requirement for pomodoro
  55. Plugin 'mnick/vim-pomodoro'
  56. "Plugin 'mattn/calendar.vim'
  57. Plugin 'itchyny/calendar.vim'
  58. Plugin 'vim-scripts/gnupg.vim'
  59. Plugin 'yuratomo/gmail.vim'
  60. Plugin 'Shougo/vimproc'
  61. "Plugin 'jmcantrell/vim-journal'
  62. Plugin 'edthedev/minion'
  63. Plugin 'darfink/vim-plist'
  64.  
  65. " Zotero plugin
  66. Plugin 'Shougo/unite.vim'
  67. Plugin 'rafaqz/citation.vim'
  68.  
  69. call vundle#end()
  70. " let Vundle manage Vundle
  71. " and don't put the comment on the same line
  72.  
  73. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  74. " General behavior
  75. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  76. "colorscheme blue
  77. "colorscheme coffee
  78. "colorscheme darkblue
  79. colorscheme default "GOOD
  80. "colorscheme delek
  81. "colorscheme desert
  82. "colorscheme elflord
  83. "colorscheme evening NICE
  84. "colorscheme koehler
  85. "colorscheme morning NICE
  86. "colorscheme murphy
  87. "colorscheme pablo
  88. "colorscheme peachpuff
  89. "colorscheme ron
  90. "colorscheme shine
  91. "colorscheme slate
  92. "colorscheme torte
  93. "colorscheme zellner
  94.  
  95. set autowrite " Speichert bei jedem :make, ;next, :rewind etc.
  96. set autoread
  97.  
  98. if match($TERM, "screen")!=-1
  99. set term=xterm
  100. endif
  101.  
  102. set title " Set buffer name as terminal name
  103.  
  104. " Schaltet syntax-highlighting und korrektes Einrücken an
  105. " und filetype spezifisches ein
  106. syntax on
  107. filetype plugin indent on
  108.  
  109. " Vermeidet Probleme beim pasten aus dem Browser
  110. " Disable by default to make delimitMate work
  111. " set paste
  112.  
  113. " Stellt die Dateinamenerweiterung wie unter bash ein
  114. set wildmode=longest,list
  115.  
  116. " Der Zeiger springt kurz zur öffnenden Klammer, wenn die schließende
  117. " eingegeben wird
  118. set showmatch
  119. set matchtime=1 " In diesem Fall 1/10 sek.
  120.  
  121. set autoindent " automatic and smart indentation
  122. set smartindent
  123. set copyindent
  124.  
  125. " Die Einrückweite pro Level
  126. set shiftwidth=4
  127.  
  128. " Ein Tab wird wie 4 Leerzeichen angezeigt und dank expandtab werden tabs
  129. " gleich als Leerzeichen eingefügt.
  130. set tabstop=4
  131. set expandtab
  132. set softtabstop=4
  133. set smarttab
  134.  
  135. " Setzt die maximale Textbreite von Fließtext
  136. "set linebreak
  137. set textwidth=66
  138.  
  139. " highlight lines that are to long
  140. " highlight OverLength ctermbg=red ctermfg=white guibg=#592929
  141. " match OverLength /\%79v.\+/
  142.  
  143. " Wenn mit /suchwort gesucht wird, springt der Zeiger schon beim Eintippen
  144. set incsearch
  145.  
  146. "Sucht standardmäßig ohne Groß- und Kleinschreibung zu unterscheiden
  147. set ignorecase
  148.  
  149. "Blendet Zeileninformation ein
  150. set ruler
  151.  
  152. "Blendet Formatierungszeichen ein
  153. set lcs=tab:>-,trail:-,nbsp:~
  154. set nolist
  155.  
  156. "Faltet automatisch neue Dateien nach Einrückung ein
  157. set foldmethod=indent
  158. "set foldcolumn=8
  159. set foldlevel=8
  160. set showcmd " Display an incomplete command in the lower right corner of the Vim window
  161.  
  162. set mouse-=a " Disable mouse
  163. set mousehide " Hide mouse after chars typed
  164. set scrolloff=3 "Always keep at least 3 lines around the cursor
  165. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  166. " Keyboard short cuts
  167. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  168. " change the mapleader from \ to ,
  169. let mapleader=","
  170. "let mapleader=" "
  171.  
  172. " Show trailing characters and such
  173. map <leader>st :tet list<CR>
  174. map <leader>sr /\(\<\S\+\>\)\(\_\s\+\<\1\>\)\+<CR>
  175.  
  176. " Quickly edit/reload the vimrc file
  177. nmap <silent> <leader>oc :e $MYVIMRC<CR>
  178. nmap <silent> <leader>rc :so $MYVIMRC<CR>
  179. nmap <silent> <leader>ob :e ~/.bashrc<CR>
  180. nmap <silent> <leader>rb :!hash -r && source ~/.bashrc<CR>
  181. nmap <leader>h :help<space>
  182.  
  183. " Vundle/Bundle short cuts
  184. nmap <leader>bs :BundleSearch<space>
  185. nmap <silent> <leader>bi :BundleInstall<CR>
  186. nmap <silent> <leader>bu :BundleUpdate<CR>
  187.  
  188. " Short cut for hypergit
  189. nmap <leader>g :Gmail<CR>
  190. nmap <leader>gs :Gstatus<CR>
  191. nmap <leader>gd :Gdiff<CR>
  192. nmap <leader>gc :Gcommit<CR>
  193.  
  194. " Short cut for Goyo, close w/ <leader>q
  195. nmap <leader>y :Goyo<CR> " Enter distraction free mode
  196.  
  197. " Save files, close vim
  198. map <leader>w :w<CR>
  199. map <leader>x :x<CR>
  200. map <leader>q :q!<CR>
  201.  
  202. nmap <silent><leader>c :SyntasticCheck<CR>
  203.  
  204. " Open netrw explore in write mode
  205. nmap <leader>v :Vex<CR>
  206.  
  207. " Simplify saving and closing of files
  208. "map <F5> :silent execute "!pdflatex % > /dev/null && xpdf -remote paper -reload > /dev/null &"<CR>ggG<C-o><C-o>
  209. map <F5> :!%<CR>
  210. map <F8> :w<CR>
  211. map <F10> :x<CR>
  212.  
  213. " Spellcheck, ignore tex comments
  214. map <F7> :SyntasticCheck<CR>
  215. map <F9> :set spell<CR>
  216. let g:tex_comment_nospell=1
  217.  
  218. " Short cuts for ConqueTerm shell
  219. map <leader>sh :set splitbelow<CR>:new<CR>:resize 10<CR>:ConqueTerm bash<CR>
  220. map <leader>py :set splitbelow<CR>:new<CR>:resize 10<CR>:ConqueTerm python<CR>
  221. map <leader>sc :set splitbelow<CR>:new<CR>:resize 10<CR>:ConqueTerm scala<CR>
  222. map <leader>rb :set splitbelow<CR>:new<CR>:resize 10<CR>:ConqueTerm irb<CR>
  223.  
  224. " open MRU menu
  225. nnoremap <leader>m :MRU<CR>
  226. " NERDtree on <leader>t
  227. nnoremap <leader>t :NERDTree<CR>
  228.  
  229. nmap <leader>cd :Calendar -view=day<CR>
  230. nmap <leader>cm :Calendar -view=month<CR>
  231. nmap <leader>cw :Calendar -view=week<CR>
  232. nmap <leader>cy :Calendar -view=year<CR>
  233. nmap <leader>cc :Calendar -view=clock<CR>
  234. nmap <leader>j :Calendar -view=week<CR>
  235.  
  236. " remove trailing whitespace
  237. map <leader>rt :%s/\s\+$//<CR>
  238. map <leader>sp :set paste<CR>
  239. map <leader>fl a.format(**locals())<ESC>
  240. map <leader>up i#!/usr/bin/env python<CR><CR>if __name__ == '__main__':<CR>
  241. map <leader>um i#!/usr/bin/env python<CR><CR>def main():<CR> pass<CR><CR>if __name__ == '__main__':<CR> main()<ESC>
  242. map <leader>in iif __name__ == '__main__':<CR>
  243.  
  244. " open FuzzyFinder
  245. map <leader>ff :FufFile<CR>
  246.  
  247. " Have NERDTree alway open in the current folder
  248. set autochdir
  249. let NERDTreeChDirMode=2
  250.  
  251. " Setzt die Ergebnisse einer Stringsuche immer in die Mitte des Bildschirms
  252. nmap n nzzzv
  253. nmap N Nzzzv
  254. nmap * *zzzv
  255. nmap # #zzzv
  256. nmap g* g*zzzv
  257. nmap g# g#zzzv
  258.  
  259. " Indent the whole file using --
  260. fun! BenIndent()
  261. let oldLine=line('.')
  262. normal(gg=G)
  263. execute ':' . oldLine
  264. endfun
  265. map -- :call BenIndent()<cr>
  266.  
  267. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  268. " Language specific behavior
  269. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  270.  
  271. " Fortran
  272. " Fixes 'bug' in wrong form recognition
  273. let fortran_free_source=1
  274. let fortran_fold=1
  275. "autocmd FileType fortran compiler ifort
  276.  
  277. " Java Spezifisches
  278. let java_highlight_all=1
  279. let java_highlight_functions="style"
  280. let java_allow_cpp_keywords=1
  281.  
  282. " LaTeX Spezifisches
  283. "set iskeyword+=:
  284. "let g:Tex_Env_theorem "\\pspicture(0,0)(,)(,)\<CR>\<CR>\\endpspicture"
  285. let g:Tex_DefaultTargetFormat='pdf'
  286. let g:Tex_CompileRule='latex --interaction=nonstopmode $*'
  287. let g:Tex_CompileRule_ps='dvips -q -Ppdf -o $*.ps $*.dvi'
  288. let g:Tex_CompileRule_pdf='ps2pdf $*.ps'
  289. let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf'
  290. let g:Tex_IgnoredWarnings=' \"Underfull\n".
  291. \"Overfull\n".
  292. \"specifier changed to\n".
  293. \"You have requested\n".
  294. \"Missing number, treated as zero.\n".
  295. \"There were undefined references\n".
  296. \"Citation %.%# undefined\n"
  297. \"Unused global option"'
  298.  
  299. autocmd Filetype html,xml,xsl source ~/.vim/bundle/closetag.vim/plugin/closetag.vim
  300. autocmd BufRead,BufNewFile *.scala set filetype=scala
  301. autocmd BufRead,BufNewFile *.sc set filetype=scala
  302. ""Enables OmniComplete Toggeling with only Ctrl-n
  303. "set complete-=k complete+=k
  304.  
  305. let NERDTreeIgnore=['\~$', '\.pyc$', '\.pyo$', '\.class$', 'pip-log\.txt$', '\.o$']
  306.  
  307. nnoremap <tab> <c-p>
  308.  
  309. " Function to automagically increase number of marked column
  310. fun! Incr()
  311. let l = line(".")
  312. let c = virtcol("'<")
  313. let l1 = line("'<")
  314. let l2 = line("'>")
  315. if l1 > l2
  316. let a = l - l2
  317. else
  318. let a = l - l1
  319. endif
  320. if a != 0
  321. exe 'normal '.c.'|'
  322. exe 'normal '.a."\<c-a>"
  323. endif
  324. normal `<
  325. endfunction
  326. vnoremap <c-a> :call Incr()<CR>
  327.  
  328. "jump to last position when reopen
  329. autocmd BufReadPost *
  330. \ if line("'\"") > 0 && line("'\"") <= line("$") |
  331. \ exe "normal! g`\"" |
  332. \ endif
  333.  
  334. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  335. " Plugin specific behavior
  336. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  337. " OmniCompletion
  338. "Omni Completion für alle möglichen sprachen einschalten
  339. autocmd FileType python set omnifunc=pythoncomplete#Complete
  340. autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
  341. "autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
  342. autocmd FileType css set omnifunc=csscomplete#CompleteCSS
  343. "autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
  344. "autocmd FileType php set omnifunc=phpcomplete#CompletePHP
  345. "autocmd FileType c set omnifunc=ccomplete#Complete
  346.  
  347. let g:SuperTabDefaultCompletionType = "context"
  348. set completeopt=menuone,longest,preview
  349.  
  350. " for Goerz' sendToScreen gimmick
  351. autocmd BufNewFile,BufRead *.py let b:sendToProgramMode="ipython"
  352. let b:sendToProgramName="~/.vim/scripts/send2screen.py -S ipy1 "
  353.  
  354. " settings for pydiction (Python tab completion) plugin)
  355. let g:pydiction_location="~/.vim/ftplugin/pydiction/complete-dict"
  356. let g:pydiction_menu_height=20
  357.  
  358. let g:tex_flavor='latex'
  359.  
  360. "" for Go
  361. "filetype off
  362. "filetype plugin indent off
  363. "set runtimepath += "/usr/local/go/misc/vim"
  364. "filetype plugin indent on
  365. "syntax on
  366.  
  367. let g:instant_markdown_slow = 1
  368.  
  369. " allow for better search and replace
  370. vnoremap <silent> s //e<C-r>=&selection=='exclusive'?'+1':''<CR><CR>
  371. \:<C-u>call histdel('search',-1)<Bar>let @/=histget('search',-1)<CR>gv
  372. omap s :normal vs<CR>
  373.  
  374. function! NumberToggle()
  375. if(&relativenumber == 1)
  376. set number
  377. else
  378. set relativenumber
  379. endif
  380. endfunc
  381.  
  382. nnoremap <C-n> :call NumberToggle()<cr>
  383.  
  384. " Open number per default on open
  385. call NumberToggle()
  386.  
  387. " Run flake8 with F7, ignore certain errors
  388. let g:flake8_ignore="E501,W293"
  389.  
  390. " Syntastic settings
  391. set statusline+=%#warningmsg#
  392. set statusline+=%{SyntasticStatuslineFlag()}
  393. set statusline+=%*
  394.  
  395. let g:syntastic_always_populate_loc_list = 1
  396. let g:syntastic_auto_loc_list = 1
  397. let g:syntastic_check_on_open = 0
  398. let g:syntastic_check_on_wq = 0
  399. let g:syntastic_check_on_q = 0
  400. let g:syntastic_check_on_w = 0
  401. let g:syntastic_check_on_x = 0
  402. let g:syntastic_python_checkers = ['pylint', 'flake8']
  403. let g:syntastic_python_flake8_args='--ignore=E501,E402'
  404. let g:syntastic_mode_map = { 'mode': 'passive' }
  405.  
  406. let delimitMate_autoclose = 1
  407. let delimitMate_expand_cr = 0
  408. let delimitMate_expand_space = 1
  409.  
  410. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""
  411. " Lightline settings
  412. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""
  413. let g:lightline = {
  414. \ 'colorscheme': 'wombat',
  415. \ }
  416. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""
  417. " Pomodoro settings
  418. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""
  419. nmap <leader>ps :PomodoroStart<CR>
  420. " Duration of a pomodoro in minutes (default: 25)
  421. let g:pomodoro_time_work = 25
  422.  
  423. " Duration of a break in minutes (default: 5)
  424. let g:pomodoro_time_slack = 5
  425.  
  426. " Log completed pomodoros, 0 = False, 1 = True (default: 0)
  427. let g:pomodoro_do_log = 0
  428.  
  429. " Path to the pomodoro log file (default: /tmp/pomodoro.log)
  430. let g:pomodoro_log_file = "/tmp/pomodoro.log"
  431.  
  432. " Vim Calender configuration
  433. let g:calendar_frame = 'default'
  434. let g:calendar_google_calendar = 1
  435. let g:calendar_google_task = 1
  436. let g:calendar_task = 1
  437. let g:calendar_task_delete = 1
  438. let g:calendar_yank_deleting = 1
  439.  
  440. " Handy abbreviations
  441. iabbrev @- mjhoffmann@gmail.com
  442. iabbrev date- <c-r>=strftime("%F")<CR>
  443.  
  444. " Minion Shortcuts
  445. nmap <leader>mn :MinionNote<space>
  446. nmap <leader>mo :MinionOpen<space>
  447.  
  448. " Minimap shortcuts
  449. "let g:minimap_highlight='Visual'
  450. nmap <leader>ms :Minimap<CR>
  451. nmap <leader>mc :MinimapClose<CR>
  452.  
  453. " Zotero plugin settings
  454. nmap <space> [unite]
  455. nnoremap [unite] <nop>
  456. let g:citation_vim_zotero_folder=["/Users/maxjh/Library/Application Support/Zotero/Profiles/y9hwubw4.default/zotero"]
  457. let g:citation_vim_bibtex_file="/Users/maxjh/stanford/My Library.bib"
  458. let g:citation_vim_mode="zotero"
  459. let g:citation_vim_collection = "My Library"
  460. let g:citation_vim_cache_path='~/.vim/cache_path'
  461.  
  462. let g:citation_vim_outer_prefix="["
  463. let g:citation_vim_inner_prefix="@"
  464. let g:citation_vim_suffix="]"
  465. nnoremap <silent><leader>z :<C-u>Unite -buffer-name=citation -start-insert -default-action=append citation/key<cr>
  466. nnoremap <silent><leader>c :<C-u>Unite -buffer-name=citation -start-insert -default-action=append citation/key<cr>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement