Compare commits

20 Commits

Author SHA1 Message Date
d946ed85ba auto up 09:02:45 up 0:01, 2 users, load average: 3.05, 1.13, 0.42 2025-12-20 09:02:50 +01:00
c212fdff32 auto up 01:55:05 up 0:08, 2 users, load average: 0.34, 0.53, 0.32 2025-11-21 01:55:07 +01:00
06f9002028 auto up 11:49:23 up 0:19, 2 users, load average: 0.09, 0.27, 0.37 2025-11-20 11:49:25 +01:00
1d8aba920c auto up 15:54:41 up 1:28, 2 users, load average: 2.26, 2.48, 1.96 2025-11-18 15:54:43 +01:00
77dee32c29 auto up 09:41:45 up 1:27, 2 users, load average: 0.31, 0.36, 0.36 2025-11-18 09:41:47 +01:00
c4c8ef4893 auto up 11:24:53 up 0:07, 2 users, load average: 2.26, 1.72, 0.89 2025-11-17 11:24:55 +01:00
ea0b19b71a auto up 11:48:23 up 3:25, 2 users, load average: 0.17, 0.26, 0.17 2025-11-14 11:48:39 +01:00
b467a414c4 auto up 14:05:46 up 0:07, 2 users, load average: 0.42, 0.38, 0.20 2025-11-12 14:05:48 +01:00
067c267e26 auto up 17:06:41 up 0:01, 2 users, load average: 0.30, 0.13, 0.05 2025-11-07 17:06:43 +01:00
98bcb5f285 auto up 11:52:14 up 0:59, 2 users, load average: 0.27, 0.30, 0.33 2025-11-06 11:52:15 +01:00
67ee375ba7 auto up 23:53:40 up 0:02, 2 users, load average: 0.88, 0.49, 0.20
auto up  00:24:13  up   0:32,  2 users,  load average: 0.84, 0.77, 0.74

auto up  17:13:21  up   4:51,  2 users,  load average: 1.17, 1.00, 0.87

auto up  18:55:47  up   0:01,  2 users,  load average: 0.67, 0.36, 0.14

auto up  18:57:31  up   0:00,  2 users,  load average: 0.71, 0.18, 0.06

auto up  19:03:28  up   0:09,  2 users,  load average: 0.22, 0.38, 0.26

auto up  01:08:17  up   6:30,  2 users,  load average: 0.62, 0.57, 0.51

auto up  02:38:43  up   0:05,  3 users,  load average: 0.52, 0.53, 0.25

auto up  10:53:19  up   0:00,  2 users,  load average: 1.01, 0.25, 0.08
2025-11-06 10:54:06 +01:00
38f3acc17f Minros 2025-10-03 13:29:45 +02:00
b3cbf4d2c9 Update typstar 2025-09-24 18:56:40 +02:00
ba038af54f Update and fix lsp update deprecation 2025-09-24 18:31:47 +02:00
80bb4e207a Skip usage of windsuf 2025-09-23 16:31:22 +02:00
e4cb69ad82 Fix double lsp 2025-09-18 23:18:19 +02:00
e2a6c21f81 Update readme 2025-09-01 17:07:32 +02:00
c351f5edd4 More lsps 2025-09-01 01:31:42 +02:00
dc95d79a11 Played around with the signcolum 2025-09-01 00:04:10 +02:00
949eb06300 Custom borders for hovering and diagnostics 2025-08-31 16:42:42 +02:00
19 changed files with 444 additions and 249 deletions

View File

@@ -1,11 +1,11 @@
# Neovim configuration in pure lua # Neovim configuration in pure lua
You can configure the current semester that you are in for university integrations. Configure the environment in `conf.lua`.
There are certain things required like `make` and `npm` for various plugins. Most lsp require `npm` installed on the system.
## Dependencies ## Dependencies
To install proper snippets and get the basic lsp the following programs are needed in path. To install proper snippets and get lsp running install the following programs into your path
``` ```
make make
@@ -14,8 +14,3 @@ gcc
libc libc
bash bash
``` ```
## General
This configuration is based on the lazy plugin manager.

View File

