aboutsummaryrefslogtreecommitdiff
path: root/plugin/alternate_filetypes.vim
blob: 45e8009be39759423c095160ccf289e2d2ce6dcb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"
" alternate_filetypes.vim: Switch buffer to related filetypes, e.g. HTML while
" editing PHP, or AWK/sed while editing shell script.
"
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
if exists('loaded_alternate_filetypes') || &compatible
  finish
endif

" User command to switch to alternate filetype and display it
command -bar AlternateFileType
      \ call alternate_filetypes#() | set filetype?

" Mapping target to run user command
nnoremap <Plug>(AlternateFileType)
      \ :<C-U>AlternateFileType<CR>