Advertisement
Guest User

Untitled

a guest
Apr 24th, 2013
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.04 KB | None | 0 0
  1. "this enables the mouse (scrolling, clicking...)
  2. set mouse=a
  3. set tabstop=4
  4. set shiftwidth=4
  5. set expandtab
  6. set cindent
  7. set foldmethod=indent
  8. set tabpagemax=200
  9. set runtimepath=~/.vim,~/.vim/vim-fuzzyfinder,~/.vim/vim-l9,~/.vim/nerdtree,~/.vim/vim72,~/.vim/vim-phpunit
  10. set ruler
  11. set rulerformat=%55(%{strftime('%a\ %b\ %e\ %I:%M\ %p')}\ %5l,%-6(%c%V%)\ %P%)
  12. set ofu=syntaxcomplete#Complete
  13. set mousemodel=popup
  14. "para que no salga el mensaje de Este archivo swap ya existe
  15. "ojo hay que crear previamente el directorio ~/tmp
  16. set backupdir=~/tmp
  17. set lines=60
  18. set columns=157
  19.  
  20. map tp :set invpaste paste?<enter>
  21. set showmode
  22.  
  23. if &diff
  24. set t_Co=256
  25. colorscheme murphy
  26. else
  27. colorscheme darkblue
  28. endif
  29.  
  30. set nocompatible " be iMproved
  31. filetype off " required!
  32.  
  33. set rtp+=~/.vim/bundle/vundle/
  34. call vundle#rc()
  35.  
  36. " let Vundle manage Vundle
  37. " required!
  38. Bundle 'gmarik/vundle'
  39.  
  40. " My Bundles here:
  41. "
  42. " original repos on github
  43. Bundle 'Valloric/YouCompleteMe'
  44. "Bundle 'Lokaltog/vim-easymotion'
  45. "Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
  46. "Bundle 'tpope/vim-rails.git'
  47. " vim-scripts repos
  48. "Bundle 'L9'
  49. "Bundle 'FuzzyFinder'
  50. " non github repos
  51. "Bundle 'git://git.wincent.com/command-t.git'
  52. " ...
  53.  
  54. filetype plugin indent on " required!
  55. "
  56. " Brief help
  57. " :BundleList - list configured bundles
  58. " :BundleInstall(!) - install(update) bundles
  59. " :BundleSearch(!) foo - search(or refresh cache first) for foo
  60. " :BundleClean(!) - confirm(or auto-approve) removal of unused bundles
  61. "
  62. " see :h vundle for more details or wiki for FAQ
  63. " NOTE: comments after Bundle command are not allowed..
  64.  
  65. syntax on
  66.  
  67. map 11 ^i//<esc>
  68. map 22 ^:s/\/\///<enter>
  69. map! <? <?php ?><esc>hi
  70. map tn :tabnew \| :FufFile pattern:<enter>
  71. map gs <C-w><C-]><C-w>TzR
  72. map gf <C-w>gf zR<esc> :tabmove 1<enter> :tabp<enter>
  73. map gl :!git log -p %<enter>
  74. map fo :FufFile <enter>
  75. map fr :FufRenewCache<enter>
  76. map gj :tabnext<enter>
  77. map gk :tabprevious<enter>
  78. map g9 :tablast<enter>
  79. map gn \c<Space>
  80. """"""""""""""""""""""Xdebug
  81. "inicia el debugger y muestra el valor y el tipo de la variable
  82. map gu ^^o$aux=0;<esc>:w<enter><F10>:! ~/vim_debug.sh &<enter><F5>
  83. "cierra el debugger y borra la linea auxiliar que habiamos añadido
  84. map gi <F6><F6>gk<F10>dd:w<enter>k
  85. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  86. map gm gg=G''
  87. map go :w<enter> :chromiumreload<enter><c-l>
  88. map <S-Enter> O<Esc>
  89. map <CR> o<Esc>
  90. map fo :FufFile pattern:<enter>
  91. vmap <F9> :call ExecMySQL()<CR>
  92. nmap <F9> V:call ExecMySQL()<CR>
  93. ":nnoremap gp avar_dump();<Esc>
  94. :nnoremap gl adie("fasfs");<Esc>
  95. "añade espacios con el espacio en normal mode
  96. :nnoremap <space> i<space><esc>
  97. map terr Oerror_log(sprintf('%100s', __LINE__ . '::' . __METHOD__ . ':: ') . 'here' . "\n", 3, '/tmp/tmp_log');<esc>0f(w
  98. map ttry Otry {<enter>//some code here<enter>} catch (\Exception $e) {<enter>echo $e->getMessage();<enter>}<esc>3k^
  99. map tfunc O/**<enter>* @todo fill function documentation here<enter>*/<enter>public function replaceMyName()<enter>{<enter>}<esc>kkf(
  100. map tfor Oforeach($collection as $object) {<enter>}<esc>k0f(w
  101. map tif Oif (true) {<enter>//some code here<enter>}<esc>2kft
  102. map telse Oif (true) {<enter>//some code here<enter>} else {<enter>//some code here<enter>}<esc>4kft
  103.  
  104.  
  105.  
  106. let s:windowmapnr = 0
  107. let s:wins='123456780!@#$%^&*()'
  108. while (s:windowmapnr < strlen(s:wins))
  109. exe 'noremap <silent> <M-' . s:wins[s:windowmapnr] . '> ' . (s:windowmapnr + 1) . 'gt'
  110. exe 'imap <silent> <M-' . s:wins[s:windowmapnr] . '> <C-O>' . (s:windowmapnr + 1) . 'gt'
  111. exe 'cmap <silent> <M-' . s:wins[s:windowmapnr] . '> <C-C>' . (s:windowmapnr + 1) . 'gt'
  112. exe 'vmap <silent> <M-' . s:wins[s:windowmapnr] . '> <C-C>' . (s:windowmapnr + 1) . 'gt'
  113. let s:windowmapnr += 1
  114. endwhile
  115. unlet s:windowmapnr s:wins
  116. "endmap tabs
  117.  
  118. " vsearch.vim
  119. " Visual mode search
  120. function! s:VSetSearch()
  121. let temp = @@
  122. norm! gvy
  123. let @/ = '\V' . substitute(escape(@@, '\'), '\n', '\\n', 'g')
  124. let @@ = temp
  125. endfunction
  126.  
  127. vnoremap * :<C-u>call <SID>VSetSearch()<CR>//<CR>
  128. vnoremap # :<C-u>call <SID>VSetSearch()<CR>??<CR>
  129. :nnoremap tl :buffers<CR>:buffer<Space>
  130.  
  131. "first, enable status line always
  132. set laststatus=2
  133. set foldlevel=99
  134.  
  135. " now set it up to change the status line based on mode
  136. "if version >= 700
  137. " au InsertEnter * hi StatusLine term=reverse ctermbg=5 gui=undercurl guisp=White
  138. " au InsertLeave * hi StatusLine term=reverse ctermfg=0 ctermbg=2 gui=bold,reverse
  139. "endif
  140.  
  141. let g:phpcs_std_list="PEAR"
  142. let g:phpcs_max_output = 0 " Unlimited output.
  143. "comprueba que exista el archivo .custom_vimrc antes de cargarlo, porque sino
  144. "da error
  145. let FILEA=expand("./.custom_vimrc")
  146. if filereadable(FILEA)
  147. source .custom_vimrc
  148. endif
  149.  
  150. "filetype plugin on
  151. "au FileType php set omnifunc=phpcomplete#CompletePHP
  152.  
  153. "borra los espacios en blanco al final de las lineas (trailing spaces) cuando se salva el archivo.
  154. autocmd BufWritePre * :%s/\s\+$//e
  155.  
  156. "twig highlighting
  157. au BufRead,BufNewFile *.twig set syntax=htmljinja
  158. let g:neocomplcache_enable_at_startup = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement