mirror of
https://github.com/gyoder/dots.git
synced 2026-02-27 17:03:45 +00:00
added existing nvim config
This commit is contained in:
parent
d6d6dab380
commit
bdf3cdecda
24 changed files with 996 additions and 0 deletions
49
vim/.config/nvim/init.lua
Normal file
49
vim/.config/nvim/init.lua
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
--
|
||||
-- nvim init script by grace
|
||||
--
|
||||
|
||||
-- Get hostname
|
||||
local handle = io.popen("hostname")
|
||||
local hostname = handle:read("*a") or ""
|
||||
handle:close()
|
||||
hostname = hostname:gsub("%s+", "")
|
||||
vim.g.hostname = hostname
|
||||
if string.match(hostname, "cs.purdue.edu") then
|
||||
vim.g.is_purdue = true
|
||||
else
|
||||
vim.g.is_purdue = false
|
||||
end
|
||||
|
||||
-- add required things to path
|
||||
if vim.g.is_purdue then
|
||||
vim.env.PATH = vim.env.PATH .. ':' .. os.getenv("HOME") .. '/clangd/bin:/u/riker/u98/cs240/bin'
|
||||
end
|
||||
|
||||
require("plugins")
|
||||
require("native-lsp")
|
||||
require("diagnostics")
|
||||
require("remap")
|
||||
|
||||
|
||||
if vim.g.is_purdue then
|
||||
require("westwood-lint")
|
||||
end
|
||||
require("standard-lint")
|
||||
|
||||
vim.cmd("source ~/.vim/settings.vim")
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||
pattern = { "*" },
|
||||
command = [[%s/\s\+$//e]],
|
||||
})
|
||||
|
||||
|
||||
-- File IO can be slow and this might help idk
|
||||
if vim.g.is_purdue then
|
||||
vim.cmd("set noundofile") -- i forgor how to do this in lua so i didnt
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue