dotfiles/nvim/init.lua
2023-11-21 23:43:08 +01:00

188 lines
4.2 KiB
Lua

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
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 = {
{
'windwp/nvim-autopairs',
event = 'InsertEnter',
config = function ()
require('nvim-autopairs').setup{}
end
},
{
'windwp/nvim-ts-autotag',
config = function ()
require('nvim-ts-autotag').setup()
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{}
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(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
}),
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'}
}
},
{
'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'}}
},
{
'akinsho/bufferline.nvim',
config = function ()
require('bufferline').setup{
options = {
separator_style = "thin",
indicator = {
style = "none"
},
diagnostics = "nvim_lsp",
always_show_bufferline = false,
offsets = {
{
filetype = "neo-tree",
text = "Explorer",
highlight = "directory",
separator = false
}
}
}
}
end,
dependencies = {
'nvim-tree/nvim-web-devicons',
},
},
{
'nvim-lualine/lualine.nvim',
config = function()
require('lualine').setup {
options = {
disabled_filetypes = {
statusline = {
"neo-tree"
}
}
}
}
end,
dependencies = {{'nvim-tree/nvim-web-devicons'}},
},
{
'nvim-neo-tree/neo-tree.nvim',
branch = "v3.x",
dependencies = {
{'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
},
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function ()
local configs = require("nvim-treesitter.configs")
configs.setup({
ensure_installed = { "c", "rust", "lua", "vim", "vimdoc", "markdown" , "javascript", "html", "astro" },
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
})
end
},
}
require("lazy").setup(plugins)
if vim.g.neovide == true then
vim.api.nvim_set_keymap('n', "<F11>", ":let g:neovide_fullscreen = !g:neovide_fullscreen<CR>", {})
end
vim.opt.splitright = true
vim.opt.splitbelow = true
vim.opt.shiftwidth = 2
vim.opt.cmdheight = 0
vim.opt.guifont = "jetbrains mono:h11"
vim.opt.termguicolors = true
vim.wo.number = true
vim.opt.fillchars = {
vert = " "
}