Vim User Manual 阅读笔记 Usr_05.txt Set your settings 设置你的设置

如果已经存在vimrc文件

If you already have a vimrc file (e.g., when your sysadmin has one setup for you), you can edit it this way: >

:edit $MYVIMRC

不同操作系统中的配置文件

For Unix and Macintosh this file is always used and is recommended:

~/.vimrc

For MS-Windows you can use one of these:

$HOME/_vimrc

$VIM/_vimrc

如果首次创建vimrc给所有用户

If you are creating the vimrc file for the first time, it is recommended to put this line at the top: >

source $VIMRUNTIME/defaults.vim

This initializes Vim for new users (as opposed to traditional Vi users). See |defaults.vim| for the details.

*05.4* Simple mappings 简单映射

:map 命令

*05.5* Adding a package 添加包 *add-package* *matchit-install*

A package is a set of files that you can add to Vim. There are two kinds of packages: optional and automatically loaded on startup.

安装

解压到 ~/.vim/pack/ 下的某个子目录下

*05.6* Adding a plugin 添加插件 *add-plugin* *plugin*
USING A GLOBAL PLUGIN 全局插件

a Vim script file that is loaded automatically when Vim starts

复制到 ~/.vim/plugin/目录下即可,可以使用子目录组织。

system plugin directory ~

Unix ~/.vim/plugin/

PC HOME/vimfiles/plugin or VIM/vimfiles/plugin

Amiga s:vimfiles/plugin

Macintosh $VIM:vimfiles:plugin

Mac OS X ~/.vim/plugin/

FILETYPE PLUGINS 文件类型插件 *add-filetype-plugin* *ftplugins*

在子目录 ~/.vim/ftplugin/文件类型名.vim ,如果重复可以用 <文件类型名>_too.vim,换名字不在 该文件类型名下 起作用了,下划线是用来保证不冲突。

*05.7* Adding a help file 包的帮助文件 *add-local-help*

plug的helpfile,安放好plug之后,把帮助文件放到 ~/.vim/doc 目录下。Copy the help file to the "doc" directory. >

:!cp /tmp/doit.txt ~/.vim/doc

Now comes the trick, which allows you to jump to the subjects in the new help file: Generate the local tags file with the |:helptags| command. >

:helptags ~/.vim/doc

Now you can use the >

:help doit

*05.8* The option window 选项窗口

各类设置值可在此处查看并修改,在同一窗口文件中。

:options

*05.9* Often used options 常用选项

修改配置弄乱了后,复位

:set iskeyword&

NOT WRAPPING LINES

自动换行 :Set nowrap

Vim会卷动到原本不可见的词,如果用户移动到这些词

自动滚动 :set sidescroll=10

WRAPPING MOVEMENT COMMANDS

设置哪个键移动到词可以自动移动到 上/下 一行

VIEWING TABS

Set list 查看制表符等不可见符号

ROOM FOR MESSAGES

:set cmdheight=3

设置命令窗口高度

相关推荐
zyplayer-doc14 分钟前
研发接口文档怎么长期维护:zyplayer-doc把API、Markdown和变更记录放进同一个知识库
大数据·数据库·人工智能·笔记·pdf·ocr
2CM_Embed17 分钟前
F28379D 下载后 VOFA+ 无数据、Reset 后恢复:一次 TZ 中断误触发排查记录
笔记·单片机·sci·c2000·f28379d·vofa·tz
●VON1 小时前
鸿蒙 PC Markdown 编辑器链接补全与离线校验:中文路径、标题锚点与授权边界
华为·编辑器·harmonyos·鸿蒙
蓝创工坊Blue Foundry1 小时前
本地 PDF、图片字段提取到 Excel:用文档工作台的完整流程
python·ocr·vim·paddlepaddle
星恒随风1 小时前
C++ STL 详解:list 的使用、迭代器失效、模拟实现与 vector 对比
开发语言·数据结构·c++·笔记·学习·list
●VON1 小时前
鸿蒙 PC Markdown 编辑器快速打开:模糊排序、最近权重与纯键盘路径
华为·编辑器·计算机外设·harmonyos·鸿蒙
●VON1 小时前
鸿蒙 PC Markdown 编辑器命令面板:把桌面高频操作收束到一个入口
服务器·华为·编辑器·harmonyos·鸿蒙
一起努力啊~2 小时前
DataWhale组队学习笔记--llm-algo-leetcode(五)
笔记·学习·llm
是上好佳佳佳呀3 小时前
【机器学习|DAY03】K近邻算法(KNN)笔记
笔记·机器学习·近邻算法
圣光SG13 小时前
Servlet学习笔记
笔记·学习·servlet