Restructure to monorepo

This commit is contained in:
Luka Jankovic 2025-01-24 01:18:12 +01:00
parent 2d7c3cd696
commit b37fcbd18f
35 changed files with 1 additions and 2 deletions

1
nvim/init.lua Normal file
View file

@ -0,0 +1 @@
require("config")

29
nvim/lazy-lock.json Normal file
View file

@ -0,0 +1,29 @@
{
"codeium.nvim": { "branch": "main", "commit": "ebed4f7cc8a18184d8332d421ca10bed5f7d59a1" },
"conform.nvim": { "branch": "master", "commit": "70019124aa4f2e6838be9fbd2007f6d13b27a96d" },
"deadcolumn.nvim": { "branch": "master", "commit": "897c905aef1a268ce4cc507d5cce048ed808fa7a" },
"git-messenger.vim": { "branch": "master", "commit": "edc603d4cda7894a743e383e16c638e206d03148" },
"gitsigns.nvim": { "branch": "main", "commit": "76d88f3b584e1f83b2aa51663a32cc6ee8d97eff" },
"indent-blankline.nvim": { "branch": "master", "commit": "7a698a1d7ed755af9f5a88733b23ca246ce2df28" },
"lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" },
"lsp_signature.nvim": { "branch": "master", "commit": "5b64964ed02098c85613ee3d20f96bed1dfb64cc" },
"lspsaga.nvim": { "branch": "main", "commit": "13b3cdc9a53ec821b9e693ee71501cc2d6cf206c" },
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "e942edf5c85b6a2ab74059ea566cac5b3e1514a4" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.icons": { "branch": "main", "commit": "1c79feb7478ca773fa3dac5cadf43ced9180e861" },
"nord.nvim": { "branch": "master", "commit": "80c1e5321505aeb22b7a9f23eb82f1e193c12470" },
"nvim-cmp": { "branch": "main", "commit": "8c82d0bd31299dbff7f8e780f5e06d2283de9678" },
"nvim-lspconfig": { "branch": "master", "commit": "339ccc81e08793c3af9b83882a6ebd90c9cc0d3b" },
"nvim-surround": { "branch": "main", "commit": "9f0cb495f25bff32c936062d85046fbda0c43517" },
"nvim-tree.lua": { "branch": "master", "commit": "d529a99f88e0dff02e0aa275db2f595cd252a2c8" },
"nvim-treesitter": { "branch": "master", "commit": "984214ef8e4ca18d77639663319aabdfba89632f" },
"nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" },
"oil.nvim": { "branch": "master", "commit": "09fa1d22f5edf0730824d2b222d726c8c81bbdc9" },
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
"refactoring.nvim": { "branch": "master", "commit": "2db6d378e873de31d18ade549c2edba64ff1c2e3" },
"stcursorword": { "branch": "main", "commit": "f6810ed5001eeee6061fdce77b292a5565823ded" },
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
"which-key.nvim": { "branch": "main", "commit": "1f8d414f61e0b05958c342df9b6a4c89ce268766" }
}

3
nvim/lua/config/init.lua Normal file
View file

@ -0,0 +1,3 @@
require('config.lazy')
require('config.settings')
require('config.keybinds')

View file

@ -0,0 +1,8 @@
-- Remap Ctrl + h/j/k/l for pane movement
vim.api.nvim_set_keymap('n', '<C-h>', '<C-w>h', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<C-j>', '<C-w>j', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<C-k>', '<C-w>k', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<C-l>', '<C-w>l', { noremap = true, silent = true })
-- Clear Highlights
vim.api.nvim_set_keymap('n', '<Esc>', ':noh<CR>', { noremap = true, silent = true })

35
nvim/lua/config/lazy.lua Normal file
View file

@ -0,0 +1,35 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "nord" } },
-- automatically check for plugin updates
checker = { enabled = false },
})

View file

@ -0,0 +1,47 @@
-- Line numbers
vim.wo.number = true
-- Tabs
vim.o.expandtab = true
vim.o.smartindent = true
vim.o.tabstop = 4
vim.o.shiftwidth = 4
-- Clipboard
vim.o.clipboard = "unnamedplus"
vim.api.nvim_exec(
[[
augroup YankHighlight
autocmd!
autocmd TextYankPost * silent! lua vim.highlight.on_yank()
augroup end
]],
false
)
-- Restore cursor
local restore_cursor_augroup = vim.api.nvim_create_augroup("restore_cursor_shape_on_exit", { clear = true })
vim.api.nvim_create_autocmd({ "VimLeave" }, {
group = restore_cursor_augroup,
desc = "restore the cursor shape on exit of neovim",
command = "set guicursor=a:ver20",
})
-- Horizontal Split Line
vim.opt.laststatus = 3
-- Padding around current line
vim.opt.scrolloff = 5
-- Highlight current line
vim.opt.cursorline = true
-- Column limit
vim.opt.colorcolumn = "80"
-- Set signcolumn to prevent lsp flickering
vim.opt.signcolumn = "yes"
-- Always show tabline
vim.opt.laststatus = 2

