pedrorvidal

Untitled

Nov 3rd, 2011
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. set nocompatible
  2. source $VIMRUNTIME/vimrc_example.vim
  3. source $VIMRUNTIME/mswin.vim
  4. behave mswin
  5.  
  6. set diffexpr=MyDiff()
  7. function MyDiff()
  8.   let opt = '-a --binary '
  9.   if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  10.   if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  11.   let arg1 = v:fname_in
  12.   if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  13.   let arg2 = v:fname_new
  14.   if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  15.   let arg3 = v:fname_out
  16.   if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  17.   let eq = ''
  18.   if $VIMRUNTIME =~ ' '
  19.     if &sh =~ '\<cmd'
  20.       let cmd = '""' . $VIMRUNTIME . '\diff"'
  21.       let eq = '"'
  22.     else
  23.       let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
  24.     endif
  25.   else
  26.     let cmd = $VIMRUNTIME . '\diff'
  27.   endif
  28.   silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
  29. endfunction
  30.  
  31. "------------------------------- Minhas configuracoes -----------------------
  32. " SnipMate fix
  33. " Add this line:
  34. " source $VIMRUNTIME/after/plugin/snipMate.vim
  35. " at the end of file C:\Program Files\Vim\vim73\plugin\snipMate.vim
  36. " source $VIMRUNTIME/after/plugin/snipMate.vim
  37.  
  38. colorscheme Dusk
  39. set guifont=Consolas:h11
  40.  
  41. filetype plugin indent on
  42. :verbose set ai!
  43. :verbose set si!
  44. " set si! silent
  45.  
  46. " change the mapleader from \ to ,
  47. let mapleader=","
  48.  
  49. "Map escape key to jj -- much faster
  50. imap jj <esc>
  51.  
  52. "Saves time; maps the spacebar to colon
  53. nmap <space> :
  54.  
  55. " Quickly edit/reload the vimrc file
  56. nmap <silent> <leader>ev :e $MYVIMRC<CR>
  57. nmap <silent> <leader>sv :so $MYVIMRC<CR>
  58.  
  59. set hidden
  60.  
  61. set nowrap        " don't wrap lines
  62. set tabstop=4     " a tab is four spaces
  63.  
  64. set backspace=indent,eol,start
  65.           " allow backspacing over everything in insert mode
  66. set autoindent    " always set autoindenting on
  67. set smartindent     "talvez deva desabilitar
  68. set copyindent    " copy the previous indentation on autoindenting
  69. set number        " always show line numbers
  70. set shiftwidth=4  " number of spaces to use for autoindenting
  71. set shiftround    " use multiple of shiftwidth when indenting with '<' and '>'
  72. set showmatch     " set show matching parenthesis
  73. set ignorecase    " ignore case when searching
  74. set smartcase     " ignore case if search pattern is all lowercase,
  75.                  "    case-sensitive otherwise
  76. set smarttab      " insert tabs on the start of a line according to
  77.                  "    shiftwidth, not tabstop
  78. set hlsearch      " highlight search terms
  79. set incsearch     " show search matches as you type
  80.  
  81. set history=1000         " remember more commands and search history
  82. set undolevels=1000      " use many muchos levels of undo
  83. set wildignore=*.swp,*.bak,*.pyc,*.class
  84. set title                " change the terminal's title
  85. set visualbell           " don't beep
  86. set noerrorbells         " don't beep
  87.  
  88. set nobackup
  89. set noswapfile
  90. set nowritebackup
  91.  
  92. if &t_Co >= 256 || has("gui_running")
  93.   " colorscheme ir_black
  94.   colorscheme Dusk
  95. endif
  96.  
  97. if &t_Co > 2 || has("gui_running")
  98.     " switch syntax highlighting on, when the terminal has colors
  99.     syntax on
  100. endif
  101.  
  102. set pastetoggle=<F11>
  103.  
  104. set mouse=a
  105.  
  106. "It clears the search buffer when you press ,/
  107. nmap <silent> ,/ :nohlsearch<CR>  
  108.  
  109. map <F3> :MRU<CR>
  110.  
  111. "Show lines numbers
  112. set number
  113. set ruler
  114.  
  115. "Prefer a slightly higher line height
  116. set linespace=3
  117.  
  118. "Better line wrapping
  119. set wrap
  120.  
  121. "Hide mouse when typing
  122. set mousehide
  123.  
  124. " Alphabetically sort CSS properties in file with :SortCSS
  125. :command! SortCSS :g#\({\n\)\@<=#.,/}/sort
  126. set encoding=utf-8
  127. scriptencoding utf-8
  128. set fileencoding=utf-8
  129.  
  130. set shortmess+=filmnrxoOtT      " abbrev. of messages (avoids 'hit enter')
  131. set viewoptions=folds,options,cursor,unix,slash " better unix / windows compatibility
  132.  
  133. "Split windows below the current window.
  134. set splitbelow              
  135.  
  136. " session settings
  137. set sessionoptions=resize,winpos,winsize,buffers,tabpages,folds,curdir,help
  138.  
  139. "Map code completion to , + tab
  140. imap <leader><tab> <C-x><C-o>
  141.  
  142. " More useful command-line completion
  143. set wildmenu
  144.  
  145. "Auto-completion menu
  146. set wildmode=list:longest
  147.  
  148. "Change zen coding plugin expansion key to shift + e
  149. let g:user_zen_expandabbr_key = '<C-e>'
  150.  
  151. "Faster shortcut for commenting. Requires T-Comment plugin
  152. map <leader>c <c-_><c-_>
  153.  
  154. set foldenable                  " auto fold code
  155. set softtabstop=4               " let backspace delete indent
  156.  
  157. " SnipMate {
  158.         " Setting the author var
  159.        " If forking, please overwrite in your .vimrc.local file
  160.         "let g:snips_author = 'Steve Francia <[email protected]>'
  161.         " Shortcut for reloading snippets, useful when developing
  162.         nnoremap ,smr <esc>:exec ReloadAllSnippets()<cr>
  163.     " }
  164.  
  165. " easier window navigation
  166. nmap <C-h> <C-w>h
  167. nmap <C-j> <C-w>j
  168. nmap <C-k> <C-w>k
  169. nmap <C-l> <C-w>l
  170.  
  171. "------------------------"
  172. "NERDTREE PLUGIN SETTINGS
  173. "------------------------"
  174.  
  175. "Shortcut for NERDTreeToggle
  176. "nmap <leader>nt :NERDTreeToggle <CR>
  177. map <F2> :NERDTreeToggle<CR>
  178.  
  179. "Show hidden files in NerdTree
  180. let NERDTreeShowHidden=1
  181.  
  182. " -------------------- Opções NERDTREE Editadas por mim -------------
  183. " tab navigation like firefox
  184. :nmap <C-S-tab> :tabprevious<CR>
  185. :nmap <C-tab> :tabnext<CR>
  186. :map <C-S-tab> :tabprevious<CR>
  187. :map <C-tab> :tabnext<CR>
  188. :imap <C-S-tab> <Esc>:tabprevious<CR>i
  189. :imap <C-tab> <Esc>:tabnext<CR>i
  190. :nmap <C-t> :tabnew :NERDTree<CR>
  191. :imap <C-t> <Esc>:tabnew :NERDTree<CR>
  192. "autopen NERDTree and focus cursor in new document
  193. autocmd VimEnter * NERDTree H:/
  194. autocmd VimEnter * wincmd p
  195.  
  196. "Helpeful abbreviations
  197. iab lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
  198. iab llorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
  199.  
  200. "Spelling corrects. Just for example. Add yours below.
  201. iab teh the
  202. iab Teh The
  203.  
  204. " Get to home dir easier
  205. " <leader>hm is easier to type than :cd ~
  206. nmap <leader>hm :cd ~/ <CR>
  207.  
  208.  
  209. "MRU configuration
  210. set viewoptions-=options
  211. augroup vimrc
  212.    autocmd BufWritePost *
  213.    \   if expand('%') != '' && &buftype !~ 'nofile'
  214.    \|      mkview
  215.    \|  endif
  216.    autocmd BufRead *
  217.    \   if expand('%') != '' && &buftype !~ 'nofile'
  218.    \|      silent loadview
  219.    \|  endif
  220. augroup END
  221.  
  222.  
  223.  
Advertisement
Add Comment
Please, Sign In to add comment