Skip to content

Instantly share code, notes, and snippets.

@ik9999
Last active January 24, 2016 21:35
Show Gist options
  • Save ik9999/6e485d3d7f43821cbd3a to your computer and use it in GitHub Desktop.
Save ik9999/6e485d3d7f43821cbd3a to your computer and use it in GitHub Desktop.
.vimrc
"NeoBundle
if 0 | endif
if has('vim_starting')
if &compatible
set nocompatible
endif
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
call neobundle#begin(expand('~/.vim/bundle/'))
NeoBundleFetch 'Shougo/neobundle.vim'
NeoBundle 'gmarik/Vundle.vim'
NeoBundle 'tpope/vim-fugitive'
NeoBundle 'L9'
NeoBundle 'rstacruz/sparkup', {'rtp': 'vim/'}
NeoBundle 'easymotion/vim-easymotion'
NeoBundle 'flazz/vim-colorschemes'
NeoBundle 'scrooloose/nerdcommenter'
NeoBundle 'scrooloose/nerdtree'
NeoBundle 'jelera/vim-javascript-syntax'
NeoBundle 'pangloss/vim-javascript'
NeoBundle 'nathanaelkane/vim-indent-guides'
NeoBundle 'benekastah/neomake'
NeoBundle 'Valloric/YouCompleteMe', { 'do': './install.sh' }
NeoBundle 'marijnh/tern_for_vim'
NeoBundle 'xolox/vim-misc'
NeoBundle 'xolox/vim-notes'
NeoBundle '907th/vim-auto-save'
NeoBundle 'airblade/vim-gitgutter'
NeoBundle 'ik9999/mru'
NeoBundle 'vim-scripts/ReplaceWithRegister'
NeoBundle 'ik9999/grep'
NeoBundle 'hail2u/vim-css3-syntax'
NeoBundle 'kien/ctrlp.vim'
NeoBundle 'wavded/vim-stylus'
NeoBundle 'mattn/emmet-vim'
NeoBundle 'vim-scripts/cbackup.vim'
NeoBundle 'Valloric/MatchTagAlways'
NeoBundle 'editorconfig/editorconfig-vim'
NeoBundle 'othree/html5.vim'
"Plugin 'ft_improved'
NeoBundle 'justinmk/vim-sneak'
NeoBundle 'SirVer/ultisnips'
NeoBundle 'honza/vim-snippets'
NeoBundle 'othree/yajs.vim'
NeoBundle 'othree/javascript-libraries-syntax.vim'
NeoBundle 'mbbill/undotree'
NeoBundle 'ik9999/purple-monochrome-vim'
call neobundle#end()
NeoBundleCheck
"Main
filetype off
set hidden
set tabstop=2
set backspace=indent,eol,start
set autoindent
set copyindent
set shiftwidth=2
set expandtab
set shiftround
set nocompatible
set smarttab
set number
set incsearch
set ignorecase
set smartcase
set hlsearch
set history=1000
set undolevels=1000
set title
set visualbell
set noerrorbells
set nobackup
set noswapfile
set clipboard=unnamedplus
set background=light
let g:python_host_prog='/usr/bin/python'
let g:python_host_skip_check = 1
set shell=/bin/bash
set guioptions-=m
set guioptions-=T
set guioptions-=r
set guioptions-=L
set cursorline
set ruler
set laststatus=2
set relativenumber
set foldmethod=indent
set foldlevel=99
set ttyfast
set notimeout
set ttimeout
set nocindent
set indentexpr=
syntax enable
filetype plugin indent on
autocmd BufLeave,FocusLost * silent! wall
set omnifunc=syntaxcomplete#Complete
set viminfo='20,<9000,s9000
"Design
colorscheme purple-monochrome-vim
set fillchars+=vert:\
set guicursor=n-v-c:block-Cursor
set guicursor+=i:ver100-iCursor
set guicursor+=n-v-c:blinkon0
set guicursor+=i:blinkwait10
let &t_SI = "\<Esc>]50;CursorShape=1\x7" " Vertical line in insert mode
let &t_EI = "\<Esc>]50;CursorShape=0\x7" " Block in normal mode
if version >= 700
au InsertEnter * hi StatusLine guifg=#4D4D4D guibg=#FFFFFF gui=bold
au InsertLeave * hi StatusLine guifg=#FFFFFF guibg=#5B5B5B gui=bold
endif
set statusline+=%F
"Various bindings
nnoremap <Leader>g :let @+=expand('%:p')<CR>
noremap <Leader>d "_d
vnoremap <Leader>d "_d
noremap <Leader>c "_c
vnoremap <Leader>c "_c
noremap <Leader>x "_x
vnoremap <Leader>x "_x
"vnoremap <silent> <expr> <Leader>p <sid>Repl()
map <Leader>n :nohl<CR>
map <Leader>q <C-W>h
map <Leader>e <C-W>l
map <Leader>j <C-W>j
map <Leader>k <C-W>k
map <Leader>o <C-O>
map <Leader>i <C-I>
vmap <Leader>p gr
vmap <Leader>P gr
map <Leader>w %
nnoremap <Tab>y 0y$
nnoremap <Tab>W i<space><esc>
nnoremap <Tab>w a<space><esc>
map <Tab>q :q<CR>
nnoremap <Tab>n a<enter><esc>
nnoremap <Tab>N i<enter><esc>
nnoremap <Tab>j :m .+1<CR>==
nnoremap <Tab>k :m .-2<CR>==
vnoremap <Tab>j :m '>+1<CR>gv=gv
vnoremap <Tab>k :m '<-2<CR>gv=gv
map <Tab>p o<C-R>+<esc>$
map <Tab>P O<C-R>+<esc>$
map <Tab>e :w<CR>
map <Tab>; :
"Easymotion
let g:EasyMotion_leader_key = '<Leader>'
let g:EasyMotion_smartcase = 1
let g:EasyMotion_do_mapping = 0
"Acejump
nnoremap <Leader>s :call AceJump()<CR>
:nmap j gj
:nmap k gk
"Vimnotes
let g:notes_directories = ['~/.vimnotes']
let g:notes_suffix = '.txt'
"Nerdtree
map <Leader>t :NERDTreeFind<CR>
let NERDTreeShowHidden=1
let NERDTreeShowLineNumbers=1
let g:NERDTreeWinSize = 53
autocmd FileType nerdtree setlocal relativenumber
"Autosave
let g:auto_save = 1
let g:auto_save_in_insert_mode = 0
let g:auto_save_silent = 1
"Neomake
let g:neomake_javascript_enabled_makers = ['eslint']
autocmd! BufWritePost * :Neomake
autocmd! BufRead * :Neomake
"YouCompleteMe
let g:ycm_add_preview_to_completeopt=1
let g:ycm_confirm_extra_conf=0
let g:ycm_register_as_syntastic_checker = 0
let g:ycm_complete_in_comments = 1
let g:ycm_collect_identifiers_from_comments_and_strings = 1
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_seed_identifiers_with_syntax = 1
let g:ycm_key_list_select_completion = ['<Tab>']
let g:ycm_key_list_previous_completion = ['<S-Tab>']
augroup PreviewOnBottom
autocmd InsertEnter * set splitbelow
autocmd InsertLeave * set splitbelow!
augroup END
"NerdCommenter
map <Leader>z :call NERDComment(0,"toggle")<C-m>
"MRU
map <Leader>r :MRU<CR>
"Autostart
autocmd VimEnter * NERDTree
autocmd VimEnter * wincmd p
autocmd BufNewFile,BufRead *.styl set filetype=stylus
autocmd FileType javascript setlocal omnifunc=tern#Complete
autocmd FileType css,scss,styl,stylus,html set iskeyword=@,48-57,_,-,?,!,192-255
autocmd FileType css,scss,styl,stylus set omnifunc=csscomplete#CompleteCSS
autocmd BufNewFile,BufRead *.{stylus,styl} set ft=stylus.css
"Url open
function! HandleURL()
let s:uri = matchstr(getline("."), '[a-z]*:\/\/[^ >,;]*')
echo s:uri
if s:uri != ""
silent exec "!xdg-open '".s:uri."'"
else
echo "No URI found in line."
endif
endfunction
map <Leader>u :call HandleURL()<cr>
"Eclim
"let g:EclimCompletionMethod = 'omnifunc'
"let g:EclimKeepLocalHistory = 1
"let g:EclimJavascriptValidate = 0
"let g:EclimHtmlValidate = 0
"let g:EclimLocateFileDefaultAction = 'edit'
"map <Leader>f :LocateFile<CR>
"copypath.vim
let g:copypath_copy_to_unnamed_register = 1
"Ctrlp
let g:ctrlp_working_path_mode = 'ra'
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git\|build\'
"Backup
let g:backup_directory = $HOME.'/.vimbackup'
let g:backup_purge = 50
"Emmet
let g:user_emmet_install_global = 0
autocmd FileType html,css EmmetInstall
"Sneak
nmap <Tab>s <Plug>Sneak_s
nmap <Tab>S <Plug>Sneak_S
xmap <Tab>s <Plug>Sneak_s
xmap <Tab>S <Plug>Sneak_S
omap <Tab>s <Plug>Sneak_s
map <Tab>S <Plug>Sneak_S
nmap f <Plug>Sneak_f
nmap F <Plug>Sneak_F
xmap f <Plug>Sneak_f
xmap F <Plug>Sneak_F
omap f <Plug>Sneak_f
omap F <Plug>Sneak_F
nmap t <Plug>Sneak_t
nmap T <Plug>Sneak_T
xmap t <Plug>Sneak_t
xmap T <Plug>Sneak_T
omap t <Plug>Sneak_t
omap T <Plug>Sneak_T
"pangloss/vim-javascript
"let b:javascript_fold = 0
"Ultrasnips
let g:UltiSnipsExpandTrigger="<c-d>"
let g:UltiSnipsJumpForwardTrigger="<c-s>"
let g:UltiSnipsJumpBackwardTrigger="<c-x>"
let g:UltiSnipsEditSplit="vertical"
"javascript-libraries-syntax
let g:used_javascript_libs = 'jquery,angularjs,jasmine'
"Undo tree
function! Undotree_CustomToggle()
if (!exists('t:undotree') || !t:undotree.IsVisible())
call UndotreeToggle()
endif
call UndotreeFocus()
endfunction
function g:Undotree_CustomMap()
nnoremap <buffer> <tab> <NOP>
endfunction
nnoremap <Leader>a :call Undotree_CustomToggle()<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment