可以使用VIM命令行,快速实现
例如:
file test.txt test.txt: ASCII text, with CRLF line terminators
执行命令
vim -c ":w ++ff=unix" -c "q" test.txt
file test.txt test.txt: ASCII text
来源:https://stackoverflow.com/questions/13522599/how-to-run-vim-commands-from-terminal
Use
vim --cmd 'Command launched before vimrc' \
-c 'Command launched after vimrc' \
-c 'qa!' # Quit vim
. For running a command in an existing vim session you have to use +clientserver feature: run one vim with
vim --servername vim
and others with
vim --remote-send '<C-\><C-n>:Command<CR>'
标签:LF,--,vim,UNIX,Command,test,CR,txt
From: https://www.cnblogs.com/profesor/p/18330514