Skip to content

Instantly share code, notes, and snippets.

@Rolos
Last active May 23, 2016 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rolos/0d9e2ddd70751d1bea5430dd9c6203ea to your computer and use it in GitHub Desktop.
Save Rolos/0d9e2ddd70751d1bea5430dd9c6203ea to your computer and use it in GitHub Desktop.
Vim confirguration file from laracast series
" required packages:
" https://github.com/VundleVim/Vundle.vim
" https://github.com/tpope/vim-vinegar
" https://github.com/gosukiwi/vim-atom-dark
" https://github.com/scrooloose/nerdtree
" https://github.com/kien/ctrlp.vim
set nocompatible "be iMproved, required
"-------------load vundle vim configuration and plugins
so ~/.vim/plugins.vim
"-------------------Visuals------------------"
syntax enable
set t_Co=256 "Use 256 colors, this is good
set background=dark
colorscheme atom-dark-256
set backspace=indent,eol,start "makes backspace behave like in every other editor.
let mapleader = ',' "mapleader is the character with which i prefix my mappings. The default is /, i am changing it to(,).
set number "Activates the line numbers
set expandtab "translates tabs into spaces
set shiftwidth=4 "Sets the number of spaces when tab is pressed
set linespace=15 "Sets the linespace
"-------------------Search------------------"
set hlsearch "Highlight search"
set incsearch
"-------------------Split management------------------"
set splitbelow "when i open a new horizontal split set it below
set splitright "when i open a new vertical split set it to the right
"-------------------Mappings------------------"
"mappings are a special vim feature that allows us to map shortcuts to specific actions. nmap is a map when we are in normal mode"
"This maping makes it easy to edit the vimrc file. the <cr> at the end of the line indicates a press to enter. The leader is the namespace
nmap <leader>ev :tabedit $MYVIMRC<cr>
"This mapping removes highlighting after search
nmap <leader><space> :nohlsearch<cr>
nmap <C-K><C-B> :NERDTreeToggle<cr> "maps the opening of the sidebar as in sublime
nmap <c-R>:CtrlPBufTag<cr> "maps ctrl r for search as in sublime
"-------------Plugins--------------"
" some plugins configurations
""/
"/ CtrlP
""/
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git' "ignore this files when searching
let g:ctrlp_match_window = 'top,order:ttb,min:1,max:30,results:30' "display the match window on the top
"-------------------Auto Commands------------------"
"Using an autogroup allows us to improve the preformance of vim when executing autocomands
augroup autosourcing
autocmd!
"Automaticall source the vimrc file on save"
autocmd BufWritePost .vimrc source %
augroup END
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-vinegar'
Plugin 'scrooloose/nerdtree'
Plugin 'ctrlpvim/ctrlp.vim'
" 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
" 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment