Skip to content

Commit

Permalink
feat: add vim-suda
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangyinzuo committed May 30, 2024
1 parent 33253f4 commit 8f1db2c
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 3 deletions.
4 changes: 3 additions & 1 deletion install/build_nvim.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions install/build_vim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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"] }}
2 changes: 2 additions & 0 deletions root/.config/nvim/lua/plugins/vimplug.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
{
Expand Down
2 changes: 2 additions & 0 deletions root/.vim/doc/command-line-tool.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
vim:ft=help
*command-line-tool*

命令行软件 vs 图形界面软件 ~
Expand All @@ -20,6 +21,7 @@ https://github.com/jiangyinzuo/write-maintainable-command-line-tools
*thefuck* 基于规则自动修正上一个命令的错误(too slow)

https://explainshell.com/
https://www.commands.dev/

*shellcheck*

Expand Down
4 changes: 4 additions & 0 deletions root/.vim/doc/docker.txt
Original file line number Diff line number Diff line change
@@ -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/

Expand Down
8 changes: 8 additions & 0 deletions root/.vim/doc/linux.txt
Original file line number Diff line number Diff line change
@@ -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` 都是与跟踪和监控系统调用和进程执行相关的工具,但它们适用于不同的操作系统和有着不同的用途。

Expand Down
2 changes: 1 addition & 1 deletion root/.vim/doc/mydoc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ cpp需要rg with PCRE2 support

远程开发环境对比 ~

1. sourcegraph: 在线代码阅读
1. sourcegraph/github/devv.ai: *在线代码阅读* *code-search-online*

2. 本地开发环境+远程文件系统:sshfs/ |rsync| 同步

Expand Down
1 change: 1 addition & 0 deletions root/.vim/vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
3 changes: 2 additions & 1 deletion root/.vim/vimrc.d/vimplug.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 8f1db2c

Please sign in to comment.