Skip to content

Commit

Permalink
vimrc!: drop vim-plug support for neovim
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangyinzuo committed Apr 6, 2024
1 parent 134901b commit c298571
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 253 deletions.
2 changes: 2 additions & 0 deletions root/.config/nvim/lua/lsp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ local function setup_lsp(on_attach, capabilities)
}

lspconfig.texlab.setup {
autostart = vim.fn.get(vim.g.nvim_lsp_autostart, 'texlab', false),
on_attach = on_attach,
capabilities = capabilities,
settings = {
Expand All @@ -105,6 +106,7 @@ local function setup_lsp(on_attach, capabilities)

-- ltex-ls.nvim似乎也不支持add to dictionary命令,建议使用coc.nvim
lspconfig.ltex.setup {
autostart = vim.fn.get(vim.g.nvim_lsp_autostart, 'ltex', false),
on_attach = on_attach,
capabilities = capabilities,
filetypes = { "bib", "tex", "latex" },
Expand Down
5 changes: 3 additions & 2 deletions root/.config/nvim/lua/plugins/vimplug.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,11 @@ local M = {
},
{ 'whonore/Coqtail', ft = 'coq' },
{
dir = "~/.vim/pack/my_plugins/start/project",
dir = "~/.vim/pack/my_plugins/start/project.vim",
dependencies = {
'skywind3000/asynctasks.vim',
}
},
priority = 2000,
},
{ dir = "~/.vim/pack/my_plugins/start/diffbuffer.vim" },

Expand Down
46 changes: 0 additions & 46 deletions root/.config/nvim/vimplug.lua

This file was deleted.

22 changes: 7 additions & 15 deletions root/.vim/vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ if has('autocmd') " vim-tiny does not have autocmd
"""""""""""""""""""""" CONFIG """""""""""""""""""""""""""""""""

let g:vimrc_lsp = get(g:, 'vimrc_lsp', 'coc.nvim')
let g:vim_package_manager = get(g:, 'vim_package_manager', 'vim-plug')
if has('nvim')
let g:nvim_enable_inlayhints = 1
if g:vim_package_manager == 'vim-plug'
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
endif
" autopair with nvim may has bug
" https://github.com/neovim/neovim/issues/23666
let g:AutoPairsMapCR = 0
let g:nvim_lsp_autostart = {}
runtime clipboard_config.lua
endif
if filereadable(expand('~/.vim/config.vim'))
Expand Down Expand Up @@ -186,10 +182,10 @@ if has('autocmd') " vim-tiny does not have autocmd
if exists("g:vscode")
let g:loaded_netrw = 1
let g:loaded_netrwPlugin = 1
if g:vim_package_manager == 'vim-plug'
source ~/.vim/vimrc.d/plugin.vim
elseif has('nvim') && g:vim_package_manager == 'lazy.nvim'
if has('nvim')
runtime lazy.lua
else
source ~/.vim/vimrc.d/plugin.vim
endif
finish
endif
Expand Down Expand Up @@ -401,10 +397,10 @@ if has('autocmd') " vim-tiny does not have autocmd
helptags ~/.vim/doc
endif
if &loadplugins
if g:vim_package_manager == 'vim-plug'
source ~/.vim/vimrc.d/plugin.vim
elseif has('nvim') && g:vim_package_manager == 'lazy.nvim'
if has('nvim')
runtime lazy.lua
else
source ~/.vim/vimrc.d/plugin.vim
endif
endif

Expand Down Expand Up @@ -601,8 +597,4 @@ if has('autocmd') " vim-tiny does not have autocmd
set csprg=gtags-cscope
endif
endif

if g:no_plug == 0 && has('nvim') && !exists("g:vscode") && g:vim_package_manager == 'vim-plug'
runtime vimplug.lua
end
endif
17 changes: 7 additions & 10 deletions root/.vim/vimrc.d/ai.vim
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
if has('nvim') || v:version >= 900
if v:version >= 900
let g:vim_ai_roles_config_file = '~/.vim/vim-ai-roles.ini'

" alternatives: https://github.com/codota/tabnine-nvim
if g:ai_complete == 'copilot'
" copilot.vim在打开文件后,第一次快速进入插入模式时,存在卡顿的问题
" Github Coplit Support
" https://docs.github.com/en/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-neovim?platform=linux
if g:vim_package_manager == 'vim-plug'
if !has('nvim')
Plug 'github/copilot.vim'
endif
" use <C-x> to auto complete github copilot
Expand Down Expand Up @@ -38,7 +38,7 @@ if has('nvim') || v:version >= 900
elseif g:ai_complete == 'codeium'
" Alternative: https://github.com/Exafunction/codeium.nvim
if g:vim_package_manager == 'vim-plug'
if !has('nvim')
Plug 'Exafunction/codeium.vim'
endif
let g:codeium_disable_bindings = 1
Expand All @@ -53,12 +53,8 @@ if has('nvim') || v:version >= 900
imap <M-x> <Plug>(codeium-dismiss)
endif
elseif g:ai_complete == 'fittencode'
if g:vim_package_manager == 'vim-plug'
if has('nvim')
Plug 'luozhiya/fittencode.nvim'
else
Plug 'FittenTech/fittencode.vim'
endif
if !has('nvim')
Plug 'FittenTech/fittencode.vim'
endif
endif
endif
Expand Down Expand Up @@ -117,7 +113,8 @@ if has('python3')

command -nargs=1 -complete=customlist,AISwitchServerComplete AISwitchServer call AISwitchServer(<f-args>) | echom g:vim_ai_endpoint_url . ' ' . g:vim_ai_token_file_path . ' ' . g:vim_ai_model

if g:vim_package_manager == 'vim-plug'

if !has('nvim')
Plug 'madox2/vim-ai'
endif
call AISwitchServer(get(g:, 'ai_service', 'aiproxy'))
Expand Down
Loading

0 comments on commit c298571

Please sign in to comment.