直接执行编译好的二进制
Neovim是Vim的一个分支,具有更加现代的GUI、嵌入式以及脚本化的终端、异步工作控制等等特点,默认配置文件为
~/.config/nvim/init.vim
。而SpaveVim,是一个社区驱动的模块化的Vim IDE,以模块的方式组织管理插件以及相关配置,为不同的语言开发量身定制了相关的开发模块,提供了自动补全、语法检查、格式化、调试等特性,默认配置文件为~/.SpaveVim.d/init.toml
。
src zhuanlan.zhihu.com/ p/ 364457657
此外,nvim可以看作是免配置的vim。在一些配置不友好的机器上,vi和vim连高亮都没打开,即使打开了高亮,其颜色也是\033[3xm,如果你用过Windows Terminal,非常暗淡,而nvim的高亮是\033[9xm且无需打开。
tldr=Too Long; Don’t Read
仅下载这个目录 pages/
import os
import sys
def print_value(value):
formatted = list()
for field, content in value:
formatted.append('\033[91m' + field + '\033[0m')
for line in content.split('\n'):
line = line.strip()
if len(line) == 0:
continue
if line.startswith('> '):
continue
if line.startswith('#'):
line = line[1:].strip()
line = ' \033[91m{}\033[0m'.format(line)
if line.startswith('-') or line.startswith('*'):
line = line[1:].strip()
line = ' \033[92m{}\033[0m'.format(line)
if line.startswith('`') and line.endswith('`'):
line = line[1:-1].strip()
line = ' \033[93m{}\033[0m'.format(line)
formatted.append(line)
return formatted
def print_key(key):
value = list()
tldr_path = os.path.dirname(os.path.realpath(__file__))
os.chdir(tldr_path)
field_dirs = os.listdir('.')
for field_dir in field_dirs:
if field_dir.endswith('.py'):
continue
os.chdir(tldr_path)
os.chdir(field_dir)
item_names = os.listdir('.')
for item_name in item_names:
if item_name == key + '.md':
with open(item_name) as file:
content = file.read()
value.append((field_dir, content))
return value
if __name__ == '__main__':
key = '-'.join(sys.argv[1:])
if len(key) == 0:
pass
else:
value = print_key(key)
if len(value) == 0:
print('\033[93m{} not found.\033[0m'.format(key))
else:
formatted = print_value(value)
for line in formatted:
print(line)
tldr 替代品
- github.com/ srsudar/ eg
- github.com/ cheat/ cheat
from colorama import init
init(autoreset=True)
接下来展示效果!
# 插件
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
)
# nvim tldr
alias vi='~/.nvim/bin/nvim'
alias vim='~/.nvim/bin/nvim'
alias tldr='python2.7 ~/.tldr/main.py'
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('~/anaconda/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "~/anaconda/etc/profile.d/conda.sh" ]; then
. "~/anaconda/etc/profile.d/conda.sh"
else
export PATH="~/anaconda/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
安装新环境
git clone nvm
nvm install $YourVersion
npm install
npm build
ssh-keygen -o -t rsa -C "your.email@example.com" -b 4096
eval $(ssh-agent -s)
chmod 600 ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa.pub
ssh-add ~/.ssh/id_rsa