Skip to content

Instantly share code, notes, and snippets.

View kshenoy's full-sized avatar

Kartik Shenoy kshenoy

  • AMD
  • Fort Collins, CO
View GitHub Profile
@kshenoy
kshenoy / IListpp.vim
Last active August 29, 2015 13:57 — forked from dahu/gist:9718037
An unholy amalgam of [I and :ilist. This function allows to specify a pattern and then displays all lines matching that pattern and also jumps to one of the lines
function! IListpp()
let term = input("IList: /")
if term == ''
let term = expand('<cword>')
endif
let v:errmsg = ''
redir =>slist
exe 'ilist /' . term
redir END
if v:errmsg == ''
" Statusline modifications, added Fugitive Status Line & Syntastic Error Message
let g:last_mode = ''
function! Mode()
let l:mode = mode()
if l:mode !=# g:last_mode
let g:last_mode = l:mode
hi User2 guifg=#005f00 guibg=#dfff00 gui=BOLD ctermfg=22 ctermbg=190 cterm=BOLD
hi User3 guifg=#FFFFFF guibg=#414243 ctermfg=255 ctermbg=241
" Motion for "next/last object".
" For example, 'din(' will go to the Next '()' pair and delete its contents.
" and 'dip(' will go to the Previous '()' pair and delete its contents.
onoremap an :<c-u>call <SID>NextTextObject('a', 'f')<cr>
xnoremap an :<c-u>call <SID>NextTextObject('a', 'f')<cr>
onoremap in :<c-u>call <SID>NextTextObject('i', 'f')<cr>
xnoremap in :<c-u>call <SID>NextTextObject('i', 'f')<cr>
onoremap ap :<c-u>call <SID>NextTextObject('a', 'F')<cr>