mirror of https://github.com/LazyVim/starter
Merge branch 'main' into main
commit
cf8e3f2416
|
@ -1,6 +1,11 @@
|
||||||
-- Autocmds are automatically loaded on the VeryLazy event
|
-- Autocmds are automatically loaded on the VeryLazy event
|
||||||
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
||||||
|
--
|
||||||
-- Add any additional autocmds here
|
-- Add any additional autocmds here
|
||||||
|
-- with `vim.api.nvim_create_autocmd`
|
||||||
|
--
|
||||||
|
-- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults)
|
||||||
|
-- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell")
|
||||||
|
|
||||||
vim.cmd([[command! -nargs=* BashCommand lua RunBashCommand(<q-args>)]])
|
vim.cmd([[command! -nargs=* BashCommand lua RunBashCommand(<q-args>)]])
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,18 @@
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
-- bootstrap lazy.nvim
|
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||||
-- stylua: ignore
|
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||||
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", 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
|
end
|
||||||
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
spec = {
|
spec = {
|
||||||
|
@ -42,7 +50,10 @@ require("lazy").setup({
|
||||||
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
||||||
},
|
},
|
||||||
install = { colorscheme = { "tokyonight", "habamax" } },
|
install = { colorscheme = { "tokyonight", "habamax" } },
|
||||||
checker = { enabled = true }, -- automatically check for plugin updates
|
checker = {
|
||||||
|
enabled = true, -- check for plugin updates periodically
|
||||||
|
notify = false, -- notify on update
|
||||||
|
}, -- automatically check for plugin updates
|
||||||
performance = {
|
performance = {
|
||||||
rtp = {
|
rtp = {
|
||||||
-- disable some rtp plugins
|
-- disable some rtp plugins
|
||||||
|
|
|
@ -30,14 +30,6 @@ return {
|
||||||
-- disable trouble
|
-- disable trouble
|
||||||
{ "folke/trouble.nvim", enabled = false },
|
{ "folke/trouble.nvim", enabled = false },
|
||||||
|
|
||||||
-- add symbols-outline
|
|
||||||
{
|
|
||||||
"simrat39/symbols-outline.nvim",
|
|
||||||
cmd = "SymbolsOutline",
|
|
||||||
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
|
|
||||||
config = true,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- override nvim-cmp and add cmp-emoji
|
-- override nvim-cmp and add cmp-emoji
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
|
@ -71,18 +63,6 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- add telescope-fzf-native
|
|
||||||
{
|
|
||||||
"telescope.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-telescope/telescope-fzf-native.nvim",
|
|
||||||
build = "make",
|
|
||||||
config = function()
|
|
||||||
require("telescope").load_extension("fzf")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- add pyright to lspconfig
|
-- add pyright to lspconfig
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
|
@ -177,7 +157,11 @@ return {
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
table.insert(opts.sections.lualine_x, "😄")
|
table.insert(opts.sections.lualine_x, {
|
||||||
|
function()
|
||||||
|
return "😄"
|
||||||
|
end,
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -210,56 +194,4 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Use <tab> for completion and snippets (supertab)
|
|
||||||
-- first: disable default <tab> and <s-tab> behavior in LuaSnip
|
|
||||||
{
|
|
||||||
"L3MON4D3/LuaSnip",
|
|
||||||
keys = function()
|
|
||||||
return {}
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
-- then: setup supertab in cmp
|
|
||||||
{
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
dependencies = {
|
|
||||||
"hrsh7th/cmp-emoji",
|
|
||||||
},
|
|
||||||
---@param opts cmp.ConfigSchema
|
|
||||||
opts = function(_, opts)
|
|
||||||
local has_words_before = function()
|
|
||||||
unpack = unpack or table.unpack
|
|
||||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
|
||||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
|
||||||
end
|
|
||||||
|
|
||||||
local luasnip = require("luasnip")
|
|
||||||
local cmp = require("cmp")
|
|
||||||
|
|
||||||
opts.mapping = vim.tbl_extend("force", opts.mapping, {
|
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_next_item()
|
|
||||||
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
|
|
||||||
-- this way you will only jump inside the snippet region
|
|
||||||
elseif luasnip.expand_or_jumpable() then
|
|
||||||
luasnip.expand_or_jump()
|
|
||||||
elseif has_words_before() then
|
|
||||||
cmp.complete()
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { "i", "s" }),
|
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_prev_item()
|
|
||||||
elseif luasnip.jumpable(-1) then
|
|
||||||
luasnip.jump(-1)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { "i", "s" }),
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue