Vim plugin for the Haskell Yesod web framework.
- Syntax for
config/models
- Syntax for
config/routes
- Syntax for i18n
messages/
- Jump to handler files from declared routes
- Jump to and Create i18n messages
- Create new handlers for routes under the cursor while in
config/routes
Note: This plugin does not add syntax for shakesperean templates, there is another plugin that does: vim-syntax-shakespeare.
Compatible with Vundle
, Pathogen
, Vim-plug
.
vim-yesod gives you some predefined mappings:
Map | Command | Action |
---|---|---|
gh | :YesodOpenHandler | Jump to the handler of the route under the cursor |
gH | :YesodAddHandler | Create a new handler for the route under the cursor |
gm | :YesodOpenMessage | Jump to or create the i18n message under the cursor |
You can disable the predefined mappings with:
let g:yesod_disable_maps = 1
And then add your own like:
nnoremap <leader>H :YesodAddHandler<CR>
nnoremap <leader>h :YesodOpenHandler<CR>
nnoremap <leader>m :YesodOpenMessage<CR>
The Yesod default location for handlers is Handler
in the project root. If you
keep your handlers in more than one directory, lets say for instance:
src/
and moreHandlers/
, you can configure it like:
let g:yesod_handlers_directories = ['Handler', 'src', 'moreHandlers']
The Handlers directories you define will be searched recursively.
Default i18n language to use:
let g:yesod_messages_default_lang = "en"
Messages directory:
let g:yesod_messages_path = "messages"
config/models
and config/routes
files: