Skip to content

Instantly share code, notes, and snippets.

@lorenzosinisi
Created May 10, 2016 13:51
Show Gist options
  • Save lorenzosinisi/351cf6ce5d56943e0a05f39fb1085075 to your computer and use it in GitHub Desktop.
Save lorenzosinisi/351cf6ce5d56943e0a05f39fb1085075 to your computer and use it in GitHub Desktop.
vimrc file
set nocompatible " be iMproved, required
filetype off " required
autocmd ColorScheme * if g:colors_name == 'solarized' | hi link matlabComma Normal | else | hi link matlabComma SpecialKey | endif
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
set expandtab
set tabstop=2
set shiftwidth=2
set splitright
set number
set background=dark
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, require
Plugin 'VundleVim/Vundle.vim'
Plugin 'ntpeters/vim-better-whitespace'
Plugin 'slim-template/vim-slim.git'
syntax enable
filetype plugin indent on
Plugin 'vim-ruby/vim-ruby'
Plugin 'tpope/vim-endwise'
Plugin 'tpope/vim-haml'
Plugin 'majutsushi/tagbar'
set mouse=a
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
Plugin 'ascenator/L9', {'name': 'newL9'}
Plugin 'scrooloose/nerdTree'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
"
autocmd vimenter * NERDTree
highlight Cursor guifg=white guibg=black
highlight iCursor guifg=white guibg=steelblue
" set guicursor=n-v-c:block-Cursor
set guicursor+=i:ver100-iCursor
set guicursor+=n-v-c:blinkon0
set guicursor+=i:blinkwait10
set ignorecase
set hlsearch
set title
set nobackup
set noswapfile
nmap <silent> <leader>ev :e $MYVIMRC<CR>
nmap <silent> <leader>sv :so $MYVIMRC<CR>
vnoremap <C-c> *y <CR>
nnoremap <Leader>w :w<CR>
nnoremap <Leader>q :q<CR>
nnoremap <Leader>Left :tabprevious<CR>
nnoremap <C-Right>Right :tabnext<CR>
map <C-a> <esc>ggVG<CR>
" CTRL-Tab is next tab
noremap <C-Tab> :<C-U>tabnext<CR>
inoremap <C-Tab> <C-\><C-N>:tabnext<CR>
cnoremap <C-Tab> <C-C>:tabnext<CR>
" " CTRL-SHIFT-Tab is previous tab
noremap <C-S-Tab> :<C-U>tabprevious<CR>
inoremap <C-S-Tab> <C-\><C-N>:tabprevious<CR>
cnoremap <C-S-Tab> <C-C>:tabprevious<CR>
set showmatch " set show matching parenthesis
map <C-n> :NERDTreeToggle <CR>
map <C-p> :CtrlP<CR>
map <F5> :lne <CR>
map <F6> :lNe <CR>
" autocmd BufAdd * exe 'tablast | tabe "' . expand( "<afile") .'"'
autocmd BufWritePre * StripWhitespace
set runtimepath^=~/.vim/bundle/ctrlp.vim
set list
set listchars=tab:>.,trail:.,extends:#,nbsp:.
map - x "delete a character under the cursor
map <c-k> D " Delete till the end of the line
vmap <Leader>y "+y
vmap <Leader>d "+d
nmap <Leader>p "+p
nmap <Leader>P "+P
vmap <Leader>p "+p
vmap <Leader>P "+P
" <Ctrl-l> redraws the screen and removes any search highlighting.
nnoremap <silent> <C-l> :nohl<CR><C-l>
nnoremap gr :grep <cword> *<CR>
nnoremap Gr :grep <cword> %:p:h/*<CR>
nnoremap gR :grep '\b<cword>\b' *<CR>
nnoremap GR :grep '\b<cword>\b' %:p:h/*<CR>
cabbrev lvim
\ lvim /\<lt><C-R><C-W>\>/gj
\ **/**<C-R>=(expand("%:e")=="" ? "" : ".".expand("%:e"))<CR>
\ <Bar> lw
\ <C-Left><C-Left><C-Left>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment