diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-07 11:51:31 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-07 11:51:31 +1300 |
commit | 04e90fcd534d4146becc0e20d0828e2ff48c3cdf (patch) | |
tree | dec7ca15c7f1a01187292d2cf81ce87861b874a6 | |
parent | Merge branch 'feature/bash-compl' into develop (diff) | |
parent | Bind <Leader>f to show current 'formatoptions' (diff) | |
download | dotfiles-04e90fcd534d4146becc0e20d0828e2ff48c3cdf.tar.gz dotfiles-04e90fcd534d4146becc0e20d0828e2ff48c3cdf.zip |
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.vim | 9 | ||||
-rw-r--r-- | vim/config/file.vim | 5 | ||||
-rw-r--r-- | vim/config/format.vim | 5 |
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') |