From b94eefa6b58f274bb61db4e792105c3959cf2022 Mon Sep 17 00:00:00 2001 From: Ethan Morgan Date: Sat, 14 Feb 2026 16:40:16 +0000 Subject: init dotfiles and stuff --- nvim/init.lua | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 nvim/init.lua (limited to 'nvim/init.lua') diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..d27f5f1 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,97 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("sixfourtwelve") + +local formatter_ocamlformat = { + function() + return { + exe = "ocamlformat", + args = { vim.api.nvim_buf_get_name(0) }, + stdin = true + } + end +} + +require('formatter').setup({ + logging = true, + filetype = { + ocamlformat = formatter_ocamlformat, + } +}) + +vim.api.nvim_exec([[ +let g:go_fmt_autosave = 1 +let g:go_fmt_command = "goimports" +let g:go_highlight_fields = 1 +let g:go_highlight_functions = 1 +let g:go_highlight_function_calls = 1 +let g:go_highlight_extra_types = 1 +let g:go_highlight_operators = 1 +]], true) + +vim.cmd([[ + augroup CppModulesHighlight + autocmd! + autocmd FileType cpp syntax keyword cppModulesKeyword module import export + autocmd FileType cpp highlight def link cppModulesKeyword Statement + augroup END +]]) + +vim.api.nvim_exec([[ + autocmd BufNewFile,BufRead *.m set filetype=objc +]], true) + +vim.o.background = "dark" + +require("tokyonight").setup({ + style = "moon", + transparent = true, +}) + +-- vim.cmd("colorscheme bore") + +vim.api.nvim_command( + "autocmd BufWritePre *.json,*.ex,*.go,*.lua,*.rb,*.hs,*.py,*.ml,*.mli,*.c,*.h,*.cc,*.hh,*.cpp,*.hpp,*.m,*.mm,*.php,*.odin,*.rs,*.cs,*.java,*.re,*.rei,*.res,*.resi,*.scala,*.sbt,*.gleam,*.ts,*.tsx,*.test.ts,*.test.tsx,*.js,*.jsx,*.test.js,*.test.jsx,*.cr,*.odin,*.astro,*.zig,*.clj,*.cljc,*.cljs lua vim.lsp.buf.format()") + + +vim.api.nvim_set_option("clipboard", "unnamed") + +require("ts-error-translator").setup() +require('illuminate').configure({ + providers = { + 'lsp', + 'treesitter', + 'regex', + }, +}) + +-- require('.lua.sixfourtwelve.knixstatusline').setup() + +require("lualine").setup({ +options = { + theme = "kanso", + icons_enabled = true, + globalstatus = true, + component_separators = { left = " ", right = " " }, + section_separators = { left = "█", right = "█" }, + sections = { + lualine_a = {'mode'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = {'filename', 'branch', 'diff', 'diagnostics'}, + lualine_x = {'encoding', 'fileformat', 'filetype'}, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, +}, +}) -- cgit v1.2.3