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', + }, + }