diff options
| author | eric.marin <maarin.eric@gmail.com> | 2025-12-02 08:54:27 +0100 |
|---|---|---|
| committer | ericmarin <maarin.eric@gmail.com> | 2026-03-20 10:24:05 +0100 |
| commit | 2781082f1085757a0cfb929ba37de968726ec751 (patch) | |
| tree | 96f908c8eccf11d19d77c37c333ed56aa4a437d5 /nvim | |
| parent | c2acdf9cca1de631c7d1c60d7cfba2a7ab816e59 (diff) | |
| download | dotfiles-2781082f1085757a0cfb929ba37de968726ec751.tar.gz dotfiles-2781082f1085757a0cfb929ba37de968726ec751.zip | |
xd
Diffstat (limited to '')
| -rw-r--r-- | nvim/lua/config/options.lua | 12 | ||||
| -rw-r--r-- | nvim/lua/plugins/gitsigns.lua | 57 | ||||
| -rw-r--r-- | nvim/lua/plugins/image.lua | 11 | ||||
| -rw-r--r-- | nvim/lua/plugins/mini-starter.lua | 108 | ||||
| -rw-r--r-- | nvim/lua/plugins/neorg.lua | 219 | ||||
| -rw-r--r-- | nvim/lua/plugins/nvim-lspconfig.lua | 2 | ||||
| -rw-r--r-- | nvim/lua/plugins/nvim-treesitter.lua | 100 | ||||
| -rw-r--r-- | nvim/lua/plugins/toggleterm.lua | 110 |
8 files changed, 352 insertions, 267 deletions
diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua index deeeb2e..e465418 100644 --- a/nvim/lua/config/options.lua +++ b/nvim/lua/config/options.lua @@ -2,14 +2,24 @@ local opt = vim.opt -- Indent opt.tabstop = 2 +opt.softtabstop = 2 opt.shiftwidth = 2 opt.expandtab = false opt.smartindent = true opt.wrap = false +vim.api.nvim_create_autocmd("FileType", { + pattern = "bend", + callback = function() + vim.opt_local.expandtab = true + vim.opt_local.tabstop = 4 + vim.opt_local.shiftwidth = 4 + end, +}) + -- Appearance opt.number = true -opt.relativenumber = true +opt.relativenumber = false opt.cursorline = true opt.termguicolors = true opt.showmode = true diff --git a/nvim/lua/plugins/gitsigns.lua b/nvim/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..2df9a2e --- /dev/null +++ b/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,57 @@ +local opts = { + signs = { + add = { text = '┃' }, + change = { text = '┃' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + untracked = { text = '┆' }, + }, + signs_staged = { + add = { text = '┃' }, + change = { text = '┃' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + untracked = { text = '┆' }, + }, + signs_staged_enable = true, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + watch_gitdir = { + follow_files = true + }, + auto_attach = true, + attach_to_untracked = false, + current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + virt_text_priority = 100, + use_focus = true, + }, + current_line_blame_formatter = '<author>, <author_time:%R> - <summary>', + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, -- Disable if file is longer than this (in lines) + preview_config = { + -- Options passed to nvim_open_win + style = 'minimal', + relative = 'cursor', + row = 0, + col = 1 + }, +} + +return { + "lewis6991/gitsigns.nvim", + lazy = true, + event = "VeryLazy", + -- event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + opts = opts, +} diff --git a/nvim/lua/plugins/image.lua b/nvim/lua/plugins/image.lua new file mode 100644 index 0000000..b1dc285 --- /dev/null +++ b/nvim/lua/plugins/image.lua @@ -0,0 +1,11 @@ +return { + "3rd/image.nvim", + build = false, -- so that it doesn't build the rock https://github.com/3rd/image.nvim/issues/91#issuecomment-2453430239 + ft = "norg", + opts = { + backend = "sixel", + processor = "magick_cli", + only_render_image_at_cursor = true, + only_render_image_at_cursor_mode = "popup", + } +} diff --git a/nvim/lua/plugins/mini-starter.lua b/nvim/lua/plugins/mini-starter.lua index 8b216a1..67aae04 100644 --- a/nvim/lua/plugins/mini-starter.lua +++ b/nvim/lua/plugins/mini-starter.lua @@ -1,5 +1,5 @@ Headers = { - [[ + [[ ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗ ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║ ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║ @@ -7,7 +7,7 @@ Headers = { ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║ ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝ ]], - [[ + [[ ███▄ █ ▓█████ ▒█████ ██▒ █▓ ██▓ ███▄ ▄███▓ ██ ▀█ █ ▓█ ▀ ▒██▒ ██▒▓██░ █▒▓██▒▓██▒▀█▀ ██▒ ▓██ ▀█ ██▒▒███ ▒██░ ██▒ ▓██ █▒░▒██▒▓██ ▓██░ @@ -19,7 +19,7 @@ Headers = { ░ ░ ░ ░ ░ ░ ░ ░ ░ ]], - [[ + [[ ██████ █████ █████ █████ ███ ░░██████ ░░███ ░░███ ░░███ ░░░ ░███░███ ░███ ██████ ██████ ░███ ░███ ████ █████████████ @@ -29,14 +29,14 @@ Headers = { █████ ░░█████░░██████ ░░██████ ░░███ █████ █████░███ █████ ░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░ ░░░░░ ░░░░░ ░░░ ░░░░░ ]], - [[ + [[ ▐ ▄ ▄▄▄ . ▌ ▐·▪ • ▌ ▄ ·. •█▌▐█▀▄.▀· ▄█▀▄ ▪█·█▌██ ·██ ▐███▪ ▐█▐▐▌▐▀▀▪▄▐█▌.▐▌▐█▐█•▐█·▐█ ▌▐▌▐█· ██▐█▌▐█▄▄▌▐█▌.▐▌ ███ ▐█▌██ ██▌▐█▌ ▀▀ █▪ ▀▀▀ ▀█▄▀▪. ▀ ▀▀▀▀▀ █▪▀▀▀ ]], - [[ + [[ __ __ ________ ______ __ __ ______ __ __ | \ | \ \/ \| \ | \ \ \ / \ | ▓▓\ | ▓▓ ▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓\ ▓▓ | ▓▓\▓▓▓▓▓▓ ▓▓\ / ▓▓ @@ -47,7 +47,7 @@ Headers = { | ▓▓ \▓▓▓ ▓▓ \\▓▓ ▓▓ \▓▓▓ | ▓▓ \ ▓▓ \▓ | ▓▓ \▓▓ \▓▓\▓▓▓▓▓▓▓▓ \▓▓▓▓▓▓ \▓ \▓▓▓▓▓▓\▓▓ \▓▓ ]], - [[ + [[ ▀███▄ ▀███▀███▀▀▀███ ▄▄█▀▀██▄ ▀████▀ ▀███▀████▀████▄ ▄███▀ ███▄ █ ██ ▀█▄██▀ ▀██▄ ▀██ ▄█ ██ ████ ████ █ ███ █ ██ █ ██▀ ▀██ ██▄ ▄█ ██ █ ██ ▄█ ██ @@ -58,7 +58,7 @@ Headers = { ▓ ▓▓▓ ▓▓ ▓▓█▓▓▓ ▓▓▓ ▓▓▒▒ ▒▓ ▒ ▀▓▓▀ ▓▓ ▒ ▒ ▒ ▒▓▓▒ ▒▒▒▓▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒▓▒ ▒▒ ▒▒▒ ▒ ▒ ▒▒▒ ]], - [[ + [[ ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ @@ -71,7 +71,7 @@ Headers = { ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ]], - [[ + [[ ,-. _,---._ __ / \ / ) .-' `./ / \ ( ( ,' `/ /| @@ -84,13 +84,13 @@ Headers = { ) | \ `.___________|/ `--' `--' ]], - [[ + [[ |\ _,,,---,,_ ZZZzz /,`.-'`' -. ;-;;,_ |,4- ) )-,_. ,\ ( `'-' '---''(_/--' `-'\_) ]], - [[ + [[ ╭╮╭┬─╮╭─╮┬ ┬┬╭┬╮ │││├┤ │ │╰┐┌╯││││ ╯╰╯╰─╯╰─╯ ╰╯ ┴┴ ┴ @@ -98,86 +98,86 @@ Headers = { } Quotes = { - [[ + [[ I don't care that they stole my idea... I care that they don't have any of their own. ~ Nikola Tesla ]], - [[ + [[ Make everything as simple as possible, but not simpler. ~ Albert Einstein ]], - [[ + [[ Code never lies, comments sometimes do. ~ Ron Jeffries ]], - [[ + [[ Good code is its own best documentation. ~ Steve McConnell ]], - [[ + [[ I do not fear computers. I fear the lack of them. ~ Isaac Asimov ]], - [[ + [[ If a machine is expected to be infallible, it cannot also be intelligent. ~ Alan Turing ]], - [[ + [[ Mathematical reasoning may be regarded. ~ Alan Turing ]], - [[ + [[ Anti-social behavior is a trait of intelligence in a world full of conformists. ~ Nikola Tesla ]], - [[ + [[ We are very, very small, but we are profoundly capable of very, very big things. ~ Stephen Hawking ]], - [[ + [[ Quiet people have the loudest minds. ~ Stephen Hawking ]], - [[ + [[ An idiot admires complexity, a genius admires simplicity. ~ Terry Davis ]], - [[ + [[ It's hardware that makes a machine fast. It's software that makes a fast machine slow. ~ Craig Reucassel ]], - [[ + [[ Computer science is no more about computers than astronomy is about telescopes. ~ Edsger Dijkstra ]], - [[ + [[ An algorithm must be seen to be believed. ~ Donald Knuth ]], - [[ + [[ In theory there is no difference between theory and practice. In practice there is. ~ Yogi Berra ]], - [[ + [[ If Java had true garbage collection, most programs would delete themselves upon execution. ~ Robert Sewell ]], - [[ + [[ If debugging is the process of removing software bugs, then programming must be the process of putting them in. ~ Edsger Dijkstra ]], - [[ + [[ Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris. ~ Larry Wall ]], - [[ + [[ The question of whether computers can think is like the question of whether submarines can swim. ~ Edsger Dijkstra ]], - [[ + [[ Of course, I'd also suggest that whoever was the genius who thought it was a good idea to read things ONE F*CKING BYTE AT A TIME with system calls for each byte should be retroactively aborted. Who the f*ck does idiotic things like that? How did they not die as babies, considering that they @@ -190,38 +190,38 @@ Quotes = { math.randomseed(os.time()) local header = function() - return Headers[math.random(#Headers)] + return Headers[math.random(#Headers)] end local footer = function() - return Quotes[math.random(#Quotes)] + return Quotes[math.random(#Quotes)] end local config = function() - local starter = require("mini.starter") - vim.keymap.set("n", "<Space>d", starter.open, { desc = "Dashboard" }) - starter.setup({ - autoopen = true, - evaluate_single = false, - items = { - starter.sections.recent_files(5, false, true), - { name = "Plugin Manager", action = "Lazy", section = "Actions" }, - { name = "File Browser", action = "Oil --float", section = "Actions" }, - { name = "Neorg Index", action = "Neorg index", section = "Actions" }, - { name = 'Edit new buffer', action = 'enew', section = 'Actions' }, - { name = 'Quit Neovim', action = 'qall', section = 'Actions' }, - }, - header = header, - footer = footer, - content_hooks = nil, - query_updaters = "abcdefghijklmnopqrstuvwxyz0123456789_-.", - silent = false, - }) + local starter = require("mini.starter") + vim.keymap.set("n", "<Space>d", starter.open, { desc = "Dashboard" }) + starter.setup({ + autoopen = true, + evaluate_single = false, + items = { + starter.sections.recent_files(5, false, true), + { name = "Plugin Manager", action = "Lazy", section = "Actions" }, + { name = "File Browser", action = "Oil --float", section = "Actions" }, + { name = "Neorg Index", action = "Neorg index", section = "Actions" }, + { name = 'Edit new buffer', action = 'enew', section = 'Actions' }, + { name = 'Quit Neovim', action = 'qall', section = 'Actions' }, + }, + header = header, + footer = footer, + content_hooks = nil, + query_updaters = "abcdefghijklmnopqrstuvwxyz0123456789_-.", + silent = false, + }) end return { - "echasnovski/mini.starter", - lazy = false, - config = config + "echasnovski/mini.starter", + lazy = false, + config = config } diff --git a/nvim/lua/plugins/neorg.lua b/nvim/lua/plugins/neorg.lua index a36aff5..77bb71f 100644 --- a/nvim/lua/plugins/neorg.lua +++ b/nvim/lua/plugins/neorg.lua @@ -1,120 +1,117 @@ local config = function() - vim.api.nvim_create_autocmd("Filetype", { - pattern = "norg", - callback = function() - -- remap keybinds - vim.keymap.set("n", "<Space>nn", "<Plug>(neorg.dirman.new-note)", { buffer = true }) - vim.keymap.set("n", "<Space>tc", "<cmd>Neorg toc<CR>", { buffer = true }) + vim.api.nvim_create_autocmd("Filetype", { + pattern = "norg", + callback = function() + -- remap keybinds + vim.keymap.set("n", "<Space>nn", "<Plug>(neorg.dirman.new-note)", { buffer = true }) + vim.keymap.set("n", "<Space>tc", "<cmd>Neorg toc<CR>", { buffer = true }) - vim.keymap.set("i", "<C-d>", "<Plug>(neorg.promo.demote)", { buffer = true }) - vim.keymap.set("i", "<C-t>", "<Plug>(neorg.promo.promote)", { buffer = true }) - vim.keymap.set("i", "<M-CR>", "<Plug>(neorg.itero.next-iteration)", { buffer = true }) - vim.keymap.set("i", "<M-d>", "<Plug>(neorg.tempus.insert-date.insert-mode)", { buffer = true }) + vim.keymap.set("i", "<C-d>", "<Plug>(neorg.promo.demote)", { buffer = true }) + vim.keymap.set("i", "<C-t>", "<Plug>(neorg.promo.promote)", { buffer = true }) + vim.keymap.set("i", "<M-CR>", "<Plug>(neorg.itero.next-iteration)", { buffer = true }) + vim.keymap.set("i", "<M-d>", "<Plug>(neorg.tempus.insert-date.insert-mode)", { buffer = true }) - vim.keymap.set("n", "<.", "<Plug>(neorg.promo.demote)", { buffer = true }) - vim.keymap.set("n", "<<", "<Plug>(neorg.promo.demote.nested)", { buffer = true }) - vim.keymap.set("n", "<C-Space>", "<Plug>(neorg.qol.todo-items.todo.task-cycle)", { buffer = true }) - vim.keymap.set("n", "<CR>", "<Plug>(neorg.esupports.hop.hop-link)", { buffer = true }) - vim.keymap.set("n", "<Space>cm", "<Plug>(neorg.looking-glass.magnify-code-block)", { buffer = true }) - vim.keymap.set("n", "<Space>id", "<Plug>(neorg.tempus.insert-date)", { buffer = true }) - vim.keymap.set("n", "<Space>li", "<Plug>(neorg.pivot.list.invert)", { buffer = true }) - vim.keymap.set("n", "<Space>lt", "<Plug>(neorg.pivot.list.toggle)", { buffer = true }) - vim.keymap.set("n", "<Space>ma", "<Plug>(neorg.qol.todo-items.todo.task-ambiguous)", { buffer = true }) - vim.keymap.set("n", "<Space>mc", "<Plug>(neorg.qol.todo-items.todo.task-cancelled)", { buffer = true }) - vim.keymap.set("n", "<Space>md", "<Plug>(neorg.qol.todo-items.todo.task-done)", { buffer = true }) - vim.keymap.set("n", "<Space>mh", "<Plug>(neorg.qol.todo-items.todo.task-on-hold)", { buffer = true }) - vim.keymap.set("n", "<Space>mi", "<Plug>(neorg.qol.todo-items.todo.task-important)", { buffer = true }) - vim.keymap.set("n", "<Space>mp", "<Plug>(neorg.qol.todo-items.todo.task-pending)", { buffer = true }) - vim.keymap.set("n", "<Space>mr", "<Plug>(neorg.qol.todo-items.todo.task-recurring)", { buffer = true }) - vim.keymap.set("n", "<Space>mu", "<Plug>(neorg.qol.todo-items.todo.task-undone)", { buffer = true }) - vim.keymap.set("n", "<M-CR>", "<Plug>(neorg.esupports.hop.hop-link.vsplit)", { buffer = true }) - vim.keymap.set("n", "<M-t>", "<Plug>(neorg.esupports.hop.hop-link.tab-drop)", { buffer = true }) - vim.keymap.set("n", ">.", "Plug>(neorg.promo.promote)", { buffer = true }) - vim.keymap.set("n", ">>", "Plug>(neorg.promo.promote.nested)", { buffer = true }) + vim.keymap.set("n", "<.", "<Plug>(neorg.promo.demote)", { buffer = true }) + vim.keymap.set("n", "<<", "<Plug>(neorg.promo.demote.nested)", { buffer = true }) + vim.keymap.set("n", "<C-Space>", "<Plug>(neorg.qol.todo-items.todo.task-cycle)", { buffer = true }) + vim.keymap.set("n", "<CR>", "<Plug>(neorg.esupports.hop.hop-link)", { buffer = true }) + vim.keymap.set("n", "<Space>cm", "<Plug>(neorg.looking-glass.magnify-code-block)", { buffer = true }) + vim.keymap.set("n", "<Space>id", "<Plug>(neorg.tempus.insert-date)", { buffer = true }) + vim.keymap.set("n", "<Space>li", "<Plug>(neorg.pivot.list.invert)", { buffer = true }) + vim.keymap.set("n", "<Space>lt", "<Plug>(neorg.pivot.list.toggle)", { buffer = true }) + vim.keymap.set("n", "<Space>ma", "<Plug>(neorg.qol.todo-items.todo.task-ambiguous)", { buffer = true }) + vim.keymap.set("n", "<Space>mc", "<Plug>(neorg.qol.todo-items.todo.task-cancelled)", { buffer = true }) + vim.keymap.set("n", "<Space>md", "<Plug>(neorg.qol.todo-items.todo.task-done)", { buffer = true }) + vim.keymap.set("n", "<Space>mh", "<Plug>(neorg.qol.todo-items.todo.task-on-hold)", { buffer = true }) + vim.keymap.set("n", "<Space>mi", "<Plug>(neorg.qol.todo-items.todo.task-important)", { buffer = true }) + vim.keymap.set("n", "<Space>mp", "<Plug>(neorg.qol.todo-items.todo.task-pending)", { buffer = true }) + vim.keymap.set("n", "<Space>mr", "<Plug>(neorg.qol.todo-items.todo.task-recurring)", { buffer = true }) + vim.keymap.set("n", "<Space>mu", "<Plug>(neorg.qol.todo-items.todo.task-undone)", { buffer = true }) + vim.keymap.set("n", "<M-CR>", "<Plug>(neorg.esupports.hop.hop-link.vsplit)", { buffer = true }) + vim.keymap.set("n", "<M-t>", "<Plug>(neorg.esupports.hop.hop-link.tab-drop)", { buffer = true }) + vim.keymap.set("n", ">.", "Plug>(neorg.promo.promote)", { buffer = true }) + vim.keymap.set("n", ">>", "Plug>(neorg.promo.promote.nested)", { buffer = true }) - vim.keymap.set("v", "<", "<Plug>(neorg.promo.demote.range)", { buffer = true }) - vim.keymap.set("v", ">", "<Plug>(neorg.promo.promote.range)", { buffer = true }) - end, - }) + vim.keymap.set("v", "<", "<Plug>(neorg.promo.demote.range)", { buffer = true }) + vim.keymap.set("v", ">", "<Plug>(neorg.promo.promote.range)", { buffer = true }) + end, + }) - require("neorg").setup({ - load = { - ["core.defaults"] = { - config = { - disable = { - "core.esupports.metagen", - "core.journal", - } - } - }, - ["core.keybinds"] = { - config = { - default_keybinds = false - } - }, - ["core.summary"] = {}, - -- ["core.latex.renderer"] = {}, - ["core.export"] = {}, - ["core.dirman"] = { - config = { - default_workspace = "documents", - workspaces = { - documents = "~/Documents/neorg", - physics = "~/Documents/neorg/uni/fisica", - asd = "~/Documents/neorg/uni/algoritmi-strutture-dati", - }, - index = "index.norg" - } - }, - ["core.completion"] = { - config = { - engine = "nvim-cmp" - } - }, - ["core.journal"] = { - config = { - journal_folder = "journal", - workspace = "documents" - } - }, - ["core.esupports.metagen"] = { - config = { - timezone = "implicit-local", - type = "auto" - } - }, - ["core.concealer"] = { - config = { - icons = { - heading = { - icons = { "", "", "", "", "", "" }, - }, - todo = { - cancelled = { icon = "" }, - pending = { icon = "" }, - uncertain = { icon = "" }, - urgent = { icon = "" }, - }, - code_block = { - conceal = true, - width = "content", - padding = { - right = 1, - } - } - } - } - } - } - }) + require("neorg").setup({ + load = { + ["core.defaults"] = { + config = { + disable = { + "core.esupports.metagen", + "core.journal", + } + } + }, + ["core.keybinds"] = { + config = { + default_keybinds = false + } + }, + ["core.summary"] = {}, + -- ["core.latex.renderer"] = {}, + ["core.export"] = {}, + ["core.dirman"] = { + config = { + default_workspace = "documents", + workspaces = { + documents = "~/Documents/neorg", + physics = "~/Documents/neorg/uni/fisica", + asd = "~/Documents/neorg/uni/algoritmi-strutture-dati", + }, + index = "index.norg" + } + }, + ["core.completion"] = { + config = { + engine = "nvim-cmp" + } + }, + ["core.journal"] = { + config = { + journal_folder = "journal", + workspace = "documents" + } + }, + ["core.esupports.metagen"] = { + config = { + timezone = "implicit-local", + type = "auto" + } + }, + ["core.concealer"] = { + config = { + folds = false, + icons = { + heading = { + icons = { "", "", "", "", "", "" }, + }, + todo = { + cancelled = { icon = "" }, + pending = { icon = "" }, + uncertain = { icon = "" }, + urgent = { icon = "" }, + }, + code_block = { + conceal = true, + } + } + } + } + } + }) end return { - "nvim-neorg/neorg", - lazy = true, - ft = "norg", - cmd = "Neorg", - version = "*", -- Pin Neorg to the latest stable release - config = config, - -- dependencies = { "3rd/image.nvim" } + "nvim-neorg/neorg", + lazy = true, + ft = "norg", + cmd = "Neorg", + version = "*", -- Pin Neorg to the latest stable release + config = config, + -- dependencies = { "3rd/image.nvim" } } diff --git a/nvim/lua/plugins/nvim-lspconfig.lua b/nvim/lua/plugins/nvim-lspconfig.lua index 45f77b7..e464144 100644 --- a/nvim/lua/plugins/nvim-lspconfig.lua +++ b/nvim/lua/plugins/nvim-lspconfig.lua @@ -123,5 +123,5 @@ return { "neovim/nvim-lspconfig", config = config, lazy = true, - event = { "BufReadPost", "BufWritePost", "BufNewFile" } + event = { "FileType" }, } diff --git a/nvim/lua/plugins/nvim-treesitter.lua b/nvim/lua/plugins/nvim-treesitter.lua index 103d5d9..c28386d 100644 --- a/nvim/lua/plugins/nvim-treesitter.lua +++ b/nvim/lua/plugins/nvim-treesitter.lua @@ -1,53 +1,63 @@ local config = function() - require("nvim-treesitter.configs").setup({ - ensure_installed = { - "c", - "lua", - "markdown", - "vim", - "vimdoc", - "query", + require("nvim-treesitter.configs").setup({ + ensure_installed = { + "c", + "lua", + "markdown", + "vim", + "vimdoc", + "query", - "regex", - "diff", - "cmake", - "meson", - "markdown_inline", - "bash", - "toml", - "latex", + "regex", + "diff", + "cmake", + "meson", + "markdown_inline", + "bash", + "toml", + "latex", - "cpp", - "rust", - "haskell", - "nix", - "javascript", - "norg", - "fish", - "kdl", - }, - auto_install = false, - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, - incremental_selection = { - enable = true - }, - indent = { - enable = true, - }, - autotag = { - enable = true, - }, - }) + "cpp", + "rust", + "haskell", + "nix", + "javascript", + "norg", + "fish", + "kdl", + "bend", + }, + auto_install = false, + sync_install = false, + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, + incremental_selection = { + enable = true + }, + indent = { + enable = true, + }, + autotag = { + enable = true, + }, + }) - vim.cmd(":TSUpdate") + vim.filetype.add({ + extension = { + bend = "bend", + }, + }) + + vim.treesitter.language.register("bend", { "bend" }) + + vim.cmd(":TSUpdate") end return { - "nvim-treesitter/nvim-treesitter", - lazy = true, - event = { "BufReadPost", "BufWritePost", "BufNewFile" }, - config = config, + "nvim-treesitter/nvim-treesitter", + lazy = true, + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + config = config, } diff --git a/nvim/lua/plugins/toggleterm.lua b/nvim/lua/plugins/toggleterm.lua index 0426436..902cf4b 100644 --- a/nvim/lua/plugins/toggleterm.lua +++ b/nvim/lua/plugins/toggleterm.lua @@ -1,64 +1,64 @@ local init = function() - local keymap = vim.keymap - keymap.set("n", "<C-t>", ":ToggleTerm<Enter>", - { noremap = true, silent = true, desc = "Terminal (ToggleTerm)" }) -- Terminal - keymap.set("t", "<C-t>", "<C-\\><C-n>:ToggleTerm<Enter>") - keymap.set("n", "<Space>g", ":ToggleLazyGit<Enter>", - { noremap = true, silent = true, desc = "LazyGit (ToggleTerm)" }) -- LazyGit + local keymap = vim.keymap + keymap.set("n", "<C-t>", ":ToggleTerm<Enter>", + { noremap = true, silent = true, desc = "Terminal (ToggleTerm)" }) -- Terminal + keymap.set("t", "<C-t>", "<C-\\><C-n>:ToggleTerm<Enter>") + keymap.set("n", "<Space>g", ":ToggleLazyGit<Enter>", + { noremap = true, silent = true, desc = "LazyGit (ToggleTerm)" }) -- LazyGit end local config = function() - require("toggleterm").setup { - autochdir = false, - direction = "float", - open_mapping = [[<c-t>]], - terminal_mappings = true, - start_in_insert = true, - float_opts = { - border = "curved", - }, - on_open = function(term) - local cwd = vim.fn.getcwd() - if term.dir ~= cwd then - term:send("cd " .. cwd .. " && clear") - term.dir = cwd - end - end, - } - local Terminal = require("toggleterm.terminal").Terminal - local opts = { - noremap = true, -- non-recursive - silent = true, -- do not show message - } + require("toggleterm").setup { + autochdir = false, + direction = "float", + open_mapping = [[<c-t>]], + terminal_mappings = true, + start_in_insert = true, + float_opts = { + border = "curved", + }, + on_open = function(term) + local cwd = vim.fn.getcwd() + if term.dir ~= cwd then + term:send("cd " .. cwd .. " && clear") + term.dir = cwd + end + end, + } + local Terminal = require("toggleterm.terminal").Terminal + local opts = { + noremap = true, -- non-recursive + silent = true, -- do not show message + } - -- LazyGit - local lazygit = Terminal:new({ - cmd = "lazygit", - dir = "git_dir", - direction = "float", - float_opts = { - border = "curved", - }, - -- function to run on opening the terminal - on_open = function(term) - vim.cmd("startinsert!") - vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", ":close<Enter>", opts) - end, - -- function to run on closing the terminal - on_close = function() - vim.cmd("startinsert!") - end, - }) - local function toggle_lazygit() - lazygit:toggle() - end - vim.api.nvim_create_user_command("ToggleLazyGit", toggle_lazygit, {}) + -- LazyGit + local lazygit = Terminal:new({ + cmd = "lazygit", + dir = "git_dir", + direction = "float", + float_opts = { + border = "curved", + }, + -- function to run on opening the terminal + on_open = function(term) + vim.cmd("startinsert!") + vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", ":close<Enter>", opts) + end, + -- function to run on closing the terminal + on_close = function() + vim.cmd("startinsert!") + end, + }) + local function toggle_lazygit() + lazygit:toggle() + end + vim.api.nvim_create_user_command("ToggleLazyGit", toggle_lazygit, {}) end return { - "akinsho/toggleterm.nvim", - lazy = true, - cmd = { "ToggleTerm", "ToggleLazyGit" }, - init = init, - config = config, + "akinsho/toggleterm.nvim", + lazy = true, + cmd = { "ToggleTerm", "ToggleLazyGit" }, + init = init, + config = config, } |
