User Tools

Site Tools


vim

This is an old revision of the document!


Cheatsheet

Cookbook

Trouble Shooting

How to change file format and remove dos line endlings

  • If your vim show “[dos]” on the bottom, you can change it by
:e ++ff=unix
# similar commands include
:e ++ff=dos
:e ++ff=mac
  • To remove ^M
:%s/^M//g
# will do it if you use Ctrl-v Ctrl-m to input the ^M

How to change default font in windows

  • In C:\Users\<username>\_vimrc: ref
if has("gui_kde")
    set guifont=Consolas/13/-1/5/50/0/0/0/0/0
elseif has("gui_gtk")
    set guifont=Consolas\ 13
elseif has("gui_running")
    if has("win32") || has("win64")
        set guifont=Consolas:h12
    else
        set guifont=-xos4-terminus-medium-r-normal--14-140-72-72-c-80-iso8859-1
    endif
endif

How to enable ctrl+c/ctrl+v/ctrl+a etc in windows

  • Add “source $VIMRUNTIME/mswin.vim” into C:\Users\yxue\_vimrc
vim.1609690964.txt.gz · Last modified: 2021/01/03 16:22 by 127.0.0.1