Replace init.vim with init.lua and lua modules

This commit is contained in:
Gender Demon 2021-12-23 03:06:29 +00:00
parent 65f9698291
commit 93ee7f7549
6 changed files with 99 additions and 0 deletions

6
nvim/init.lua Normal file
View File

@ -0,0 +1,6 @@
-- init.lua
require("plugin_manager")
require("interface")
require("languages")
require("tabbing")

15
nvim/lua/interface.lua Normal file
View File

@ -0,0 +1,15 @@
-- Interface settings
-- Set preferred colour scheme here; it will be substituted below
local colours = "scheakur"
-- Show line numbers
vim.wo.number = true
-- Colour scheme settings
-- Use terminal-safe colours on the Linux terminal,
-- but true-colour otherwise
vim.o.termguicolors = (os.getenv("TERM") ~= "linux")
vim.o.background = "dark"
vim.cmd("syntax on")
vim.cmd(string.gsub("colorscheme ", "$", colours))

31
nvim/lua/languages.lua Normal file
View File

@ -0,0 +1,31 @@
-- Linting & Autocomplete Setup
-- ALE settings
-- Which linters to use
vim.g.ale_linters = {
["python"] = {"pycodestyle", "pylint"},
}
-- When to run linters
vim.g.ale_lint_on_text_changed = 1
vim.g.ale_lint_on_insert_leave = 0
vim.g.ale_lint_on_enter = 1
vim.g.ale_lint_on_save = 1
vim.g.ale_lint_on_filetype_change = 1
-- How to display linting hints to the user
vim.g.ale_set_loclist = 0
-- vim.g.ale_set_quickfix = 0
vim.g.ale_set_highlights = 1
vim.g.ale_set_signs = 1
vim.g.ale_echo_cursor = 1
vim.g.ale_set_balloons = 1
-- ALE completion settings
-- Enable completion
vim.g.ale_completion_enabled = 1
-- What are the units for completion delay? ms? s?
-- vim.g.ale_completion_delay = 500
vim.g.ale_completion_max_suggestions = 6
-- zig.vim config
-- Do not autoformat code on save
vim.g.zig_fmt_autosave = 0

View File

@ -0,0 +1,32 @@
-- Plugin manager setup
-- Plugin manager is packer.nvim
-- https://github.com/wbthomason/packer.nvim
return require("packer").startup(function()
-- Packer manages itself
use "wbthomason/packer.nvim"
-- ALE linting & completion
use "w0rp/ale"
-- Language support
-- Zig
use {"ziglang/zig.vim", ft={"zig"}}
-- Odin
use {"Tetralux/odin.vim", ft={"odin"}}
-- Pony
use {"jakwings/vim-pony", ft={"pony"}}
-- Pencil, for writing prose
use "reedes/vim-pencil"
-- Colour schemes
use "nightsense/cosmic_latte"
use "scheakur/vim-scheakur"
use "srcery-colors/srcery-vim"
use "nice/sweater"
use "ajgrf/sprinkles"
use "xero/sourcerer.vim"
use "franbahc/miramare"
use "everard/vim-aurora"
end)

15
nvim/lua/tabbing.lua Normal file
View File

@ -0,0 +1,15 @@
-- Tabbing settings
local g = vim.o
local w = vim.wo
local b = vim.bo
-- Width of tab character
b.tabstop = 4
-- Number of spaces per logical indent
b.shiftwidth = 4
-- Tab key inserts space characters, not tab characters
b.expandtab = true
-- Jump to same indent level as preceding line even if this line has no indent yet
g.smarttab = true