aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-07 11:51:31 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-07 11:51:31 +1300
commit04e90fcd534d4146becc0e20d0828e2ff48c3cdf (patch)
treedec7ca15c7f1a01187292d2cf81ce87861b874a6
parent361c3986369d4a705328ad17aa0038e9380b44d7 (diff)
parent35dbef982a4040158aee506873825c5d2f8db4f6 (diff)
downloaddotfiles-04e90fcd534d4146becc0e20d0828e2ff48c3cdf.tar.gz
Merge branch 'feature/vim-mappings' into develop
* feature/vim-mappings: Bind <Leader>f to show current 'formatoptions' Add leader bindings for date stamping Add \p Vim binding to show filetype
-rw-r--r--vim/config/command.vim9
-rw-r--r--vim/config/file.vim5
-rw-r--r--vim/config/format.vim5
3 files changed, 19 insertions, 0 deletions
diff --git a/vim/config/command.vim b/vim/config/command.vim
index f339635f..09ee0f40 100644
--- a/vim/config/command.vim
+++ b/vim/config/command.vim
@@ -25,3 +25,12 @@ set shellpipe=>
if exists('+shellslash')
set shellslash
endif
+
+" \d inserts the current local date from date(1)
+nnoremap <silent>
+ \ <Leader>d
+ \ :<C-U>read !date<CR>
+" \D inserts the current UTC date from date(1)
+nnoremap <silent>
+ \ <Leader>D
+ \ :<C-U>read !date -u<CR>
diff --git a/vim/config/file.vim b/vim/config/file.vim
index 4bf1f86b..a0c99f6c 100644
--- a/vim/config/file.vim
+++ b/vim/config/file.vim
@@ -3,6 +3,11 @@ if has('autocmd')
filetype plugin indent on
endif
+" Bind \p to show filetype
+nnoremap <silent>
+ \ <Leader>p
+ \ :<C-U>set filetype?<CR>
+
" Use all ancestors of current directory for :find
if has('file_in_path')
set path=**
diff --git a/vim/config/format.vim b/vim/config/format.vim
index e266f42a..e1da2d0b 100644
--- a/vim/config/format.vim
+++ b/vim/config/format.vim
@@ -2,6 +2,11 @@
" leaders when joining lines
silent! set formatoptions+=j
+" Show the current formatoptions at a glance
+noremap <silent>
+ \ <Leader>f
+ \ :<C-U>setlocal formatoptions?<CR>
+
" Use toggle_option_flag.vim plugin to bind quick toggle actions for some
" 'formatoptions' flags
if has('user_commands')