/geocfg

This is geometryolife’s configuration.

Primary LanguageCMIT LicenseMIT

geocfg

This is geometryolife’s configuration.

Git

git config --global user.name "Joe Chen"
git config --global user.email "geometryolife@gmail.com"

Editor

Helix

# 安装
git clone https://github.com/helix-editor/helix
cd helix
cargo install --path helix-term

# 检查
hx --health

Copy and Paste with system clipboard

Neither Space-p nor Space-y is working.

  • On Linux

In an X session, check that either the xclip or xsel package is installed on your system and either of these commands is in your PATH.

In a Wayland session, check that the wl-clipboard package is installed on your system and the provided wl-copy and wl-paste commands are in your PATH.

  • On WSL

Check that win32yank.exe is in your Windows PATH.

Either download the win32yank binaries manually or use scoop (scoop install win32yank).

Neovim

# Extract
tar xzvf nvim-linux64.tar.gz
# Run
./nvim-linux64/bin/nvim

安装 pynvim 给 Neovim 提供 Python 特性:

/usr/bin/python3 -m pip install pynvim

检查 Neovim 的健康状况:

:checkhealth

Configuration

  • 我的 VimL 配置文件在 nvim
    • coc 插件需要使用 yarn,需要安装 Node
  • Lua 配置 geonv

插件管理器

sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
       https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'

Proxy

Git Proxy

# 设置 http 代理
git config --global http.proxy http://127.0.0.1:7890

# 取消代理设置
git config --global --unset http.proxy

终端设置代理

# 终端代理设置,使用 ep 和 up 来启用/禁用
alias ep='export http_proxy=http://127.0.0.1:7890 && export https_proxy=https://127.0.0.1:7890 && export socks5_proxy=socks5://127.0.0.1:7891'
alias up='unset http_proxy && unset https_proxy && unset socks5_proxy'

Tools

lazygit

首先安装 go 语言

git clone https://github.com/jesseduffield/lazygit.git
cd lazygit
go install

ranger

Use the package manager of your operating system to install ranger. You can also install ranger through PyPI: pip install ranger-fm.

Language

Go

  • 下载 go 并放在安装路径:
~/prog

Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Node

  • 下载 node 并放在安装路径:
~/prog

npm

# 安装依赖到(当前的执行命令)本地的 node_modules 目录
npm install

# 全局安装
npm install -g

使用 npm 全局安装依赖,会将包安装到 node 安装目录中,例如:

# 我的 node 安装的位置
/home/joe/prog/node

# 全局安装的依赖位置
/home/joe/prog/node/lib/node_modules
  • 使用 --production 选项标志或设置 NODE_ENV 环境变量为 production 时,不安装 devDependencies 中的模块。

  • NODE_ENV 被设置为 production 的情况下,可以使用 --production=false 来同时安装 dependenciesdevDependencies 中的模块。

  • npm run 从包的 scripts 对象运行任意命令。

# 查看用户配置和全局配置文件
npm config get userconfig
npm config get globalconfig

# 设置
npm config set proxy http://127.0.0.1:7890
npm config set https-proxy http://127.0.0.1:7890

yarn

# 查看设置
yarn config list

# 设置代理
yarn config set proxy  http://username:password@server:port
yarn config set https-proxy http://username:password@server:port

Python

venv 创建虚拟环境

# 创建
python3 -m venv <ENV_DIR>

# 激活
source <ENV_DIR>/bin/activate

# 退出
deactivate

Poetry 依赖管理工具

Python packaging and dependency management made easy.

# 安装
curl -sSL https://install.python-poetry.org | python3 -

Toml

# 目前编译默认不支持 lsp,需手动开启
git clone https://github.com/tamasfe/taplo.git
cargo install taplo-cli --locked --features lsp