Skip to content

Instantly share code, notes, and snippets.

@fabianogoes
Created September 19, 2013 22:59
Show Gist options
  • Save fabianogoes/6631014 to your computer and use it in GitHub Desktop.
Save fabianogoes/6631014 to your computer and use it in GitHub Desktop.
configuração vim
" Configuration file for vim
set modelines=0 " CVE-2007-2438
" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible " Use Vim defaults instead of 100% vi compatibility
set backspace=2 " more powerful backspacing
set ai " auto indenting
set history=5000 " keep 100 lines of history
set ruler " show the cursor position
syntax on " syntax highlighting
set hlsearch " highlight the last searched term
filetype plugin on " use the file type plugins
autocmd FileType python
set omnifunc=pythoncomplete#Complete
let $Tlist_Ctags_Cmd='/usr/local/bin/ctags'
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
set number " Numera as linhas
set nobackup " Não salva arquivos de backup~
set wildmode=longest,list " Completa o comando com TAB igual o bash
set ignorecase " Ignora o case sensitive nas buscas
set smartcase " Se tiver alguma letra maiúscula, ativa o case sensitive
set smartindent " Auto-indenta
set expandtab " Identa com espaços
set tabstop=4 " Quantidade de espaços por identação
set shiftwidth=4 " Quantidade de espaços da auto-indentação
set guioptions-=T " Deixa a GUI sem a toolbar
set autochdir " Vai pro diretório do arquivo aberto
" Corretor ortográfico
set spelllang=pt " Escolhe o dicionário
" Auto-fecha parênteses, chaves etc.
inoremap { {}<LEFT>
inoremap ( ()<LEFT>
inoremap [ []<LEFT>
inoremap " ""<LEFT>
inoremap ' ''<LEFT>
" Toda vez que um parentese, colchete
" ou chave 'e aberto, o Vi mostra onde este foi aberto.
" Caso contrario, o Vi deixa em vermelho a entidade sem o seu par
set sm
"Mostra o nome do arquivo na parte superior do prompt
set title
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif |
\ endif
" Don't write backup file if vim is being called by "crontab -e"
au BufWrite /private/tmp/crontab.* set nowritebackup
" Don't write backup file if vim is being called by "chpass"
au BufWrite /private/etc/pw.* set nowritebackup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment