refactored neovim setup, init.lua is now 25 lines long instead of 224 lines long. all vim options moved to . all keybindings moved to . All plugins moved to . Also added which-key and alpha
This commit is contained in:
parent
96fd1c7641
commit
832ca5d0f5
16
example-layout.md
Normal file
16
example-layout.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
This is a nice example layout that I think would be a reasonable
|
||||||
|
way to layout my neovim configuration.
|
||||||
|
|
||||||
|
```
|
||||||
|
~/.config/nvim/
|
||||||
|
├── init.lua
|
||||||
|
└── lua
|
||||||
|
├── core
|
||||||
|
│ ├── keymaps.lua
|
||||||
|
│ └── options.lua
|
||||||
|
└── plugins
|
||||||
|
└── plugin.lua
|
||||||
|
└── configs.lua
|
||||||
|
```
|
||||||
|
|
||||||
209
init.lua
209
init.lua
@ -1,20 +1,5 @@
|
|||||||
-- Basic Settings - just throwing some text here to update the status
|
-- Load core settings
|
||||||
vim.opt.number = true
|
require("core.options")
|
||||||
vim.opt.relativenumber = true
|
|
||||||
vim.opt.mouse = 'a'
|
|
||||||
vim.opt.ignorecase = true
|
|
||||||
vim.opt.smartcase = true
|
|
||||||
vim.opt.hlsearch = false
|
|
||||||
vim.opt.wrap = false
|
|
||||||
vim.opt.tabstop = 4
|
|
||||||
vim.opt.shiftwidth = 4
|
|
||||||
vim.opt.expandtab = true
|
|
||||||
vim.opt.termguicolors = true
|
|
||||||
vim.opt.cursorline = true
|
|
||||||
vim.opt.signcolumn = 'yes'
|
|
||||||
|
|
||||||
-- Leader key
|
|
||||||
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"
|
||||||
@ -30,190 +15,8 @@ if not vim.loop.fs_stat(lazypath) then
|
|||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
-- Plugins
|
-- Load plugins
|
||||||
require("lazy").setup({
|
require("lazy").setup("plugins")
|
||||||
-- Color scheme
|
|
||||||
{
|
|
||||||
"catppuccin/nvim",
|
|
||||||
name = "catppuccin",
|
|
||||||
priority = 1000,
|
|
||||||
config = function()
|
|
||||||
vim.cmd.colorscheme "catppuccin-mocha"
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- File explorer
|
-- Load core keymaps
|
||||||
{
|
require("core.keymaps")
|
||||||
"nvim-tree/nvim-tree.lua",
|
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
|
||||||
config = function()
|
|
||||||
require("nvim-tree").setup()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Fuzzy finder
|
|
||||||
{
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
dependencies = { "nvim-lua/plenary.nvim" },
|
|
||||||
config = function()
|
|
||||||
require("telescope").setup()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"stevearc/conform.nvim",
|
|
||||||
opts = {
|
|
||||||
format_on_save = { timeout_ms = 1000, lsp_fallback = true },
|
|
||||||
formatters_by_ft = {
|
|
||||||
javascript = { "prettierd", "prettier" },
|
|
||||||
javascriptreact = { "prettierd", "prettier" },
|
|
||||||
typescript = { "prettierd", "prettier" },
|
|
||||||
typescriptreact = { "prettierd", "prettier" },
|
|
||||||
json = { "prettierd", "prettier" },
|
|
||||||
css = { "prettierd", "prettier" },
|
|
||||||
html = { "prettierd", "prettier" },
|
|
||||||
markdown = { "prettierd", "prettier" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Syntax highlighting
|
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
build = ":TSUpdate",
|
|
||||||
config = function()
|
|
||||||
require("nvim-treesitter.configs").setup({
|
|
||||||
ensure_installed = {
|
|
||||||
"lua", "vim", "bash", "javascript", "typescript", "tsx", "json", "yaml", "html", "css", "prisma",
|
|
||||||
"graphql"
|
|
||||||
},
|
|
||||||
highlight = { enable = true },
|
|
||||||
indent = { enable = true },
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Autocompletion
|
|
||||||
{
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
dependencies = {
|
|
||||||
"hrsh7th/cmp-buffer",
|
|
||||||
"hrsh7th/cmp-path",
|
|
||||||
"L3MON4D3/LuaSnip",
|
|
||||||
"saadparwaiz1/cmp_luasnip",
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
local cmp = require("cmp")
|
|
||||||
cmp.setup({
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
require("luasnip").lsp_expand(args.body)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
|
||||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
|
||||||
['<Tab>'] = cmp.mapping.select_next_item(),
|
|
||||||
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
|
||||||
}),
|
|
||||||
sources = {
|
|
||||||
{ name = 'buffer' },
|
|
||||||
{ name = 'path' },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- plugins (append to your lazy setup)
|
|
||||||
{
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
build = ":MasonUpdate",
|
|
||||||
config = true,
|
|
||||||
},
|
|
||||||
{ "williamboman/mason-lspconfig.nvim" },
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
dependencies = {
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
"williamboman/mason-lspconfig.nvim",
|
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pmizio/typescript-tools.nvim",
|
|
||||||
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
|
|
||||||
},
|
|
||||||
{ "rafamadriz/friendly-snippets" },
|
|
||||||
|
|
||||||
{ "NvChad/nvim-colorizer.lua", opts = { user_default_options = { names = false } } },
|
|
||||||
{ "luckasRanarison/tailwind-tools.nvim", opts = { document_color = { enabled = true } } },
|
|
||||||
|
|
||||||
|
|
||||||
-- Status line
|
|
||||||
{
|
|
||||||
"nvim-lualine/lualine.nvim",
|
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
|
||||||
config = function()
|
|
||||||
require("lualine").setup({
|
|
||||||
options = { theme = "catppuccin" },
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Key mappings
|
|
||||||
local keymap = vim.keymap.set
|
|
||||||
|
|
||||||
-- File explorer
|
|
||||||
keymap('n', '<leader>e', ':NvimTreeToggle<CR>', { desc = "Toggle file explorer" })
|
|
||||||
|
|
||||||
-- Fuzzy finder
|
|
||||||
keymap('n', '<leader>ff', '<cmd>Telescope find_files<cr>', { desc = "Find files" })
|
|
||||||
keymap('n', '<leader>fg', '<cmd>Telescope live_grep<cr>', { desc = "Live grep" })
|
|
||||||
keymap('n', '<leader>fb', '<cmd>Telescope buffers<cr>', { desc = "Find buffers" })
|
|
||||||
|
|
||||||
-- Better window navigation
|
|
||||||
keymap('n', '<C-h>', '<C-w>h')
|
|
||||||
keymap('n', '<C-j>', '<C-w>j')
|
|
||||||
keymap('n', '<C-k>', '<C-w>k')
|
|
||||||
keymap('n', '<C-l>', '<C-w>l')
|
|
||||||
|
|
||||||
-- Quick save and quit
|
|
||||||
keymap('n', '<leader>w', ':w<CR>', { desc = "Save" })
|
|
||||||
keymap('n', '<leader>q', ':q<CR>', { desc = "Quit" })
|
|
||||||
|
|
||||||
-- cmp: add LSP and snippets to your existing config
|
|
||||||
local cmp = require("cmp")
|
|
||||||
local luasnip = require("luasnip")
|
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
|
||||||
local lsp = require("cmp_nvim_lsp")
|
|
||||||
local capabilities = lsp.default_capabilities()
|
|
||||||
|
|
||||||
cmp.setup({
|
|
||||||
snippet = { expand = function(args) luasnip.lsp_expand(args.body) end },
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
|
||||||
["<Tab>"] = cmp.mapping.select_next_item(),
|
|
||||||
["<S-Tab>"] = cmp.mapping.select_prev_item(),
|
|
||||||
}),
|
|
||||||
sources = {
|
|
||||||
{ name = "nvim_lsp" },
|
|
||||||
{ name = "path" },
|
|
||||||
{ name = "buffer" },
|
|
||||||
{ name = "luasnip" },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- LSP setup
|
|
||||||
require("mason").setup()
|
|
||||||
require("mason-lspconfig").setup({
|
|
||||||
ensure_installed = { "ts_ls", "eslint", "jsonls", "html", "cssls", "tailwindcss" },
|
|
||||||
})
|
|
||||||
|
|
||||||
-- TypeScript
|
|
||||||
require("typescript-tools").setup({
|
|
||||||
settings = {
|
|
||||||
tsserver_file_preferences = { includeInlayParameterNameHints = "all", includeCompletionsForModuleExports = true },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|||||||
@ -1,24 +1,25 @@
|
|||||||
{
|
{
|
||||||
"LuaSnip": { "branch": "master", "commit": "eec1a84823e3fb9eb51705265cab77d9a970be20" },
|
"LuaSnip": { "branch": "master", "commit": "ccf25a5452b8697a823de3e5ecda63ed3d723b79" },
|
||||||
|
"alpha-nvim": { "branch": "main", "commit": "3979b01cb05734331c7873049001d3f2bb8477f4" },
|
||||||
"catppuccin": { "branch": "main", "commit": "af58927c55c9f3272c940ff02b3cee94a1249f26" },
|
"catppuccin": { "branch": "main", "commit": "af58927c55c9f3272c940ff02b3cee94a1249f26" },
|
||||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
|
||||||
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||||
"conform.nvim": { "branch": "master", "commit": "fbcb4fa7f34bfea9be702ffff481a8e336ebf6ed" },
|
"conform.nvim": { "branch": "master", "commit": "235dd79731c1dc51ec04abb4045cbc54727a172a" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "1ea3c4085785f460fb0e46d2fe1ee895f5f9e7c1" },
|
"lazy.nvim": { "branch": "main", "commit": "1ea3c4085785f460fb0e46d2fe1ee895f5f9e7c1" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
|
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "6bdb14f230de0904229ec367b410fb817e59b072" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "2304ff65ecc8cb2afc2484de3e2ed9a407edf0b9" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
"nvim-cmp": { "branch": "main", "commit": "a7bcf1d88069fc67c9ace8a62ba480b8fe879025" },
|
||||||
"nvim-colorizer.lua": { "branch": "master", "commit": "51cf7c995ed1eb6642aecf19067ee634fa1b6ba2" },
|
"nvim-colorizer.lua": { "branch": "master", "commit": "51cf7c995ed1eb6642aecf19067ee634fa1b6ba2" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "ac98db2f9f06a56498ec890a96928774eae412c3" },
|
"nvim-lspconfig": { "branch": "master", "commit": "e5c61b02f33b5c6538be25b2696b33b4cc91e667" },
|
||||||
"nvim-tree.lua": { "branch": "master", "commit": "e397756d2a79d74314ea4cd3efc41300e91c0ff0" },
|
"nvim-tree.lua": { "branch": "master", "commit": "64e2192f5250796aa4a7f33c6ad888515af50640" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "b8221e42cf7287c4dcde81f232f58d7b947c210d" },
|
"nvim-web-devicons": { "branch": "master", "commit": "b8221e42cf7287c4dcde81f232f58d7b947c210d" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
"tailwind-tools.nvim": { "branch": "master", "commit": "fbe982901d4508b0dcd80e07addf0fcb6dab6c49" },
|
|
||||||
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
|
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
|
||||||
"typescript-tools.nvim": { "branch": "master", "commit": "bf11d98ad5736e1cbc1082ca9a03196d45c701f1" }
|
"typescript-tools.nvim": { "branch": "master", "commit": "bf11d98ad5736e1cbc1082ca9a03196d45c701f1" },
|
||||||
|
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||||
}
|
}
|
||||||
|
|||||||
20
lua/core/keymaps.lua
Normal file
20
lua/core/keymaps.lua
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
-- Key mappings
|
||||||
|
local keymap = vim.keymap.set
|
||||||
|
|
||||||
|
-- File explorer
|
||||||
|
keymap('n', '<leader>e', ':NvimTreeToggle<CR>', { desc = "Toggle file explorer" })
|
||||||
|
|
||||||
|
-- Fuzzy finder
|
||||||
|
keymap('n', '<leader>ff', '<cmd>Telescope find_files<cr>', { desc = "Find files" })
|
||||||
|
keymap('n', '<leader>fg', '<cmd>Telescope live_grep<cr>', { desc = "Live grep" })
|
||||||
|
keymap('n', '<leader>fb', '<cmd>Telescope buffers<cr>', { desc = "Find buffers" })
|
||||||
|
|
||||||
|
-- Better window navigation
|
||||||
|
keymap('n', '<C-h>', '<C-w>h')
|
||||||
|
keymap('n', '<C-j>', '<C-w>j')
|
||||||
|
keymap('n', '<C-k>', '<C-w>k')
|
||||||
|
keymap('n', '<C-l>', '<C-w>l')
|
||||||
|
|
||||||
|
-- Quick save and quit
|
||||||
|
keymap('n', '<leader>w', ':w<CR>', { desc = "Save" })
|
||||||
|
keymap('n', '<leader>q', ':q<CR>', { desc = "Quit" })
|
||||||
18
lua/core/options.lua
Normal file
18
lua/core/options.lua
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
-- Basic Settings
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
vim.opt.mouse = 'a'
|
||||||
|
vim.opt.ignorecase = true
|
||||||
|
vim.opt.smartcase = true
|
||||||
|
vim.opt.hlsearch = false
|
||||||
|
vim.opt.wrap = false
|
||||||
|
vim.opt.tabstop = 4
|
||||||
|
vim.opt.shiftwidth = 4
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
vim.opt.signcolumn = 'yes'
|
||||||
|
vim.opt.clipboard = "unnamedplus"
|
||||||
|
|
||||||
|
-- Leader key
|
||||||
|
vim.g.mapleader = ' '
|
||||||
209
lua/plugins/plugin.lua
Normal file
209
lua/plugins/plugin.lua
Normal file
@ -0,0 +1,209 @@
|
|||||||
|
return {
|
||||||
|
-- Color scheme
|
||||||
|
{
|
||||||
|
"catppuccin/nvim",
|
||||||
|
name = "catppuccin",
|
||||||
|
priority = 1000,
|
||||||
|
config = function()
|
||||||
|
vim.cmd.colorscheme "catppuccin-mocha"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- File explorer
|
||||||
|
{
|
||||||
|
"nvim-tree/nvim-tree.lua",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
config = function()
|
||||||
|
require("nvim-tree").setup()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Fuzzy finder
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
config = function()
|
||||||
|
require("telescope").setup()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Formatter
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
opts = {
|
||||||
|
format_on_save = { timeout_ms = 1000, lsp_fallback = true },
|
||||||
|
formatters_by_ft = {
|
||||||
|
javascript = { "prettierd", "prettier" },
|
||||||
|
javascriptreact = { "prettierd", "prettier" },
|
||||||
|
typescript = { "prettierd", "prettier" },
|
||||||
|
typescriptreact = { "prettierd", "prettier" },
|
||||||
|
json = { "prettierd", "prettier" },
|
||||||
|
css = { "prettierd", "prettier" },
|
||||||
|
html = { "prettierd", "prettier" },
|
||||||
|
markdown = { "prettierd", "prettier" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Syntax highlighting
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
build = ":TSUpdate",
|
||||||
|
config = function()
|
||||||
|
require("nvim-treesitter.configs").setup({
|
||||||
|
ensure_installed = {
|
||||||
|
"lua", "vim", "bash", "javascript", "typescript", "tsx", "json", "yaml", "html", "css", "prisma",
|
||||||
|
"graphql"
|
||||||
|
},
|
||||||
|
highlight = { enable = true },
|
||||||
|
indent = { enable = true },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Autocompletion
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
"saadparwaiz1/cmp_luasnip",
|
||||||
|
"rafamadriz/friendly-snippets",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
snippet = { expand = function(args) luasnip.lsp_expand(args.body) end },
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||||
|
["<Tab>"] = cmp.mapping.select_next_item(),
|
||||||
|
["<S-Tab>"] = cmp.mapping.select_prev_item(),
|
||||||
|
}),
|
||||||
|
sources = {
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "path" },
|
||||||
|
{ name = "buffer" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- LSP
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
build = ":MasonUpdate",
|
||||||
|
config = true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
dependencies = { "williamboman/mason.nvim" },
|
||||||
|
config = function()
|
||||||
|
require("mason-lspconfig").setup({
|
||||||
|
ensure_installed = { "ts_ls", "eslint", "jsonls", "html", "cssls", "tailwindcss" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
dependencies = {
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pmizio/typescript-tools.nvim",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
|
||||||
|
config = function()
|
||||||
|
require("typescript-tools").setup({
|
||||||
|
settings = {
|
||||||
|
tsserver_file_preferences = {
|
||||||
|
includeInlayParameterNameHints = "all",
|
||||||
|
includeCompletionsForModuleExports = true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Colorizer
|
||||||
|
{
|
||||||
|
"NvChad/nvim-colorizer.lua",
|
||||||
|
opts = { user_default_options = { names = false } }
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Status line
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
config = function()
|
||||||
|
require("lualine").setup({
|
||||||
|
options = { theme = "catppuccin" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Which-key
|
||||||
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function()
|
||||||
|
local wk = require("which-key")
|
||||||
|
wk.setup({
|
||||||
|
preset = "modern",
|
||||||
|
})
|
||||||
|
|
||||||
|
wk.add({
|
||||||
|
{ "<leader>e", desc = "Toggle file explorer" },
|
||||||
|
{ "<leader>f", group = "Find" },
|
||||||
|
{ "<leader>ff", desc = "Find files" },
|
||||||
|
{ "<leader>fg", desc = "Live grep" },
|
||||||
|
{ "<leader>fb", desc = "Find buffers" },
|
||||||
|
{ "<leader>w", desc = "Save" },
|
||||||
|
{ "<leader>q", desc = "Quit" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Alpha (dashboard)
|
||||||
|
{
|
||||||
|
"goolord/alpha-nvim",
|
||||||
|
config = function()
|
||||||
|
local alpha = require('alpha')
|
||||||
|
local dashboard = require("alpha.themes.dashboard")
|
||||||
|
dashboard.section.header.val = {
|
||||||
|
[[ ^ ^ ^ ^☆ ★ ☆ ___I_☆ ★ ☆ ^ ^ ^ ^ ^ ^ ^ ]],
|
||||||
|
[[ /|\/|\/|\ /|\ ★☆ /\-_--\ ☆ ★/|\/|\ /|\/|\/|\ /|\/|\ ]],
|
||||||
|
[[ /|\/|\/|\ /|\ ★ / \_-__\☆ ★/|\/|\ /|\/|\/|\ /|\/|\ ]],
|
||||||
|
[[ /|\/|\/|\ /|\ |[]| [] | /|\/|\ /|\/|\/|\ /|\/|\ ]],
|
||||||
|
}
|
||||||
|
|
||||||
|
dashboard.section.buttons.val = {
|
||||||
|
dashboard.button("e", " New file", ":ene <BAR> startinsert <CR>"),
|
||||||
|
dashboard.button("f", " Find file", ":lua require('fzf-lua').files() <CR>"),
|
||||||
|
dashboard.button("t", " Browse cwd", ":NvimTreeOpen<CR>"),
|
||||||
|
dashboard.button("r", " Browse src", ":e ~/.local/src/<CR>"),
|
||||||
|
dashboard.button("s", " Browse scripts", ":e ~/scripts/<CR>"),
|
||||||
|
dashboard.button("c", " Config", ":e ~/.config/nvim/<CR>"),
|
||||||
|
dashboard.button("m", " Mappings", ":e ~/.config/nvim/lua/core/keymaps.lua<CR>"),
|
||||||
|
dashboard.button("p", " Plugins", ":PlugInstall<CR>"),
|
||||||
|
dashboard.button("q", " Quit", ":q!<CR>"),
|
||||||
|
}
|
||||||
|
|
||||||
|
dashboard.section.footer.val = function()
|
||||||
|
return vim.g.startup_time_ms or "[[ ]]"
|
||||||
|
end
|
||||||
|
|
||||||
|
dashboard.section.buttons.opts.hl = "Keyword"
|
||||||
|
dashboard.opts.opts.noautocmd = true
|
||||||
|
alpha.setup(dashboard.opts)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user