Provide dos2unix and unix2dos interactive commands.

This commit is contained in:
ralesi 2015-08-27 23:13:40 -07:00 committed by syl20bnr
parent 44dee74247
commit 39967189b9
2 changed files with 13 additions and 0 deletions

View File

@ -1025,6 +1025,17 @@ the right."
(call-interactively 'evil-write)
(call-interactively 'write-file)))
(defun spacemacs/dos2unix ()
"Converts the current buffer to UNIX file format."
(interactive)
(set-buffer-file-coding-system 'undecided-unix nil))
(defun spacemacs/unix2dos ()
"Converts the current buffer to DOS file format."
(interactive)
(set-buffer-file-coding-system 'undecided-dos nil))
(defun spacemacs/copy-file ()
"Write the file under new name."
(interactive)

View File

@ -119,6 +119,8 @@ Ensure that helm is required before calling FUNC."
"feD" 'spacemacs/ediff-dotfile-and-template
"feR" 'dotspacemacs/sync-configuration-layers
"fev" 'spacemacs/display-and-copy-version
"fCd" 'spacemacs/unix2dos
"fCu" 'spacemacs/dos2unix
"fg" 'rgrep
"fj" 'dired-jump
"fl" 'find-file-literally