diff --git a/.vimrc b/.vimrc index d67a6be..646a0c5 100644 --- a/.vimrc +++ b/.vimrc @@ -3,9 +3,11 @@ set number "显示行号 if has('autocmd') " vim-tiny does not have autocmd set nocp "no Vi-compatible + set relativenumber let g:mapleader = ' ' set modeline " 开启模式行, 读取文件开头结尾类似于 /* vim:set ts=2 sw=2 noexpandtab: */ 的配置 set exrc " 读取当前文件夹的.vimrc + set showcmd " show pressed keys if v:version >= 800 set bg=dark else @@ -152,14 +154,9 @@ if has('autocmd') " vim-tiny does not have autocmd set list " set nowrap " 不折行 set guifont=Monospace\ Regular\ 20 - if has("nvim-0.5.0") || has("patch-8.1.1564") - set signcolumn=number " 合并git状态与行号 - elseif v:version >= 801 - set signcolumn=yes " 同时显示git状态和行号 - endif - " vim7.3+ - set conceallevel=2 + set conceallevel=2 " vim7.3+ if v:version >= 801 + set signcolumn=yes " 同时显示git状态和行号 " https://unix.stackexchange.com/questions/149209/refresh-changed-content-of-file-opened-in-vim/383044#383044 " Set to auto read when a file is changed from the outside set autoread diff --git a/cog.toml b/cog.toml index 5f0b07a..88a5822 100644 --- a/cog.toml +++ b/cog.toml @@ -5,6 +5,7 @@ tag_prefix = "v" chore = { changelog_title = "Chore", omit_from_changelog = true } ci = { changelog_title = "CI", omit_from_changelog = true } docs = { changelog_title = "Docs", omit_from_changelog = true } +enhance = { changelog_title = "Enhance", omit_from_changelog = true } [changelog] path = "CHANGELOG.md" diff --git a/root/.config/nvim/lua/plugins/init.lua b/root/.config/nvim/lua/plugins/init.lua index 3153f36..592041f 100644 --- a/root/.config/nvim/lua/plugins/init.lua +++ b/root/.config/nvim/lua/plugins/init.lua @@ -153,6 +153,7 @@ return { { "rmagatti/auto-session", opts = { + silent_restore = false, log_level = "error", args_allow_single_directory = false, -- boolean Follow normal sesion save/load logic if launched with a single directory as the only argument auto_session_enable_last_session = false, diff --git a/root/.config/nvim/lua/plugins_setup.lua b/root/.config/nvim/lua/plugins_setup.lua index 409ec45..4937f38 100644 --- a/root/.config/nvim/lua/plugins_setup.lua +++ b/root/.config/nvim/lua/plugins_setup.lua @@ -196,14 +196,16 @@ function M.lualine() lualine_b = lualine_b, lualine_c = lualine_c, lualine_x = { "encoding", "fileformat", "filetype" }, - lualine_y = { "progress" }, - lualine_z = { "location" }, + lualine_y = {}, + -- file location + lualine_z = { "%l/%L,%v" }, }, inactive_sections = { lualine_a = {}, lualine_b = {}, lualine_c = { filename }, - lualine_x = { "location" }, + -- file location + lualine_x = { "%l/%L,%v" }, lualine_y = {}, lualine_z = {}, }, diff --git a/root/.vim/after/ftplugin/tex.vim b/root/.vim/after/ftplugin/tex.vim index 289c9ca..5895d49 100644 --- a/root/.vim/after/ftplugin/tex.vim +++ b/root/.vim/after/ftplugin/tex.vim @@ -10,4 +10,5 @@ setlocal tabstop=2 shiftwidth=2 softtabstop=2 if exists('$WSLENV') " [[palette]]打开当前tex文件中PDF对应的pptx文件 :OpenPPTX command -buffer -nargs=0 OpenPPTX call latex#OpenPPTX() + let g:PasteImageFunction = 'latex#LatexPasteImage' endif diff --git a/root/.vim/autoload/latex.vim b/root/.vim/autoload/latex.vim index 918d477..6f35308 100644 --- a/root/.vim/autoload/latex.vim +++ b/root/.vim/autoload/latex.vim @@ -24,3 +24,11 @@ function latex#SumatraPDFSendToVim(args) let l:newargs = join([l:line, ' /mnt/', l:diskname, l:wslpath], '') execute 'edit +' . l:newargs endfunction + +function latex#LatexPasteImage(relpath) + execute "normal! i\\includegraphics{" . a:relpath . "}\r\\caption{I" + let ipos = getcurpos() + execute "normal! a" . "mage}" + call setpos('.', ipos) + execute "normal! ve\" +endfunction diff --git a/root/.vim/doc/c-cpp-cuda.txt b/root/.vim/doc/c-cpp-cuda.txt index 9bb8bf9..ce78964 100644 --- a/root/.vim/doc/c-cpp-cuda.txt +++ b/root/.vim/doc/c-cpp-cuda.txt @@ -260,9 +260,9 @@ cuda 12.1 GPU监控 ~ -gpustat: `pip install gpustat` -nvtop -nvitop: `pip install nvitop` +*gpustat* `pip install gpustat` +*nvtop* +*nvitop* `pip install nvitop` 【工具篇】如何优雅地监控显卡(GPU)使用情况? - 聚丙烯酰胺的文章 - 知乎 https://zhuanlan.zhihu.com/p/577533593 diff --git a/root/.vim/vimrc b/root/.vim/vimrc index df7b732..fdeb690 100644 --- a/root/.vim/vimrc +++ b/root/.vim/vimrc @@ -1,6 +1,7 @@ set number "显示行号 if has('autocmd') " vim-tiny does not have autocmd set nocp "no Vi-compatible + set relativenumber """""""""""""""""""""" CONFIG """"""""""""""""""""""""""""""""" if filereadable(expand('~/.vim/config.vim')) @@ -26,6 +27,7 @@ if has('autocmd') " vim-tiny does not have autocmd " copied from ftplugin/man.vim command -nargs=+ -complete=shellcmd Man call dist#man#GetPage(, ) endif + set showcmd " show pressed keys endif let g:ccls_init_options = { "compilationDatabaseDirectory": "build", "index": { "threads": 0 }, "clang": { "excludeArgs": ["-frounding-math"] }} " tmux2.2以上才支持true color @@ -180,14 +182,9 @@ if has('autocmd') " vim-tiny does not have autocmd set list " set nowrap " 不折行 set guifont=Monospace\ Regular\ 20 - if has("nvim-0.5.0") || has("patch-8.1.1564") - set signcolumn=number " 合并git状态与行号 - elseif v:version >= 801 - set signcolumn=yes " 同时显示git状态和行号 - endif - " vim7.3+ - set conceallevel=2 + set conceallevel=2 " vim7.3+ if v:version >= 801 + set signcolumn=yes " 同时显示git状态和行号 " https://unix.stackexchange.com/questions/149209/refresh-changed-content-of-file-opened-in-vim/383044#383044 " Set to auto read when a file is changed from the outside set autoread diff --git a/root/.vim/vimrc.d/plugin_setup.vim b/root/.vim/vimrc.d/plugin_setup.vim index 8a75f36..ece54ed 100644 --- a/root/.vim/vimrc.d/plugin_setup.vim +++ b/root/.vim/vimrc.d/plugin_setup.vim @@ -140,15 +140,7 @@ let g:typst_pdf_viewer = 'SumatraPDF.exe' let g:mdip_imgdir = '.' let g:mdip_wsl_path = '\\\\wsl.localhost\\Ubuntu-22.04' -function! g:LatexPasteImage(relpath) - execute "normal! i\\includegraphics{" . a:relpath . "}\r\\caption{I" - let ipos = getcurpos() - execute "normal! a" . "mage}" - call setpos('.', ipos) - execute "normal! ve\" -endfunction " autocmd FileType markdown let g:PasteImageFunction = 'g:MarkdownPasteImage' -autocmd FileType tex let g:PasteImageFunction = 'g:LatexPasteImage' autocmd FileType markdown,tex nmap pi :call mdip#MarkdownClipboardImage() if has('nvim') || v:version >= 802