dotfiles/nvim/init.lua

230 lines
5.3 KiB
Lua
Raw Normal View History

2023-11-14 01:38:00 +01:00
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
2023-11-21 23:43:08 +01:00
2023-11-14 01:38:00 +01:00
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
plugins = {
2023-11-16 20:51:39 +01:00
{
'windwp/nvim-autopairs',
event = 'InsertEnter',
config = function ()
require('nvim-autopairs').setup{}
end
},
{
'windwp/nvim-ts-autotag',
config = function ()
2023-11-18 17:27:19 +01:00
require('nvim-ts-autotag').setup()
2023-11-16 20:51:39 +01:00
end
},
{
'williamboman/mason.nvim',
config = function()
require('mason').setup()
end
},
{
'neovim/nvim-lspconfig',
config = function()
local configs = require('lspconfig')
configs.lua_ls.setup{}
configs.pyright.setup{}
2023-11-25 02:21:37 +01:00
configs.tsserver.setup{}
configs.html.setup{}
2023-11-16 20:51:39 +01:00
end
},
{
'hrsh7th/nvim-cmp',
config = function()
require('luasnip.loaders.from_vscode').lazy_load()
local cmp = require('cmp')
cmp.setup({
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end
},
mapping = cmp.mapping.preset.insert ({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
2023-11-25 02:21:37 +01:00
['<CR>'] = cmp.mapping.confirm({ select = true }),
['<TAB>'] = cmp.mapping.confirm({ select = true }),
2023-11-16 20:51:39 +01:00
}),
sources = cmp.config.sources({
{name = 'nvim_lsp'},
{name = 'luasnip'},
{name = 'buffer'}
}),
})
end,
dependencies = {
{'hrsh7th/cmp-nvim-lsp'},
{'saadparwaiz1/cmp_luasnip'},
{'rafamadriz/friendly-snippets'},
{'L3MON4D3/LuaSnip'}
}
},
2023-11-14 19:20:29 +01:00
{
2023-11-15 00:30:45 +01:00
'maxmx03/dracula.nvim',
lazy = false,
config = function ()
local dracula = require 'dracula'
dracula.setup()
vim.cmd.colorscheme 'dracula'
end
},
{
'nvimdev/dashboard-nvim',
event = 'VimEnter',
config = function ()
require('dashboard').setup{
theme = "hyper"
}
end,
dependencies = {{'nvim-tree/nvim-web-devicons'}}
},
{
2023-11-21 23:43:08 +01:00
'akinsho/bufferline.nvim',
config = function ()
2023-11-22 00:27:51 +01:00
require('bufferline').setup {
2023-11-21 23:43:08 +01:00
options = {
separator_style = "thin",
indicator = {
style = "none"
},
diagnostics = "nvim_lsp",
always_show_bufferline = false,
offsets = {
{
filetype = "neo-tree",
text = "Explorer",
highlight = "directory",
separator = false
}
}
}
2023-11-15 00:30:45 +01:00
}
end,
dependencies = {
'nvim-tree/nvim-web-devicons',
},
},
{
2023-11-21 23:43:08 +01:00
'nvim-lualine/lualine.nvim',
config = function()
2023-11-22 00:27:51 +01:00
local colors_insert = {
line_background = '#282a36',
line_foreground = '#f8f8f2',
line_midtone = '#44475a',
pink = '#ff79c6',
ourple = '#bd93f9'
}
local cake_theme_dracula = {
insert = {
a = { fg = colors_insert.line_background, bg = colors_insert.pink },
b = { fg = colors_insert.line_foreground, bg = colors_insert.line_background },
z = { fg = colors_insert.line_foreground, bg = colors_insert.line_background }
},
normal = {
a = { fg = colors_insert.line_background, bg = colors_insert.ourple },
b = { fg = colors_insert.fg, bg = colors_insert.line_background },
z = { fg = colors_insert.fg, bg = colors_insert.line_background }
},
visual = {
},
replace = {
}
}
2023-11-21 23:43:08 +01:00
require('lualine').setup {
options = {
2023-11-22 00:27:51 +01:00
theme = cake_theme_dracula,
2023-11-21 23:43:08 +01:00
disabled_filetypes = {
statusline = {
"neo-tree"
}
2023-11-22 00:27:51 +01:00
},
section_separators = "",
component_separators = "",
},
sections = {
lualine_a = {'mode'},
lualine_b = {'filename', 'location'},
lualine_c = {},
lualine_x = {},
lualine_y = {},
lualine_z = {'diff','branch'}
}
2023-11-21 23:43:08 +01:00
}
end,
2023-11-15 00:30:45 +01:00
dependencies = {{'nvim-tree/nvim-web-devicons'}},
2023-11-14 19:20:29 +01:00
},
2023-11-18 17:27:19 +01:00
{
'nvim-neo-tree/neo-tree.nvim',
branch = "v3.x",
dependencies = {
2023-11-21 23:43:08 +01:00
{'nvim-lua/plenary.nvim'},
{'nvim-tree/nvim-web-devicons'},
{'MunifTanjim/nui.nvim'}
},
config = function ()
require("neo-tree").setup {
enable_git_status = true,
enable_diagnostics = true,
filesystem = {
follow_current_file = {
enabled = true
}
}
}
end
2023-11-18 17:27:19 +01:00
},
2023-11-14 01:38:00 +01:00
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function ()
local configs = require("nvim-treesitter.configs")
configs.setup({
2023-11-21 23:43:08 +01:00
ensure_installed = { "c", "rust", "lua", "vim", "vimdoc", "markdown" , "javascript", "html", "astro" },
2023-11-14 01:38:00 +01:00
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
2023-11-18 17:27:19 +01:00
})
2023-11-16 20:51:39 +01:00
end
},
2023-11-14 01:38:00 +01:00
}
require("lazy").setup(plugins)
2023-11-17 21:40:23 +01:00
if vim.g.neovide == true then
vim.api.nvim_set_keymap('n', "<F11>", ":let g:neovide_fullscreen = !g:neovide_fullscreen<CR>", {})
end
2023-11-21 23:43:08 +01:00
vim.opt.splitright = true
vim.opt.splitbelow = true
2023-11-14 01:38:00 +01:00
vim.opt.shiftwidth = 2
2023-11-18 17:27:19 +01:00
vim.opt.cmdheight = 0
2023-11-21 23:43:08 +01:00
vim.opt.guifont = "jetbrains mono:h11"
2023-11-18 17:27:19 +01:00
vim.opt.termguicolors = true
vim.wo.number = true
2023-11-21 23:43:08 +01:00
vim.opt.fillchars = {
vert = " "
}