转)vimscript in 5 minus
学习 vimscript 理解原生 vim 的配置方法,Reference:
学习 vimscript 理解原生 vim 的配置方法,Reference:
Chose Your Dotfile to start the vim
1 |
|
This Chapter mainly introduces the Recorder in vim,Which is used to do some repeated operations.This function is also called a macro.
for more information try :help recording
This section will introduce related concept/function of recording function. Which help us to understand how this works, and what we should pay attention to it.
register of vim: register is a superset of macro, it contains more function. In this part we should know, register can store some string or operations to help subsequent use.
Status:
Using :registers
or :reg
to check those we have registered, or add the registers’s name behind to show those u’re interested in.
1 |
|
Lifecycle
The information in registers will not disappear with the window closed. But maybe with the system-level’s open-close. we should test this!!! So we can store some snippet,pwd,etc.
this is the Note record the vimtutor (the basic usage of vim.)
@Aiken 2021
Most of the command can use NUM
to repeat it.d num
command means delete num
times with args below:c
means del and change mode to insert:
@Aiken 2021 this file is use to record how to config out vim’ by spacevim.
I’ll write this doc with three Parts:
Install: SpaceVim via the offical websize:
1 |
|
@Aikenhong 2021
Vim is a important consistant for editing file in shell. It’s Hightly Customized for Everyone, In this part I’ll Show my personal Vim comfigurations
And I’ll Discuss about the diff between Spacevim & Neovim.
Give a conclusion in advance: Recommand Config the Vim for Yourself
基于NeoVim进行配置,不采用SpaveVim的配置文件,这里需要建议采用最新的测试版的NeoVim(>= 0.5),Stable的NVim已经很久没有更新,对一些新的插件缺乏支持。
Installing Neovim Download NeoVim Package and Install from source
or Install from neovim-ppa Like Following:
1 |
|
该配置笔记于 20230521 重新整理。默认的 Vimrc 位置为
/usr/share/vim/vimrc
,也可以在 vim 界面使用:echo $MYVIMRC
查看当前的配置文件,默认使用的配置文件地址为~/.vimrc
参考文献地址:Good VimRC | Backspace | AutoCmd | VIM配置入门
配置文件地址:AikenDotfile,本文这里只介绍部分配置,一些过于常见的配置等等这里就不再介绍,在 dotfile 中对每行配置均有的细致的注释。
基于 VimScript) 该 blog 主要记录基础 vim 的配置文件编写,旨在使用基础 vim 的时候也能有一个较好的代码编辑体验,同时提供部分 keymap 集成一些简单的功能,方便文档编写时候的格式转换等。这个配置文件在后续配置 nvim 的时候部分配置也会沿用。
自动检测文件修改,以及对多个文件的 workspace 自动切换
1 |
|
设置 vim 对鼠标的支持,支持鼠标选择等
1 |
|
设置和系统同步的剪切板,WSL 下的剪切板设置可以参考下面文章 WSL2 clipboard not shared between Linux and Windows || Reddit - Dive into anything
1 |
|
多次编辑同一个文件的时候保持 Undo 的历史记录,便于对同一个文件进行编辑。
1 |
|
通过上述命令启用 undofile 的选项,并设置存储目录,这里需要注意的是,存储目录需要手动创建,undo 的历史记录才能生效。