`
zhangziyueup
  • 浏览: 1171240 次
文章分类
社区版块
存档分类
最新评论

SSH远程使用vi编辑模式方向键不能用解决

 
阅读更多

将以下内容加入~/.vimrc,记得先备份

ifv:progname=~?"evim"

finish

endif

"UseVimsettings,ratherthenVisettings(muchbetter!).

"Thismustbefirst,becauseitchangesotheroptionsasasideeffect.

setnocompatible

"allowbackspacingovereverythingininsertmode

setbackspace=indent,eol,start

ifhas("vms")

setnobackup"donotkeepabackupfile,useversionsinstead

else

setbackup"keepabackupfile

endif

sethistory=50"keep50linesofcommandlinehistory

setruler"showthecursorpositionallthetime

setshowcmd"displayincompletecommands

setincsearch"doincrementalsearching

"ForWin32GUI:remove't'flagfrom'guioptions':notearoffmenuentries

"let&guioptions=substitute(&guioptions,"t","","g")

"Don'tuseExmode,useQforformatting

mapQgq

"Thisisanalternativethatalsoworksinblockmode,butthedeleted

"textislostanditonlyworksforputtingthecurrentregister.

"vnoremapp"_dp

"Switchsyntaxhighlightingon,whentheterminalhascolors

"Alsoswitchonhighlightingthelastusedsearchpattern.

if&t_Co>2||has("gui_running")

syntaxon

sethlsearch

endif

"Onlydothispartwhencompiledwithsupportforautocommands.

ifhas("autocmd")

"Enablefiletypedetection.

"Usethedefaultfiletypesettings,sothatmailgets'tw'setto72,

"'cindent'isoninCfiles,etc.

"Alsoloadindentfiles,toautomaticallydolanguage-dependentindenting.

filetypepluginindenton

"Puttheseinanautocmdgroup,sothatwecandeletethemeasily.

augroupvimrcEx

au!

"Foralltextfilesset'textwidth'to78characters.

autocmdFileTypetextsetlocaltextwidth=78

"Wheneditingafile,alwaysjumptothelastknowncursorposition.

"Don'tdoitwhenthepositionisinvalidorwheninsideaneventhandler

"(happenswhendroppingafileongvim).

autocmdBufReadPost*

/ifline("'/"")>0&&line("'/"")<=line("$")|

/exe"normalg`/""|

/endif

augroupEND

else

setautoindent"alwayssetautoindentingon

endif"has("autocmd")

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics