-
Notifications
You must be signed in to change notification settings - Fork 1
Iammyself edited this page Aug 7, 2024
·
19 revisions
# export HTTPS_PROXY="socks5://192.168.1.4:7890";export HTTP_PROXY="socks5://192.168.1.4:7890";export ALL_PROXY="sock5://192.168.1.4:7890}";
git clone [email protected]:IammyselfYBX/.vim.git
# vim配置
ln -s ~/.vim/.vimrc ~/.vimrc
# nvim配置
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
chmod u+x nvim.appimage
ln -s ~/.application/nvim.appimage ~/.local/bin/nvim
ln -s ~/.vim ~/.config/nvim
ln -s ~/.config/nvim/.vimrc ~/.config/nvim/init.vim
第一次下载以后 为了确保访问github速度可以,最好配置ssh
:PlugInstall
sudo apt install fzf # Ubuntu
安装tagbar之前需要安装ctags
# Ubuntu/Debian:
sudo apt install universal-ctags
# Fedora:
sudo dnf install ctags
#Arch Linux:
#sudo pacman -S ctags
curl -sL install-node.vercel.app/lts | bash
如果下载失败就去nodejs下载官网
~/.application/node-v20.10.0-linux-x64/bin$ wget https://nodejs.org/dist/v20.10.0/node-v20.10.0-linux-x64.tar.xz
tar -Jxvf node-v20.10.0-linux-x64.tar.xz
ln -s /home/tony/.application/node-v20.10.0-linux-x64/bin/npm /home/tony/.local/bin/
ln -s /home/tony/.application/node-v20.10.0-linux-x64/bin/node /home/tony/.local/bin/
pacman -S nodejs yarn
npm config set userconfig `npm config get prefix`/.npmrc
npm config set cache `npm config get prefix`/cache
npm config set init-module `npm config get prefix`/.npm-init.js
# npm config set init.module `npm config get prefix`/.npm-init.js
npm config set registry http://mirrors.cloud.tencent.com/npm/ # 修改成腾讯云镜像源
npm config get registry # 验证命令
npm config set registry https://registry.npmmirror.com # 修改成淘宝镜像源
npm config set registry https://mirrors.huaweicloud.com/repository/npm/ # 修改成华为云镜像源
export PATH=$PATH:/home/tony/.application/node-v20.10.0-linux-x64/bin/
# 修改coc的npm源
vim ~/.npmrc
registry=https://mirrors.huaweicloud.com/repository/npm/
coc.nvim:registry=https://registry.npmmirror.com
:CocInstall coc-marketplace "安装
:CocList marketplace "打开
sudo apt install ccls
# sudo apt install clangd
pacman -S ccls
# pacman -S clang
# :CocInstall coc-clangd
:CocInstall coc-ccls
# 在CMakeList.txt 第一行添加
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# 生成 compile_commands.json文件
mkdir build
cd build
cmake ..
# 拷贝compile_commands.json到项目的根目录
cp build/compile_commands.json ./
# 在项目的根目录
$> cat compile_commands.json
[
{
"directory": "当前绝对路径",
"command": "/usr/bin/c++ -I当前绝对路径的基础上再相对路径 -c 当前绝对路径/文件1",
"file": "当前绝对路径/文件1"
},
{
"directory": "当前绝对路径",
"command": "/usr/bin/c++ -I当前绝对路径的基础上再相对路径 -c 当前绝对路径/文件2",
"file": "当前绝对路径/文件2"
},
....
]
// 文件目录结构
.
├── xserver
│ ├── compile_commands.json
│ ├── compile_commands.json.bac
│ └── xserver.cpp # 要引用xsocket.h
└── xsocket
├── xsocket.cpp
└── xsocket.h
$> pwd
/home/tony/Pratice/C++/xserver代码/xserver/
$> cat xserver.cpp
#include "xsocket.h" // 这里会报找不到头文件
#include <stdlib.h>
#include <iostream>
using namespace std;
int main(int argc,char *argv[])
{
unsigned short port = 80;
if(argc > 1)
{
port = atoi(argv[1]);
}
XSocket server;
server.Bind(port);
int client = server.Accept();
cout<<"accept " << client<<endl;
return 0;
}
$ cat compile_commands.json // ALE和coc的代码检测都没问题
[
{
"directory": "/home/tony/Pratice/C++/xserver代码/xserver/build",
"command": "/usr/bin/c++ -I/home/tony/Pratice/C++/xserver代码/xserver/../xsocket -c /home/tony/Pratice/C++/xserver代码/xserver/xserver.cpp",
"file": "/home/tony/Pratice/C++/xserver代码/xserver/xserver.cpp"
}
]
$ cat compile_commands.json.bac // coc的代码检测都没问题,但ALE依旧提示找不到头文件
[
{
"directory": "/home/tony/Pratice/C++/xserver代码/xserver/",
"command": "/usr/bin/cc -I/home/tony/Pratice/C++/xserver代码/xserver/ -std=c++11 -o ./xserver -c /home/tony/Pratice/C++/xserver代码/xserver/xserver.cpp",
"file": "/home/tony/Pratice/C++/xserver代码/xserver/xserver.cpp"
}
]
sudo apt install python
pip install pynvim # if use coc.nvim
npm install -g solc # -g进行全局安装Solidity编译器
npm install -g @remix-project/remixd # remixd安装
对于Ububtu
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc
在命令行中,使用 solcjs 而非 solc 。 solcjs 的命令行选项同 solc 和一些工具(如 geth )是不兼容的,因此不要期望 solcjs 能像 solc 一样工作。
npm i solidity-ls -g # 安装Solidity语言服务器https://github.com/qiuxiang/solidity-ls
:CocInstall coc-solidity
:Copilot setup " 配置 GitHub Copilot
:Copilot enable " 启用