init
This commit is contained in:
@@ -0,0 +1,33 @@
|
|||||||
|
vim.cmd("set expandtab")
|
||||||
|
vim.cmd("set tabstop=2")
|
||||||
|
vim.cmd("set softtabstop=2")
|
||||||
|
vim.cmd("set shiftwidth=2")
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
vim.fn.system({
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--filter=blob:none",
|
||||||
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
|
"--branch=stable",
|
||||||
|
lazypath,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
require("lazy").setup("plugins")
|
||||||
|
local builtin = require("telescope.builtin")
|
||||||
|
vim.keymap.set('n', '<C-p>', builtin.find_files, {})
|
||||||
|
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||||
|
vim.keymap.set('n', '<C-e>', ':Neotree filesystem reveal left<CR>')
|
||||||
|
|
||||||
|
require('nvim-treesitter').setup {
|
||||||
|
ensure_installed = { "c", "javascript", "lua" },
|
||||||
|
highlight = { enable = true },
|
||||||
|
indent = { enable = true }
|
||||||
|
}
|
||||||
|
|
||||||
|
require("catppuccin").setup()
|
||||||
|
vim.cmd.colorscheme "catppuccin"
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" },
|
||||||
|
"catppuccin": { "branch": "main", "commit": "0a5de4da015a175f416d6ef1eda84661623e0500" },
|
||||||
|
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||||
|
"cmp-nvim-lua": { "branch": "main", "commit": "e3a22cb071eb9d6508a156306b102c45cd2d573d" },
|
||||||
|
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||||
|
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
|
"neo-tree.nvim": { "branch": "v3.x", "commit": "9d6826582a3e8c84787bd7355df22a2812a1ad59" },
|
||||||
|
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "f386df19b145607a33885b6110ef5c04faae42cb" },
|
||||||
|
"nvim-treesitter": { "branch": "main", "commit": "957f86ae3f049ab6681ed64c05b05768fcaed0d2" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "737cf6c657898d0c697311d79d361288a1343d50" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
|
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
return {
|
||||||
|
"catppuccin/nvim",
|
||||||
|
name = "catppuccin",
|
||||||
|
priority = 1000
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
return {
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"hrsh7th/cmp-nvim-lua",
|
||||||
|
"saadparwaiz1/cmp_luasnip",
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local cmp = require'cmp'
|
||||||
|
local luasnip = require'luasnip'
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
snippet = { expand = function(args) luasnip.lsp_expand(argx.body) end },
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
['<Tab>'] = cmp.mapping.select_next_item(),
|
||||||
|
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||||
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
|
}),
|
||||||
|
sources = {
|
||||||
|
{ name = 'nvim_lsp' },
|
||||||
|
{ name = 'luasnip' },
|
||||||
|
{ name = 'buffer' },
|
||||||
|
{ name = 'path' },
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
return {
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
config = function()
|
||||||
|
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||||
|
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||||
|
|
||||||
|
vim.lsp.config('clangd', {
|
||||||
|
capabilities = capabilities,
|
||||||
|
cmd = { "clangd", "--background-index" },
|
||||||
|
filetypes = { "c", "cpp", "objc", "objcpp" },
|
||||||
|
root_markers = { "compile_commands.json", ".git" },
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.enable('clangd')
|
||||||
|
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
|
||||||
|
end
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
return {
|
||||||
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
|
branch = "v3.x",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"MunifTanjim/nui.nvim",
|
||||||
|
"nvim-tree/nvim-web-devicons"
|
||||||
|
},
|
||||||
|
lazy = false,
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
return {
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
tag = "0.1.5",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" }
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
return {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
build = ":TSUpdate",
|
||||||
|
highlight = { enable = true }
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user