Advertisement
erodemobiles

vi4M

Apr 26th, 2011
630
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 5.83 KB | None | 0 0
  1. syntax on
  2. filetype plugin on
  3. set spelllang=pl
  4. set autochdir
  5. set smartindent
  6. set nocompatible
  7. autocmd BufEnter * lcd %:p:h
  8. set visualbell
  9.  
  10. filetype plugin on
  11. au FileType php set omnifunc=phpcomplete#CompletePHP
  12. au BufNewFile,BufRead *.zcml set filetype=xml
  13. autocmd BufWritePost *.py !/usr/local/bin/reload_plone
  14.  
  15. let php_sql_query=1                                                                      
  16. let php_htmlInStrings=1
  17. source ~/.vim/abbrevations
  18. if has("gui_running")
  19.     " GUI is running or is about to start.
  20.     " Maximize gvim window.
  21. "   set lines=99999 columns=99999
  22.     set cursorline
  23.     set guifont=Inconsolata\ Medium\ 12
  24.     colorscheme pyte
  25. else
  26.     colorscheme pyte
  27.     set cursorline
  28.     "noremap <C-]> :tabnext<CR>
  29.     "noremap <C-[> :tabprev<CR>
  30. endif
  31.  
  32. " // The switch of the Tag List
  33. nmap <F9> :TlistToggle<CR>
  34. " // The switch of the Source Explorer
  35. nmap <F8> :SrcExplToggle<CR>
  36. " // Set the height of Source Explorer window
  37. let g:SrcExpl_winHeight = 8
  38. " // Set 100 ms for refreshing the Source Explorer
  39. let g:SrcExpl_refreshTime = 100
  40. " // Set "Enter" key to jump into the exact definition context
  41. let g:SrcExpl_jumpKey = "<ENTER>"
  42. " // Set "Space" key for back from the definition context
  43. let g:SrcExpl_gobackKey = "<SPACE>"
  44. " // In order to Avoid conflicts, the Source Explorer should know what plugins
  45. " // are using buffers. And you need add their bufname into the list below
  46. " // according to the command ":buffers!"
  47. let g:SrcExpl_pluginList = [
  48.         \ "__Tag_List__",
  49.         \ "_NERD_tree_",
  50.         \ "Source_Explorer"
  51.     \ ]
  52. " // Enable/Disable the local definition searching, and note that this is not
  53. " // guaranteed to work, the Source Explorer doesn't check the syntax for now.
  54. " // It only searches for a match with the keyword according to command 'gd'
  55. let g:SrcExpl_searchLocalDef = 1
  56.  
  57. " // Let the Source Explorer update the tags file when opening
  58. let g:SrcExpl_isUpdateTags = 1
  59.  
  60. " // Use program 'ctags' with argument '--sort=foldcase -R' to create or
  61. " // update a tags file
  62. let g:SrcExpl_updateTagsCmd = "ctags --sort=foldcase -R ."
  63.  
  64. " // Set "<F12>" key for updating the tags file artificially
  65. let g:SrcExpl_updateTagsKey = "<F12>"
  66.  
  67. " // Database:
  68. let g:dbext_default_profile_czteryczwarte = 'host=localhost:type=MySQL:user=root:passwd=me7pa:dbname=czteryczwarte_crmcombine_prod'
  69. let g:dbext_default_profile_timework = 'host=localhost:type=MySQL:user=root:passwd=me7pa:dbname=timework_crmcombine_prod'
  70. let g:dbext_default_profile_4people = 'host=localhost:type=MySQL:user=root:passwd=me7pa:dbname=4people_crmcombine_prod'
  71. let g:dbext_default_profile_silny = 'host=localhost:type=MySQL:user=root:passwd=me7pa:dbname=silny_crmcombine_prod'
  72. let g:dbext_default_profile_tdm = 'host=localhost:type=MySQL:user=root:passwd=me7pa:dbname=tdm_crmcombine_prod'
  73. let g:dbext_default_profile = 'czteryczwarte'
  74.  
  75. " Use neocomplcache.
  76. let g:NeoComplCache_EnableAtStartup = 0
  77. " Use smartcase.
  78. let g:NeoComplCache_SmartCase = 1
  79. " Use camel case completion.
  80. "let g:NeoComplCache_EnableCamelCaseCompletion = 1
  81. " Use underbar completion.
  82. let g:NeoComplCache_EnableUnderbarCompletion = 1
  83. " Set minimum syntax keyword length.
  84. let g:NeoComplCache_MinSyntaxLength = 3
  85. " Set manual completion length.
  86. let g:NeoComplCache_ManualCompletionStartLength = 0
  87. " Set minimum keyword length.
  88. let g:NeoComplCache_MinKeywordLength = 3
  89.  
  90. imap <silent><C-l>     <Plug>(neocomplcache_snippets_expand)
  91. smap <silent><C-l>     <Plug>(neocomplcache_snippets_expand)
  92. inoremap <expr><C-h> pumvisible() ? "\<C-y>\<C-h>" : "\<C-h>"
  93. inoremap <expr><silent><C-g>     neocomplcache#undo_completion()
  94. inoremap <expr><C-s>     neocomplcache#complete_common_string()
  95. set autoindent
  96. map <F2> <Esc>:1,$!xmllint --format -<CR>
  97. map <F1> <Esc>:TlistOpen<CR>
  98. map <F3> <Esc>:NERDTree<CR>
  99. map <F4> <Esc>:VCSAnnotate<CR><C-w>40+
  100. map <F5> f'li)<Esc>hhF'itr(<Esc>
  101. set encoding=utf-8
  102. map <F9> <Esc>:VCSVimDiff<CR>
  103. map <F12> <Esc>:call SwitchWeb2py()<CR>
  104. map <F11> <Esc>:call GetHTML()<CR>
  105. map <S-k> <Esc>:tabnext<CR>
  106. map <S-j> <Esc>:tabprev<CR>
  107. highlight CursorLine ctermbg=yellow
  108. set background=light
  109. set statusline=%F[%l:%c_of_%L(%p%%)]
  110. set laststatus=2
  111. map <S-e> :join<CR>
  112. set noswapfile
  113. set mouse=a
  114. set incsearch
  115. set smartcase
  116. set hid
  117. set wildmenu
  118. set cmdheight=2
  119. set nolazyredraw
  120. set magic
  121. set showmatch
  122. set noerrorbells
  123. set novisualbell
  124. set tm=500
  125. set nobackup
  126. set nowb
  127. set noswapfile
  128. set so=7
  129. set ignorecase
  130. set hlsearch
  131.  
  132. "vimgrep
  133. vnoremap <silent> gv :call VisualSearch('gv')<CR>
  134. map <leader>g :vimgrep // **/*.<left><left><left><left><left><left><left>
  135. " From an idea by Michael Naumann
  136. function! VisualSearch(direction) range
  137.     let l:saved_reg = @"
  138.     execute "normal! vgvy"
  139.  
  140.     let l:pattern = escape(@", '\\/.*$^~[]')
  141.     let l:pattern = substitute(l:pattern, "\n$", "", "")
  142.  
  143.     if a:direction == 'b'
  144.         execute "normal ?" . l:pattern . "^M"
  145.     elseif a:direction == 'gv'
  146.         call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.')
  147.     elseif a:direction == 'f'
  148.         execute "normal /" . l:pattern . "^M"
  149.     endif
  150.  
  151.     let @/ = l:pattern
  152.     let @" = l:saved_reg
  153. endfunction
  154.  
  155.  
  156.  
  157. function! CmdLine(str)
  158. exe "menu Foo.Bar :" . a:str
  159. emenu Foo.Bar
  160. unmenu Foo
  161. endfunction
  162.  
  163.  
  164. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  165. " => Command mode related
  166. " """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  167. " Smart mappings on the command line
  168. cno $h e ~/
  169. cno $d e ~/Desktop/
  170. cno $j e ./
  171. cno $c e <C-\>eCurrentFileDir("e")<cr>
  172.  
  173. " $q is super useful when browsing on the command line
  174. cno $q <C-\>eDeleteTillSlash()<cr>
  175.  
  176. " Bash like keys for the command line
  177. cnoremap <C-A>      <Home>
  178. cnoremap <C-E>      <End>
  179. cnoremap <C-K>      <C-U>
  180.  
  181. cnoremap <C-P> <Up>
  182. cnoremap <C-N> <Down>
  183. " :autocmd CursorMoved * silent! exe printf('match IncSearch /\<%s\>/', expand('<cword>'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement