diff --git a/vimrc b/vimrc index fa7783a..26a9fca 100644 --- a/vimrc +++ b/vimrc @@ -7,6 +7,7 @@ Plug 'nanotech/jellybeans.vim' " keepers Plug 'airblade/vim-gitgutter' +Plug 'atomaka/renamefile.vim' Plug 'bronson/vim-trailing-whitespace' Plug 'ctrlpvim/ctrlp.vim' Plug 'rbgrouleff/bclose.vim' @@ -114,8 +115,9 @@ map 4 :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab map a :set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab " plugin -map bi :PlugInstall -map bu :PlugUpdate +map pc :PlugClean +map pi :PlugInstall +map pu :PlugUpdate " clear search map cs :let @/ = "" @@ -128,7 +130,7 @@ nnoremap BD :Bclose! " other map fw :FixWhitespace map pm :set paste! -map sa :call RenameFile() +map sa :RenameFile map se :e ~/.vimrc map sz :so ~/.vimrc @@ -139,15 +141,3 @@ syntax enable " go let g:go_fmt_command = "goimports" - -" FUNCTIONS -" Rename current file - from github/garybernhardt -function! RenameFile() - let old_name = expand('%') - let new_name = input('New file name: ', expand('%'), 'file') - if new_name != '' && new_name != old_name - exec ':saveas ' . new_name - exec ':silent !rm ' . old_name - redraw! - endif -endfunction