.dotfiles/configs/init.lua

96 lines
2.6 KiB
Lua
Raw Normal View History

2021-08-19 17:04:46 +02:00
local u = require("utils")
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;
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
2021-08-19 17:24:36 +02:00
{url="git@github.com:marko-cerovac/material.nvim"},
2021-08-19 15:57:07 +02:00
{url="git@github.com:ryanoasis/vim-devicons"},
2021-08-19 17:24:36 +02:00
{url="git@github.com:xiyaowong/nvim-transparent"},
2021-08-19 15:57:07 +02:00
-- 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 17:24:36 +02:00
if u.has_plugin("material") then
print("Load config")
2021-08-19 16:42:49 +02:00
2021-08-19 17:14:34 +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
cmd [[set mouse=a]]
cmd [[set undofile]]
2021-08-19 17:14:34 +02:00
-- Apply Theme
o.syntax = "enable"
o.termguicolors = true
g.NERDTreeShowHidden = true
g.NERDTreeAutoDeleteBuffer = true
g.NERDTreeMinimalUI = true
g.NERDTreeDirArrows = true
g.hidden = true
2021-08-19 17:24:36 +02:00
g.material_style = "deep ocean"
require('material').set()
require("transparent").setup({enable = true})
2021-08-19 17:14:34 +02:00
-- Remove background color
2021-08-19 17:24:36 +02:00
cmd("highlight Normal guibg=none")
cmd("highlight NonText guibg=none")
2021-08-10 21:50:49 +02:00
2021-08-19 17:14:34 +02:00
-- KeyBindings
g.mapleader = " "
require "keymappings"
2021-08-10 21:50:49 +02:00
2021-08-19 17:14:34 +02:00
-- Treesitter config
require "nvim-treesitter.configs".setup {ensure_installed = {"bash", "svelte", "css", "svelte", "typescript", "javascript", "go", "lua", "yaml"}, highlight = {enable = true}}
-- Toggleterm / Lazygit setup
require "lazy-git"
-- Autocommands
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
2021-08-19 17:14:34 +02:00
-- Autocompletion Setup
require "autocomplete"
2021-08-10 21:50:49 +02:00
2021-08-19 17:14:34 +02:00
-- LSP Config
2021-08-19 16:09:20 +02:00
2021-08-19 17:14:34 +02:00
require "lsp-utils"
2021-08-10 21:50:49 +02:00
2021-08-19 17:14:34 +02:00
opt.completeopt = {"menuone", "noinsert", "noselect"}
opt.shortmess:append({c = true})
2021-08-10 21:50:49 +02:00
2021-08-19 17:14:34 +02:00
-- Autoformat
require "autoformatter"
2021-08-19 16:09:20 +02:00
2021-08-19 17:24:36 +02:00
else
paq.install();
2021-08-19 17:14:34 +02:00
end