Skip to content

Instantly share code, notes, and snippets.

@rasefon
Last active December 19, 2015 23:28
Show Gist options
  • Save rasefon/6034646 to your computer and use it in GitHub Desktop.
Save rasefon/6034646 to your computer and use it in GitHub Desktop.
vimrc for ubuntu.
set nocompatible
"Close vi compatible mode
set nocp
" Settings for vundle
filetype off
set rtp+=~/.vim/bundle/vundle
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
"======================My plugins=========================
" Vim Scripts repo
Bundle 'The-NERD-Commenter'
Bundle 'The-NERD-tree'
Bundle 'snipMate'
Bundle 'FuzzyFinder'
Bundle 'Handlebars'
Bundle 'L9'
Bundle 'xptemplate'
Bundle 'neocomplcache'
Bundle 'molokai'
Bundle 'taglist.vim'
Bundle 'slimv.vim'
Bundle 'OmniCppComplete'
" Github repo
Bundle 'kien/ctrlp.vim'
Bundle 'tpope/vim-fugitive'
Bundle 'bling/vim-airline'
Bundle 'nanotech/jellybeans.vim'
Bundle 'Lokaltog/vim-distinguished'
Bundle 'jgdavey/vim-railscasts'
Bundle 'elzr/vim-json'
Bundle 'git://github.com/jelera/vim-javascript-syntax.git'
Bundle 'git://github.com/scrooloose/syntastic.git'
Bundle 'rasefon/cscope_maps.vim.git'
Bundle 'rasefon/vim-daim.git'
Bundle 'kovisoft/slimv.git'
Bundle 'amdt/vim-niji.git'
Bundle 'vim-scripts/paredit.vim.git'
Bundle 'rasefon/vim-web-indent'
Bundle 'pangloss/vim-javascript'
Bundle 'nono/jquery.vim'
Bundle 'othree/html5.vim'
Bundle 'kchmck/vim-coffee-script'
Bundle 'digitaltoad/vim-jade'
filetype plugin indent on
"======================My settings========================
" Set to auto read when a file is changed from the outside
set autoread
" With a map leader it's possible to do extra key combinations
" like <leader>w saves the current file
let mapleader = ","
let g:mapleader = ","
" Fast editing of the .vimrc
map <leader>ev :e! ~/.vimrc<cr>
"Fast reloading of the .vimrc
map <leader>l :source ~/.vimrc<cr>
"When .vimrc is edited, reload it
autocmd! bufwritepost .vimrc source ~/.vimrc
"Open grep window
map <leader>cw :botright cwindow<cr>
"Close current buffer quickly
map <leader>z :close<cr>
"force to overwrite file
map <leader>w :w!<cr>
"Build help
"map <leader>bh :helptags ~/.vim/doc<cr>
map <leader>bh :helptags ~/_vim/doc<cr>
"Taglist
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
let Tlist_Use_Right_Window=1
let Tlist_WinWidth=65
map <F8> :TlistToggle<cr>
" Set tagbar
"nmap <F8> :TagbarToggle<cr>
"let g:tagbar_ctags_bin='ctags'
"let g:tagbar_width=45
"FufBufferTag
map <leader>fbt :FufBufferTag<cr>
"FufBuffer
map <leader>fbf :FufBuffer<cr>
"Vim grep
map <leader>vg :vimgrep
"Quick build tags
map <leader>bt :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --exclude=.git --exclude=log <cr>
"Quick build cscope
map <leader>bc :!cscope -R -b <cr>
" quick copy and paste
map <leader>yy "+y
map <leader>pp "+p
syntax enable "Enable syntax hl
colorscheme distinguished
set number
set cursorline
set cursorcolumn
"set ruler "Always show current position
set cmdheight=1 "The commandbar height
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Text, tab and indent related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set shiftwidth=2
set tabstop=2
set expandtab
"set autochdir
"Make search act like search in modern browsers
set incsearch
"Highlight the search result
set hlsearch
set showmatch "Show matching bracets when text indicator is over them
set mat=2 "How many tenths of a second to blink
"Set magic on, for regular expressions
set magic
set cindent
set laststatus=2
set foldenable
set foldmethod=manual
set foldcolumn=2
"set font
set guifont=Bitstream\ Vera\ Sans\ Mono\ 9
"set guifont=Consolas:h10
set fenc=utf-8
"Ignore case when searching
set ignorecase
set smartcase
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Files, backups and undo
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Turn backup off, since most stuff is in SVN, git anyway...
set nobackup
set nowb
set noswapfile
"Show default help
let g:bufExplorerDefaultHelp=1
"Show detial help
let g:bufExplorerDetailedHelp=1
"Show relative to the current directory
let g:bufExplorerShowRelativePath=1
"The buffers are sorted by the buffer's name
let g:bufExplorerSortBy='extension'
"Split right
let g:bufExplorerSplitRight=1
"NERD_Tree
map <F7> :NERDTreeToggle<cr>
let NERDTreeCaseSensitiveSort=1
let NERDTreeWinPos="right"
let NERDTreeWinSize=65
" Quick match
map <F3> <S-*>
map <F2> <S-#>
"CtrlP file finder
map <leader>ff :CtrlP ./<cr>
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " Linux/MacOSX
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.hg$\|\.svn$',
\ 'file': '\.exe$\|\.so$\|\.dll$',
\ 'link': 'SOME_BAD_SYMBOLIC_LINKS',
\ }
let g:ctrlp_by_filename=1
let g:ctrlp_use_caching=1
"omni compl ruby
let g:rubycomplete_buffer_loading=1
let g:rubycomplete_classes_in_global=1
let g:rubycomplete_rails=1
"omnicpp
let OmniCpp_GlobalScopeSearch=1
let OmniCpp_NamespaceSearch=2
let OmniCpp_MayCompleteDot=0
let OmniCpp_MayCompleteArrow=0
let OmniCpp_MayCompleteScope=0
" HandleBars settings
au BufRead,BufNewFile *.handlebars,*.hbs set ft=handlebars
" Status bar
set statusline=%F%m%r%h%w/[FORMAT=%{&ff}]/[TYPE=%Y]/[ASCII=/%03.3b]/[HEX=/%02.2B]/[POS=%04l,%04v][%p%%]/[LEN=%L]
set laststatus=2
" Show command keys in the status line, default off in Unix!
set sc
" Syntastic
let g:syntastic_check_on_open=1
map <leader>se :Errors<cr>
set cul
"Grep related utilities configuration
"let Grep_Path="C:\GnuWin32\bin\grep.exe"
"let Fgrep_Path="C:\GnuWin32\bin\fgrep.exe"
"let Egrep_Path="C:\GnuWin32\bin\egrep.exe"
"let Grep_Find_Path="C:\GnuWin32\bin\find.exe"
"let Grep_Xargs_Path="C:\GnuWin32\bin\xargs.exe"
"let Grep_Default_Options='-i'
let g:paredit_mode = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment