Skip to content

Instantly share code, notes, and snippets.

@eloytoro
Last active June 3, 2018 16:05
Show Gist options
  • Save eloytoro/4d913da0d20aa3b40a632894c14ac13f to your computer and use it in GitHub Desktop.
Save eloytoro/4d913da0d20aa3b40a632894c14ac13f to your computer and use it in GitHub Desktop.
" ----------------------------------------------------------------------------
" HL | Find out syntax group
" ----------------------------------------------------------------------------
function! s:hl()
return map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunction
" ----------------------------------------------------------------------------
" ¯\_(ツ)_/¯
" ----------------------------------------------------------------------------
function! Shrug()
let hl = s:hl()
if &filetype == 'markdown' && index(hl, 'markdownCode') == -1
return "¯\\\\\\_(ツ)\\_/¯"
endif
return "¯\\_(ツ)_/¯"
endfunction
inoremap <silent> <c-\> <C-R>=Shrug()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment