From 991091228f9e403015edd0106ccfc3a0ce62e304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Vulquin?= Date: Wed, 24 Jul 2024 22:10:02 +0200 Subject: nvim: continue fennel porting Yeah I'm lazy but these are my dotfiles. A quick summary: * plugins.lsp.attach is now ported * toast.core is reorganized * new nil? and number? checks * new assoc function * new toast.table.unpack function (cross lua compat) * toast.macros.tbl now uses assoc instead of from-pairs and group * apparently I had forgotten to add {pre,post,init}.fnl before, so that's done now Still todo: ftplugin, colors. --- dot_config/nvim/init.lua | 52 ++++++++++++++++++++---------------------------- 1 file changed, 22 insertions(+), 30 deletions(-) (limited to 'dot_config/nvim/init.lua') diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index 4dcf175..ec4a55e 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -1,34 +1,26 @@ --- allow running code unconditionally before or after plugins / noplugins are loaded +-- [nfnl] Compiled from init.fnl by https://github.com/Olical/nfnl, do not edit. local function doif(path) - local cpath = vim.fn.stdpath 'config' .. '/' - if vim.fn.filereadable(cpath .. path) > 0 then - dofile(cpath .. path) - end + local path0 = (vim.fn.stdpath("config") .. "/" .. path) + local do_3f = (0 < vim.fn.filereadable(path0)) + if do_3f then + return dofile(path0) + else + return nil + end end - --- leader, localleader, options -doif 'pre.lua' - --- plugins -if vim.fn.executable 'git' == 0 then - doif 'noplugins.lua' +doif("pre.lua") +if (0 == vim.fn.executable("git")) then + doif("noplugins.lua") else - 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 'lazy'.setup("plugins", {}) - require 'bindings' - vim.cmd [[colorscheme starlight]] + local lazypath = (vim.fn.stdpath("data") .. "/lazy/lazy.nvim") + local fstat = vim.loop.fs_stat(lazypath) + if not fstat then + vim.fn.system({"git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath}) + else + end + do end (vim.opt.rtp):prepend(lazypath) + do end (require("lazy")).setup("plugins", {}) + require("bindings") + vim.cmd("colorscheme starlight") end - --- custom file associations etc -doif 'post.lua' +return doif("post.lua") -- cgit v1.2.3