[nvim] push more config
This commit is contained in:
parent
84dd3c0037
commit
c7e8fb4668
@ -17,8 +17,13 @@ require("lazy").setup({
|
|||||||
-- { import = "lazyvim.plugins.extras.lang.json" },
|
-- { import = "lazyvim.plugins.extras.lang.json" },
|
||||||
},
|
},
|
||||||
defaults = {
|
defaults = {
|
||||||
lazy = true, -- every plugin is lazy-loaded by default
|
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
|
||||||
version = "*", -- try installing the latest stable version for plugins that support semver
|
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
|
||||||
|
lazy = false,
|
||||||
|
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
|
||||||
|
-- have outdated releases, which may break your Neovim install.
|
||||||
|
version = false, -- always use the latest git commit
|
||||||
|
-- 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 }, -- automatically check for plugin updates
|
||||||
|
|||||||
@ -9,6 +9,17 @@ if true then return {} end
|
|||||||
-- * disable/enabled LazyVim plugins
|
-- * disable/enabled LazyVim plugins
|
||||||
-- * override the configuration of LazyVim plugins
|
-- * override the configuration of LazyVim plugins
|
||||||
return {
|
return {
|
||||||
|
-- add gruvbox
|
||||||
|
{ "ellisonleao/gruvbox.nvim" },
|
||||||
|
|
||||||
|
-- Configure LazyVim to load gruvbox
|
||||||
|
{
|
||||||
|
"LazyVim/LazyVim",
|
||||||
|
opts = {
|
||||||
|
colorscheme = "gruvbox",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
-- change trouble config
|
-- change trouble config
|
||||||
{
|
{
|
||||||
"folke/trouble.nvim",
|
"folke/trouble.nvim",
|
||||||
@ -38,10 +49,9 @@ return {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- change some telescope options and add telescope-fzf-native
|
-- change some telescope options and a keymap to browse plugin files
|
||||||
{
|
{
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
dependencies = { { "nvim-telescope/telescope-fzf-native.nvim", build = "make" } },
|
|
||||||
keys = {
|
keys = {
|
||||||
-- add a keymap to browse plugin files
|
-- add a keymap to browse plugin files
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
@ -60,6 +70,12 @@ return {
|
|||||||
winblend = 0,
|
winblend = 0,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- add telescope-fzf-native
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
dependencies = { { "nvim-telescope/telescope-fzf-native.nvim", build = "make" } },
|
||||||
-- apply the config and additionally load fzf-native
|
-- apply the config and additionally load fzf-native
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
local telescope = require("telescope")
|
local telescope = require("telescope")
|
||||||
@ -68,7 +84,20 @@ return {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- add pyright and setup tsserver with typescript.nvim
|
-- add pyright to lspconfig
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
---@class PluginLspOpts
|
||||||
|
opts = {
|
||||||
|
---@type lspconfig.options
|
||||||
|
servers = {
|
||||||
|
-- pyright will be automatically installed with mason and loaded with lspconfig
|
||||||
|
pyright = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- add tsserver and setup with typescript.nvim instead of lspconfig
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
@ -85,8 +114,7 @@ return {
|
|||||||
opts = {
|
opts = {
|
||||||
---@type lspconfig.options
|
---@type lspconfig.options
|
||||||
servers = {
|
servers = {
|
||||||
-- pyright will be automatically installed with mason and loaded with lspconfig
|
-- tsserver will be automatically installed with mason and loaded with lspconfig
|
||||||
pyright = {},
|
|
||||||
tsserver = {},
|
tsserver = {},
|
||||||
},
|
},
|
||||||
-- you can do any additional lsp server setup here
|
-- you can do any additional lsp server setup here
|
||||||
@ -133,7 +161,7 @@ return {
|
|||||||
},
|
},
|
||||||
|
|
||||||
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
|
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
|
||||||
-- would overwrite `ensure_installed` with the ne value.
|
-- would overwrite `ensure_installed` with the new value.
|
||||||
-- If you'd rather extend the default config, use the code below instead:
|
-- If you'd rather extend the default config, use the code below instead:
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
@ -186,4 +214,56 @@ 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()
|
||||||
|
-- they 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…
x
Reference in New Issue
Block a user