@@ -1,32 +1,34 @@
{ {
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
"aerial.nvim": { "branch": "master", "commit": "c7cbbad40c2065fccfd1f1863bb2c08180c0533d" }, "aerial.nvim": { "branch": "master", "commit": "c7cbbad40c2065fccfd1f1863bb2c08180c0533d" },
"alpha-nvim": { "branch": "main", "commit": "2b3cbcdd980cae1e022409289245053f62fb50f6" },
"barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"fzf-lua": { "branch": "main", "commit": "bebc84e7ffc8fd86103f6ed6c590df72d524d342" }, "fzf-lua": { "branch": "main", "commit": "2388dcd61731ae158bf7dad2ae0419291837e557" },
"gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" }, "gitsigns.nvim": { "branch": "main", "commit": "f780609807eca1f783a36a8a31c30a48fbe150c5" },
"gruvbox.nvim": { "branch": "main", "commit": "12c2624287dc827edb5d72b2bc4c9619e692a554" }, "gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" },
"harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" }, "harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazygit.nvim": { "branch": "main", "commit": "3c524ebec6072568064235c407195e9f9fd0cb8a" }, "lazydev.nvim": { "branch": "main", "commit": "258d2a5ef4a3e3d6d9ba9da72c9725c53e9afcbd" },
"lazygit.nvim": { "branch": "main", "commit": "2305deed25bc61b866d5d39189e9105a45cf1cfb" },
"lspsaga.nvim": { "branch": "main", "commit": "8efe00d6aed9db6449969f889170f1a7e43101a1" }, "lspsaga.nvim": { "branch": "main", "commit": "8efe00d6aed9db6449969f889170f1a7e43101a1" },
"lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "5e085efe67fccb13372d54331d849219662a7e93" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "a1067cf84b4ff81b66d2bf4d01f4cbdb5de40bd0" },
"mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" }, "mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-lspconfig": { "branch": "master", "commit": "408cf07b97535825cca6f1afa908d98348712ba6" }, "nvim-lspconfig": { "branch": "master", "commit": "b3cce1419ca67871ae782b3e529652f8a016f0de" },
"nvim-tree.lua": { "branch": "master", "commit": "fefa335f1c8f690eb668a1efd18ee4fc6d64cd3e" }, "nvim-tree.lua": { "branch": "master", "commit": "e179ad2f83b5955ab0af653069a493a1828c2697" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-web-devicons": { "branch": "master", "commit": "f66cdfef5e84112045b9ebc3119fee9bddb3c687" }, "nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"telekasten.nvim": { "branch": "main", "commit": "b3ac2b07f2df504bb80112fec349714086a80037" }, "telekasten.nvim": { "branch": "main", "commit": "b3ac2b07f2df504bb80112fec349714086a80037" },
"telescope-undo.nvim": { "branch": "main", "commit": "928d0c2dc9606e01e2cc547196f48d2eaecf58e5" },
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
"toggleterm.nvim": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" }, "toggleterm.nvim": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" },
"typstar": { "branch": "main", "commit": "67a76bec16af7c726a77b9c3a15ef37b34967a9c" }, "typstar": { "branch": "main", "commit": "b0613321025cdbd89dbb9ccbc73e62a6b72a80fe" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" },
"which-key.nvim": { "branch": "main", "commit": "904308e6885bbb7b60714c80ab3daf0c071c1492" }
} }

View File

@@ -4,5 +4,6 @@ config.season = "S3" -- Current semester
config.projects = vim.fn.expand("~/projects") config.projects = vim.fn.expand("~/projects")
config.uni_dir = vim.fn.expand("~/projects/university/" .. config.season) config.uni_dir = vim.fn.expand("~/projects/university/" .. config.season)
config.user = vim.fn.system('whoami'):gsub('\n', '') config.user = vim.fn.system('whoami'):gsub('\n', '')
config.book_file = vim.fn.expand("~/projects/university/book.typ")
return config return config

View File

@@ -21,6 +21,15 @@ vim.api.nvim_create_autocmd("FileType", {
end, end,
}) })
vim.api.nvim_create_autocmd("FileType", {
pattern = "c",
callback = function()
vim.bo.tabstop = 2
vim.bo.shiftwidth = 2
vim.bo.expandtab = true
end,
})
vim.api.nvim_create_augroup("RememberFolds", { vim.api.nvim_create_augroup("RememberFolds", {
clear = true clear = true
}) })

View File

