setup telescope, treesitter, autopairs plugins for neovim
This commit is contained in:
parent
f6eeeba825
commit
489bb981a8
@ -1,3 +1,3 @@
|
||||
require("config.bindings")
|
||||
require("plugins.lazy")
|
||||
require("config.lazy")
|
||||
require("config.options")
|
||||
|
||||
7
.config/nvim/lazy-lock.json
Normal file
7
.config/nvim/lazy-lock.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"auto-pairs": { "branch": "master", "commit": "39f06b873a8449af8ff6a3eee716d3da14d63a76" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "5da195ac3dfafd08d8b10756d975f0e01e1d563a" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }
|
||||
}
|
||||
35
.config/nvim/lua/config/lazy.lua
Normal file
35
.config/nvim/lua/config/lazy.lua
Normal file
@ -0,0 +1,35 @@
|
||||
-- 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.
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
||||
|
||||
4
.config/nvim/lua/plugins/autopairs.lua
Normal file
4
.config/nvim/lua/plugins/autopairs.lua
Normal file
@ -0,0 +1,4 @@
|
||||
return {
|
||||
"jiangmiao/auto-pairs"
|
||||
}
|
||||
|
||||
14
.config/nvim/lua/plugins/telescope.lua
Normal file
14
.config/nvim/lua/plugins/telescope.lua
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
-- Setups
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.8',
|
||||
-- or , branch = '0.1.x',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' }
|
||||
}
|
||||
|
||||
-- Keybindings
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
|
||||
vim.keymap.set('n', '<leader>fb', builtin.buffers)
|
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep)
|
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags)
|
||||
21
.config/nvim/lua/plugins/treesitter.lua
Normal file
21
.config/nvim/lua/plugins/treesitter.lua
Normal file
@ -0,0 +1,21 @@
|
||||
local languages = {"c", "lua", "vim", "vimdoc", "javascript", "html", "java", "typescript", "tsx", "python"}
|
||||
local M = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = function()
|
||||
require("nvim-treesitter.install").update({ with_sync = true })()
|
||||
end,
|
||||
opts = function ()
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
|
||||
configs.setup({
|
||||
ensure_installed = languages,
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
return { M }
|
||||
|
||||
@ -2,3 +2,5 @@ README.md
|
||||
.git
|
||||
scripts
|
||||
Makefile
|
||||
.config/pulse
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user