.dotfiles/configs/init.lua

97 lines
2.5 KiB
Lua
Raw Normal View History

2021-08-10 21:50:49 +02:00
local o = vim.o
local opt = vim.opt
local g = vim.g
2021-08-19 16:59:40 +02:00
local cmd = vim.cmd;
cmd [[highlight Normal guibg=none]]
cmd [[highlight NonText guibg=none]]
2021-08-10 21:50:49 +02:00
2021-08-19 15:57:07 +02:00
require("install-paq")
2021-08-19 16:44:25 +02:00
local paq = require("paq");
2021-08-19 16:42:49 +02:00
paq:setup({verbose=true}) {
2021-08-19 16:11:53 +02:00
{url="git@github.com:savq/paq-nvim"}, -- Let Paq manage itself
2021-08-19 15:57:07 +02:00
-- Theming Plugins
{url="git@github.com:kaicataldo/material.vim", branch = "main"},
{url="git@github.com:ryanoasis/vim-devicons"},
-- Layout Plugins
{url="git@github.com:preservim/nerdtree"},
{url="git@github.com:hoob3rt/lualine.nvim"},
-- Code Navigation
{url="git@github.com:nvim-lua/popup.nvim"},
{url="git@github.com:nvim-lua/plenary.nvim"},
{url="git@github.com:nvim-telescope/telescope.nvim"},
-- Syntax / Autocomplete
{url="git@github.com:neovim/nvim-lspconfig"},
{url="git@github.com:nvim-lua/lsp-status.nvim"},
{url="git@github.com:hrsh7th/nvim-compe"},
{url="git@github.com:nvim-treesitter/nvim-treesitter", run = ":TSUpdate"},
-- Formatting
{url="git@github.com:mhartington/formatter.nvim"},
-- Git Interface
{url="git@github.com:akinsho/nvim-toggleterm.lua"}
}
2021-08-19 16:42:49 +02:00
local status = pcall(require, "material");
if not(status) then
2021-08-19 16:59:40 +02:00
paq.install();
2021-08-19 16:42:49 +02:00
end
2021-08-19 15:57:07 +02:00
local u = require("utils")
2021-08-10 21:50:49 +02:00
-- Global options
o.number = true
o.tabstop = 2
o.shiftwidth = 2 -- Indents will have a width of 4
o.softtabstop = 2 -- Sets the number of columns for a TAB
o.expandtab = false -- Expand TABs to spaces
2021-08-19 16:59:40 +02:00
cmd [[set mouse=a]]
cmd [[set undofile]]
-- Apply Theme
o.syntax = "enable"
o.termguicolors = true
g.NERDTreeShowHidden = true
g.NERDTreeAutoDeleteBuffer = true
g.NERDTreeMinimalUI = true
g.NERDTreeDirArrows = true
g.hidden = true
g.material_theme_style = "ocean_community"
2021-08-19 16:02:46 +02:00
2021-08-19 16:59:40 +02:00
cmd [[colorscheme material]]
-- Remove background color
2021-08-19 16:59:40 +02:00
cmd [[highlight Normal guibg=none]]
cmd [[highlight NonText guibg=none]]
2021-08-10 21:50:49 +02:00
2021-08-19 15:57:07 +02:00
-- KeyBindings
g.mapleader = " "
require "keymappings"
2021-08-10 21:50:49 +02:00
2021-08-19 15:57:07 +02:00
-- Treesitter config
2021-08-19 17:02:47 +02:00
require "nvim-treesitter.configs".setup {ensure_installed = {"bash", "svelte", "css", "svelte", "typescript", "javascript", "xml", "go", "lua", "yaml"} highlight = {enable = true}}
-- Toggleterm / Lazygit setup
2021-08-19 16:59:40 +02:00
require "lazy-git"
2021-08-10 21:50:49 +02:00
-- Autocommands
2021-08-19 16:59:40 +02:00
u.create_augroup(
{
{"VimEnter", "*", "if (@% == '') | NERDTree | endif"},
{"BufEnter", "*", 'if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif'}
},
"Nerdtree"
)
2021-08-10 21:50:49 +02:00
-- Autocompletion Setup
2021-08-19 16:59:40 +02:00
require "autocomplete"
2021-08-10 21:50:49 +02:00
-- LSP Config
2021-08-19 16:09:20 +02:00
require "lsp-utils"
2021-08-10 21:50:49 +02:00
opt.completeopt = {"menuone", "noinsert", "noselect"}
opt.shortmess:append({c = true})
-- Autoformat
2021-08-19 16:09:20 +02:00
require "autoformatter"