aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-21 00:30:35 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-21 00:30:35 +1200
commitc6e7ed8353f313c6414214036f6485f6984d10ce (patch)
treee3f81c8df3049281faeecfecbb8c3da56c7d8a51
parent9974fda1136b394e2dab341e96e37cb2d8dc8aaa (diff)
parent370d2acf9cf0f8c74a162face48a7894fca61ba0 (diff)
downloaddotfiles-c6e7ed8353f313c6414214036f6485f6984d10ce.tar.gz
Merge branch 'release/v4.36.0'v4.36.0
* release/v4.36.0: Bump VERSION Add mappings and function for Markdown headings
-rw-r--r--VERSION4
-rw-r--r--vim/after/ftplugin/markdown.vim6
-rw-r--r--vim/autoload/markdown.vim6
3 files changed, 14 insertions, 2 deletions
diff --git a/VERSION b/VERSION
index a180255d..06f060d6 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v4.35.0
-Mon May 20 12:11:18 UTC 2019
+tejr dotfiles v4.36.0
+Mon May 20 12:30:34 UTC 2019
diff --git a/vim/after/ftplugin/markdown.vim b/vim/after/ftplugin/markdown.vim
index 7189a09a..6634924e 100644
--- a/vim/after/ftplugin/markdown.vim
+++ b/vim/after/ftplugin/markdown.vim
@@ -31,3 +31,9 @@ xnoremap <buffer> <expr> <LocalLeader>Q
\ quote#QuoteReformat()
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>Q'
\ . '|xunmap <buffer> <LocalLeader>Q'
+
+" Autoformat headings
+nnoremap <buffer> <LocalLeader>-
+ \ :<C-U>call markdown#Heading('-')<CR>
+nnoremap <buffer> <LocalLeader>=
+ \ :<C-U>call markdown#Heading('=')<CR>
diff --git a/vim/autoload/markdown.vim b/vim/autoload/markdown.vim
new file mode 100644
index 00000000..34c7bda7
--- /dev/null
+++ b/vim/autoload/markdown.vim
@@ -0,0 +1,6 @@
+" Add an underline under a heading
+function! markdown#Heading(char) abort
+ let heading = getline('.')
+ let underline = repeat(a:char, strlen(heading))
+ call append(line('.'), underline)
+endfunction