View file

@ -0,0 +1,15 @@
return {
"Exafunction/codeium.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"hrsh7th/nvim-cmp",
},
config = function()
require("codeium").setup({
enable_cmp_source = false,
virtual_text = {
enabled = true,
}
})
end
}

View file

@ -0,0 +1 @@
return { 'Bekaboo/deadcolumn.nvim' }

View file

@ -0,0 +1,7 @@
return {
'rhysd/git-messenger.vim',
cmd = { 'GitMessenger' },
keys = {
{ "<leader>gm", "<cmd>GitMessenger<cr>", desc = "[G]it [M]essenger" },
}
}

View file

@ -0,0 +1,8 @@
return {
"lewis6991/gitsigns.nvim",
config = function()
require("gitsigns").setup({
current_line_blame = true,
})
end,
}

View file

@ -0,0 +1,7 @@
return {
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
---@module "ibl"
---@type ibl.config
opts = {},
}

171
nvim/lua/plugins/lsp.lua Normal file
View file

@ -0,0 +1,171 @@
return {
{
"williamboman/mason.nvim",
cmd = "Mason",
},
{
"williamboman/mason-lspconfig.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
require("mason").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,
},
{
"ray-x/lsp_signature.nvim",
event = "VeryLazy",
opts = {},
config = function(_, opts)
require 'lsp_signature'.setup(opts)
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
local bufnr = args.buf
local client = vim.lsp.get_client_by_id(args.data.client_id)
if vim.tbl_contains({ 'null-ls' }, client.name) then -- blacklist lsp
return
end
require("lsp_signature").on_attach({
-- ... setup options here ...
}, bufnr)
end,
})
end
},
{
"neovim/nvim-lspconfig",
},
{
"stevearc/conform.nvim",
event = { "BufWritePre" },
cmd = { "ConformInfo" },
opts = function()
local mason_reg = require("mason-registry")
local formatters = {}
local formatters_by_ft = {}
-- add diff langue vs filetype
local keymap = {
["c++"] = "cpp",
["c#"] = "cs",
}
-- add dif conform vs mason
local name_map = {
["cmakelang"] = "cmake_format",
["deno"] = "deno_fmt",
["elm-format"] = "elm_format",
["gdtoolkit"] = "gdformat",
["nixpkgs-fmt"] = "nixpkgs_fmt",
["opa"] = "opa_fmt",
["php-cs-fixer"] = "php_cs_fixer",
["ruff"] = "ruff_format",
["sql-formatter"] = "sql_formatter",
["xmlformatter"] = "xmlformat",
}
for _, pkg in pairs(mason_reg.get_installed_packages()) do
for _, type in pairs(pkg.spec.categories) do
-- only act upon a formatter
if type == "Formatter" then
-- if formatter doesn't have a builtin config, create our own from a generic template
if not require("conform").get_formatter_config(pkg.spec.name) then
-- the key of the entry to this table
-- is the name of the bare executable
-- the actual value may not be the absolute path
-- in some cases
local bin = next(pkg.spec.bin)
-- this should be replaced by a function
-- that quieries the configured mason install path
local prefix = vim.fn.stdpath("data") .. "/mason/bin/"
formatters[pkg.spec.name] = {
command = prefix .. bin,
args = { "$FILENAME" },
stdin = true,
require_cwd = false,
}
end
-- finally add the formatter to it's compatible filetype(s)
for _, ft in pairs(pkg.spec.languages) do
local ftl = string.lower(ft)
local ready = mason_reg.get_package(pkg.spec.name):is_installed()
if ready then
if keymap[ftl] ~= nil then
ftl = keymap[ftl]
end
if name_map[pkg.spec.name] ~= nil then
pkg.spec.name = name_map[pkg.spec.name]
end
formatters_by_ft[ftl] = formatters_by_ft[ftl] or {}
table.insert(formatters_by_ft[ftl], pkg.spec.name)
end
end
end
end
end
return {
formatters = formatters,
formatters_by_ft = formatters_by_ft,
}
end,
keys = {
{
"<leader>fm",
function()
require("conform").format({ async = true })
end,
mode = "",
desc = "Format buffer",
},
{
"<leader>ca",
function()
vim.lsp.buf.code_action()
end,
mode = "",
desc = "Code Action",
},
{
"<leader>rn",
function()
vim.lsp.buf.rename()
end,
mode = "",
desc = "[R]e[N]ame",
},
{
"gd",
function()
vim.lsp.buf.definition()
end,
mode = "",
desc = "[G]oto [D]efinition",
},
{
"gD",
function()
vim.lsp.buf.declaration()
end,
mode = "",
desc = "[G]oto [D]eclaration",
},
},
},
}

View file

@ -0,0 +1,22 @@
return {
'nvimdev/lspsaga.nvim',
config = function()
require("lspsaga").setup({
ui = {
code_action = '',
expand = '+',
collapse = '-'
}
})
end,
dependencies = {
{ 'nvim-tree/nvim-web-devicons' },
{ 'nvim-treesitter/nvim-treesitter' },
},
event = "LspAttach",
keys = {
{ "<leader>fi", "<cmd>Lspsaga finder<cr>", desc = "LSP Find References" },
{ "<leader>ci", "<cmd>Lspsaga incoming_calls<cr>", desc = "Incoming Calls" },
{ "<leader>co", "<cmd>Lspsaga outgoing_calls<cr>", desc = "Outgoing Calls" },
}
}

View file

@ -0,0 +1,3 @@
return {
"echasnovski/mini.icons"
}

View file

@ -0,0 +1,6 @@
return {
'shaunsingh/nord.nvim',
config = function()
vim.cmd [[colorscheme nord]]
end
}

View file

@ -0,0 +1,9 @@
return {
"kylechui/nvim-surround",
version = "*",
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
})
end
}

View file

@ -0,0 +1,10 @@
return {
'nvim-tree/nvim-tree.lua',
config = function()
require("nvim-tree").setup()
end,
keys = {
{ "<M-n>", "<cmd>NvimTreeToggle<cr>", desc = "Toggle [N]vimTree" },
{ "<leader>nr", "<cmd>NvimTreeRefresh<cr>", desc = "[N]vimTree [R]efresh" },
}
}

View file

@ -0,0 +1,13 @@
return {
'nvim-treesitter/nvim-treesitter',
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = "all",
auto_install = true,
sync_install = false,
highlight = {
enable = true,
},
})
end
}

6
nvim/lua/plugins/oil.lua Normal file
View file

@ -0,0 +1,6 @@
return {
"stevearc/oil.nvim",
config = function()
require("oil").setup()
end,
}

View file

@ -0,0 +1,23 @@
return {
"ThePrimeagen/refactoring.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
lazy = false,
config = function()
require("refactoring").setup()
end,
keys = {
{
"<leader>xe",
"<cmd>Refactor extract <cr>",
desc = "Refactor Extract"
},
{
"<leader>xv",
"<cmd>Refactor extract_var <cr>",
desc = "Refactor Extract Variable"
},
}
}

View file

@ -0,0 +1,11 @@
return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("lualine").setup({
options = {
disabled_filetypes = { "NvimTree" },
},
})
end,
}

View file

@ -0,0 +1,5 @@
return {
"sontungexpt/stcursorword",
event = "VeryLazy",
config = true,
}

View file

@ -0,0 +1,23 @@
return {
"nvim-telescope/telescope.nvim",
tag = "0.1.8",
dependencies = { "nvim-lua/plenary.nvim" },
event = "VimEnter",
config = function()
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<leader>sf", builtin.find_files, { desc = "[S]earch [F]iles" })
vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch [G]rep" })
vim.keymap.set("n", "<leader>/", function()
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
winblend = 20,
previewer = false,
}))
end, { desc = "[/] Fuzzily search in current buffer" })
vim.keymap.set("n", "<leader>ff", function()
require("telescope.builtin").lsp_document_symbols({ symbols = "function" })
end, { desc = "[F]ind [F]unction" })
end,
}

View file

@ -0,0 +1,11 @@
return {
"akinsho/toggleterm.nvim",
cmd = "ToggleTerm",
keys = {
{ "<M-\\>", "<cmd>ToggleTerm</cr>", desc = "Toggle Terminal" },
},
version = "*",
opts = {
open_mapping = [[<M-\>]],
},
}

View file

@ -0,0 +1,14 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
opts = {},
keys = {
{
"<leader>?",
function()
require("which-key").show({ global = false })
end,
desc = "Buffer Local Keymaps (which-key)",
},
},
}