Code Monkey home page Code Monkey logo

vimrc's Introduction

小彭老师自用 NeoVim 整合包

本整合包内含大量实用插件,包括智能补全、语法高亮、错误提示、快速跳转、全局搜索、集成终端、文件浏览、Git 支持等。且安装方便,小彭老师自用同款,纯 Lua 配置,是您基于 NeoVim 的 IDE 不二之选。

安装方法

无需克隆本仓库,直接在命令行中输入以下命令即可安装:

curl -sLf http://142857.red/nvimrc-install.sh | bash

如果安装遇到问题,欢迎通过 GitHub issue 反映,我会尽快帮您解决。

  • 目前只支持 Linux 系统,暂时不支持 MacOS 等系统。
  • 请勿以 root 身份运行!否则会为 root 安装 nvim 插件而不是当前用户,插件安装后仅对当前用户有效。
  • 您的系统中无需事先安装有 nvim,本整合包内部已经自带了最新版 nvim 的 AppImage,可无依赖直接运行。
  • 无需连接 GitHub,所有插件全部已经预下载在整合包内部,无需 GitHub 加速器!
  • 过程中会通过您系统的包管理器安装一些工具,所以只需确保包管理器的设置是国内源即可。
  • 为了能够使用补全,会为您安装如 clangd 一类的包,但即使其中一个安装失败,也不影响其他语言和编辑器整体的使用。
  • 安装脚本运行中可能产生一些冗余错误信息,属于正常现象,不影响使用,请忽视他们。

安装完成后,输入 nvim 即可使用,按 q 或 :wqa 即可退出。

推荐为您的终端安装 Nerd Font 字体,然后设置环境变量 export NERD_FONTS=1,这样就可以显示文件类型图标了。

小彭老师用的是 JetBrainsMono Nerd Font Regular,字号 16,这是一款专为程序员打造的等宽字体。

手动安装

如果你有稳定的 GitHub 连接,也可以考虑手动安装:

test -f ~/.config/nvim && mv ~/.config/nvim{,.backup}
git clone https://github.com/archibate/vimrc ~/.config/nvim

手动安装的好处是你以后只需 git pull 就可以更新上小彭老师最新改动。

初次进入会有一些报错,提示你包缺失,输入 :PackerInstall 即可自动安装全部所需的包(需要连接 GitHub),重启后稍等片刻,即可开始使用 nvim。

若需要自己定制插件参数或添加更多插件,可以编辑 ./lua/archvim/plugins.lua

支持的 Linux 发行版

  • Arch Linux(亲测可用)
  • Ubuntu (亲测 20.04 可用)
  • Manjano Linux (理论可行,没有测试过)
  • Debian (理论可行,没有测试过)
  • Kali Linux (理论可行,没有测试过)
  • Raspbian (理论可行,没有测试过)
  • Fedora (感谢 @justiceeem 大佬)
  • OpenSUSE (感谢 @sleeplessai 大佬)
  • CentOS (感谢 @xxy-im 大佬)
  • Deepin (感谢 @zhangasia 大佬)
  • MacOS (未经测试,如果你用的发现没问题可以和我说一声)

脚本会创建或修改的文件

/usr/bin/nvim
/usr/bin/.nvim.appimage.noextract
~/.config/nvim
~/.local/share/nvim
  • 如果脚本发现您已经存在 ~/.config/nvim 目录,则会将其备份至 ~/.config/.nvim.backup.随机数字
  • 如果脚本发现您已经存在 /usr/bin/nvim 可执行文件,但版本不足 0.9.1,则会用本整合包内置的 nvim.AppImage 替换他。
  • 请勿以 sudo 模式运行本脚本,本脚本内部自动会在需要时采取 sudo。

欲了解本整合包安装与打包原理,请看 compile.sh

内含插件

完整插件列表,请查看 lua/archvim/plugins.lua

默认启用的语法高亮

c,cpp,cmake,lua,python,html,javascript,css,json,bash,regex,markdown

你可以输入 :TSInstall <language> 来安装更多语言的语义高亮支持。

默认安装的 LSP 服务器(用于补全)

clangd,pyright,cmake-language-server,lua_ls,tsserver

可以通过执行 :Mason 或修改 lua/archvim/config/lspconfig.lua 来安装更多语言的 LSP 补全支持。

旧版本 Vimrc

本分支为最新 NeoVim 版插件整合包,对于来自 BV1H44y1V7DW 视频想领取老版 Vim 插件的同学,请移步 main 分支

以下为小彭老师自己看的

通过运行 ./compile.sh 生成 .build_cache/nvimrc-install.sh 这个一键安装脚本(约 25 MiB)后,我会把他发布到 142857.red。

我会运行 docker run -v $PWD/.build_cache:/mnt -it --rm ubuntu:20.04 来测试兼容性。

在 Ubuntu 容器中,我会用 NODEP=1 bash nvimrc-install.sh 避免使用包管理器,加速安装,方便测试。

vimrc's People

Contributors

archibate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vimrc's Issues

Arch Linux 报错:bash: line 309978: /usr/bin/nvim: Permission denied

OS: Arch Linux

在脚本检查用户是否拥有0.9.1的nvim时似乎有问题:能检测出nvim版本,但提示我未用有并尝试再安装nvim,安装后出现Permission Denied拒绝访问

以下是脚本打印的检查nvim部分的日志:

