From e084437b4d50a07f3a7b481087a9a967e7204b15 Mon Sep 17 00:00:00 2001 From: QQ Date: Mon, 2 Oct 2023 22:05:38 +0800 Subject: [PATCH] update --- init.lua | 19 +++------------- install.sh => install | 3 +++ lua/G.lua | 13 +++++------ lua/neovim/plugsettings/lspconfig.lua | 31 ++++++++++++++++++++++++++- 4 files changed, 43 insertions(+), 23 deletions(-) rename install.sh => install (88%) diff --git a/init.lua b/init.lua index ec36005..f58cc19 100644 --- a/init.lua +++ b/init.lua @@ -1,21 +1,8 @@ -local G = require('G') +G = require('G') -local lazypath = G.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not G.loop.fs_stat(lazypath) then - G.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) -end +require('plugsettings') -G.opt.rtp:prepend(lazypath) - - -if vim.g.vscode then +if G.g.vscode then require('vscode.vscode') else require('neovim.neovim') diff --git a/install.sh b/install similarity index 88% rename from install.sh rename to install index 585a74e..1131162 100755 --- a/install.sh +++ b/install @@ -1,11 +1,14 @@ if [ -f /etc/lsb-release ]; then + echo "This linux is Ubuntu!!!" + # 安装neovim apt install software-properties-common add-apt-repository ppa:neovim-ppa/unstable apt update && apt upgrade -y && apt install neovim -y + # 安装nodejs(lsp 用得到) curl -sL https://deb.nodesource.com/setup_lts.x | bash - apt update && apt upgrade -y && apt install nodejs -y diff --git a/lua/G.lua b/lua/G.lua index cd43cd2..15e398f 100644 --- a/lua/G.lua +++ b/lua/G.lua @@ -1,12 +1,13 @@ local G = {} -G.g = vim.g -G.b = vim.b -G.o = vim.o -G.fn = vim.fn -G.api = vim.api -G.opt = vim.opt +G.g = vim.g +G.b = vim.b +G.o = vim.o +G.fn = vim.fn +G.api = vim.api +G.opt = vim.opt G.loop = vim.loop +G.lb = vim.lsp.buf function G.map(maps) for _,map in pairs(maps) do diff --git a/lua/neovim/plugsettings/lspconfig.lua b/lua/neovim/plugsettings/lspconfig.lua index 3a5a3ac..c0c8713 100644 --- a/lua/neovim/plugsettings/lspconfig.lua +++ b/lua/neovim/plugsettings/lspconfig.lua @@ -1,3 +1,32 @@ return { - 'neovim/nvim-lspconfig', + { + 'neovim/nvim-lspconfig', + config = function() + local lsp = require('lspconfig') + require'lspconfig'.pyright.setup{} + -- lsp.lua_ls.setup{} + -- local opts = {buffer = ev.buf} + G.map({ + + -- G.lb = vim.lsp.buf + -- { 'n', 'gD', G.lb.declaration, opts}, + -- { 'n', 'gd', G.lb.definition, opts}, + -- { 'n', 'gi', G.lb.implementation, opts}, + + }) + end, + }, + { + 'hrsh7th/nvim-cmp', + dependencies = { + 'hrsh7th/cmp-cmdline', + 'hrsh7th/cmp-path', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-nvim-lsp', + }, + }, + { + 'williamboman/mason.nvim', + }, + }