diff options
| author | Mike Vink <mike1994vink@gmail.com> | 2022-11-21 11:35:50 +0100 |
|---|---|---|
| committer | Mike Vink <mike1994vink@gmail.com> | 2022-11-21 11:35:50 +0100 |
| commit | d8c08728465ef5679d771f01d5ce84fb1ddb9096 (patch) | |
| tree | 66a9da3e952bcd88cb33269c293de2bba344a082 | |
| parent | 389acba1bbddc5336eb65f752da36529c7f7b85d (diff) | |
start moving stuff to fennel
| -rw-r--r-- | flake.lock | 18 | ||||
| -rw-r--r-- | home.nix | 4 | ||||
| -rw-r--r-- | neovim/fnl/conf/build-init.fnl | 0 | ||||
| -rw-r--r-- | neovim/fnl/conf/init.fnl | 10 | ||||
| -rw-r--r-- | neovim/fnl/conf/macros.fnl (renamed from neovim/fnl/macros.fnl) | 0 | ||||
| -rw-r--r-- | neovim/fnl/conf/pkgs.fnl | 1 | ||||
| -rw-r--r-- | neovim/fnl/conf/pkgs/cmp.fnl | 18 | ||||
| -rw-r--r-- | neovim/fnl/conf/settings.fnl | 6 | ||||
| -rw-r--r-- | neovim/fnl/cookbook.fnl | 1 | ||||
| -rw-r--r-- | neovim/init.fnl | 77 | ||||
| -rw-r--r-- | neovim/init.lua | 32 |
11 files changed, 52 insertions, 115 deletions
@@ -8,11 +8,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1668332334, - "narHash": "sha256-YT1qcE/MCqBO1Bi/Yr6GcFpNKsvmzrBKh8juyXDbxQc=", + "lastModified": 1668788863, + "narHash": "sha256-FsdUG+YkRX7JZKZm6T44J2h+0pXB1sWA9AobyiozFK0=", "owner": "nix-community", "repo": "home-manager", - "rev": "bc90de24d898655542589237cc0a6ada7564cb6c", + "rev": "948d1f8a5cef55a281d4f5d17f3b79df6c82fce1", "type": "github" }, "original": { @@ -39,11 +39,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1668417584, - "narHash": "sha256-yeuEyxKPwsm5fIHN49L/syn9g5coxnPp3GsVquhrv5A=", + "lastModified": 1668765800, + "narHash": "sha256-rC40+/W6Hio7b/RsY8SvQPKNx4WqNcTgfYv8cUMAvJk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "013fcdd106823416918004bb684c3c186d3c460f", + "rev": "52b2ac8ae18bbad4374ff0dd5aeee0fdf1aea739", "type": "github" }, "original": { @@ -55,11 +55,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1668459637, - "narHash": "sha256-HqnWCKujmtu8v0CjzOT0sr7m2AR7+vpbZJOp1R0rodY=", + "lastModified": 1668766498, + "narHash": "sha256-UjZlIrbHGlL3H3HZNPTxPSwJfr49jIfbPWCYxk0EQm4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "16f4e04658c2ab10114545af2f39db17d51bd1bd", + "rev": "f42a45c015f28ac3beeb0df360e50cdbf495d44b", "type": "github" }, "original": { @@ -106,8 +106,8 @@ Flake = { lua_language_server = [[${pkgs.sumneko-lua-language-server}]], bash = [[${pkgs.bashInteractive}/bin/bash]] } -vim.opt.runtimepath:append({ [[~/dotnix/neovim]], [[~/dotnix/neovim/lua]] }) -package.path = [[/home/mike/dotnix/?/init.lua;]] .. [[/home/mike/.cache/nvim/hotpot/hotpot.nvim/lua/?/init.lua;]] .. package.path +vim.opt.runtimepath:append({ [[~/dotnix/neovim]], [[~/dotnix/neovim/lua]], [[~/dotnix/neovim/fnl]]}) +package.path = [[/home/mike/dotnix/?/init.lua;]] .. [[/home/mike/dotnix/?/?;]] .. [[/home/mike/.cache/nvim/hotpot/hotpot.nvim/lua/?/init.lua;]] .. package.path require'neovim' LUA "; diff --git a/neovim/fnl/conf/build-init.fnl b/neovim/fnl/conf/build-init.fnl new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/neovim/fnl/conf/build-init.fnl diff --git a/neovim/fnl/conf/init.fnl b/neovim/fnl/conf/init.fnl new file mode 100644 index 0000000..4d10062 --- /dev/null +++ b/neovim/fnl/conf/init.fnl @@ -0,0 +1,10 @@ +(tset (. vim "g") "mapleader" " ") +(tset (. vim "g") "maplocalleader" " ") + +(vim.cmd "colorscheme gruvbox-material") + +(let [ts (require :nvim-treesitter.configs)] + (ts.setup + {:highlight {:enable true}})) + +(require :conf.pkgs) diff --git a/neovim/fnl/macros.fnl b/neovim/fnl/conf/macros.fnl index fe10ed3..fe10ed3 100644 --- a/neovim/fnl/macros.fnl +++ b/neovim/fnl/conf/macros.fnl diff --git a/neovim/fnl/conf/pkgs.fnl b/neovim/fnl/conf/pkgs.fnl new file mode 100644 index 0000000..77b3e73 --- /dev/null +++ b/neovim/fnl/conf/pkgs.fnl @@ -0,0 +1 @@ +(require :conf.pkgs.cmp) diff --git a/neovim/fnl/conf/pkgs/cmp.fnl b/neovim/fnl/conf/pkgs/cmp.fnl new file mode 100644 index 0000000..c31cb02 --- /dev/null +++ b/neovim/fnl/conf/pkgs/cmp.fnl @@ -0,0 +1,18 @@ +(let [cmp (require :cmp) + luasnip (require :luasnip) + snip (fn [args] (luasnip.lsp_expand (. args :body)))] + + (cmp.setup + {:snippet {:expand snip} + :completion {:autocomplete false} + :mapping + (cmp.mapping.preset.insert + {"<C-b>" (cmp.mapping.scroll_docs -4) + "<C-f>" (cmp.mapping.scroll_docs 4) + "<C-A>" (cmp.mapping.complete) + "<C-e>" (cmp.mapping.confirm {:select true})}) + :sources (cmp.config.sources + [{:name :conjure} + {:name :nvim_lsp} + {:name :path} + {:name :luasnip}])})) diff --git a/neovim/fnl/conf/settings.fnl b/neovim/fnl/conf/settings.fnl new file mode 100644 index 0000000..580ec91 --- /dev/null +++ b/neovim/fnl/conf/settings.fnl @@ -0,0 +1,6 @@ +(import-macros { : settings} :conf.macros) +(settings + backup false + backupcopy yes + foldmarker "///,///") + diff --git a/neovim/fnl/cookbook.fnl b/neovim/fnl/cookbook.fnl deleted file mode 100644 index 12fc2f2..0000000 --- a/neovim/fnl/cookbook.fnl +++ /dev/null @@ -1 +0,0 @@ -(vim.cmd "echo 'hi'") diff --git a/neovim/init.fnl b/neovim/init.fnl index cafa98e..878dff3 100644 --- a/neovim/init.fnl +++ b/neovim/init.fnl @@ -1,95 +1,26 @@ +;; Ahead of time compiles this file to ./init.lua (fn build-init [] (let [{: build} (require :hotpot.api.make) - ;; by default, Fennel wont perform strict global checking when - ;; compiling but we can force it to check by providing a list - ;; of allowed global names, this can catch some additional errors in - ;; this file. allowed-globals (icollect [n _ (pairs _G)] n) - opts {:verbosity 1 ;; set to 1 (or dont inclued the key) to see messages + opts {:verbosity 0 :compiler {:modules {:allowedGlobals allowed-globals}}}] - ;; just pass back the whole path as is (build "/home/mike/dotnix/neovim/init.fnl" opts ".+" #(values $1)))) +;; Call hotpot.setup and compile again after fs event (let [hotpot (require :hotpot) setup hotpot.setup build hotpot.api.make.build uv vim.loop] - ;; do some configuration stuff (setup {:provide_require_fennel true :compiler {:modules {:correlate true} :macros {:env :_COMPILER :compilerEnv _G :allowedGlobals false}}}) - ;; watch this file for changes and auto-rebuild on save (let [handle (uv.new_fs_event) - ;; uv wont accept condensed paths path (vim.fn.expand "/home/mike/dotnix/neovim/init.fnl")] - ;; note the vim.schedule call (uv.fs_event_start handle path {} #(vim.schedule build-init)) - ;; close the uv handle when we quit nvim (vim.api.nvim_create_autocmd :VimLeavePre {:callback #(uv.close handle)}))) -(import-macros { : settings} :macros) - -(tset (. vim "g") "mapleader" " ") -(tset (. vim "g") "maplocalleader" " ") - -(vim.cmd "colorscheme gruvbox-material") - -(settings - backup false - backupcopy yes) - -(let [ts (require :nvim-treesitter.configs)] - ((. ts :setup - {:highlight {:enable true}}))) - -(let [cmp (require :cmp) - snip (fn [args] ((. (require :luasnip) :lsp_expand) (. args :body)))] - ((. cmp :setup) - {:snippet {:expand snip} - :completion {:autocomplete false} - :mapping - (cmp.mapping.preset.insert - {"<C-b>" (cmp.mapping.scroll_docs -4) - "<C-A>" (cmp.mapping.complete)}) - :sources (cmp.config.sources - [{:name :conjure} - {:name :nvim_lsp} - {:name :path} - {:name :luasnip}])})) - - - - - -; {} -; snippet = {} -; -- REQUIRED - you must specify a snippet engine -; expand = function(args) -; require('luasnip').lsp_expand(args.body) -- For `luasnip` users. -; end, -; , -; completion = {} -; autocomplete = false -; , -; window = {} -; -- completion = cmp.config.window.bordered(), -; -- documentation = cmp.config.window.bordered(), -; , -; mapping = cmp.mapping.preset.insert({}) -; ['<C-b>'] = cmp.mapping.scroll_docs(-4), -; ['<C-f>'] = cmp.mapping.scroll_docs(4), -; ['<C-A>'] = cmp.mapping.complete(), -; ['<C-e>'] = cmp.mapping.abort(), -; ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. -; , -; sources = cmp.config.sources({}) -; { name = 'conjure' }, -; { name = 'nvim_lsp' }, -; { name = 'luasnip' }, -; { name = 'path' }, -; -; +(require :conf) diff --git a/neovim/init.lua b/neovim/init.lua index c8ca7ec..36ad398 100644 --- a/neovim/init.lua +++ b/neovim/init.lua @@ -15,7 +15,7 @@ local function build_init() end allowed_globals = tbl_17_auto end - local opts = {verbosity = 1, compiler = {modules = {allowedGlobals = allowed_globals}}} + local opts = {verbosity = 0, compiler = {modules = {allowedGlobals = allowed_globals}}} local function _3_(_241) return _241 end @@ -38,32 +38,4 @@ do end vim.api.nvim_create_autocmd("VimLeavePre", {callback = _5_}) end -vim.g["mapleader"] = " " -vim.g["maplocalleader"] = " " -vim.cmd("colorscheme gruvbox-material") -for k_7_auto, v_8_auto in pairs({backup = "false", backupcopy = "yes"}) do - local _6_ = {k_7_auto, v_8_auto} - if ((_G.type(_6_) == "table") and (nil ~= (_6_)[1]) and ((_6_)[2] == "true")) then - local a_9_auto = (_6_)[1] - vim.opt[k_7_auto] = true - elseif ((_G.type(_6_) == "table") and (nil ~= (_6_)[1]) and ((_6_)[2] == "false")) then - local a_9_auto = (_6_)[1] - vim.opt[k_7_auto] = false - elseif ((_G.type(_6_) == "table") and (nil ~= (_6_)[1]) and (nil ~= (_6_)[2])) then - local a_9_auto = (_6_)[1] - local b_10_auto = (_6_)[2] - vim.opt[k_7_auto] = v_8_auto - else - end -end -do - local ts = require("nvim-treesitter.configs") - ts.setup[{highlight = {enable = true}}]() -end -local cmp = require("cmp") -local snip -local function _8_(args) - return (require("luasnip")).lsp_expand(args.body) -end -snip = _8_ -return cmp.setup({snippet = {expand = snip}, completion = {autocomplete = false}, mapping = cmp.mapping.preset.insert({["<C-b>"] = cmp.mapping.scroll_docs(-4), ["<C-A>"] = cmp.mapping.complete()}), sources = cmp.config.sources({{name = "conjure"}, {name = "nvim_lsp"}, {name = "path"}, {name = "luasnip"}})})
\ No newline at end of file +return require("conf")
\ No newline at end of file |