...
-- Checking NeoVim version...
NVIM v0.9.1
Build type: Release
LuaJIT 2.1.1692616192

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
-- NeoVim 0.9.1 or above not found, installing latest for you
main: line 309974: /usr/bin/nvim: Permission denied
x=$$; mkdir -p /tmp/_nvim_appimg_.$x && bash -c "cd /tmp/_nvim_appimg_.$x && /usr/bin/.nvim.appimage.noextract --appimage-extract > /dev/null 2>&1" && /tmp/_nvim_appimg_.$x/squashfs-root/AppRun "$@"; x=$?; rm -rf /tmp/_nvim_appimg_.$x exit $x
bash: line 309978: /usr/bin/nvim: Permission denied

以下是运行脚本前 nvim 状态:

──────────────────────────────────────────────────────────────────────────────
nvim: require("nvim.health").check()

Configuration
- WARNING Missing user config file: /home/Izery/.config/nvim/init.vim
  - ADVICE:
    - :help init.vim

Runtime
- OK $VIMRUNTIME: /usr/share/nvim/runtime

Performance
- OK Build type: Release

Remote Plugins
- OK Up to date

terminal
- key_backspace (kbs) terminfo entry: key_backspace=\177
- key_dc (kdch1) terminfo entry: key_dc=\E[3~
- $COLORTERM="truecolor"
                                                                                                                                
:version                                                                                                              
NVIM v0.9.1
Build type: Release
LuaJIT 2.1.1692616192

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
Press ENTER or type command to continue

求助小彭老师...

ccls make出错

系统:ubunut 2004
命令: ./install.sh
出错:

/home/linuxbrew/.linuxbrew/bin/ld: /home/linuxbrew/.linuxbrew/lib/libLLVM-13.so: undefined reference to `std::__exception_ptr::exception_ptr::_M_release()@CXXABI_1.3.13'
/home/linuxbrew/.linuxbrew/bin/ld: /home/linuxbrew/.linuxbrew/lib/libclang-cpp.so.13: undefined reference to `std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
/home/linuxbrew/.linuxbrew/bin/ld: /home/linuxbrew/.linuxbrew/lib/libLLVM-13.so: undefined reference to `std::__exception_ptr::exception_ptr::_M_addref()@CXXABI_1.3.13'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/ccls.dir/build.make:701:ccls] 错误 1
make[1]: *** [CMakeFiles/Makefile2:188:CMakeFiles/ccls.dir/all] 错误 2
make: *** [Makefile:130:all] 错误 2

猜测原因: ccls编译出现问题?还是因为用的homebrew的ld的导致链接出错

I install error

-- Welcome to ArchVim installation script :)
ERROR: .vim/install.sh not found, please download from github.com/archibate/vimrc/releases

latest release error `tail: cannot open`

After downloading vimrc-install.sh

$ bash vimrc-install.sh 
tail: cannot open 'vimrc-install.sh' for reading: No such file or directory

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now

Ubuntu 20.04


curl -sLf http://142857.red/vimrc-install.sh | bash works fine.

no support centos?

github.com/junegunn/fzf/src/tui

src/tui/tcell.go:18:6: HasFullscreenRenderer redeclared in this block
previous declaration at src/tui/dummy.go:7:30
src/tui/tcell.go:27:6: Attr redeclared in this block
previous declaration at src/tui/dummy.go:5:6
src/tui/tcell.go:75:2: Bold redeclared in this block
previous declaration at src/tui/dummy.go:20:19
src/tui/tcell.go:76:2: Dim redeclared in this block
previous declaration at src/tui/dummy.go:21:24
src/tui/tcell.go:77:2: Blink redeclared in this block
previous declaration at src/tui/dummy.go:24:24
src/tui/tcell.go:78:2: Reverse redeclared in this block
previous declaration at src/tui/dummy.go:26:24
src/tui/tcell.go:79:2: Underline redeclared in this block
previous declaration at src/tui/dummy.go:23:24
src/tui/tcell.go:80:2: Italic redeclared in this block
previous declaration at src/tui/dummy.go:22:24
src/tui/tcell.go:84:2: AttrUndefined redeclared in this block
previous declaration at src/tui/dummy.go:16:23
src/tui/tcell.go:85:2: AttrRegular redeclared in this block
previous declaration at src/tui/dummy.go:17:28
src/tui/tcell.go:85:2: too many errors
make: *** [Makefile:130: target/fzf-linux_amd64] Error 2

是我使用的不对吗

ERROR: .vim/install.sh not found, please download from github.com/archibate/vimrc/releases
和md文件描述不一样 找不到install.sh文件

Arch linux - branch nvim-2 install error

系统:Arch Linux (virtualbox虚拟机)
问题1 :在运行curl -sLf http://142857.red/nvimrc-install.sh | bash之后,出现如下输出:

-- Checking NeoVim version...
NVIM v0.9.1
Build type: Release
LuaJIT 2.1.0-beta3

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
-- NeoVim 0.9.1 or above not found, installing latest for you
main: line 272988: /usr/bin/nvim: Permission denied
x=$$; mkdir -p /tmp/_nvim_appimg_.$x && bash -c "cd /tmp/_nvim_appimg_.$x && /usr/bin/.nvim.appimage.noextract --appimage-extract > /dev/null 2>&1" && /tmp/_nvim_appimg_.$x/squashfs-root/AppRun "$@"; x=$?; rm -rf /tmp/_nvim_appimg_.$x exit $x
bash: line 272992: /usr/bin/nvim: Permission denied

问题2 :在我已经安装neovim且版本为0.9.1的情况下,运行安装文件时,仍然会显示-- NeoVim 0.9.1 or above not found, installing latest for you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.