@@ -20,7 +20,7 @@ vim.keymap.set("n", "<leader>snf", "<cmd>set nonu<CR>")
vim.keymap.set("n", "n", "nzz", { silent = true }) vim.keymap.set("n", "n", "nzz", { silent = true })
vim.keymap.set("n", "N", "Nzz", { silent = true }) vim.keymap.set("n", "N", "Nzz", { silent = true })
vim.keymap.set("n", "<C-o>", "<C-o>zz", { silent = true }) vim.keymap.set("n", "<C-o>", "<C-o>zz", { silent = true })
vim.keymap.set("n", "<C-i>", "<C-i>zz", { silent = true }) vim.keymap.set("n", "<`C-i>", "<C-i>zz", { silent = true })
vim.keymap.set("n", "<C-u>", "<C-u>zz", { silent = true }) vim.keymap.set("n", "<C-u>", "<C-u>zz", { silent = true })
vim.keymap.set("n", "<C-d>", "<C-d>zz", { silent = true }) vim.keymap.set("n", "<C-d>", "<C-d>zz", { silent = true })
vim.keymap.set('n', '<leader>a', 'm9ggVG"+y`9') vim.keymap.set('n', '<leader>a', 'm9ggVG"+y`9')
@@ -28,10 +28,10 @@ vim.keymap.set('n', '<leader>va', 'ggVG')
vim.keymap.set('n', '<leader>tr', ':tabnew<CR>:term<CR>i') vim.keymap.set('n', '<leader>tr', ':tabnew<CR>:term<CR>i')
-- Indent all will be replaced by the formatting of lsp where the lsp is installed -- Indent all will be replaced by the formatting of lsp where the lsp is installed
vim.keymap.set('n', '<leader>ia', 'gg=G<C-o>zz') vim.keymap.set('n', '<leader>ia', 'gg=G<C-o>zz') -- This can break
vim.keymap.set('n', '<leader>ya', 'ggVG"+y<C-o>') vim.keymap.set('n', '<leader>ya', 'ggVG"+y<C-o>')
vim.keymap.set('n', '<leader>ss', ':wa<CR>') vim.keymap.set('n', '<leader>ss', ':wa<CR>')
vim.keymap.set("n", "<leader>nn", ":e ~/synced/brainstore/zettelkasten/quick<CR>", { silent = true }) vim.keymap.set("n", "<leader>nn", ":e ~/Nextcloud/Notes/quick.txt<CR>", { silent = true })
-- Folding -- Folding
local opts = { noremap = true, silent = true } local opts = { noremap = true, silent = true }
@@ -51,6 +51,7 @@ vim.keymap.set("n", "<leader>fs", toggle_fold, opts) -- close all folds
vim.keymap.set('n', '<leader>occ', ':e ~/.config/nvim/init.lua<CR>`.zz') vim.keymap.set('n', '<leader>occ', ':e ~/.config/nvim/init.lua<CR>`.zz')
vim.keymap.set('n', '<leader>oct', ':e ~/synced/vault/contacts/contacts.txt<CR>`.zz') vim.keymap.set('n', '<leader>oct', ':e ~/synced/vault/contacts/contacts.txt<CR>`.zz')
vim.keymap.set('n', '<leader>ock', ':e ~/.config/nvim/lua/config/keymaps.lua<CR>`.zz') vim.keymap.set('n', '<leader>ock', ':e ~/.config/nvim/lua/config/keymaps.lua<CR>`.zz')
vim.keymap.set('n', '<leader>ocd', ':e ~/.config/nvim/lua/config/autocmds.lua<CR>`.zz') vim.keymap.set('n', '<leader>ocd', ':e ~/.config/nvim/lua/config/autocmds.lua<CR>`.zz')
vim.keymap.set('n', '<leader>oco', ':e ~/.config/nvim/lua/config/options.lua<CR>`.zz') vim.keymap.set('n', '<leader>oco', ':e ~/.config/nvim/lua/config/options.lua<CR>`.zz')
vim.keymap.set('n', '<leader>ocl', ':e ~/.config/nvim/lua/config/lazy.lua<CR>`.zz') vim.keymap.set('n', '<leader>ocl', ':e ~/.config/nvim/lua/config/lazy.lua<CR>`.zz')
@@ -62,6 +63,7 @@ vim.keymap.set('n', '<leader>oq', ':e ~/synced/brainstore/input.txt<CR>`.zz')
vim.keymap.set('n', '<leader>ot', ':e ~/synced/brainstore/todos/todo.txt<CR>`.zz') vim.keymap.set('n', '<leader>ot', ':e ~/synced/brainstore/todos/todo.txt<CR>`.zz')
vim.keymap.set('n', '<leader>od', ':e ~/synced/brainstore/todos/done.txt<CR>`.zz') vim.keymap.set('n', '<leader>od', ':e ~/synced/brainstore/todos/done.txt<CR>`.zz')
vim.keymap.set('n', '<leader>ou', ':e ~/projects/university/' .. conf.season .. '/input.txt<CR>`.zz') vim.keymap.set('n', '<leader>ou', ':e ~/projects/university/' .. conf.season .. '/input.txt<CR>`.zz')
vim.keymap.set('n', '<leader>fd', ':e ~/projects/university/' .. conf.season .. '/input.txt<CR>`.zz')
vim.keymap.set('n', '<leader>oz', ':e ~/.zshrc<CR>`.zz') vim.keymap.set('n', '<leader>oz', ':e ~/.zshrc<CR>`.zz')
vim.keymap.set('n', '<leader>oaa', ':e ~/.common_shell<CR>`.zz') vim.keymap.set('n', '<leader>oaa', ':e ~/.common_shell<CR>`.zz')
vim.keymap.set('n', '<leader>ow', ':e ~/synced/brainstore/waste.txt<CR>') vim.keymap.set('n', '<leader>ow', ':e ~/synced/brainstore/waste.txt<CR>')
@@ -70,6 +72,8 @@ vim.keymap.set('n', '<leader>ohh', ':e ~/nixos/user/home.nix<CR>`.zz')
vim.keymap.set('n', '<leader>op', ':e ~/nixos/user/packages.nix<CR>`.zz') vim.keymap.set('n', '<leader>op', ':e ~/nixos/user/packages.nix<CR>`.zz')
vim.keymap.set('n', '<leader>on', ':e ~/nixos/configuration.nix<CR>`.zz') vim.keymap.set('n', '<leader>on', ':e ~/nixos/configuration.nix<CR>`.zz')
vim.keymap.set('n', '<leader>om', ':e ~/nixos/modules/<CR>') vim.keymap.set('n', '<leader>om', ':e ~/nixos/modules/<CR>')
vim.keymap.set('n', '<leader>oomt', ":e ~/dotfiles/home/dot-kmonad/thinkpad.kbd<CR>")
vim.keymap.set('n', '<leader>oomh', ":e ~/dotfiles/home/dot-kmonad/hyper.kbd<CR>")
vim.keymap.set('n', '<leader>oho', ':e ~/nixos/hosts<CR>') vim.keymap.set('n', '<leader>oho', ':e ~/nixos/hosts<CR>')
vim.keymap.set('n', '<leader>ll', ':Lazy<CR>') vim.keymap.set('n', '<leader>ll', ':Lazy<CR>')
@@ -112,11 +116,8 @@ vim.keymap.set('v', '<leader>p', function()
vim.cmd('normal! "+p') vim.cmd('normal! "+p')
end, { desc = 'Yank to clipboard and keep the selection' }) end, { desc = 'Yank to clipboard and keep the selection' })
vim.keymap.set('v', 'p', function() vim.keymap.set('n', '<leader>nh', ":noh<CR>")
local unnamed_content = vim.fn.getreg('""')
vim.api.nvim_command('normal! p')
vim.fn.setreg('""', unnamed_content)
end, { desc = 'Paste from unnamed register (don\'t overwrite it) in visual mode' })
vim.keymap.set('v', '<leader>y', function() vim.keymap.set('v', '<leader>y', function()
vim.cmd('normal! "+y') vim.cmd('normal! "+y')

View File

@@ -34,3 +34,5 @@ require("lazy").setup({
enabled = false, enabled = false,
}, },
}) })
require("utils.after")

View File

@@ -1,7 +1,14 @@
vim.o.shiftwidth = 4; vim.o.shiftwidth = 4;
vim.o.tabstop = 4; vim.o.tabstop = 4;
vim.o.number = true; vim.o.number = true;
vim.opt.relativenumber = true
vim.o.ignorecase = true; vim.o.ignorecase = true;
--vim.o.guicursor = "n-v-c-sm-i-ci-ve:block";
vim.o.cursorline = true
vim.cmd([[
highlight CursorLine cterm=NONE guibg=#4c3c3c
]])
-- Disable mouse completly -- Disable mouse completly
vim.o.mouse = ""; vim.o.mouse = "";
@@ -17,10 +24,16 @@ vim.opt.termguicolors = true
--vim.g.loaded_netrw = 1 --vim.g.loaded_netrw = 1
--vim.g.loaded_netrwPlugin = 1 --vim.g.loaded_netrwPlugin = 1
vim.opt.signcolumn = "yes" --vim.opt.signcolumn = "number"
vim.opt.signcolumn = "yes:1"
-- Enable Treesitter-based folding -- Enable Treesitter-based folding
vim.opt.foldmethod = "expr" vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()" vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
vim.opt.foldlevelstart = 99 -- open all folds by default vim.opt.foldlevelstart = 99 -- open all folds by default
vim.opt.fillchars = "fold:╌" vim.opt.fillchars = "fold:╌"
vim.g.GPGDefaultRecipients = {"C6772451703DE183A4983CBA063DC054484835A6"}
vim.o.expandtab = true -- Use spaces instead of tabs
vim.o.smarttab = true -- Insert 'shiftwidth' spaces when pressing Tab

