Skip to content

Commit

Permalink
feat: add satanson's perl scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangyinzuo committed May 16, 2024
1 parent c155edd commit 845a676
Show file tree
Hide file tree
Showing 15 changed files with 6,431 additions and 74 deletions.
30 changes: 14 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ See also `install/README.md`

#### Vim

vim 9.1 (full features)
vim 8.2.4919 (most of features)
vim 7.4.629 (minimal)
vim 9.1+ (full features)
vim 8.2.4919+ (most of features)
vim 7.4.629+ (minimal)

##### Install in Ubuntu

Expand All @@ -28,38 +28,34 @@ Unofficial PPA for Vim: https://launchpad.net/~jonathonf/+archive/ubuntu/vim

##### Build Vim from Source

Run `install/build_vim_from_source.sh` or

```sh
apt install libgtk-3-dev libxt-dev
./configure --with-features=huge --enable-fontset=yes --enable-cscope=yes --enable-multibyte --enable-python3interp=yes --with-python3-config-dir --enable-gui --with-x
make -j4
make install
```

See also: `install/build_vim_from_source.sh`

#### Neovim

neovim 0.10.0+ (for inlay hint)
neovim 0.10.0+

Source code and executables: https://github.com/neovim/neovim/releases

##### Install from Package

Supported build needs glibc 2.29, while glibc versions of Ubuntu18.04 and CentOS 7.1 are lower than 2.28
Supported build needs glibc 2.29, while glibc versions of Ubuntu18.04 and CentOS 7.1 are lower than 2.28.

https://github.com/neovim/neovim/blob/nightly/INSTALL.md#install-from-package

Unstable PPA (needs Ubuntu 20.04+):

https://launchpad.net/~neovim-ppa/+archive/ubuntu/unstable
[Unstable PPA (requires Ubuntu 20.04+)](https://launchpad.net/~neovim-ppa/+archive/ubuntu/unstable)

See: https://github.com/neovim/neovim-releases

##### Build from Source

tested in Ubuntu 18.04

See `install/build_nvim_from_source.sh`
Tested in Ubuntu 18.04, run `install/build_nvim_from_source.sh`

### Node.js (coc.nvim, copilot.vim)

Expand Down Expand Up @@ -103,11 +99,13 @@ Environment variables to setup: `$DOC2`

## Install Plugins Manually

vim-plug/lazy.nvim plugin directory: `g:vim_plug_dir` (`~/plugged` by default), run `:PlugInstall`. `PlugInstall` can also update helptags for plugins.
coc home: `~/coc`, run `:CocInstall`.
[vim-plug](https://github.com/junegunn/vim-plug)/[lazy.nvim](https://github.com/folke/lazy.nvim) plugin directory:
`g:vim_plug_dir` (`~/plugged` by default).

[coc.nvim](https://github.com/neoclide/coc.nvim) home: `~/coc`, run `:CocInstall`.
gadgets home: `~/gadgets`

You can manually (un)pack them like this:
You can manually pack them and upload to a remote server:
```
cd ~/plugged
tar -cf plugged.tar fzf LeaderF coc.nvim fzf.vim
Expand Down
13 changes: 13 additions & 0 deletions install/build_satanson_ag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
if [ -x "$(command -v apt)" ]; then
sudo apt-get install -y automake pkg-config libpcre3-dev zlib1g-dev liblzma-dev
elif [ -x "$(command -v yum)" ]; then
yum -y install pkgconfig automake gcc zlib-devel pcre-devel xz-devel
fi

pushd build
rm -r the_silver_searcher
git clone --depth=1 https://github.com/satanson/the_silver_searcher
cd the_silver_searcher
./build.sh
sudo make install
popd
7 changes: 7 additions & 0 deletions install/sync-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,11 @@ wget --output-document root/fzf/fzf-git.sh https://github.com/junegunn/fzf-git.s
wget --output-document root/scripts/lsix https://github.com/hackerb9/lsix/raw/master/lsix &
wget --output-document root/scripts/v https://github.com/rupa/v/raw/master/v &
wget --output-document root/goto.sh https://github.com/iridakos/goto/raw/master/goto.sh &

# Satanson's perl scripts: https://github.com/satanson/cpp_etudes
# C++阅码神器cpptree.pl和calltree.pl的使用 - satanson的文章 - 知乎 https://zhuanlan.zhihu.com/p/339910341
for perl_script in calltree.pl java_calltree.pl cpptree.pl javatree.pl deptree.pl ; do
( wget --output-document root/scripts/$perl_script https://github.com/satanson/cpp_etudes/raw/master/$perl_script && chmod +x root/scripts/$perl_script ) &
done

wait
3 changes: 3 additions & 0 deletions root/.vim/config.vim.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ if has('nvim')
let g:vim_package_manager = 'lazy.nvim'
" coc.nvim (default) | nvim-lsp (nvim only)
let g:vimrc_lsp = 'nvim-lsp'
else
set grepprg=rg\ --vimgrep\ -uu
set grepformat=%f:%l:%c:%m
endif
21 changes: 20 additions & 1 deletion root/.vim/doc/c-cpp-cuda.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,29 @@ output to quickfix list: >
= 延迟赋值,使用到变量的时候才确定变量的值
:= 立即赋值

--------------------------------------------------------------------------------------
======================================================================================
C++包管理器

*cmake*

CMake 4种编译类型 ~

Debug, Release, RelWithDebInfo, MinSizeRel

https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html

*CPM.cmake* https://github.com/cpm-cmake/CPM.cmake

使用项目:rapidsai/RAFT

*conan*

使用项目:milvus

*bazel*

使用项目:HA3

--------------------------------------------------------------------------------------
*c++20-module*

Expand Down Expand Up @@ -117,3 +132,7 @@ Ubuntu18.04 为2.27
**gcc版本**
2024年初,CentOS 7.1: 4.8.5
Ubuntu 16.04: 5.4.0
======================================================================================
*cpp-mistakes*

使用std::copy拷贝std::vector,而非memcpy
21 changes: 0 additions & 21 deletions root/.vim/doc/conventional-commits.txt

This file was deleted.

33 changes: 30 additions & 3 deletions root/.vim/doc/git-help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ vim:ft=help
===============================================================================
*git添加ppa*
https://launchpad.net/~git-core/+archive/ubuntu/ppa
-------------------------------------------------------------------------------
===============================================================================
Git 开发规范
https://github.com/universal-ctags/ctags/pull/3747
https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows
Expand All @@ -16,9 +16,34 @@ https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows

See also:
$DOC2/cs/system/software_engineering/version-control-and-release-model
$DOC2/cs/tools-open-source/git-github
$DOC2/cs/system/software_engineering/tools-open-source/git-github

-------------------------------------------------------------------------------
*conventional-commits*

https://cbea.ms/git-commit/

|semver|
www.conventionalcommits.org

*cog*
cli工具: https://github.com/cocogitto/cocogitto

bash补全(See: https://docs.cocogitto.io/) >
cog generate-completions bash > ~/.local/share/bash-completion/completions/cog
<

初始化配置文件 >
cog init
<

之后可以在cog.toml中添加`tag_prefix = "v"`,用于识别语义化版本 https://semver.org/lang/zh-CN/


*git-cliff* 自动生成changelog

其它工具
https://commitlint.js.org/#/
===============================================================================
*git-log*

git 查看src/main.c 20-25行的修改历史
Expand Down Expand Up @@ -601,5 +626,7 @@ hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
-------------------------------------------------------------------------------
*git-mv* *git-grep* git对应的mv grep
===============================================================================

3 changes: 1 addition & 2 deletions root/.vim/doc/project-vim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ vim:ft=help
*project-vim*

>
:LoadCodeNote
:Cdroot
let g:copilot_workspace_folders = ['~/Projects/myproject']
let g:nvim_lsp_autostart = {'clangd': v:true}
<
9 changes: 7 additions & 2 deletions root/.vim/doc/python-env.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,15 @@ https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html
升/降级python
micromamba install python=3.11

micromamba创建新环境,使用python3.10.6
>
micromamba create -n myenv python=3.10.6
<

----------------------------------------------------------------
*pdm* 替代requirements.txt
*pdm* 替代requirements.txt https://pdm-project.org/latest/

https://pdm-project.org/latest/
*python-poetry* 替代requirements.txt https://github.com/python-poetry/poetry
----------------------------------------------------------------
*matplotlib-show报错*
>
Expand Down
Loading

0 comments on commit 845a676

Please sign in to comment.