Last active
June 3, 2018 16:05
-
-
Save eloytoro/4d913da0d20aa3b40a632894c14ac13f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ---------------------------------------------------------------------------- | |
" 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