View File

@@ -77,4 +77,26 @@ function M.watch_and_open()
}) })
end end
function M.just_open()
-- Parse the current file and check for typst
local input = vim.fn.expand("%:p")
if not input:match("%.typ$") then
vim.notify("Not a Typst file", vim.log.levels.WARN)
return
end
local dir = vim.fn.fnamemodify(input, ":h") -- directory of the Typst file
local filename = vim.fn.expand("%:t:r") .. ".pdf" -- filename without extension + .pdf
local output = dir .. "/" .. filename
-- Start typst watch
local cwd = vim.fn.getcwd() -- set the starting directory
-- TODO: root setting does not work
local watch_cmd = { "typst", "compile", "--root", cwd, input, output }
vim.fn.jobstart(watch_cmd)
functions.sleep(0.5)
vim.fn.jobstart({ "sioyek", output })
end
return M return M

View File

@@ -116,6 +116,36 @@ function M.get_newest_vl_file(files)
return newest_file return newest_file
end end
-- Function to insert chapter reference at top summary section
local function add_chapter_to_summary(course, new_vl_name)
local book_file = vim.fn.expand(conf.book_file)
local rel_path = string.format("%s/VL/%s", course.path:match("university/(.+)$"), new_vl_name)
local default_title = new_vl_name
local chapter_line = string.format(' - #chapter("%s")[%s]\n', rel_path, default_title:match("^(.-)%."))
local lines = {}
for l in io.lines(book_file) do
table.insert(lines, l)
end
local out = io.open(book_file, "w")
local inserted = false
local right_block = false
for _, l in ipairs(lines) do
-- insert after the course's existing index line
if not inserted and l:match('"' .. course.path:match("university/(.+)$") .. '/index.typ"') then
right_block = true
end
if not inserted and right_block and l:match("^%s*$") then
out:write(chapter_line .. "\n" .. l)
inserted = true
else
out:write(l .. "\n")
end
end
out:close()
end
-- Function to create a new VL file based on the template and incrementing the number -- Function to create a new VL file based on the template and incrementing the number
function M.create_new_vl(course) function M.create_new_vl(course)
local vl_dir = course.path .. "/VL" local vl_dir = course.path .. "/VL"
@@ -145,6 +175,8 @@ function M.create_new_vl(course)
-- Copy the template if it exists -- Copy the template if it exists
vim.fn.system({ "cp", template_path, new_vl_path }) vim.fn.system({ "cp", template_path, new_vl_path })
add_chapter_to_summary(course, new_vl_name)
-- Open the new VL file -- Open the new VL file
vim.cmd("edit " .. new_vl_path) vim.cmd("edit " .. new_vl_path)
else else

View File

