modularize nvim config and some more plugins
This commit is contained in:
@@ -1,14 +1,4 @@
|
|||||||
|
|
||||||
-- Basics
|
|
||||||
vim.opt.number = true
|
|
||||||
vim.opt.relativenumber = true
|
|
||||||
vim.opt.tabstop = 4
|
|
||||||
vim.opt.shiftwidth = 4
|
|
||||||
vim.opt.expandtab = true
|
|
||||||
vim.opt.smartindent = true
|
|
||||||
vim.g.mapleader = " "
|
|
||||||
|
|
||||||
|
|
||||||
-- Bootstrap lazy.nvim
|
-- Bootstrap lazy.nvim
|
||||||
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.loop.fs_stat(lazypath) then
|
||||||
@@ -24,38 +14,14 @@ end
|
|||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
|
||||||
-- Load Plugins
|
|
||||||
local plugins = {
|
|
||||||
|
|
||||||
-- catppuccin: color scheme
|
|
||||||
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 },
|
|
||||||
|
|
||||||
-- telescope: fuzzy search
|
|
||||||
{ "nvim-telescope/telescope.nvim", tag = '0.1.5', dependencies = { "nvim-lua/plenary.nvim" } },
|
|
||||||
|
|
||||||
-- treesitter: code parser
|
|
||||||
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }
|
|
||||||
|
|
||||||
}
|
|
||||||
local opts = {}
|
local opts = {}
|
||||||
require("lazy").setup(plugins, opts)
|
|
||||||
|
require("basic-settings")
|
||||||
|
require("lazy").setup("plugins")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- telescope set up
|
|
||||||
local builtin = require("telescope.builtin")
|
|
||||||
vim.keymap.set('n', '<C-p>', builtin.find_files, {})
|
|
||||||
vim.keymap.set('n', '<leader>f', builtin.live_grep, {})
|
|
||||||
|
|
||||||
|
|
||||||
-- treesitter set up
|
|
||||||
local config = require("nvim-treesitter.config")
|
|
||||||
config.setup({
|
|
||||||
ensure_installed = {"python", "bash", "lua"},
|
|
||||||
highlight = { enable = true },
|
|
||||||
indent = { enable = true }
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
-- catppuccin set up
|
|
||||||
require("catppuccin").setup()
|
|
||||||
vim.cmd.colorscheme "catppuccin"
|
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
-- Basics
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
vim.opt.tabstop = 4
|
||||||
|
vim.opt.shiftwidth = 4
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
vim.opt.smartindent = true
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
|
vim.keymap.set("t", "<esc>", [[<C-\><C-n>]], { desc = "Exit terminal mode" })
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
return {}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
-- catppuccin: color scheme
|
||||||
|
return {
|
||||||
|
"catppuccin/nvim",
|
||||||
|
lazy = false,
|
||||||
|
name = "catppuccin",
|
||||||
|
priority = 1000,
|
||||||
|
|
||||||
|
-- set up
|
||||||
|
config = function()
|
||||||
|
vim.cmd.colorscheme "catppuccin"
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
return {
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
config = function()
|
||||||
|
require('lualine').setup({
|
||||||
|
options = {
|
||||||
|
theme = 'dracula'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
-- nvim-neo-tree: Tree file browser
|
||||||
|
return {
|
||||||
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
|
branch = "v3.x",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"MunifTanjim/nui.nvim",
|
||||||
|
"nvim-tree/nvim-web-devicons", -- optional, but recommended
|
||||||
|
},
|
||||||
|
lazy = false, -- neo-tree will lazily load itself
|
||||||
|
|
||||||
|
-- set up
|
||||||
|
config = function()
|
||||||
|
vim.keymap.set('n', '<C-n>', ':Neotree filesystem reveal left<CR>', {})
|
||||||
|
end
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
-- telescope: fuzzy search
|
||||||
|
return {
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
-- tag = '0.1.5',
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
|
||||||
|
-- set up
|
||||||
|
config = function()
|
||||||
|
local builtin = require("telescope.builtin")
|
||||||
|
vim.keymap.set('n', '<C-p>', builtin.find_files, {})
|
||||||
|
vim.keymap.set('n', '<leader>f', builtin.live_grep, {})
|
||||||
|
end
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
-- treesitter: code parser
|
||||||
|
return {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
build = ":TSUpdate",
|
||||||
|
|
||||||
|
-- set up
|
||||||
|
config = function()
|
||||||
|
local config = require("nvim-treesitter.config")
|
||||||
|
config.setup({
|
||||||
|
ensure_installed = {"python", "bash", "lua"},
|
||||||
|
highlight = { enable = true },
|
||||||
|
indent = { enable = true }
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user