aboutsummaryrefslogtreecommitdiff
path: root/vim/ftplugin/textarea.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-03-28 15:26:31 +1300
committerTom Ryder <tom@sanctum.geek.nz>2019-03-28 15:26:31 +1300
commit80b398502a752dafdbb8187f72e85d8c1f7fc5ae (patch)
tree9ada42a4d274b46fa28af8a277a087ec02f6ffa0 /vim/ftplugin/textarea.vim
parent751214f93b38940097bc2e0e22e8a1dad3838fdf (diff)
downloaddotfiles-80b398502a752dafdbb8187f72e85d8c1f7fc5ae.tar.gz
dotfiles-80b398502a752dafdbb8187f72e85d8c1f7fc5ae.zip
Add textarea filetype
This custom filetype is just a hook to hang functionality for TextEditorAnywhere documents under Windows. Most of the time, it's me writing email, or comments that benefit from email formatting, so I've configured <LocalLeader>f to switch to the mail filetype. This switching could probably benefit from a plugin, actually.
Diffstat (limited to 'vim/ftplugin/textarea.vim')
-rw-r--r--vim/ftplugin/textarea.vim10
1 files changed, 10 insertions, 0 deletions
diff --git a/vim/ftplugin/textarea.vim b/vim/ftplugin/textarea.vim
new file mode 100644
index 00000000..b5c5ca98
--- /dev/null
+++ b/vim/ftplugin/textarea.vim
@@ -0,0 +1,10 @@
+" Stop here if the user doesn't want ftplugin mappings
+if exists('g:no_plugin_maps') || exists('g:no_textarea_maps')
+ finish
+endif
+
+" Switch to mail filetype, just because that's very often the contents of text
+" areas I edit using TextEditorAnywhere
+nnoremap <buffer> <LocalLeader>f
+ \ :<C-U>setlocal filetype=mail<CR>
+let b:undo_ftplugin = '|nunmap <buffer> <LocalLeader>f'