Skip to content

Commit

Permalink
ftdetect: remove autocommand nonsense
Browse files Browse the repository at this point in the history
it turns out, the rest is not necessary
  • Loading branch information
benknoble committed Dec 28, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 9a77bb8 commit af77abd
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions ftdetect/racket.vim
Original file line number Diff line number Diff line change
@@ -9,20 +9,12 @@ let g:racket_hash_lang_dict = get(g:, 'racket_hash_lang_dict',

" Tries to detect filetype from #lang line; defaults to ft=racket.
function! RacketDetectHashLang()
let redo_autocommands = !empty(&filetype)
let matches = matchlist(getline(1), g:racket_hash_lang_regexp)
if ! empty(matches)
execute 'set filetype='.get(g:racket_hash_lang_dict, matches[1], substitute(matches[1], '[/\*?[|<>]', '', 'g'))
else
set filetype=racket
endif
if redo_autocommands
if g:syntax_on
execute 'doautocmd syntaxset FileType' &filetype
endif
execute 'doautocmd filetypeplugin FileType' &filetype
execute 'doautocmd filetypeindent FileType' &filetype
endif
endfunction

au BufRead,BufNewFile *.rkt,*.rktl call RacketDetectHashLang()

0 comments on commit af77abd

Please sign in to comment.