Skip to content

Instantly share code, notes, and snippets.

@Brethel
Created April 16, 2019 02:44
Show Gist options
  • Save Brethel/d16d20676dfac73462479e5e04751a12 to your computer and use it in GitHub Desktop.
Save Brethel/d16d20676dfac73462479e5e04751a12 to your computer and use it in GitHub Desktop.
vimrc file
set nocompatible
filetype off " required
" -----------------------------------------------------------------------------
" https://github.com/VundleVim/Vundle.vim
" -----------------------------------------------------------------------------
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" file explorer
Plugin 'scrooloose/nerdtree'
" tagbar
Plugin 'majutsushi/tagbar'
" cscope autoload and key map
Plugin 'mzlogin/cscope_macros.vim'
" markdown
Plugin 'mzlogin/vim-markdown-toc'
Plugin 'mzlogin/vim-kramdown-tab'
" C++
Plugin 'vim-scripts/OmniCppComplete'
Plugin 'vim-scripts/a.vim'
Plugin 'mbbill/code_complete'
" Java
Plugin 'vim-scripts/javacomplete'
" java decompile
Plugin 'mzlogin/vim-smali'
" comment lines in a program
Plugin 'vim-scripts/EnhCommentify.vim'
" MiniBufExpl
Plugin 'fholgado/minibufexpl.vim'
" brackets auto pair
Plugin 'jiangmiao/auto-pairs'
" web indent
Plugin 'jason0x43/vim-js-indent'
Plugin 'lukaszb/vim-web-indent'
" Qml
Plugin 'peterhoeg/vim-qml'
" h5
Plugin 'mattn/emmet-vim'
call vundle#end() " required
filetype plugin indent on " required
" -----------------------------------------------------------------------------
set showcmd
set showmatch
set matchtime=2
set smartindent
set ai " always set autoindenting on
set backspace=indent,eol,start
set bs=2 " allow backspacing over everything in insert mode
set nobackup " do not keep a backup file, use versions instead
set noundofile
"if has("vms")
" set nobackup " do not keep a backup file, use versions instead
"else
" set backup " keep a backup file
"endif
set wildmenu
set wildmode=longest:list,full
set bomb
set encoding=utf-8
set fileencodings=utf-8
"set encoding=latin1
"set fileencodings=latin1
set history=150 " keep 150 lines of command line history
set ruler " show the cursor position all the time
set incsearch " do incremental searching
set expandtab
set number
set ts=4
set sw=4
set hidden
"set guifont=Bitstream\ Vera\ Sans\ Mono\ 8
set guifont=Inconsolata-dz\ for\ Powerline\ Medium\ 10
"set guifont=-misc-fixed-medium-r-normal-*-*-120-*-*-c-*-iso8859-1
"set guifont=-misc-fixed-medium-r-semicondensed-*-*-120-*-*-c-*-iso8859-1
set statusline=%F%h%m%r%=%p%%\ (%l,%c)
set laststatus=2
set vb " visual_bell
set ignorecase
set nosol " no start-of-line
">>> fode com o modo visual
" behave mswin
"
" set selectmode+=mouse
set lazyredraw
" For regular expressions turn magic on
set magic
" " Show matching brackets when text indicator is over them
set showmatch
" " How many tenths of a second to blink when matching brackets
set mat=2
"
"
map Q gq
map <C-Z> :undo<CR>
imap <C-Z> <ESC>:undo<CR>i
map <F5> <ESC>v%
imap <F5> <ESC>v%
map <Space> i<END><CR><ESC>
map <TAB> i<Home><TAB><ESC>
map P "*p
nmap <BS> X
map <C-S> :w<CR>
imap <C-S> <ESC>:w<CR>i
"---
map <S-C-T> :tabnew<CR>
imap <S-C-T> <ESC>:tabnew<CR>i
map <C-TAB> :bnext<CR>
imap <C-TAB> <ESC>:bnext<CR>i
map <S-C-TAB> :bprev<CR>
imap <S-C-TAB> <ESC>:bprev<CR>i
"--- shift-insert default (CLI) behaviour
map <S-Insert> <MiddleMouse>
map! <S-Insert> <MiddleMouse>
" Make p in Visual mode replace the selected text with the "" register.
vnoremap p <Esc>:let current_reg = @"<CR>gvs<C-R>=current_reg<CR><Esc>
"hi Normal guibg=lightyellow
set guioptions-=T "no toolbar ( set toolbar=icons,tooltips para voltar com essa merda )
set tbs "binary search on tagfile
if has("gui_running")
colorscheme murphy
set lines=65 columns=150
cmap wq w
" let do_syntax_sel_menu = 1|runtime! synmenu.vim|aunmenu &Syntax.&Show\ filetypes\ in\ menu
let do_syntax_sel_menu = 1|runtime! synmenu.vim|aunmenu &Syntax.&Show\ filetypes\ in\ menu
endif
augroup filetypedetect
autocmd! BufNewFile,BufRead *.epl,*.phtml,*.shtml setf embperl
augroup END
autocmd BufNewFile,BufRead *.epl,*.phtml,*.shtml colorscheme embperl_dark
autocmd Filetype gitcommit setlocal spell textwidth=72
syn on
hi Comment ctermbg=gray
hi Visual term=reverse
hi Visual ctermfg=blue ctermbg=yellow
hi Visual guifg=blue guibg=yellow
hi StatusLine gui=bold guifg=cyan guibg=blue
hi StatusLine ctermfg=gray ctermbg=black
">>> estraga com o modo visual
" behave mswin
"
" set selectmode+=mouse
" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
" let &guioptions = substitute(&guioptions, "t", "", "g")
" Don't use Ex mode, use Q for formatting
" Make p in Visual mode replace the selected text with the "" register.
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" 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 all text files set 'textwidth' to 132 characters.
au FileType text setlocal tw=132
" When editing a file, always jump to the last known cursor position.
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
" red square if extra spaces on eol
au BufNewFile,BufRead * syn match EolSpace display excludenl "\s\+$"
au BufNewFile,BufRead * hi EolSpace term=reverse ctermbg=DarkRed
au BufNewFile,BufRead *.mxml set filetype=mxml
au BufNewFile,BufRead *.as set filetype=actionscript
endif " has("autocmd"a)
"format XML with gg=G
au FileType xml setlocal equalprg=xmllint\ --format\ --recover\ -\ 2>/dev/null
":call SumFunc
fu! SumFunc() range
let old = @a
normal gv"ay
let sel=@a
let @a=old
let res=0
try
exe 'let res = ' . join(split(sel,'\n'), '+')
"call append(a:lastline, printf("Sum: %.02f", res))
echom "Sum " res
catch
return -1
endtry
return 0
endfu
com! FormatJSON %!python -m json.tool
com! FormatXML %!xmllint --format --recover -
cmap SS call SumFunc()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment