skywind3000 / vim-init Goto Github PK
View Code? Open in Web Editor NEW轻量级 Vim 配置框架,全中文注释
License: MIT License
轻量级 Vim 配置框架,全中文注释
License: MIT License
各位在云里雾里试着看懂这份配置的vim新手,建议直接切换到neovim,这里的大部分配置都是默认的不需要去设置。请跟上趋势,享受更现代化的vim好吗。readme里批评建映射的我真是醉了。。。
如题,具体表现为按下 ESC 键,大约需等待 1 秒左右的时间,此时可以正常插入,但会停止退出正常模式。此外,可以通过连按两次 ESC 键来立即切换回普通模式。
这个问题在 Ubuntu 18.04 上并不会出现,而在 openSUSE 15 上会出现。vim 使用的是系统软件源的vim。
初学 vim ,还不是很懂。希望大神可以抽空解答一下,谢谢!
新手请教大佬。个人比较习惯单按home和end键跳转行尾行末的操作,pluginstall之后,进入插入模式按了end或者home会出现乱码(控制字符?),有办法让这两个键起作用吗?我试了unmap<end> , inoremap<end> xxx 这些都没有起作用。
有 tmux 何没有的功能键超时(毫秒)
把 Leader 定义成空格,同是 绑定 imap 组合按键时,vim 需要等待到 timeoutlen 才明白输入的是一个 normal 的空格键位, 在这种情况下导致输入后没有即使反馈,感觉影响到了写入速度,请问有什么方式能够解决这个问题?
这两行为什么在iterm2里面失灵?我的left option 好像map在esc+, left option-> right option->也没有map其它键
noremap :call Tab_MoveLeft()
noremap :call Tab_MoveRight()
奇怪的是下面选tab是work的
noremap :tabn 1
noremap :tabn 2
noremap :tabn 3
noremap :tabn 4
noremap :tabn 5
noremap :tabn 6
noremap :tabn 7
noremap :tabn 8
noremap :tabn 9
noremap :tabn 10
I found control+_ means undo from internet, but the setting bellow only insert _
.
vim-init/init/init-keymaps.vim
Line 25 in 10640cc
为什么要把外部的插件加到本仓库?
" 取得本文件所在的目录
let s:home = fnamemodify(resolve(expand('<sfile>:p')), ':h')
" 定义一个命令用来加载文件
command! -nargs=1 LoadScript exec 'so '.s:home.'/'.'<args>'
" 将 vim-init 目录加入 runtimepath
exec 'set rtp+='.s:home
" 将 ~/.vim 目录加入 runtimepath (有时候 vim 不会自动帮你加入)
set rtp+=~/.vim
let g:devrte_vim_plug_path='/opt/devrte/runtime/vim-conf/vim-plug'
" 加载Skywind3000 的脚本
LoadScript vim-init/init.vim
python3 << EOF
import sys
import vim
import importlib
try:
module = importlib.machinery.SourceFileLoader("aaa", "./.ycm_extra_conf.py").load_module()
flags = module.FlagsForFile("a.cpp")["flags"]
cflags = vim.eval("g:ale_c_gcc_options")
cppflags = vim.eval("g:ale_cpp_gcc_options")
for flag in flags:
if flag[0:2] == "-I":
if flag.find("llvm") == -1:
cflags = cflags + " "
cflags = cflags + flag
cppflags = cppflags + " "
cppflags = cppflags + flag
vim.command("let g:ale_c_gcc_options = '%s'"% cflags)
vim.command("let g:ale_cpp_gcc_options = '%s'"% cppflags)
except Exception as e:
exit
EOF
我写了上边这个脚本,就是用于读取 .ycm_extra_conf.py 的一些编译信息设置到ALE中,总是出现下边这个错误:
No module named 'ycm_core'
将 .ycm_extra_conf.py中import ycm_core 去掉就没有问题了
是我这个脚本先于YCM加载的原因吗
我在neovim下使用,拼写错误提示,无法显示下划线,但是vim没问题,这是neovim的问题吗?
" git 仓库使用 histogram 算法进行 diff
let g:signify_vcs_cmds = {
\ 'git': 'git diff --no-color --diff-algorithm=histogram --no-ext-diff -U0 -- %f',
}
比如下面两个:
https://github.com/vim/vim/blob/master/runtime/autoload/netrw.vim
https://github.com/vim/vim/blob/master/runtime/autoload/pythoncomplete.vim
当G到文件末尾,再滚动光标卡得几乎不能控制。
应该不是文件长度的问题,打开一个几十万行的Makefile文件的时候没有这种现象。
对有些插件,在plug#begin和plug#end之间增加配置代码好像会出现找不到变量或者函数的问题,我添加了
``
if index(g:bundle_group, 'ycmd') < 0
" Plug 'maralla/completor.vim'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-buffer.vim'
endif
" asyncomplete {
let g:asyncomplete_remove_duplicates = 1
call asyncomplete#register_source(asyncomplete#sources#buffer#get_source_options({
\ 'name': 'buffer',
\ 'whitelist': ['*'],
\ 'blacklist': ['go'],
\ 'completor': function('asyncomplete#sources#buffer#completor'),
\ }))
autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif
" }
``
后面会说找不到asyncomplete#sources#buffer#get_source_options函数,放到plug#end后面就好了,之前彩虹括号也遇到配置问题,这是plug插件的问题吗,但有些配置又没有问题
假设我的文件目录:
.
├── rtthread-nano // 这是操作系统的源码
│ └── rt-thread
└── test // 这是应用层代码,这些代码依赖rtthread-nano
test的目录中已经有.git或.root了,所以根据规则,test的目录就已经是顶层目录了。
所以我的疑问是,如何在test这个目录中编码时让他自动关联rtthread-nano这里的源码?
我想在vim中用 +/* 之类的符号做寄存器,可是这几个好像都是快速移动的按键映射。配置文件里面找也没有相关设置,不懂这是为什么?
总之,山寨居多,还有某些著名的广为流传的 Vim 配置,我都不想点名了,把 Leader 键映射成逗号了,它不知道逗号/分号在 Vim 里是用来定位 f/t 搜索的下一个/上一个结果的么?就和 n/N 定位斜杠搜索一样。把 Leader 定义成空格我都还觉得挺科学,定义成逗号和分号的这些配置,是在把错误的用法源源不断的交给未来的新用户。
大部分拥有并维护了自己Vim配置的人都知道 ,
和 ;
的作用,但是依然采用 ,
作为 <Leader>
键映射的原因在于, ,
键相比其他键影响最小且有着好的人体工程学体验(用过都知道吧。。。,并且 f/t
的行内搜索使用率相比 <Leader>
键是要小的,而,
搜索上个结果的使用率就更小了,再并且,把 ,
绑定<Leader>
键依然不影响原来功能,只是需要等待个 timeout 时间,所以这也是网络上大部分都是把 ,
作为自己的 <Leader>
键。
综上,你上面的描述实在不是很恰当。
因为把plug提到了style前面,而style里面设置了showmode
新手向大佬求教,neovim+ vim-plug初次在msys2上启动报错:
NO SUCH FILE OR DIRECTORY: C:\msys2\usr\bin\cmd
有办法hack plugin.vim去支持msys2下启动吗?
vim 8.1.513 compile with python3,最新的
echodoc 最新的,f16ae31b7b9d8429cb0579ba104db0d0951c40224
ycm 最新的,faa019aa532475c5028527ffbfe1e910119d663c
@skywind3000 你的echodoc, ycm的版本是多少
应该得到的是vim-init/tools/conf
但是脚本中实际算成了vim-init/init/tools/conf,这样就找不到那个配置了。
Hi 大佬。知乎 v2ex拜读过您的一些文章很受用。对大佬的造诣也是很认可。关于逗号和空格作为leader 。我觉得没那么过激的,用逗号也不是错误。可能不常使用f/t的 下一个。所以使用逗号。我曾经翻阅了不少大佬的配置 例如 Shougo 等。空格和逗号都有的。感觉直接否定用逗号做空格是错误的不太好=3=。
我把init-config.vim这个文件合入到我的vim配置中,出现标题中描述的现象。第一次按下Esc的时候如果时间等待稍长一些(1S)才能恢复正常模式,如果快速按下Esc和其他字母按键,会出现一些奇怪的字符。我已经设置ttimeoutlen值为50了。
排查原因是【终端下允许 ALT,详见:http://www.skywind.me/blog/archives/2021】这段配置引起的,注释掉就好了。
另外请教一个问题,wiki中介绍有一句话不明白:
【前面在终端软件里配置好 ALT键,但是 Vim 的话,由于历史原因,需要在你的 vimrc 里加一段键盘码配置】
这里的历史原因是什么,为什么需要另外配置。
还有config.vim中【功能键终端码矫正】是为什么,我以前没有矫正也可以映射相关按键。
我的vim使用环境是:
1.putty连接本地ubuntu虚拟机。
2.ubuntu系统
您好,感谢您的分享
有个问题请教一下,signcolumn这个是什么?我使用的是默认的7.4版本,跟这个有关系吗?
[00:34:18@zhubo ~]$vim test.c
处理 /home/zhubo/vim-init/init/init-style.vim 时发生错误:
第 23 行:
E518: 未知的选项: signcolumn=yes
请按 ENTER 或其它命令继续
vim-init/init/init-plugins.vim
Line 230 in 77a1590
最后应该加上 >= 0 吧,因为改了插件,没法提交pull request 了。
当工程中有git submodule 时,在submodule中找代码根指的时submodule的根,无法找到指外的代码,有好的解决方案吗?
vim 7.4.52
有最低版本要求?
应把init.vim中的“插件加载”部分放在“界面样式”部分之前
g:ale_set_balloons=0 is ok
请问空格打出来的是点是为什么
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.