Skip to content

Instantly share code, notes, and snippets.

@ayushjain7
Last active October 13, 2016 21:44
Show Gist options
  • Save ayushjain7/8cfc93e16abcb64d60a363d0db8e4b13 to your computer and use it in GitHub Desktop.
Save ayushjain7/8cfc93e16abcb64d60a363d0db8e4b13 to your computer and use it in GitHub Desktop.
"""""""""""""
" Ayush Jain
"""""""""""""
set nocompatible " Disable vi-compatibility
" Plugin setup through Vundle
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim' " Vundle
Plugin 'scrooloose/nerdcommenter' " Nerdcommenter
"Plugin 'Valloric/YouCompleteMe'
Plugin 'Shougo/vim-javacomplete2'
Plugin 'kien/ctrlp.vim'
Plugin 'Felikz/ctrlp-py-matcher'
call vundle#end()
" Enable filetype plugins
filetype plugin on
filetype indent on
autocmd BufEnter *.c setlocal tabstop=8 shiftwidth=8 softtabstop=8 textwidth=80 noexpandtab cindent cinoptions=:0,l1,t0,g0,(0
autocmd BufEnter *.h setlocal tabstop=8 shiftwidth=8 softtabstop=8 textwidth=80 noexpandtab cindent cinoptions=:0,l1,t0,g0,(0
" Set to auto read when a file is changed from the outside
set autoread
set nobackup
set noswapfile
set showmode " always show what mode we're currently editing in
set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines
set tabstop=4 " a tab is four spaces
set smarttab
set tags=tags
set softtabstop=4 " when hitting <BS>, pretend like a tab is removed, even if spaces
set expandtab " expand tabs by default (overloadable per file type later)
set shiftwidth=4 " number of spaces to use for autoindenting
set shiftround " use multiple of shiftwidth when indenting with '<' and '>'
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set autoindent " always set autoindenting on
set copyindent " copy the previous indentation on autoindenting
set number " always show line numbers
set ignorecase " ignore case when searching
set hlsearch " Highlight search results
set incsearch " Makes search act like search in modern browsers
set smartcase " ignore case if search pattern is all lowercase,
set visualbell " don't beep
set noerrorbells " don't beep
set autowrite " Save on buffer switch
let mapleader = ","
let g:mapleader = ","
nmap <leader>w :w!<cr> " Fast saves
" easier window navigation
nmap <C-h> <C-w>h
nmap <C-j> <C-w>j
nmap <C-k> <C-w>k
nmap <C-l> <C-w>l
autocmd BufWritePre *.php :%s/\s\+$//e " Auto-remove trailing spaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment