From 8f1db2ca7309e88394acf6a0424698c752a28bf7 Mon Sep 17 00:00:00 2001 From: Yinzuo Jiang Date: Thu, 30 May 2024 11:15:41 +0800 Subject: [PATCH] feat: add vim-suda --- install/build_nvim.sh | 4 +++- install/build_vim.sh | 2 ++ project_dotfiles/{clangd.project.vim => cpp.project.vim} | 5 +++++ root/.config/nvim/lua/plugins/vimplug.lua | 2 ++ root/.vim/doc/command-line-tool.txt | 2 ++ root/.vim/doc/docker.txt | 4 ++++ root/.vim/doc/linux.txt | 8 ++++++++ root/.vim/doc/mydoc.txt | 2 +- root/.vim/vimrc | 1 + root/.vim/vimrc.d/vimplug.vim | 3 ++- 10 files changed, 30 insertions(+), 3 deletions(-) rename project_dotfiles/{clangd.project.vim => cpp.project.vim} (51%) diff --git a/install/build_nvim.sh b/install/build_nvim.sh index 069d71e..56471ef 100755 --- a/install/build_nvim.sh +++ b/install/build_nvim.sh @@ -1,9 +1,11 @@ #!/bin/bash +PYTHON=/usr/bin/python3 + commit=$1 sudo apt-get -y install ninja-build gettext cmake unzip curl build-essential -pip3 install -U neovim +$PYTHON -m pip install -U neovim function _uninstall() { sudo cmake --build build/ --target uninstall diff --git a/install/build_vim.sh b/install/build_vim.sh index b55e276..2389cf8 100755 --- a/install/build_vim.sh +++ b/install/build_vim.sh @@ -4,6 +4,8 @@ commit=$1 MAKE_FLAG=${MAKE_FLAG:-"-j4"} +sudo apt-get -y install libgtk-3-dev libxt-dev + function _uninstall() { sudo make uninstall } diff --git a/project_dotfiles/clangd.project.vim b/project_dotfiles/cpp.project.vim similarity index 51% rename from project_dotfiles/clangd.project.vim rename to project_dotfiles/cpp.project.vim index 051a921..c73386f 100644 --- a/project_dotfiles/clangd.project.vim +++ b/project_dotfiles/cpp.project.vim @@ -1,3 +1,8 @@ +" clangd let g:nvim_lsp_autostart = {'clangd': v:true} let g:clangd_args = ["--clang-tidy", "--compile-commands-dir=build_debug", "--pretty", "--background-index", "--header-insertion=iwyu"] let g:clangd_cmd = [g:clangd_path] + g:clangd_args + +" ccls +" let g:nvim_lsp_autostart = {'ccls': v:true} +" let g:ccls_init_options = { "compilationDatabaseDirectory": "build_debug", "index": { "threads": 0 }, "clang": { "excludeArgs": ["-frounding-math"] }} diff --git a/root/.config/nvim/lua/plugins/vimplug.lua b/root/.config/nvim/lua/plugins/vimplug.lua index 87ab5f5..6461075 100644 --- a/root/.config/nvim/lua/plugins/vimplug.lua +++ b/root/.config/nvim/lua/plugins/vimplug.lua @@ -8,6 +8,8 @@ local M = { "vim-scripts/dbext.vim", ft = "sql", }, + -- suda is a plugin to read or write files with sudo command. + "lambdalisue/vim-suda", "andymass/vim-matchup", "jiangyinzuo/bd.vim", { diff --git a/root/.vim/doc/command-line-tool.txt b/root/.vim/doc/command-line-tool.txt index 74c9054..f555c95 100644 --- a/root/.vim/doc/command-line-tool.txt +++ b/root/.vim/doc/command-line-tool.txt @@ -1,3 +1,4 @@ +vim:ft=help *command-line-tool* 命令行软件 vs 图形界面软件 ~ @@ -20,6 +21,7 @@ https://github.com/jiangyinzuo/write-maintainable-command-line-tools *thefuck* 基于规则自动修正上一个命令的错误(too slow) https://explainshell.com/ +https://www.commands.dev/ *shellcheck* diff --git a/root/.vim/doc/docker.txt b/root/.vim/doc/docker.txt index a8100e0..4212f65 100644 --- a/root/.vim/doc/docker.txt +++ b/root/.vim/doc/docker.txt @@ -1,6 +1,10 @@ vim:ft=help *docker* |nvidia-docker| +nvidia-docker 被achieved了,使用 *nvidia-container-toolkit* +- https://github.com/NVIDIA/nvidia-docker +- https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html + Ubuntu 18.04安装 docker https://roychou121.github.io/2020/07/13/ubuntu-install-docker/ diff --git a/root/.vim/doc/linux.txt b/root/.vim/doc/linux.txt index 9a4ebc5..7f8351c 100644 --- a/root/.vim/doc/linux.txt +++ b/root/.vim/doc/linux.txt @@ -1,5 +1,13 @@ +vim:ft=help *linux* +-------------------------------------------------------------------------- +Linux发行版 ~ + +Ubuntu 18.04和CentOS 7 对应 +Ubuntu 22.04和CentOS 9 对应 (见OceanBase安装依赖脚本 d714ba809a438602eb6d7b47e9d95c769fd21d93) + +-------------------------------------------------------------------------- *trace工具* `ktrace`, `ptrace`, 和 `strace` 都是与跟踪和监控系统调用和进程执行相关的工具,但它们适用于不同的操作系统和有着不同的用途。 diff --git a/root/.vim/doc/mydoc.txt b/root/.vim/doc/mydoc.txt index 4524bcd..673d548 100644 --- a/root/.vim/doc/mydoc.txt +++ b/root/.vim/doc/mydoc.txt @@ -256,7 +256,7 @@ cpp需要rg with PCRE2 support 远程开发环境对比 ~ -1. sourcegraph: 在线代码阅读 +1. sourcegraph/github/devv.ai: *在线代码阅读* *code-search-online* 2. 本地开发环境+远程文件系统:sshfs/ |rsync| 同步 diff --git a/root/.vim/vimrc b/root/.vim/vimrc index a0eaaaa..b36920b 100644 --- a/root/.vim/vimrc +++ b/root/.vim/vimrc @@ -211,6 +211,7 @@ if has('autocmd') " vim-tiny does not have autocmd autocmd FileChangedShellPost * echohl WarningMsg | echo "File changed on disk. Buffer reloaded." | echohl Noneau FocusGained,BufEnter * checktime endif + " Enable persistent undo so that undo history persists across vim sessions if has("persistent_undo") if has('nvim') let target_path = expand('~/.vim/undodir/nvim') diff --git a/root/.vim/vimrc.d/vimplug.vim b/root/.vim/vimrc.d/vimplug.vim index b899653..1e513a8 100644 --- a/root/.vim/vimrc.d/vimplug.vim +++ b/root/.vim/vimrc.d/vimplug.vim @@ -36,8 +36,9 @@ if !exists('g:vscode') " Plug 'mbbill/undotree' " let g:undotree_WindowLayout = 4 Plug 'simnalamburt/vim-mundo' - " Enable persistent undo so that undo history persists across vim sessions + " suda is a plugin to read or write files with sudo command. + Plug 'lambdalisue/vim-suda' Plug 'aperezdc/vim-template' Plug 'szw/vim-maximizer'