Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " /usr/share/vim/vimrc
- " Arkanon <arkanon@lsd.org.br>
- " 2011/04/18 (Seg) 14:31:30 (BRS)
- " 2009/09/29 (Ter) 21:51:57 (BRS)
- " TODO
- "
- " - auto-close of ), ] and } when in front of non-null strings
- " - auto-close of ' and "
- " ok multiply match use (/ceat/ and /[ \t]*/)
- " - auto-source .vimrc on save
- " - auto-reload script on save
- " In vim help (:h [keyword])
- " - follow a link: position the cursor between |bars| and hit CTRL-]
- " - go back: type CTRL-T or CTRL-O (repeat to go further back)
- " Use Vim settings, rather then Vi settings (much better!).
- " This must be first, because it changes other options as a side effect.
- set nocompatible
- if has('win32')
- lang Portuguese_Brazil
- " let $VIMRUNTIME = 'h:\_opt\office\vim\default\share'
- " let $FS = 'h:\_opt\office\vim\ceat'
- endif
- if has('unix')
- lang pt_BR.UTF8
- " let $FS = '/export/fs/etc/vim'
- endif
- set spelllang=pt
- "set spell
- "set rtp=~/.vim,$FS,$VIMRUNTIME
- "helptags ~/.vim/doc
- "helptags $VIMRUNTIME/doc/Align.txt
- "runtime plugins/Align.vim
- "runtime plugins/AlignMaps.vim
- "runtime plugins/TagList.vim
- " Tell vim to remember certain things when we exit
- " '50 : marks will be remembered for up to # previously edited files
- " "100 : will save up to # lines for each register
- " :50 : up to # lines of command-line history will be remembered
- " % : saves and restores the buffer list
- " n... : where to save the viminfo files
- set viminfo='50,\"100,:50,%,n~/.viminfo
- " jumps to the last known position in a file just after opening it, if the '"' mark is set.
- " don't do it if position is invalid or inside an event handler (happens when dropping a file on gvim).
- au BufReadPost *
- \ if line("'\"") > 0 && line("'\"") <= line("$")
- \ | exe "normal! g`\""
- \ | endif
- " taglist
- let Tlist_Auto_Open = 0
- let Tlist_Exit_OnlyWindow = 1
- let Tlist_GainFocus_On_ToggleOpen = 0
- let Tlist_Inc_Winwidth = 0
- let Tlist_Show_One_File = 1
- let Tlist_Use_SingleClick = 0
- let Tlist_Compact_Format = 1
- let Tlist_Display_Tag_Scope = 1
- let Tlist_Close_On_Select = 0
- let Tlist_WinWidth = 22
- nnoremap <silent> T :TlistToggle<cr>
- " function/class folding for php files
- map <c-f5> <esc>:EnableFastPHPFolds<cr>
- map <c-f6> <esc>:EnablePHPFolds<cr>
- map <c-f7> <esc>:DisablePHPFolds<cr>
- "let g:DisableAutoPHPFolding = 1
- " tabs navigation
- set tabpagemax=30
- map th :tabfirst<cr>
- map tj :tabnext<cr>
- map tk :tabprev<cr>
- map tl :tablast<cr>
- map td :tabclose<cr>
- map tt :tabedit<space>
- map tn :tabnew<space>
- map tm :tabm<space>
- " text alignment
- "
- runtime macros/justify.vim " maps _j to justify macro, in both normal and visual modes
- "
- " idem, to _c and center command
- nmap _c :center<cr>
- vmap _c :center<cr>
- "
- " idem, to _l and left command
- nmap _l :left<cr>
- vmap _l :left<cr>
- "
- " idem, to _r and right command
- nmap _r :right<cr>
- vmap _r :right<cr>
- " Enable file type detection.
- " Use the default filetype settings, so that mail gets 'tw' set to 72,
- " 'cindent' is on in C files, etc.
- " Also load indent files, to automatically do language-dependent indenting.
- "filetype plugin indent on
- " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
- "let &guioptions = substitute(&guioptions, "t", "", "g")
- "set ts=10 " tab stop = define o tamanho do tab
- "set et " expandtab = tab é convertido em espaços
- "ret " 'retabula', substituindo tabs por espaços
- "
- " File format
- "set ff=dos " <cr><nl>
- "set ff=unix " <nl>
- "set ff=mac " <cr>
- " alinha pelo caracter '=', deve haver uma linha em branco antes
- map <c-a> !}<bs>Align =<cr>
- " teste: afhjki= 44
- " d= 546
- " Don't use Ex mode, use Q for formatting
- map Q gq
- "set tw=125 " text width
- "gq} " reformata a largura da linha conforme tw
- syntax on
- set nohlsearch " no highlights search results
- " <http://vim.wikia.com/wiki/Highlight_unwanted_spaces>
- autocmd Syntax * syntax match TailSpace /\s\+$\| \+\ze\t/ containedin=ALL
- autocmd Syntax * syntax match todo /\<\CTODO\>/ containedin=ALL
- autocmd Syntax * syntax match bug /\<\CBUG\>\|\<\CBUGS\>/ containedin=ALL
- autocmd Syntax * syntax match erro /\<\CERRO\>/ containedin=ALL
- autocmd Syntax * syntax match feature /\<\CFEATURE\>\|\<\CFEATURES\>/ containedin=ALL
- autocmd Syntax * syntax match ok /\<\cok\>/ containedin=ALL
- autocmd Syntax * syntax match no /\<\cno\>/ containedin=ALL
- autocmd Syntax * syntax match problema /\<\CPROBLEMA\>\|\<\CPROBLEMAS\>/ containedin=ALL
- autocmd Syntax * syntax match resolvido /\<\CRESOLVIDO\>/ containedin=ALL
- autocmd Syntax * syntax match resolver /\<\CRESOLVER\>/ containedin=ALL
- highligh TailSpace ctermbg=lightred guibg=lightred
- highligh todo ctermbg=yellow guibg=yellow cterm=bold gui=bold ctermfg=black guifg=black
- highligh bug ctermfg=red guifg=red cterm=bold gui=bold
- highligh erro ctermfg=red guifg=red cterm=bold gui=bold
- highligh feature ctermfg=blue guifg=blue cterm=bold gui=bold
- highligh ok ctermfg=darkgreen guifg=darkgreen cterm=bold gui=bold
- highligh no ctermfg=red guifg=red cterm=bold gui=bold
- highligh problema ctermbg=red guibg=red cterm=bold gui=bold ctermfg=white guifg=white
- highligh resolvido ctermbg=lightgreen guibg=lightgreen
- highligh resolver ctermbg=yellow guibg=yellow
- function! TextEnableCodeSnip(filetype,start,end,textSnipHl) abort
- " <http://vim.wikia.com/wiki/Different_syntax_highlighting_within_regions_of_a_file>
- let ft=toupper(a:filetype)
- let group='textGroup'.ft
- if exists('b:current_syntax')
- let s:current_syntax=b:current_syntax
- " Remove current syntax definition, as some syntax files (e.g. cpp.vim)
- " do nothing if b:current_syntax is defined.
- unlet b:current_syntax
- endif
- execute 'syntax include @'.group.' syntax/'.a:filetype.'.vim'
- try
- execute 'syntax include @'.group.' after/syntax/'.a:filetype.'.vim'
- catch
- endtry
- if exists('s:current_syntax')
- let b:current_syntax=s:current_syntax
- else
- unlet b:current_syntax
- endif
- execute 'syntax region textSnip'.ft.'
- \ matchgroup='.a:textSnipHl.'
- \ start="'.a:start.'" end="'.a:end.'"
- \ contains=@'.group
- endfunction
- call TextEnableCodeSnip( 'php' , '<?php' , '?>' , 'SpecialComment' )
- call TextEnableCodeSnip( 'html' , 'print \"' , '\";' , 'SpecialComment' )
- "set mouse=r
- set nomousehide " don't hide the mouse pointer while typing
- set backspace=indent,eol,start " allow backspacing over everything in insert mode
- set history=50 " keep 50 lines of command line history
- set showcmd " display incomplete commands
- set incsearch " do incremental searching
- set noai " no autoindent
- set indentexpr=
- set novb t_vb= " use audio bell
- set nobackup
- set nowrap
- set ruler " show the cursor position all the time
- " <http://www.faqs.org/faqs/editor-faq/vi/part2/>
- " ctrl-c cannot be remapped when it is defined as the interrupt character in Unix
- vmap <a-c> :y+<cr>
- set paste
- "map <c-t> :w!<cr>:!aspell check %<cr>:e! %<cr>
- map <f1> :execute "help ".expand("<cword>")<cr>
- map <f2> dwi <esc>jb/ <cr>
- map <f3> 0i <esc>Jr j
- map <f4> mz<esc>c$<c-r>=strftime("%Y/%m/%d %T")<cr><esc>`z
- map <f5> mz<esc>c$<c-r>=strftime("%Y/%m/%d (%a) %T (%Z)")<cr><esc>`z
- imap <f5> <c-r>=strftime("%Y/%m/%d (%a) %T (%Z)")<cr>
- map <f6> mz<esc>c$<c-r>=strftime("%d/%m/%Y %a %T")<cr><esc>`z
- map <f7> mz<esc>c$<c-r>=strftime("%c")<cr><esc>`z
- map <f8> mz<esc>:%s/\s\+$//g<cr>`z
- map <f11> :tab ball<cr>
- " insert current file name without extension
- map ff :execute "normal i".expand("%:r")<cr>l
- " insert current file name with full path
- map FF :execute "normal i".expand("%:p")<cr>l
- map ,v :w<cr>:e ~\.vimrc<cr> " edits .vimrc
- map ,u :source ~/.vimrc<cr> " reloads .vimrc
- " auto-close {, ( and [
- "imap { {}<left>
- "imap ( ()<left>
- "imap [ []<left>
- " removes auto command for wrap text files
- au! BufRead *.txt
- " if editing a new registry file, auto includes standard header with filename as first comment
- au BufNewFile *.reg set ff=dos | execute "normal iREGEDIT4\<cr>\<cr>; ".expand("<afile>:r")."\<cr>\<cr>"
- " if editing a registry file, sets ff do dos (cr+lf)
- au FileType registry set ff=dos
- " if editing .vimrc, sources it-self after saving
- "echo "."
- "au BufWritePost ~/.vimrc source ~/.vimrc
- au FileType crontab set compatible
- au FileType xhtml set enc=utf-8
- au BufNewFile,BufRead *.js.php,*.javascript.php,*.es.php setf javascript
- au BufNewFile,BufRead *.svg.php setf xml
- au BufNewFile,BufRead *.css.php setf css
- au BufNewFile,BufRead *.php,*.phps,*.php\d,*.phtml,*.ctp setf php
- " Open multiple files in tabs.
- "au BufReadPost * tab ball
- " automatically give executable permission to scripts starting with #!/usr/bin/perl and #!/bin/sh
- "au BufWritePost * if getline(1) =~ "^#!/bin/[a-z]*sh" || getline(1) =~ "^#!/usr/bin/perl" | silent execute "!chmod +x <afile>" | endif
- "au BufWritePost * if getline(1) =~ "^#!/bin/[a-z]*sh" || getline(1) =~ "^#!/usr/bin/perl"
- "au BufWritePost * silent execute "!chmod +x <afile>"
- "au BufWritePost * edit
- "au BufWritePost * endif
- "set statusline=[%{&ff}]\ %y\ [asc\ \%03.3b,#\%02.2B]\ [%l/%L(%p%%),%v]\ %m\ %r\ %h\ %w
- "set laststatus=2 " ever shows status line
- "if $LIGHT_TERM
- " colorscheme light
- "else
- " colorscheme dark
- "endif
- " EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement