Skip to content

Commit

Permalink
vimrc: neovim 0.10.0 has builtin commenting, remove Comment.nvim plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangyinzuo committed Apr 8, 2024
1 parent 40bb857 commit 476b834
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 13 deletions.
3 changes: 2 additions & 1 deletion root/.config/nvim/lazy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ require("lazy").setup("plugins", {
reset_packpath = false,
rtp = {
paths = {
'~/.vim'
'~/.vim',
'~/.vim/after'
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions root/.config/nvim/lua/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,9 @@ return {
},
opts = {}
},
{
'numToStr/Comment.nvim',
opts = {
}
},
-- neovim 0.10.0 has builtin comments
-- :h commenting
-- 'numToStr/Comment.nvim',
{
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
Expand Down
1 change: 1 addition & 0 deletions root/.vim/after/ftplugin/c.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setlocal commentstring=//\ %s
3 changes: 3 additions & 0 deletions root/.vim/after/ftplugin/cpp.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
command -buffer -nargs=? YDef call cpp#YDef(<f-args>)

setlocal commentstring=//\ %s
1 change: 1 addition & 0 deletions root/.vim/after/ftplugin/csv.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set commentstring=#\ %s
1 change: 1 addition & 0 deletions root/.vim/after/ftplugin/cuda.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setlocal commentstring=//\ %s
5 changes: 1 addition & 4 deletions root/.vim/ftplugin/cpp.vim → root/.vim/autoload/cpp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function s:yank_def(lineNumber, className)
endfunction

" [[palette]]生成cpp类方法的函数定义,放在默认寄存器 :YDef
function YDef(...)
function cpp#YDef(...)
let l:current_line_number = line('.')

if a:0 == 0
Expand All @@ -29,6 +29,3 @@ function YDef(...)
endif
call s:yank_def(l:current_line_number, className)
endfunction
command -nargs=? YDef call YDef(<f-args>)

setlocal commentstring=//%s
1 change: 0 additions & 1 deletion root/.vim/ftplugin/c.vim

This file was deleted.

1 change: 0 additions & 1 deletion root/.vim/ftplugin/csv.vim

This file was deleted.

1 change: 0 additions & 1 deletion root/.vim/ftplugin/cuda.vim

This file was deleted.

0 comments on commit 476b834

Please sign in to comment.