Skip to content

Commit

Permalink
Move RenameFile out to a submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrisbin committed May 29, 2013
1 parent a7f0103 commit 29059c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Expand Up @@ -83,3 +83,7 @@
path = bundle/vim-mkdir
url = https://github.com/pbrisbin/vim-mkdir
ignore = dirty
[submodule "bundle/vim-rename-file"]
path = bundle/vim-rename-file
url = https://github.com/pbrisbin/vim-rename-file
ignore = dirty
1 change: 1 addition & 0 deletions bundle/vim-rename-file
Submodule vim-rename-file added at 90e27b
14 changes: 2 additions & 12 deletions vimrc
Expand Up @@ -62,8 +62,9 @@ inoremap (<CR> (<CR>)<C-o>O
nnoremap <C-l> :<C-u>nohlsearch<CR><C-l>
map <Leader>r :Run<CR>
map <Leader>m :make<CR>
map <Leader>n :RenameFile<CR>
map <Leader>r :Run<CR>
cmap w!! w !sudo tee % >/dev/null<CR>:e!<CR><CR>
Expand All @@ -79,14 +80,3 @@ function! RestoreCursor()
exe "normal g`\""
endif
endfunction

function! RenameFile()
let old_name = expand('%')
let new_name = input('New file name: ', old_name, 'file')

if new_name != '' && new_name != old_name
exec 'saveas ' . new_name
call delete(old_name)
endif
endfunction
map <Leader>n :call RenameFile()<CR>

0 comments on commit 29059c7

Please sign in to comment.