Skip to content

Instantly share code, notes, and snippets.

@kikyous
Last active December 21, 2015 13:59
Show Gist options
  • Save kikyous/6316511 to your computer and use it in GitHub Desktop.
Save kikyous/6316511 to your computer and use it in GitHub Desktop.
" Modeline and Notes
" vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker:
"
" _ _ _ _
" | | _(_) | ___ _ __ _(_)_ __ ___
" | |/ / | |/ / | | |____\ \ / / | '_ ` _ \
" | <| | <| |_| |_____\ V /| | | | | | |
" |_|\_\_|_|\_\\__, | \_/ |_|_| |_| |_|
" |___/
"
"
" This is the personal vimrc file forked from http://spf13.com.
"
" Environment {
" Basics {
set nocompatible " Must be first line
if !(has('win16') || has('win32') || has('win64'))
set shell=/bin/sh
endif
" }
" Windows Compatible {
" On Windows, also use '.vim' instead of 'vimfiles'; this makes synchronization
" across (heterogeneous) systems easier.
if has('win32') || has('win64')
set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/.vim/after
endif
" }
" Setup Bundle Support {
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
" }
" }
" Bundles {
Bundle 'tpope/vim-fugitive'
Bundle 'tpope/vim-surround'
" Bundle 'Shougo/neocomplete.vim'
" Bundle 'Lokaltog/vim-easymotion'
Bundle 'tpope/vim-rails'
Bundle 'kchmck/vim-coffee-script'
Bundle 'kien/ctrlp.vim'
Bundle 'scrooloose/nerdtree'
Bundle 'slim-template/vim-slim'
Bundle 'Yggdroot/indentLine'
Bundle 'scrooloose/syntastic'
Bundle 'tomtom/tcomment_vim'
Bundle 'Raimondi/delimitMate'
Bundle 'bling/vim-airline'
Bundle 'junegunn/vim-easy-align'
Bundle 'jnwhiteh/vim-golang'
" Bundle 'junegunn/seoul256.vim'
" Bundle 'majutsushi/tagbar'
Bundle 'junegunn/goyo.vim'
Bundle 'Shougo/vimproc.vim'
" }
" General {
set t_Co=256
set background=dark " Assume a dark background
if !has('gui')
set term=$TERM " Make arrow and other keys work
endif
filetype plugin indent on " Automatically detect file types.
syntax on " Syntax highlighting
set mouse=a " Automatically enable mouse usage
set mousehide " Hide the mouse cursor while typing
scriptencoding utf-8
"set autowrite " Automatically write a file when leaving a modified buffer
set shortmess=atI
set viewoptions=folds,options,cursor,unix,slash " Better Unix / Windows compatibility
" set virtualedit=onemore " Allow for cursor beyond last character
set history=1000 " Store a ton of history (default is 20)
" set spell " Spell checking on
set hidden " Allow buffer switching without saving
set nobackup
set nowritebackup
set noswapfile
" Return to last edit position when opening files (You want this!)
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" autocmd BufAdd,BufNewFile,BufRead * nested tab sball
" mswin behave {
vnoremap <C-X> "+x
vnoremap <unique> <C-C> "+ygv
noremap <C-V> "+gP
cnoremap <C-V> <C-R>+
exe 'inoremap <script> <C-V>' paste#paste_cmd['i']
exe 'vnoremap <script> <C-V>' paste#paste_cmd['v']
noremap <C-S> :update<CR>
inoremap <C-S> <ESC>:update<CR>
" }
" }
" Vim UI {
set guifont=Anonymous\ Pro\ for\ Powerline\ 14
set guioptions=
set guicursor+=i:ver10-Cursor
colorscheme molokai
set tabpagemax=15 " Only show 15 tabs
" set showmode " Display the current mode
" set cursorline " Highlight current line
" highlight clear SignColumn " SignColumn should match background for
" things like vim-gitgutter
set laststatus=2
set backspace=indent,eol,start " Backspace for dummies
set linespace=0 " No extra spaces between rows
set nu " Line numbers on
" set showmatch " Show matching brackets/parenthesis
set incsearch " Find as you type search
set hlsearch " Highlight search terms
set winminheight=0 " Windows can be 0 line high
set ignorecase " Case insensitive search
set smartcase " Case sensitive when uc present
" set wildmenu " Show list instead of just completing
set wildmode=list:full
set whichwrap=b,s,<,>,[,] " Backspace and cursor keys wrap too
set scrolljump=5 " Lines to scroll when cursor leaves screen
set scrolloff=3 " Minimum lines to keep above and below cursor
set foldenable " Auto fold code
set list
set listchars=tab:›\ ,trail:•,extends:#,nbsp:. " Highlight problematic whitespace
" }
" Formatting {
" set nowrap " Wrap long lines
set autoindent " Indent at the same level of the previous line
set shiftwidth=2 " Use indents of 4 spaces
set expandtab " Tabs are spaces, not tabs
set tabstop=2 " An indentation every four columns
set softtabstop=2 " Let backspace delete indent
"set matchpairs+=<:> " Match, to be used with %
set pastetoggle=<F12> " pastetoggle (sane indentation on pastes)
" }
" Key (re)Mappings {
let mapleader = "`"
noremap <F5> :set hlsearch!<CR>
noremap <F11> :set fullscreen!<CR>
noremap gs :Gstatus<CR>
nnoremap gp :Git push origin <C-R>=fugitive#head()<CR>
nnoremap <leader>s :%s/<C-R>=expand("<cword>")<CR>//g<left><left>
noremap <silent> <F8> :TagbarToggle<CR>
noremap <silent> <F7> :NERDTreeToggle<CR>
noremap <silent> <C-B> :CtrlPBuffer<CR>
noremap <silent> <C-P> :CtrlP<CR>
" }
" Plugins {
" Neocomplete {
" let g:neocomplete#enable_at_startup = 1
" let g:neocomplete#enable_smart_case = 1
" let g:neocomplete#sources#syntax#min_keyword_length = 3
" let g:neocomplete#lock_buffer_name_pattern = '\*ku\*'
" let g:neocomplete#enable_insert_char_pre = 1
" inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
" inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
" inoremap <expr><C-y> neocomplete#close_popup()
" inoremap <expr><C-e> neocomplete#cancel_popup()
" }
" Ctrlp {
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/tmp/*
set wildignore+=*.so,*.zip,*.jpg,*.gif,*.png,*.pdf,*.ico,*.sqlite*
let g:ctrlp_mruf_exclude = '/tmp/.*\|/temp/.*\|.git/.*'
let g:ctrlp_working_path_mode = 0
let g:ctrlp_arg_map = 1
let g:ctrlp_extensions = ['funky']
let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:10,results:20'
nnoremap <Leader>fu :CtrlPFunky<Cr>
" }
" Others {
let g:tagbar_width = 30
let g:airline_powerline_fonts=1
" let g:airline_theme='solarized'
vnoremap <silent> <Enter> :EasyAlign<cr>
" }
" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment