Deleted lazy dependency
This commit is contained in:
parent
27202df0a5
commit
ceeb113721
24 changed files with 193 additions and 243 deletions
26
init.lua
Normal file
26
init.lua
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
vim.g.mapleader = " "
|
||||
|
||||
require('packer')
|
||||
|
||||
require("config.lsp")
|
||||
require("config.diagnostics")
|
||||
require("config.mappings")
|
||||
require("config.commands")
|
||||
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
vim.opt.smartindent= true
|
||||
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
|
||||
vim.opt.linebreak = true
|
||||
vim.opt.showbreak = "—>"
|
||||
|
||||
vim.opt.mouse = "n"
|
||||
vim.opt.mousemodel = "popup"
|
||||
vim.opt.mousescroll = {"ver:1", "hor:0"}
|
||||
0
lua/config/commands.lua
Normal file
0
lua/config/commands.lua
Normal file
|
|
@ -19,6 +19,4 @@ vim.keymap.set('n', ld('fg'), builtin.live_grep, { desc = 'Telescope live grep'
|
|||
vim.keymap.set('n', ld('fb'), builtin.buffers, { desc = 'Telescope buffers' })
|
||||
vim.keymap.set('n', ld('fh'), builtin.help_tags, { desc = 'Telescope help tags' })
|
||||
|
||||
vim.keymap.set('n', ld('t'), auto('Trouble diagnostics toggle'), {desc = 'Toggle diagnostics (Trouble)'})
|
||||
|
||||
vim.keymap.set('n', ld('q'), auto('NERDTreeToggle'), {desc = 'toggle nerdtree'})
|
||||
25
lua/packer.lua
Normal file
25
lua/packer.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
local config_module_dir = 'packs/'
|
||||
local packs_file = 'packs.lua'
|
||||
|
||||
vim.pack.add(require(packs_file))
|
||||
|
||||
local config_module_path = vim.fs.joinpath(vim.fn.stdpath('config'), 'lua/' .. config_module_dir)
|
||||
for name, _ in vim.fs.dir(config_module_path) do
|
||||
if name == 'lua.lua' then
|
||||
goto continue
|
||||
end
|
||||
local ok, config = pcall(require,config_module_dir .. name:gsub('%.lua',''))
|
||||
if ok then
|
||||
if config[1] ~= nil then
|
||||
config[1]()
|
||||
end
|
||||
if config['config'] ~= nil then
|
||||
config['config']()
|
||||
end
|
||||
end
|
||||
::continue::
|
||||
end
|
||||
|
||||
vim.api.nvim_create_user_command('UpdatePacks', function ()
|
||||
vim.pack.update()
|
||||
end, {})
|
||||
56
lua/packs/cmp.lua
Normal file
56
lua/packs/cmp.lua
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
function config_cmp()
|
||||
local cmp = require'cmp'
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
-- completion = cmp.config.window.bordered(),
|
||||
-- documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
||||
cmp.setup.cmdline({ '/', '?' }, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
}),
|
||||
matching = { disallow_symbol_nonprefix_matching = false }
|
||||
})
|
||||
|
||||
-- local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
-- vim.lsp.config('<YOUR_LSP_SERVER>', {
|
||||
-- capabilities = capabilities
|
||||
-- })
|
||||
-- vim.lsp.enable('<YOUR_LSP_SERVER>')
|
||||
|
||||
end
|
||||
|
||||
return {
|
||||
config_cmp
|
||||
}
|
||||
22
lua/packs/lua.lua
Normal file
22
lua/packs/lua.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
function gh(link)
|
||||
return 'https://github.com/' .. link
|
||||
end
|
||||
|
||||
return {
|
||||
gh('L3MON4D3/LuaSnip'),
|
||||
gh('folke/which-key.nvim'),
|
||||
gh('hrsh7th/cmp-buffer'),
|
||||
gh('hrsh7th/cmp-cmdline'),
|
||||
gh('hrsh7th/cmp-nvim-lsp'),
|
||||
gh('hrsh7th/cmp-path'),
|
||||
gh('hrsh7th/nvim-cmp'),
|
||||
gh('iamcco/markdown-preview.nvim'),
|
||||
gh('midoBB/nvim-quicktype'),
|
||||
gh('nvim-lua/plenary.nvim'),
|
||||
gh('neovim/nvim-lspconfig'),
|
||||
gh('nvim-telescope/telescope.nvim'),
|
||||
gh('preservim/nerdtree'),
|
||||
gh('saadparwaiz1/cmp_luasnip'),
|
||||
gh('sakhnik/nvim-gdb')
|
||||
}
|
||||
|
||||
64
nvim-pack-lock.json
Normal file
64
nvim-pack-lock.json
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
"plugins": {
|
||||
"LuaSnip": {
|
||||
"rev": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24",
|
||||
"src": "https://github.com/L3MON4D3/LuaSnip"
|
||||
},
|
||||
"cmp-buffer": {
|
||||
"rev": "b74fab3656eea9de20a9b8116afa3cfc4ec09657",
|
||||
"src": "https://github.com/hrsh7th/cmp-buffer"
|
||||
},
|
||||
"cmp-cmdline": {
|
||||
"rev": "d126061b624e0af6c3a556428712dd4d4194ec6d",
|
||||
"src": "https://github.com/hrsh7th/cmp-cmdline"
|
||||
},
|
||||
"cmp-nvim-lsp": {
|
||||
"rev": "cbc7b02bb99fae35cb42f514762b89b5126651ef",
|
||||
"src": "https://github.com/hrsh7th/cmp-nvim-lsp"
|
||||
},
|
||||
"cmp-path": {
|
||||
"rev": "c642487086dbd9a93160e1679a1327be111cbc25",
|
||||
"src": "https://github.com/hrsh7th/cmp-path"
|
||||
},
|
||||
"cmp_luasnip": {
|
||||
"rev": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90",
|
||||
"src": "https://github.com/saadparwaiz1/cmp_luasnip"
|
||||
},
|
||||
"markdown-preview.nvim": {
|
||||
"rev": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee",
|
||||
"src": "https://github.com/iamcco/markdown-preview.nvim"
|
||||
},
|
||||
"nerdtree": {
|
||||
"rev": "690d061b591525890f1471c6675bcb5bdc8cdff9",
|
||||
"src": "https://github.com/preservim/nerdtree"
|
||||
},
|
||||
"nvim-cmp": {
|
||||
"rev": "2ffe79f1f021def8dd1fcd81deb16f1bb0d989f3",
|
||||
"src": "https://github.com/hrsh7th/nvim-cmp"
|
||||
},
|
||||
"nvim-gdb": {
|
||||
"rev": "67abac716b626ece57f3a7c72121542f0b3edfe9",
|
||||
"src": "https://github.com/sakhnik/nvim-gdb"
|
||||
},
|
||||
"nvim-lspconfig": {
|
||||
"rev": "77b7432d4770d23b277d37923e5a08a442d8bb07",
|
||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
"nvim-quicktype": {
|
||||
"rev": "6d557a32fec1fb8a0b635e98cb856b24c7f0ef00",
|
||||
"src": "https://github.com/midoBB/nvim-quicktype"
|
||||
},
|
||||
"plenary.nvim": {
|
||||
"rev": "74b06c6c75e4eeb3108ec01852001636d85a932b",
|
||||
"src": "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
"telescope.nvim": {
|
||||
"rev": "40aedd8a68c78a656a10a8d62d80c54af59420fb",
|
||||
"src": "https://github.com/nvim-telescope/telescope.nvim"
|
||||
},
|
||||
"which-key.nvim": {
|
||||
"rev": "3aab2147e74890957785941f0c1ad87d0a44c15a",
|
||||
"src": "https://github.com/folke/which-key.nvim"
|
||||
}
|
||||
}
|
||||
}
|
||||
28
old/init.lua
28
old/init.lua
|
|
@ -1,28 +0,0 @@
|
|||
vim.g.mapleader = "<Space>"
|
||||
|
||||
require("config.lazy")
|
||||
require("config.lsp")
|
||||
require("config.diagnostics")
|
||||
require("config.mappings")
|
||||
require("lazy").setup("plugins")
|
||||
|
||||
local opt = vim.opt
|
||||
|
||||
opt.number = true
|
||||
opt.relativenumber = true
|
||||
|
||||
opt.smartindent= true
|
||||
--opt.clipboard='unnamedplus'
|
||||
|
||||
opt.tabstop = 4
|
||||
opt.shiftwidth = 4
|
||||
|
||||
opt.ignorecase = true
|
||||
opt.smartcase = true
|
||||
|
||||
opt.linebreak = true
|
||||
opt.showbreak = "—>"
|
||||
|
||||
opt.mouse = "n"
|
||||
opt.mousemodel = "popup"
|
||||
opt.mousescroll = {"ver:1", "hor:0"}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
||||
"nerdtree": { "branch": "master", "commit": "690d061b591525890f1471c6675bcb5bdc8cdff9" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "2ffe79f1f021def8dd1fcd81deb16f1bb0d989f3" },
|
||||
"nvim-gdb": { "branch": "master", "commit": "67abac716b626ece57f3a7c72121542f0b3edfe9" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "910f0c4d46aa186641518395bc7e6fffb4d23baf" },
|
||||
"nvim-quicktype": { "branch": "main", "commit": "6d557a32fec1fb8a0b635e98cb856b24c7f0ef00" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Make sure to setup `mapleader` and `maplocalleader` before
|
||||
-- loading lazy.nvim so that mappings are correct.
|
||||
-- This is also a good place to setup other settings (vim.opt)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- import your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "habamax" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
function config_cmp()
|
||||
-- Set up nvim-cmp.
|
||||
local cmp = require'cmp'
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
-- REQUIRED - you must specify a snippet engine
|
||||
expand = function(args)
|
||||
--vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
|
||||
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
||||
-- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
|
||||
|
||||
-- For `mini.snippets` users:
|
||||
-- local insert = MiniSnippets.config.expand.insert or MiniSnippets.default_insert
|
||||
-- insert({ body = args.body }) -- Insert at cursor
|
||||
-- cmp.resubscribe({ "TextChangedI", "TextChangedP" })
|
||||
-- require("cmp.config").set_onetime({ sources = {} })
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
-- completion = cmp.config.window.bordered(),
|
||||
-- documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
--{ name = 'vsnip' }, -- For vsnip users.
|
||||
{ name = 'luasnip' }, -- For luasnip users.
|
||||
-- { name = 'ultisnips' }, -- For ultisnips users.
|
||||
-- { name = 'snippy' }, -- For snippy users.
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
||||
-- To use git you need to install the plugin petertriho/cmp-git and uncomment lines below
|
||||
-- Set configuration for specific filetype.
|
||||
--[[ cmp.setup.filetype('gitcommit', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'git' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
require("cmp_git").setup() ]]--
|
||||
|
||||
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline({ '/', '?' }, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
}),
|
||||
matching = { disallow_symbol_nonprefix_matching = false }
|
||||
})
|
||||
|
||||
-- Set up lspconfig.
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
|
||||
vim.lsp.config('<YOUR_LSP_SERVER>', {
|
||||
capabilities = capabilities
|
||||
})
|
||||
vim.lsp.enable('<YOUR_LSP_SERVER>')
|
||||
|
||||
end
|
||||
|
||||
return {
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'hrsh7th/cmp-path',
|
||||
'hrsh7th/cmp-cmdline',
|
||||
{
|
||||
'hrsh7th/nvim-cmp',
|
||||
config = config_cmp
|
||||
},
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
return {
|
||||
'sakhnik/nvim-gdb',
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
return
|
||||
{
|
||||
'folke/trouble.nvim',
|
||||
opts = {},
|
||||
cmd = "Trouble",
|
||||
}
|
||||
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
return {
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
build = "cd app && yarn install",
|
||||
init = function()
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
end,
|
||||
ft = { "markdown" },
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
return {
|
||||
'neovim/nvim-lspconfig',
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
return {
|
||||
"midoBB/nvim-quicktype" ,
|
||||
cmd = "QuickType",
|
||||
ft = { "typescript", "python", "java", "go", "rust", "cs", "swift", "elixir", "kotlin", "typescriptreact", "dart" }
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
return {
|
||||
'L3MON4D3/LuaSnip',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
return
|
||||
{
|
||||
'nvim-telescope/telescope.nvim', version = '*',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
-- optional but recommended
|
||||
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
function theme()
|
||||
vim.cmd('colorscheme tokyonight')
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = theme,
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
return {
|
||||
'preservim/nerdtree',
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
return {
|
||||
'folke/which-key.nvim',
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
vim.opt.showmatch = true
|
||||
Loading…
Add table
Add a link
Reference in a new issue