@@ -8,6 +8,12 @@ return {
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
end end
require("gruvbox").setup({
palette_overrides = {
bright_yellow = "#AD5944"; -- workaround
}
})
vim.cmd.colorscheme("gruvbox") vim.cmd.colorscheme("gruvbox")
transparentBackground() transparentBackground()

View File

@@ -25,6 +25,14 @@ return {
{ "<leader>tw", function() require("custom.typst").watch_and_open() end, desc = "Watch Typst" }, { "<leader>tw", function() require("custom.typst").watch_and_open() end, desc = "Watch Typst" },
}, },
}, },
{
dir = get_custom_dir("typst"),
name = "typst",
dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim" },
keys = {
{ "<leader>tu", function() require("custom.typst").just_open() end, desc = "Open Typst" },
},
},
{ {
dir = get_custom_dir("journal"), dir = get_custom_dir("journal"),
name = "journal", name = "journal",

View File

@@ -58,22 +58,44 @@ return {
config = function() config = function()
require("mason").setup() require("mason").setup()
-- Workaround for local zls -- Workaround for local lsp only
-- does not work so nice on non nixos systems
local servers_modified = servers local servers_modified = servers
for i, v in ipairs(servers_modified) do for i, v in ipairs(servers_modified) do
if v == "zls" then if v == "zls" then
table.remove(servers_modified, i) table.remove(servers_modified, i)
break break
end end
if v == "clangd" then
table.remove(servers_modified, i)
break
end
if v == "hls" then
table.remove(servers_modified, i)
break
end
end end
require("mason-lspconfig").setup({ require("mason-lspconfig").setup({
ensure_installed = servers_modified, ensure_installed = servers_modified,
automatic_installation = true, automatic_enable = false,
}) })
end, end,
}, },
{
"folke/lazydev.nvim",
ft = "lua", -- only load on lua files
opts = {
library = {
-- See the configuration section for more details
-- Load luvit types when the `vim.uv` word is found
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
{
path = "${3rd}/love2d/library", },
},
},
},
{ {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
dependencies = { dependencies = {
@@ -84,15 +106,17 @@ return {
}, },
config = function() config = function()
local cmp = require("cmp") local cmp = require("cmp")
local border = "single"
local max_entries = 7
cmp.setup({ cmp.setup({
window = { window = {
completion = cmp.config.window.bordered({ completion = cmp.config.window.bordered({
border = "rounded", border = border,
scrollbar = false, scrollbar = false,
}), }),
documentation = cmp.config.window.bordered({ documentation = cmp.config.window.bordered({
border = "rounded", border = border,
scrollbar = false, scrollbar = false,
}), }),
}, },
@@ -112,8 +136,15 @@ return {
{ name = "buffer" }, { name = "buffer" },
{ name = "path" }, { name = "path" },
}), }),
performance = { max_view_entries = 25 }, performance = {
debounce = 60,
throttle = 30,
fetching_timeout = 500,
filtering_context_budget = 3,
confirm_resolve_timeout = 80,
async_budget = 1,
max_view_entries = max_entries,
}
}) })
end end
}, },
@@ -124,22 +155,10 @@ return {
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",
}, },
config = function() config = function()
local lspconfig = require("lspconfig")
-- Custom overwrites for servers -- Custom overwrites for servers
local server_settings = { local server_settings = {}
lua_ls = {
settings = {
Lua = {
diagnostics = { globals = { "vim" } },
},
},
},
}
local capabilities = require("cmp_nvim_lsp").default_capabilities() local capabilities = require("cmp_nvim_lsp").default_capabilities()
local on_attach = function(_, bufnr) local on_attach = function(_, bufnr)
local opts = { buffer = bufnr, noremap = true, silent = true } local opts = { buffer = bufnr, noremap = true, silent = true }
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
@@ -153,10 +172,12 @@ return {
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts) vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts) vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) vim.keymap.set("n", "]d", function()
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts) vim.diagnostic.jump({ count = 1, float = true })
--vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, opts) end, opts)
-- vim.keymap.set("n", "<leader>lq", vim.diagnostic.setloclist, opts) vim.keymap.set("n", "[d", function()
vim.diagnostic.jump({ count = -1, float = true })
end, opts)
vim.keymap.set("n", "<leader>lwa", vim.lsp.buf.add_workspace_folder, opts) vim.keymap.set("n", "<leader>lwa", vim.lsp.buf.add_workspace_folder, opts)
vim.keymap.set("n", "<leader>lwr", vim.lsp.buf.remove_workspace_folder, opts) vim.keymap.set("n", "<leader>lwr", vim.lsp.buf.remove_workspace_folder, opts)
@@ -169,7 +190,7 @@ return {
end, opts) end, opts)
end end
-- Setup servers manually -- Setup and enable servers manually
for _, server in ipairs(servers) do for _, server in ipairs(servers) do
local config = { local config = {
capabilities = capabilities, capabilities = capabilities,
@@ -178,7 +199,8 @@ return {
if server_settings[server] then if server_settings[server] then
config = vim.tbl_deep_extend("force", config, server_settings[server]) config = vim.tbl_deep_extend("force", config, server_settings[server])
end end
lspconfig[server].setup(config) vim.lsp.config(server, config)
vim.lsp.enable(server)
end end
-- Add text in diagnostics -- Add text in diagnostics

View File

@@ -16,6 +16,14 @@ return {
end) end)
end end
}, },
--{
-- 'Exafunction/windsurf.vim',
-- event = 'BufEnter'
--},
{
"Ascyii/vim-gnupg",
dev = true
},
{ {
"akinsho/toggleterm.nvim", "akinsho/toggleterm.nvim",
config = function() config = function()
@@ -41,7 +49,7 @@ return {
'Ascyii/telekasten.nvim', 'Ascyii/telekasten.nvim',
dev = true, dev = true,
config = function() config = function()
local base_zet = "~/synced/brainstore/zettelkasten" local base_zet = "~/Nextcloud/Notes"
-- Again can only use opts when not using config -- Again can only use opts when not using config
require("telekasten").setup({ require("telekasten").setup({

View File

@@ -25,7 +25,7 @@ return {
"<leader>fr", "<leader>fr",
function() function()
require('telescope.builtin').oldfiles({ require('telescope.builtin').oldfiles({
disable_devicons = true, disable_devicons = false,
}) })
end, end,
desc = "Open last files" desc = "Open last files"
@@ -34,13 +34,7 @@ return {
{ {
"<leader>g", "<leader>g",
function() function()
require('telescope.builtin').live_grep({ require('utils.functions').fzf_wrapped("grep")
disable_devicons = true,
cwd = vim.fn.getcwd(),
additional_args = function()
return { '--hidden', '--glob', '!.git/*' }
end,
})
end end
}, },
{ {
@@ -52,22 +46,41 @@ return {
{ {
"<leader><leader>", "<leader><leader>",
function() function()
require('telescope.builtin').find_files({ require('utils.functions').fzf_wrapped("find")
hidden = true,
no_ignore = true,
follow = true,
disable_devicons = false,
prompt_title = "Find Files",
find_command = {
"rg", "--files",
"--glob", "!**/.git/*",
"--glob", "!**/build/*",
"--glob", "!**/*.{jpg,png,gif,mp4,mkv,tar,zip,iso}"
}
})
end end
} }
}, },
config = true, config = true,
}, },
{
"debugloop/telescope-undo.nvim",
dependencies = {
{
"nvim-telescope/telescope.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
},
},
keys = {
{
"<leader>u",
"<cmd>Telescope undo<cr>",
desc = "undo history",
},
},
opts = {
extensions = {
undo = {
side_by_side = true,
layout_strategy = "vertical",
layout_config = {
preview_height = 0.7,
},
},
},
},
config = function(_, opts)
require("telescope").setup(opts)
require("telescope").load_extension("undo")
end,
}
} }

View File

@@ -7,10 +7,14 @@ return {
local configs = require("nvim-treesitter.configs") local configs = require("nvim-treesitter.configs")
configs.setup({ configs.setup({
sync_install = true, sync_install = true,
ensure_installed = { "typst", "go", "bash", "python", "nix", "lua" }, ensure_installed = { "css", "html", "rust", "php", "typst", "go", "bash", "python", "nix", "lua", "cpp", "c", "java" },
auto_install = true,
highlight = { enable = true }, highlight = { enable = true },
indent = { enable = true }, indent = { enable = true },
fold = { enable = true }, fold = { enable = true },
ignore_install = {},
modules = {},
}) })
end end
}, },

View File

@@ -27,6 +27,10 @@ return {
"<leader>ti", "<leader>ti",
":TypstarInsertRnote<CR>", ":TypstarInsertRnote<CR>",
}, },
{
"<leader>td",
":TypstarDeleteRnote<CR>",
},
{ {
"<leader>to", "<leader>to",
":TypstarOpenDrawing<CR>", ":TypstarOpenDrawing<CR>",

21
lua/utils/after.lua Normal file
View File

@@ -0,0 +1,21 @@
local function rounded_border()
return { '', '', '', '', '', '', '', '' }
end
-- Buffer the original fuction
local nvim_open_win = vim.api.nvim_open_win
-- Set color to a slight gray
vim.api.nvim_set_hl(0, 'FloatBorder', { bg = 'None', fg = '#a0a0a0' })
vim.api.nvim_set_hl(0, 'NormalFloat', { bg = 'None' })
-- Border overwrite
vim.api.nvim_open_win = function(buf, enter, opts)
opts = opts or {}
if opts.border == nil then
opts.border = rounded_border()
end
return nvim_open_win(buf, enter, opts)
end

View File

@@ -17,6 +17,35 @@ function M.get_cwd()
end end
end end
function M.fzf_wrapped(type)
local t = require("telescope.builtin")
if type == "grep" then
t.live_grep({
disable_devicons = true,
cwd = vim.fn.getcwd(),
additional_args = function()
return { '--hidden', '--glob', '!.git/*' }
end,
})
end
if type == "find" then
t.find_files({
hidden = true,
no_ignore = true,
follow = true,
disable_devicons = false,
prompt_title = "Find Files",
find_command = {
"rg", "--files",
"--glob", "!**/.git/*",
"--glob", "!**/build/*",
"--glob", "!**/*.{jpg,png,gif,mp4,mkv,tar,zip,iso}"
}
})
end
end
--- @return {} --- @return {}
function M.get_lsp_servers() function M.get_lsp_servers()
local servers = { "lua_ls" } local servers = { "lua_ls" }
@@ -51,12 +80,33 @@ function M.get_lsp_servers()
warn_once("gopls", "[mason] Skipping gopls (go not found)") warn_once("gopls", "[mason] Skipping gopls (go not found)")
end end
if vim.fn.executable("npm") == 1 then if vim.fn.executable("php") == 1 then
table.insert(servers, "pyright") table.insert(servers, "intelephense")
table.insert(servers, "clangd")
table.insert(servers, "bashls")
else else
warn_once("npm", "[mason] Skipping pyright/clangd/bashls (npm not found)") warn_once("php", "[mason] Skipping intelephense (php not found)")
end
if vim.fn.executable("hls") == 1 then
table.insert(servers, "hls")
else
warn_once("haskell", "[mason] Skipping hls (hls not found)")
end
if vim.fn.executable("npm") == 1 then
if vim.fn.executable("clangd") == 1 then
table.insert(servers, "clangd")
end
if vim.fn.executable("java") == 1 then
table.insert(servers, "jdtls")
end
table.insert(servers, "pyright")
table.insert(servers, "bashls")
table.insert(servers, "cssls")
table.insert(servers, "html")
table.insert(servers, "jsonls")
else
warn_once("npm", "[mason] Skipping npm related (npm not found)")
end end
if vim.fn.executable("cargo") == 1 then if vim.fn.executable("cargo") == 1 then
@@ -71,12 +121,11 @@ function M.get_lsp_servers()
end end
if vim.fn.executable("deno") == 1 then if vim.fn.executable("deno") == 1 then
table.insert(servers, "denols") table.insert(servers, "ts_ls")
else else
warn_once("deno", "[mason] Skipping denols (deno not found)") warn_once("deno", "[mason] Skipping denols and tsserver (deno not found)")
end end
-- Only configure zig when in local environment
if vim.fn.executable("zls") == 1 then if vim.fn.executable("zls") == 1 then
table.insert(servers, "zls") table.insert(servers, "zls")
end end

View File

@@ -1,17 +0,0 @@
local ls = require("luasnip")
local s = ls.snippet
local t = ls.text_node
local i = ls.insert_node
return {
s("cfo", { -- check for error
t("if err != nil {"), t({ "", "\t" }),
i(1, "return err"),
t({ "", "}" })
}),
s("struct", {
t("type "), i(1, "MyStruct"), t(" struct {"),
t({ "", "\t" }), i(2, "Field type"),
t({ "", "}" })
}),
}