Initial commit

This commit is contained in:
Vegard Berg 2023-05-21 22:15:06 +02:00
commit 2393d5a2d3
25 changed files with 348 additions and 0 deletions

16
fnl/init.fnl Normal file
View File

@ -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")

49
init.lua Normal file
View File

@ -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")

24
lazy-lock.json Normal file
View File

@ -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" }
}

25
lua/init.lua Normal file
View File

@ -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

25
lua/mappings.lua Normal file
View File

@ -0,0 +1,25 @@
--
return {
n = {
["<leader>C"] = { name = "Conjure" },
["<leader>CE"] = { "<cmd>ConjureEval<cr>", desc = "Evaluate based on context" },
["<leader>Cm"] = { "<cmd>ConjureEvalMotion<cr>", desc = "Evaluate based on motion" },
["<leader>Cb"] = { "<cmd>ConjureEvalBuf<cr>", desc = "Evaluate buffer" },
["<leader>Cf"] = { "<cmd>ConjureEvalFile<cr>", desc = "Evaluate file" },
["<leader>Ce"] = { "<cmd>ConjureEvalCurrentForm<cr>", desc = "Evaluate current form" },
["<leader>Cr"] = { "<cmd>ConjureEvalRootForm<cr>", desc = "Evaluate root form" },
["<leader>C!"] = { "<cmd>ConjureEvalReplaceForm<cr>", desc = "Evaluate and replace form" },
["<leader>Cw"] = { "<cmd>ConjureEvalWord<cr>", desc = "Evaluate word" },
["<leader>Cm"] = { "<cmd>ConjureEvalMarkedForm<cr>", desc = "Evaluate form at mark" },
["<leader>Cc"] = { name = "Evaluate with result comment" },
["<leader>Cce"] = { "<cmd>ConjureEvalCommentCurrentForm<cr>", desc = "Evaluate current form" },
["<leader>Ccr"] = { "<cmd>ConjureEvalCommentRootForm<cr>", desc = "Evaluate root form" },
["<leader>Ccw"] = { "<cmd>ConjureEvalCommentWord<cr>", desc = "Evaluate word" },
},
v = {
["<leader>C"] = { "<cmd>ConjureEvalVisual<cr>", desc = "Evalute selection" },
}
}

22
lua/plugins/aerial.lua Normal file
View File

@ -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', '{', '<cmd>AerialPrev<CR>', {buffer = bufnr})
vim.keymap.set('n', '}', '<cmd>AerialNext<CR>', {buffer = bufnr})
end
})
-- You probably also want to set a keymap to toggle aerial
vim.keymap.set('n', '<leader>a', '<cmd>AerialToggle!<CR>')
end
}

8
lua/plugins/aniseed.lua Normal file
View File

@ -0,0 +1,8 @@
return {
"Olical/aniseed",
lazy = false,
priority = 100,
init = function(_)
vim.g["aniseed#env"] = true
end
}

16
lua/plugins/barbar.lua Normal file
View File

@ -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
}

31
lua/plugins/conjure.lua Normal file
View File

@ -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({
["<leader>C"] = { name = "Conjure" },
["<leader>CE"] = { "<cmd>ConjureEval<cr>", "Evaluate based on context" },
["<leader>Cm"] = { "<cmd>ConjureEvalMotion<cr>", "Evaluate based on motion" },
["<leader>Cb"] = { "<cmd>ConjureEvalBuf<cr>", "Evaluate buffer" },
["<leader>Cf"] = { "<cmd>ConjureEvalFile<cr>", "Evaluate file" },
["<leader>Ce"] = { "<cmd>ConjureEvalCurrentForm<cr>", "Evaluate current form" },
["<leader>Cr"] = { "<cmd>ConjureEvalRootForm<cr>", "Evaluate root form" },
["<leader>C!"] = { "<cmd>ConjureEvalReplaceForm<cr>", "Evaluate and replace form" },
["<leader>Cw"] = { "<cmd>ConjureEvalWord<cr>", "Evaluate word" },
["<leader>Cm"] = { "<cmd>ConjureEvalMarkedForm<cr>", "Evaluate form at mark" },
["<leader>Cc"] = { name = "Evaluate with result comment" },
["<leader>Cce"] = { "<cmd>ConjureEvalCommentCurrentForm<cr>", "Evaluate current form" },
["<leader>Ccr"] = { "<cmd>ConjureEvalCommentRootForm<cr>", "Evaluate root form" },
["<leader>Ccw"] = { "<cmd>ConjureEvalCommentWord<cr>", "Evaluate word" },
}, { mode = "n" })
wk.register({
["<leader>C"] = { "<cmd>ConjureEvalVisual<cr>", "Evalute selection" },
}, { mode = "v" })
end,
}

13
lua/plugins/lualine.lua Normal file
View File

@ -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
}

6
lua/plugins/luasnip.lua Normal file
View File

@ -0,0 +1,6 @@
-- https://github.com/L3MON4D3/LuaSnip
return {
"L3MON4D3/LuaSnip",
build = "make install_jsregexp"
}

View File

@ -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,
}

7
lua/plugins/mason.lua Normal file
View File

@ -0,0 +1,7 @@
return {
"williamboman/mason.nvim",
build = ":MasonUpdate", -- :MasonUpdate updates registry contents
config = function()
require("mason").setup()
end
}

5
lua/plugins/neodev.lua Normal file
View File

@ -0,0 +1,5 @@
-- https://github.com/folke/neodev.nvim
return {
"folke/neodev.nvim"
}

7
lua/plugins/nord.lua Normal file
View File

@ -0,0 +1,7 @@
return {
"shaunsingh/nord.nvim",
lazy = false,
config = function()
vim.cmd.colorscheme "nord"
end
}

5
lua/plugins/nui.lua Normal file
View File

@ -0,0 +1,5 @@
-- https://github.com/MunifTanjim/nui.nvim
return {
"MunifTanjim/nui.nvim"
}

View File

@ -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
}

8
lua/plugins/nvim-cmp.lua Normal file
View File

@ -0,0 +1,8 @@
-- https://github.com/hrsh7th/nvim-cmp
return {
"hrsh7th/nvim-cmp",
dependencies = {
"saadparwaiz1/cmp_luasnip",
},
}

View File

@ -0,0 +1,3 @@
return {
"neovim/nvim-lspconfig",
}

View File

@ -0,0 +1,5 @@
-- https://github.com/rcarriga/nvim-notify
return {
"rcarriga/nvim-notify"
}

View File

@ -0,0 +1,5 @@
return {
"nvim-telescope/telescope.nvim",
tag = "0.1.1",
dependencies = { "nvim-lua/plenary.nvim" }
}

View File

@ -0,0 +1,7 @@
return {
"nvim-tree/nvim-tree.lua",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("nvim-tree").setup {}
end
}

View File

@ -0,0 +1,4 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate"
}

View File

@ -0,0 +1,6 @@
-- https://github.com/eraserhd/parinfer-rust
return {
"eraserhd/parinfer-rust",
build = "cargo build --release"
}

11
lua/plugins/which-key.lua Normal file
View File

@ -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
}