Skip to content

Instantly share code, notes, and snippets.

@vicolachips44
Last active August 29, 2015 14:12
Show Gist options
  • Save vicolachips44/dbdcdff551318a9ec3d0 to your computer and use it in GitHub Desktop.
Save vicolachips44/dbdcdff551318a9ec3d0 to your computer and use it in GitHub Desktop.
latest .vimrc configuration file
set nocompatible
filetype off
set encoding=utf-8
scriptencoding utf-8
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
"""--- PLUGIN SECTION BEGIN ---"""
Plugin 'gmarik/Vundle.vim'
Plugin 'kien/ctrlp.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'godlygeek/tabular'
Plugin 'bling/vim-airline'
Plugin 'rbgrouleff/bclose.vim'
Plugin 'majutsushi/tagbar'
Plugin 'jlanzarotta/bufexplorer'
Plugin 'scrooloose/syntastic'
Plugin 'Raimondi/delimitMate'
Plugin 'tomtom/tcomment_vim'
Plugin 'groenewege/vim-less'
Plugin 'evidens/vim-twig'
Plugin 'jdonaldson/vaxe'
Plugin 'kchmck/vim-coffee-script'
Plugin 'elzr/vim-json'
Plugin 'hail2u/vim-css3-syntax'
"----- SNIPMATE DEPENDENCIES ----
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
Plugin 'garbas/vim-snipmate'
"----- VDEBUG ----
Plugin 'joonty/vdebug.git'
"----- GIT -----
Plugin 'tpope/vim-fugitive'
"""--- PLUGIN SECTION END ---"""
call vundle#end()
"----- Colors -----
set t_Co=256
syntax enable
set background=dark
colorscheme mustang
if has("gui_running")
set guifont=Bitstream\ Vera\ Sans\ Mono\ 11
set lines=999 columns=999
set cursorline
set fu
colorscheme solarized
endif
"----- DEFAULT SETTINGS -----
set ruler
set ttyfast
set statusline=%f\ %=L:%l/%L\ %c\ (%p%%)
set number
set nowrap
set nobackup
set nowritebackup
set noswapfile
set showcmd
set timeout timeoutlen=1000 ttimeoutlen=100
set laststatus=2
set autoread
set splitbelow
set splitright
set wildignore+=*/.git/*,*/app/cache/*,*/.DS_Store
filetype plugin indent on
set nofoldenable
set undolevels=4000
"------ Indentation ------
set tabstop=4
set shiftwidth=4
set autoindent
set expandtab
set list
set listchars=tab:▸▸,trail:¬
set backspace=indent,eol,start
"------ Searching ------
set incsearch
set ignorecase
set smartcase
set hlsearch
set mouse=a
set lazyredraw
set guioptions=m
set guioptions-=T
set guioptions-=L
set guioptions=r
set showtabline=1
"----- other settings -----
set encoding=utf8
set ffs=unix,dos,mac
set colorcolumn=80
"---- related to copen cclose quickfix window position ----
autocmd FileType qf wincmd J
"----- NERDTree -----
set switchbuf+=usetab,newtab
let NERDTreeChDirMode=2
let g:nerdtree_tabs_open_on_console_startup=1
let NERDTreeMinimalUI=1
let NERDTreeShowHidden=1
let NERDTreeIgnore = ['.git$[[dir]]', '\.pyc$', 'bin$[[dir]]', 'cache$[[dir]]']
"----- TAGBAR ------
let g:tagbar_compact = 1
let g:tagbar_width=26
"----- DelimitMate ----
let delimitMate_expand_cr = 1
let delimitMate_expand_space = 1
"----- Syntastic ----
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 0
let g:syntastic_error_symbol = ""
let g:syntastic_warning_symbol = ""
let g:syntastic_auto_jump = 0
let g:syntastic_json_checkers=['jsonlint']
let g:syntastic_enable_highlighting = 0
"----- vim-json -----
let g:vim_json_syntax_conceal = 0
"------ Vdebug settings -----
let g:vdebug_options= {
\ "port" : 10000,
\ "server" : 'localhost',
\ "timeout" : 30,
\ "on_close" : 'detach',
\ "break_on_open" : 0,
\ "ide_key" : '',
\ "path_maps" : {},
\ "debug_window_level" : 0,
\ "debug_file_level" : 0,
\ "debug_file" : "",
\ "watch_window_style" : 'expanded',
\ "marker_default" : '',
\ "marker_closed_tree" : '',
\ "marker_open_tree" : ''
\}
let g:vdebug_features= {
\'max_data' : 512,
\'max_depth' : 5,
\'max_children' : 128
\}
let g:vdebug_keymap = {
\ "run" : "<Leader>db",
\ "run_to_cursor" : "<Down>",
\ "step_over" : "<Up>",
\ "step_into" : "<Left>",
\ "step_out" : "<Right>",
\ "close" : "<leader>dx",
\ "detach" : "<leader>dq",
\ "set_breakpoint" : "<Leader>bp",
\ "eval_visual" : "<Leader>ev"
\}
"----- MAPPINGS -----
let g:mapleader = ","
nmap j gj
nmap k gk
map <leader>x :Bclose
map <leader>xa :1,1000 x!<cr>
map <leader>vs :vsplit <cr>
map <leader>hs :split <cr>
noremap <silent> <C-S> :update<CR>
vnoremap <silent> <C-S> <C-C>:update<CR>
inoremap <silent> <C-S> <C-O>:update<CR>
" Useful mappings for managing tabs
map <leader>tn :tabnew<cr>
map <leader>to :tabonly<cr>
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove<cr>
map <leader>tr :tabprevious<cr>
map <leader>ty :tabnext<cr>
"----- NERDTREE -----
map <leader>nt :NERDTreeTabsToggle <CR>
map <leader>nf :NERDTreeTabsFind <CR>
" ----- TAGBAR -----
map <leader>tt :TagbarToggle <CR>
"----- Cut & Paste ------
map <Leader>pa "+gP
map <Leader>co "+y
"----- TABULARIZE -----
vmap <Leader>a= :Tabularize /=<CR>
vmap <Leader>a: :Tabularize /:\zs<CR>
vmap <Leader>aa :Tabularize /\|<CR>
" ----- Buffer Explorer -----
map <leader>be :BufExplorer <CR>
" ----- END MAPPINGS -----
"----- Remove trailing spaces (unless markdown file type)
fun! StripTrailingWhitespace()
" don't strip on these filetypes
if &ft =~ 'markdown'
return
endif
%s/\s\+$//e
endfun
autocmd BufWritePre * call StripTrailingWhitespace()
autocmd FileType javascript,html,twig,css setl sw=2 sts=2 et
autocmd BufRead,BufNewFile *.json set filetype=json
"----- CURSOR POS -----
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment