fix: init.lua

This commit is contained in:
max_richter 2021-08-19 17:14:34 +02:00
parent ab373fb15b
commit 104a2849db

View File

@ -31,63 +31,63 @@ paq:setup({verbose=true}) {
{url="git@github.com:akinsho/nvim-toggleterm.lua"} {url="git@github.com:akinsho/nvim-toggleterm.lua"}
} }
local status = pcall(require, "material"); if u.has_plugin("nvim-treesiter") then
if not(status) then
paq.install(); paq.install();
end else
-- Global options -- Global options
o.number = true o.number = true
o.tabstop = 2 o.tabstop = 2
o.shiftwidth = 2 -- Indents will have a width of 4 o.shiftwidth = 2 -- Indents will have a width of 4
o.softtabstop = 2 -- Sets the number of columns for a TAB o.softtabstop = 2 -- Sets the number of columns for a TAB
o.expandtab = false -- Expand TABs to spaces o.expandtab = false -- Expand TABs to spaces
cmd [[set mouse=a]] cmd [[set mouse=a]]
cmd [[set undofile]] cmd [[set undofile]]
-- Apply Theme -- Apply Theme
o.syntax = "enable" o.syntax = "enable"
o.termguicolors = true o.termguicolors = true
g.NERDTreeShowHidden = true g.NERDTreeShowHidden = true
g.NERDTreeAutoDeleteBuffer = true g.NERDTreeAutoDeleteBuffer = true
g.NERDTreeMinimalUI = true g.NERDTreeMinimalUI = true
g.NERDTreeDirArrows = true g.NERDTreeDirArrows = true
g.hidden = true g.hidden = true
g.material_theme_style = "ocean_community" g.material_theme_style = "ocean_community"
if u.has_plugin("material") then if u.has_plugin("material") then
cmd [[colorscheme material]] cmd [[colorscheme material]]
end end
-- Remove background color -- Remove background color
cmd [[highlight Normal guibg=none]] cmd [[highlight Normal guibg=none]]
cmd [[highlight NonText guibg=none]] cmd [[highlight NonText guibg=none]]
-- KeyBindings -- KeyBindings
g.mapleader = " " g.mapleader = " "
require "keymappings" require "keymappings"
-- Treesitter config -- Treesitter config
require "nvim-treesitter.configs".setup {ensure_installed = {"bash", "svelte", "css", "svelte", "typescript", "javascript", "xml", "go", "lua", "yaml"} highlight = {enable = true}} require "nvim-treesitter.configs".setup {ensure_installed = {"bash", "svelte", "css", "svelte", "typescript", "javascript", "go", "lua", "yaml"}, highlight = {enable = true}}
-- Toggleterm / Lazygit setup -- Toggleterm / Lazygit setup
require "lazy-git" require "lazy-git"
-- Autocommands -- Autocommands
u.create_augroup( u.create_augroup(
{ {
{"VimEnter", "*", "if (@% == '') | NERDTree | endif"}, {"VimEnter", "*", "if (@% == '') | NERDTree | endif"},
{"BufEnter", "*", 'if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif'} {"BufEnter", "*", 'if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif'}
}, },
"Nerdtree" "Nerdtree"
) )
-- Autocompletion Setup -- Autocompletion Setup
require "autocomplete" require "autocomplete"
-- LSP Config -- LSP Config
require "lsp-utils" require "lsp-utils"
opt.completeopt = {"menuone", "noinsert", "noselect"} opt.completeopt = {"menuone", "noinsert", "noselect"}
opt.shortmess:append({c = true}) opt.shortmess:append({c = true})
-- Autoformat -- Autoformat
require "autoformatter" require "autoformatter"
end