aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-16 09:22:44 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-16 09:22:44 +1200
commitd7491b213b2f0df6da97f2f1c951cb070b9513a5 (patch)
treea3a2df95aae0f674dd21736a9ab1d13c31de96e4 /vim/autoload
parentMerge branch 'release/v1.30.0' (diff)
parentBump VERSION (diff)
downloaddotfiles-d7491b213b2f0df6da97f2f1c951cb070b9513a5.tar.gz
dotfiles-d7491b213b2f0df6da97f2f1c951cb070b9513a5.zip
Merge branch 'release/v1.31.0'v1.31.0
* release/v1.31.0: Bump VERSION Add shebang_create_exec.vim plugin Add missing <buffer> to mail quote unmaps Update plugins Remove pattern \m where not needed for 'magic' Simplify/correct Korn shell shebang matching Use non-capturing groups in VimL where appropriate Use \= in preference to \+ in VimL patterns Add plugin file for setting 'wildignore' Update auto_cache_dirs.vim plugin Check for +autocmd before gitcommit ftplugin hooks Adaptive 'colorcolumn' for gitcommit filetype
Diffstat (limited to 'vim/autoload')
-rw-r--r--vim/autoload/gitcommit.vim20
1 files changed, 20 insertions, 0 deletions
diff --git a/vim/autoload/gitcommit.vim b/vim/autoload/gitcommit.vim
new file mode 100644
index 00000000..56b35ba6
--- /dev/null
+++ b/vim/autoload/gitcommit.vim
@@ -0,0 +1,20 @@
+" Choose the color column depending on non-comment line count
+function! gitcommit#CursorColumn() abort
+
+ " Last line number
+ let l:ll = line('$')
+
+ " If we can find a line after the first that isn't a comment, we're
+ " composing the message
+ if l:ll > 1
+ for l:li in range(2, l:ll)
+ if getline(l:li) !~# '^\s*#'
+ return '+1'
+ endif
+ endfor
+ endif
+
+ " Otherwise, we're still composing our subject
+ return '51'
+
+endfunction