init
This commit is contained in:
commit
866a877889
|
|
@ -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.
|
||||
install = { colorscheme = { "habamax" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
return {
|
||||
{
|
||||
"kylechui/nvim-surround",
|
||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-surround").setup({
|
||||
-- Configuration here, or leave empty to use defaults
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
'echasnovski/mini.pairs',
|
||||
version = '*' ,
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require('mini.pairs').setup({})
|
||||
end
|
||||
},
|
||||
{ 'echasnovski/mini.ai', version = '*' , },
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||
},
|
||||
config = function()
|
||||
vim.keymap.set("n", "<leader>e", function()
|
||||
vim.cmd [[Neotree]]
|
||||
end, { desc = "Run Neotree" })
|
||||
end
|
||||
}, {
|
||||
'MagicDuck/grug-far.nvim',
|
||||
config = function()
|
||||
require('grug-far').setup({
|
||||
-- options, see Configuration section below
|
||||
-- there are no required options atm
|
||||
-- engine = 'ripgrep' is default, but 'astgrep' can be specified
|
||||
});
|
||||
|
||||
vim.keymap.set("n", "<leader>g", function()
|
||||
vim.cmd [[GrugFar]]
|
||||
end, { desc = "Run GrugFar" })
|
||||
end
|
||||
}, {
|
||||
"folke/flash.nvim",
|
||||
event = "VeryLazy",
|
||||
---@type Flash.Config
|
||||
opts = {},
|
||||
-- stylua: ignore
|
||||
}, {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.8',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
config = function()
|
||||
local builtin = require('telescope.builtin')
|
||||
local utils = require('telescope.utils')
|
||||
|
||||
vim.keymap.set('n', '<leader>l', builtin.live_grep, { desc = 'Telescope live grep' })
|
||||
vim.keymap.set('n', '<leader>b', builtin.buffers, { desc = 'Telescope buffers' })
|
||||
vim.keymap.set('n', '<leader>h', builtin.help_tags, { desc = 'Telescope help tags' })
|
||||
vim.keymap.set('n', '<leader>t', function()
|
||||
vim.cmd [[TodoTelescope]]
|
||||
end, { desc = 'Telescope Todo' })
|
||||
|
||||
vim.keymap.set('n', '<leader>cd', builtin.diagnostics, { desc = 'Telescope diagnostics' })
|
||||
vim.keymap.set('n', '<leader>cr', builtin.lsp_references, { desc = 'Telescope lsp references' })
|
||||
vim.keymap.set('n', '<leader>cs', builtin.treesitter, { desc = 'Telescope treesitter' })
|
||||
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
|
||||
vim.keymap.set('n', '<leader>fb', function()
|
||||
builtin.find_files({ cwd = utils.buffer_dir() })
|
||||
end, { desc = 'Telescope find in buffer dir' })
|
||||
|
||||
vim.keymap.set('n', '<leader>fs', function()
|
||||
vim.cmd [[w]]
|
||||
end, { desc = 'Save' })
|
||||
|
||||
vim.keymap.set('n', '<leader>fq', function()
|
||||
vim.cmd [[q]]
|
||||
end, { desc = 'Close' })
|
||||
|
||||
vim.keymap.set('n', '<leader>fQ', function()
|
||||
vim.cmd [[q!]]
|
||||
end, { desc = 'Force close' })
|
||||
|
||||
vim.keymap.set('n', '<leader>fd', function()
|
||||
vim.cmd [[wq]]
|
||||
end, { desc = 'Save and close' })
|
||||
end
|
||||
}, {
|
||||
"folke/trouble.nvim",
|
||||
opts = {}, -- for default options, refer to the configuration section for custom setup.
|
||||
cmd = "Trouble",
|
||||
}, {
|
||||
"aznhe21/actions-preview.nvim",
|
||||
config = function()
|
||||
vim.keymap.set({ "v", "n" }, "<leader>ca", require("actions-preview").code_actions, { desc = "Telescope code actions"})
|
||||
end,
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
return {
|
||||
{
|
||||
"pmizio/typescript-tools.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
|
||||
opts = {},
|
||||
config = function()
|
||||
require('typescript-tools').setup({})
|
||||
end
|
||||
},{
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
},
|
||||
config = function()
|
||||
require('cmp').setup({
|
||||
completion = {
|
||||
keyword_length = 1,
|
||||
max_item_count = 6
|
||||
},
|
||||
sources = {
|
||||
{ name = "nvim_lsp", keyword_length = 1, max_item_count = 6 },
|
||||
{ name = "buffer", keyword_length = 1, max_item_count = 6 },
|
||||
{ name = "path", keyword_length = 1, max_item_count = 6 },
|
||||
}
|
||||
})
|
||||
end
|
||||
},{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function ()
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
|
||||
configs.setup({
|
||||
ensure_installed = { "tsx", "typescript", "javascript", "html" },
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
return {
|
||||
{
|
||||
"ellisonleao/gruvbox.nvim",
|
||||
config = function()
|
||||
vim.cmd([[colorscheme gruvbox]])
|
||||
end
|
||||
},
|
||||
{
|
||||
'akinsho/bufferline.nvim',
|
||||
version = "*",
|
||||
dependencies = 'nvim-tree/nvim-web-devicons',
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("bufferline").setup()
|
||||
end
|
||||
},{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("lualine").setup()
|
||||
end
|
||||
}, {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
require('todo-comments').setup({})
|
||||
|
||||
vim.keymap.set("n", "]t", function()
|
||||
require("todo-comments").jump_next()
|
||||
end, { desc = "Next todo comment" })
|
||||
|
||||
vim.keymap.set("n", "[t", function()
|
||||
require("todo-comments").jump_prev()
|
||||
end, { desc = "Previous todo comment" })
|
||||
end
|
||||
},{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue