From e85e3a2549fdbc2c3391ec92d4c179642d05bffb Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 7 Nov 2017 11:45:50 +1300 Subject: Add \p Vim binding to show filetype --- vim/config/file.vim | 5 +++++ 1 file changed, 5 insertions(+) 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 + \ p + \ :set filetype? + " Use all ancestors of current directory for :find if has('file_in_path') set path=** -- cgit v1.2.3 From dc0ab08ed472c4db827360bfc9f5959e675a6c8a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 7 Nov 2017 10:21:25 +1300 Subject: Add leader bindings for date stamping \d adds local time, \D adds UTC time. --- vim/config/command.vim | 9 +++++++++ 1 file changed, 9 insertions(+) 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 + \ d + \ :read !date +" \D inserts the current UTC date from date(1) +nnoremap + \ D + \ :read !date -u -- cgit v1.2.3 From 35dbef982a4040158aee506873825c5d2f8db4f6 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 7 Nov 2017 10:10:44 +1300 Subject: Bind f to show current 'formatoptions' I think this option has become overloaded in recent versions and that these would make more sense and be more manageable as separate but interacting options. --- vim/config/format.vim | 5 +++++ 1 file changed, 5 insertions(+) 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 + \ f + \ :setlocal formatoptions? + " Use toggle_option_flag.vim plugin to bind quick toggle actions for some " 'formatoptions' flags if has('user_commands') -- cgit v1.2.3