From 2393d5a2d3f0656fe7621612b1ef055d889ec2e9 Mon Sep 17 00:00:00 2001 From: Vegard Berg Date: Sun, 21 May 2023 22:15:06 +0200 Subject: [PATCH] Initial commit --- fnl/init.fnl | 16 +++++++++++ init.lua | 49 +++++++++++++++++++++++++++++++++ lazy-lock.json | 24 ++++++++++++++++ lua/init.lua | 25 +++++++++++++++++ lua/mappings.lua | 25 +++++++++++++++++ lua/plugins/aerial.lua | 22 +++++++++++++++ lua/plugins/aniseed.lua | 8 ++++++ lua/plugins/barbar.lua | 16 +++++++++++ lua/plugins/conjure.lua | 31 +++++++++++++++++++++ lua/plugins/lualine.lua | 13 +++++++++ lua/plugins/luasnip.lua | 6 ++++ lua/plugins/mason-lspconfig.lua | 25 +++++++++++++++++ lua/plugins/mason.lua | 7 +++++ lua/plugins/neodev.lua | 5 ++++ lua/plugins/nord.lua | 7 +++++ lua/plugins/nui.lua | 5 ++++ lua/plugins/nvim-autopairs.lua | 15 ++++++++++ lua/plugins/nvim-cmp.lua | 8 ++++++ lua/plugins/nvim-lspconfig.lua | 3 ++ lua/plugins/nvim-notify.lua | 5 ++++ lua/plugins/nvim-telescope.lua | 5 ++++ lua/plugins/nvim-tree.lua | 7 +++++ lua/plugins/nvim-treesitter.lua | 4 +++ lua/plugins/parinfer-rust.lua | 6 ++++ lua/plugins/which-key.lua | 11 ++++++++ 25 files changed, 348 insertions(+) create mode 100644 fnl/init.fnl create mode 100644 init.lua create mode 100644 lazy-lock.json create mode 100644 lua/init.lua create mode 100644 lua/mappings.lua create mode 100644 lua/plugins/aerial.lua create mode 100644 lua/plugins/aniseed.lua create mode 100644 lua/plugins/barbar.lua create mode 100644 lua/plugins/conjure.lua create mode 100644 lua/plugins/lualine.lua create mode 100644 lua/plugins/luasnip.lua create mode 100644 lua/plugins/mason-lspconfig.lua create mode 100644 lua/plugins/mason.lua create mode 100644 lua/plugins/neodev.lua create mode 100644 lua/plugins/nord.lua create mode 100644 lua/plugins/nui.lua create mode 100644 lua/plugins/nvim-autopairs.lua create mode 100644 lua/plugins/nvim-cmp.lua create mode 100644 lua/plugins/nvim-lspconfig.lua create mode 100644 lua/plugins/nvim-notify.lua create mode 100644 lua/plugins/nvim-telescope.lua create mode 100644 lua/plugins/nvim-tree.lua create mode 100644 lua/plugins/nvim-treesitter.lua create mode 100644 lua/plugins/parinfer-rust.lua create mode 100644 lua/plugins/which-key.lua diff --git a/fnl/init.fnl b/fnl/init.fnl new file mode 100644 index 0000000..6cbd9ba --- /dev/null +++ b/fnl/init.fnl @@ -0,0 +1,16 @@ +(module nvim-config + {autoload {nvim aniseed.nvim}}) + +;;(vim.cmd.colorscheme "industry") +;; Done in init.lua instead, as it +; (set vim.g.mapleader " ") +(set vim.opt.termguicolors true) +(set vim.opt.number true) +(set vim.opt.relativenumber true) +(set vim.opt.autoindent true) +(set vim.opt.tabstop 4) +(set vim.opt.shiftwidth 4) +(set vim.opt.softtabstop 4) +(set vim.opt.expandtab true) +(set vim.opt.mouse "a") + diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..ef8db00 --- /dev/null +++ b/init.lua @@ -0,0 +1,49 @@ + +vim.g.mapleader = " " + +vim.cmd [[autocmd! ColorScheme * highlight FloatBorder guifg=white guibg=#1f2335]] + +local border = { + {"🭽", "FloatBorder"}, + {"▔", "FloatBorder"}, + {"🭾", "FloatBorder"}, + {"▕", "FloatBorder"}, + {"🭿", "FloatBorder"}, + {"▁", "FloatBorder"}, + {"🭼", "FloatBorder"}, + {"▏", "FloatBorder"}, +} + +-- LSP settings (for overriding per client) +local handlers = { + ["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {border = border}), + ["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {border = border }), +} + +local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview +function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...) + opts = opts or {} + opts.border = opts.border or border + return orig_util_open_floating_preview(contents, syntax, opts, ...) +end + +--[[ +░█░░░█▀█░▀▀█░█░█░░░░█▀█░█░█░▀█▀░█▄█ +░█░░░█▀█░▄▀░░░█░░░░░█░█░▀▄▀░░█░░█░█ +░▀▀▀░▀░▀░▀▀▀░░▀░░▀░░▀░▀░░▀░░▀▀▀░▀░▀ +]]-- +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") diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..c67d5ff --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,24 @@ +{ + "LuaSnip": { "branch": "master", "commit": "2f78933799ef1a8558057ea7d06d6ccb11140711" }, + "aerial.nvim": { "branch": "master", "commit": "3a17406d9d8f01f46d207f42d8849eb924eb0755" }, + "aniseed": { "branch": "master", "commit": "44d2886a9ec38abac61b4c73c2e57fb752232cfe" }, + "barbar.nvim": { "branch": "master", "commit": "b8ca6076f75e49cca1fa0288c080f3d10ec2152c" }, + "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, + "gitsigns.nvim": { "branch": "main", "commit": "c18b7ca0b5b50596722f3a1572eb9b8eb520c0f1" }, + "lazy.nvim": { "branch": "main", "commit": "5f316cea4f0b5379e0094d6cfa5e1ee5e279f65a" }, + "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, + "mason.nvim": { "branch": "main", "commit": "08b2fd308e0107eab9f0b59d570b69089fd0b522" }, + "neodev.nvim": { "branch": "main", "commit": "0c5d6c2ac2fadebedf08282d9403ef6c3dc31896" }, + "nord.nvim": { "branch": "master", "commit": "fab04b2dd4b64f4b1763b9250a8824d0b5194b8f" }, + "nui.nvim": { "branch": "main", "commit": "698e75814cd7c56b0dd8af4936bcef2d13807f3c" }, + "nvim-autopairs": { "branch": "master", "commit": "7747bbae60074acf0b9e3a4c13950be7a2dff444" }, + "nvim-cmp": { "branch": "main", "commit": "3ac8d6cd29c74ff482d8ea47d45e5081bfc3f5ad" }, + "nvim-lspconfig": { "branch": "master", "commit": "6f1d124bbcf03c4c410c093143a86415f46d16a0" }, + "nvim-notify": { "branch": "master", "commit": "f3024b912073774111202f5fa6518b0cd2a74432" }, + "nvim-tree.lua": { "branch": "master", "commit": "736c7ff59065275f0483af4b7f07a9bc41449ad0" }, + "nvim-treesitter": { "branch": "master", "commit": "8e59b4919d1a61bd4eb29c397bd19bab83883cbb" }, + "nvim-web-devicons": { "branch": "master", "commit": "986875b7364095d6535e28bd4aac3a9357e91bbe" }, + "plenary.nvim": { "branch": "master", "commit": "9ac3e9541bbabd9d73663d757e4fe48a675bb054" }, + "telescope.nvim": { "branch": "master", "commit": "c1a2af0af69e80e14e6b226d3957a064cd080805" }, + "which-key.nvim": { "branch": "main", "commit": "5a6c954a5a46023c19acc03a8b6d7c3e57964fc5" } +} \ No newline at end of file diff --git a/lua/init.lua b/lua/init.lua new file mode 100644 index 0000000..715bf64 --- /dev/null +++ b/lua/init.lua @@ -0,0 +1,25 @@ +local _2afile_2a = "fnl/init.fnl" +local _2amodule_name_2a = "nvim-config" +local _2amodule_2a +do + package.loaded[_2amodule_name_2a] = {} + _2amodule_2a = package.loaded[_2amodule_name_2a] +end +local _2amodule_locals_2a +do + _2amodule_2a["aniseed/locals"] = {} + _2amodule_locals_2a = (_2amodule_2a)["aniseed/locals"] +end +local autoload = (require("aniseed.autoload")).autoload +local nvim = autoload("aniseed.nvim") +do end (_2amodule_locals_2a)["nvim"] = nvim +vim.opt.termguicolors = true +vim.opt.number = true +vim.opt.relativenumber = true +vim.opt.autoindent = true +vim.opt.tabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.softtabstop = 4 +vim.opt.expandtab = true +vim.opt.mouse = "a" +return _2amodule_2a \ No newline at end of file diff --git a/lua/mappings.lua b/lua/mappings.lua new file mode 100644 index 0000000..154021d --- /dev/null +++ b/lua/mappings.lua @@ -0,0 +1,25 @@ +-- + +return { + n = { + ["C"] = { name = "Conjure" }, + ["CE"] = { "ConjureEval", desc = "Evaluate based on context" }, + ["Cm"] = { "ConjureEvalMotion", desc = "Evaluate based on motion" }, + ["Cb"] = { "ConjureEvalBuf", desc = "Evaluate buffer" }, + ["Cf"] = { "ConjureEvalFile", desc = "Evaluate file" }, + ["Ce"] = { "ConjureEvalCurrentForm", desc = "Evaluate current form" }, + ["Cr"] = { "ConjureEvalRootForm", desc = "Evaluate root form" }, + ["C!"] = { "ConjureEvalReplaceForm", desc = "Evaluate and replace form" }, + ["Cw"] = { "ConjureEvalWord", desc = "Evaluate word" }, + ["Cm"] = { "ConjureEvalMarkedForm", desc = "Evaluate form at mark" }, + + + ["Cc"] = { name = "Evaluate with result comment" }, + ["Cce"] = { "ConjureEvalCommentCurrentForm", desc = "Evaluate current form" }, + ["Ccr"] = { "ConjureEvalCommentRootForm", desc = "Evaluate root form" }, + ["Ccw"] = { "ConjureEvalCommentWord", desc = "Evaluate word" }, + }, + v = { + ["C"] = { "ConjureEvalVisual", desc = "Evalute selection" }, + } +} diff --git a/lua/plugins/aerial.lua b/lua/plugins/aerial.lua new file mode 100644 index 0000000..05429e4 --- /dev/null +++ b/lua/plugins/aerial.lua @@ -0,0 +1,22 @@ +-- https://github.com/stevearc/aerial.nvim + +return { + 'stevearc/aerial.nvim', + -- Optional dependencies + dependencies = { + "nvim-treesitter/nvim-treesitter", + "nvim-tree/nvim-web-devicons" + }, + config = function() + require('aerial').setup({ + -- optionally use on_attach to set keymaps when aerial has attached to a buffer + on_attach = function(bufnr) + -- Jump forwards/backwards with '{' and '}' + vim.keymap.set('n', '{', 'AerialPrev', {buffer = bufnr}) + vim.keymap.set('n', '}', 'AerialNext', {buffer = bufnr}) + end + }) + -- You probably also want to set a keymap to toggle aerial + vim.keymap.set('n', 'a', 'AerialToggle!') + end +} diff --git a/lua/plugins/aniseed.lua b/lua/plugins/aniseed.lua new file mode 100644 index 0000000..4f8b478 --- /dev/null +++ b/lua/plugins/aniseed.lua @@ -0,0 +1,8 @@ +return { + "Olical/aniseed", + lazy = false, + priority = 100, + init = function(_) + vim.g["aniseed#env"] = true + end +} diff --git a/lua/plugins/barbar.lua b/lua/plugins/barbar.lua new file mode 100644 index 0000000..0276317 --- /dev/null +++ b/lua/plugins/barbar.lua @@ -0,0 +1,16 @@ +-- https://github.com/romgrk/barbar.nvim + +return {'romgrk/barbar.nvim', + dependencies = { + 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status + 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons + }, + init = function() vim.g.barbar_auto_setup = false end, + opts = { + -- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default: + -- animation = true, + -- insert_at_start = true, + -- …etc. + }, + version = '^1.0.0', -- optional: only update when a new 1.x version is released + } diff --git a/lua/plugins/conjure.lua b/lua/plugins/conjure.lua new file mode 100644 index 0000000..4de01c0 --- /dev/null +++ b/lua/plugins/conjure.lua @@ -0,0 +1,31 @@ +-- https://github.com/Olical/conjure + +return { + "Olical/conjure", + ft = { "clojure", "fennel", "racket", "hy", "julia", "rust", "lua", "python" }, + config = function() + wk = require[[which-key]] + wk.register({ + ["C"] = { name = "Conjure" }, + ["CE"] = { "ConjureEval", "Evaluate based on context" }, + ["Cm"] = { "ConjureEvalMotion", "Evaluate based on motion" }, + ["Cb"] = { "ConjureEvalBuf", "Evaluate buffer" }, + ["Cf"] = { "ConjureEvalFile", "Evaluate file" }, + ["Ce"] = { "ConjureEvalCurrentForm", "Evaluate current form" }, + ["Cr"] = { "ConjureEvalRootForm", "Evaluate root form" }, + ["C!"] = { "ConjureEvalReplaceForm", "Evaluate and replace form" }, + ["Cw"] = { "ConjureEvalWord", "Evaluate word" }, + ["Cm"] = { "ConjureEvalMarkedForm", "Evaluate form at mark" }, + + + ["Cc"] = { name = "Evaluate with result comment" }, + ["Cce"] = { "ConjureEvalCommentCurrentForm", "Evaluate current form" }, + ["Ccr"] = { "ConjureEvalCommentRootForm", "Evaluate root form" }, + ["Ccw"] = { "ConjureEvalCommentWord", "Evaluate word" }, + }, { mode = "n" }) + + wk.register({ + ["C"] = { "ConjureEvalVisual", "Evalute selection" }, + }, { mode = "v" }) + end, +} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..9413467 --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,13 @@ +-- https://github.com/nvim-lualine/lualine.nvim + +return { + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require("lualine").setup { + icons_enabled = true, + theme = "nord", + + } + end +} diff --git a/lua/plugins/luasnip.lua b/lua/plugins/luasnip.lua new file mode 100644 index 0000000..8f221e1 --- /dev/null +++ b/lua/plugins/luasnip.lua @@ -0,0 +1,6 @@ +-- https://github.com/L3MON4D3/LuaSnip + +return { + "L3MON4D3/LuaSnip", + build = "make install_jsregexp" +} diff --git a/lua/plugins/mason-lspconfig.lua b/lua/plugins/mason-lspconfig.lua new file mode 100644 index 0000000..b1f0f66 --- /dev/null +++ b/lua/plugins/mason-lspconfig.lua @@ -0,0 +1,25 @@ +-- https://github.com/williamboman/mason-lspconfig.nvim + +return { + "williamboman/mason-lspconfig.nvim", + dependencies = { "williamboman/mason.nvim" }, + config = function() + require("mason-lspconfig").setup() + + require("mason-lspconfig").setup_handlers { + -- The first entry (without a key) will be the default handler + -- and will be called for each installed server that doesn't have + -- a dedicated handler. + function (server_name) -- default handler (optional) + require("lspconfig")[server_name].setup {} + end, + -- Next, you can provide a dedicated handler for specific servers. + -- For example, a handler override for the `rust_analyzer`: + --[[ + ["rust_analyzer"] = function () + require("rust-tools").setup {} + end + ]]-- + } + end, +} diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua new file mode 100644 index 0000000..5360ff8 --- /dev/null +++ b/lua/plugins/mason.lua @@ -0,0 +1,7 @@ +return { + "williamboman/mason.nvim", + build = ":MasonUpdate", -- :MasonUpdate updates registry contents + config = function() + require("mason").setup() + end +} diff --git a/lua/plugins/neodev.lua b/lua/plugins/neodev.lua new file mode 100644 index 0000000..0e67ad9 --- /dev/null +++ b/lua/plugins/neodev.lua @@ -0,0 +1,5 @@ +-- https://github.com/folke/neodev.nvim + +return { + "folke/neodev.nvim" +} diff --git a/lua/plugins/nord.lua b/lua/plugins/nord.lua new file mode 100644 index 0000000..1463c66 --- /dev/null +++ b/lua/plugins/nord.lua @@ -0,0 +1,7 @@ +return { + "shaunsingh/nord.nvim", + lazy = false, + config = function() + vim.cmd.colorscheme "nord" + end +} diff --git a/lua/plugins/nui.lua b/lua/plugins/nui.lua new file mode 100644 index 0000000..240c405 --- /dev/null +++ b/lua/plugins/nui.lua @@ -0,0 +1,5 @@ +-- https://github.com/MunifTanjim/nui.nvim + +return { + "MunifTanjim/nui.nvim" +} diff --git a/lua/plugins/nvim-autopairs.lua b/lua/plugins/nvim-autopairs.lua new file mode 100644 index 0000000..7d25d78 --- /dev/null +++ b/lua/plugins/nvim-autopairs.lua @@ -0,0 +1,15 @@ +-- https://github.com/windwp/nvim-autopairs + +return { + "windwp/nvim-autopairs", + dependencies = { "hrsh7th/nvim-cmp" }, + config = function() + require("nvim-autopairs").setup {} + + local cmp_autopairs = require("nvim-autopairs.completion.cmp") + local cmp = require("cmp") + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) + end +} + + diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua new file mode 100644 index 0000000..77fd849 --- /dev/null +++ b/lua/plugins/nvim-cmp.lua @@ -0,0 +1,8 @@ +-- https://github.com/hrsh7th/nvim-cmp + +return { + "hrsh7th/nvim-cmp", + dependencies = { + "saadparwaiz1/cmp_luasnip", + }, +} diff --git a/lua/plugins/nvim-lspconfig.lua b/lua/plugins/nvim-lspconfig.lua new file mode 100644 index 0000000..7687988 --- /dev/null +++ b/lua/plugins/nvim-lspconfig.lua @@ -0,0 +1,3 @@ +return { + "neovim/nvim-lspconfig", +} diff --git a/lua/plugins/nvim-notify.lua b/lua/plugins/nvim-notify.lua new file mode 100644 index 0000000..86ab55a --- /dev/null +++ b/lua/plugins/nvim-notify.lua @@ -0,0 +1,5 @@ +-- https://github.com/rcarriga/nvim-notify + +return { + "rcarriga/nvim-notify" +} diff --git a/lua/plugins/nvim-telescope.lua b/lua/plugins/nvim-telescope.lua new file mode 100644 index 0000000..d597026 --- /dev/null +++ b/lua/plugins/nvim-telescope.lua @@ -0,0 +1,5 @@ +return { + "nvim-telescope/telescope.nvim", + tag = "0.1.1", + dependencies = { "nvim-lua/plenary.nvim" } +} diff --git a/lua/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua new file mode 100644 index 0000000..d94ed3f --- /dev/null +++ b/lua/plugins/nvim-tree.lua @@ -0,0 +1,7 @@ +return { + "nvim-tree/nvim-tree.lua", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require("nvim-tree").setup {} + end +} diff --git a/lua/plugins/nvim-treesitter.lua b/lua/plugins/nvim-treesitter.lua new file mode 100644 index 0000000..f2522ad --- /dev/null +++ b/lua/plugins/nvim-treesitter.lua @@ -0,0 +1,4 @@ +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate" +} diff --git a/lua/plugins/parinfer-rust.lua b/lua/plugins/parinfer-rust.lua new file mode 100644 index 0000000..e4c80a0 --- /dev/null +++ b/lua/plugins/parinfer-rust.lua @@ -0,0 +1,6 @@ +-- https://github.com/eraserhd/parinfer-rust + +return { + "eraserhd/parinfer-rust", + build = "cargo build --release" +} diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua new file mode 100644 index 0000000..dcc9f50 --- /dev/null +++ b/lua/plugins/which-key.lua @@ -0,0 +1,11 @@ +-- https://github.com/folke/which-key.nvim + +return { + "folke/which-key.nvim", + config = function() + vim.o.timeout = true + vim.o.timeoutlen = 300 + require("which-key").setup({ + }) + end +}