Skip to content

Instantly share code, notes, and snippets.

@ezuk
Created October 20, 2015 11:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ezuk/ca7b061d9ab769c0c735 to your computer and use it in GitHub Desktop.
Save ezuk/ca7b061d9ab769c0c735 to your computer and use it in GitHub Desktop.
set expandtab
set shiftwidth=2
set softtabstop=2
set cpoptions=aABceFsy
set relativenumber
set number
nnoremap <NL> i<CR><Esc>
autocmd Filetype yaml nmap yp :YamlGetFullPath<CR>
let g:gist_post_private = 1
let g:multi_cursor_exit_from_visual_mode = 0
let g:multi_cursor_exit_from_insert_mode = 0
" Different snippet folder, to back up my snippets to git
let g:neosnippet#snippets_directory='~/.dotfiles/.snippets'
" SuperTab like snippets behavior.
imap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)"
\: pumvisible() ? "\<C-n>" : "\<TAB>"
" list buffers with Ctrl-B
nmap <C-b> :CtrlPBuffer<CR>
" Arrow keys exit out of insert mode automatically
inoremap <silent> <Up> <ESC><Up>
inoremap <silent> <Down> <ESC><Down>
inoremap ;; <Esc><Right>
vnoremap ;; <Esc>
" My custom commands
command MakeItLink s/\[\(.*\)\](.*)/%{link: \1}/
" Make CtrlP faster
let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' }
" Allow closing buffers in CtrlP buffer list using c-2
let g:ctrlp_buffer_func = { 'enter': 'CtrlPMappings' }
function! CtrlPMappings()
nnoremap <buffer> <silent> <C-@> :call <sid>DeleteBuffer()<cr>
endfunction
function! s:DeleteBuffer()
let path = fnamemodify(getline('.')[2:], ':p')
let bufn = matchstr(path, '\v\d+\ze\*No Name')
exec "bd" bufn ==# "" ? path : bufn
exec "norm \<F5>"
endfunction
" Fixes slow speed due to syntax highlighting
set re=1
syntax sync minlines=256
" Git grep the word under the cursor using ,pf
nmap <leader>pf "zyiw:exe "Ggrep ".@z.""<bar> copen <CR>"
" Make a new line with binding.pry when I use ,bp
nmap <leader>bp obinding.pry<ESC>
" search and replace selected text in visual mode
vnoremap <C-r> "hy:%s/<C-r>h//gc<left><left><left>
" properly wrap lines
command! -nargs=* Wrap set wrap linebreak nolist
" bright active line for bright themes
command DarkMode set background=dark
command BrightMode set background=light
"fix "press Enter to contine"
set cmdheight=2
" Start interactive EasyAlign in visual mode (e.g. vip<Enter>)
vmap <Enter> <Plug>(EasyAlign)
" " Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)
let g:vroom_use_vimux = 1
let g:vroom_use_spring = 1
" First test run
map <Leader>t :call vroom#RunTestFile({'runner':'rvm reload;spring testunit'})<CR>
map <Leader>r :call vroom#RunTestFile({'runner':'spring testunit'})<CR>
" Host specific config
let hostfile=$HOME.'/.vimrc.local.'.hostname()
if filereadable(hostfile)
exe 'source ' . hostfile
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment