mirror of
https://github.com/Ascyii/nvim.git
synced 2026-01-01 04:04:24 -05:00
Refactor all the custom modules into better structures. Clear separation of keybindings that belong to cusstom modules. Added custom snippets and vsc snippets.
This commit is contained in:
@@ -12,16 +12,53 @@ return {
|
||||
dir = get_custom_dir("todo"),
|
||||
name = "todo",
|
||||
dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim" },
|
||||
config = function()
|
||||
require("custom.todo").setup()
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>ta", function() require("custom.todo").mark_done() end, desc = "Watch Typst" },
|
||||
},
|
||||
|
||||
},
|
||||
{
|
||||
dir = get_custom_dir(),
|
||||
dir = get_custom_dir("typst"),
|
||||
name = "typst",
|
||||
dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim" },
|
||||
keys = {
|
||||
{ "<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("journal"),
|
||||
name = "journal",
|
||||
config = function ()
|
||||
local journal = require("custom.journal")
|
||||
vim.keymap.set("n", "<leader>joup", function()
|
||||
journal.open_today()
|
||||
end, { desc = "Open todays journal" })
|
||||
end
|
||||
},
|
||||
{
|
||||
dir = get_custom_dir("uni"),
|
||||
name = "uni",
|
||||
config = function ()
|
||||
local uni = require("custom.uni")
|
||||
vim.keymap.set("n", "<leader>nv", function()
|
||||
uni.select_course_directory()
|
||||
end, { desc = "Open UniCourse menu" })
|
||||
end
|
||||
|
||||
},
|
||||
{
|
||||
dir = get_custom_dir("linker"),
|
||||
name = "linker",
|
||||
config = function()
|
||||
local links = require("custom.linker")
|
||||
|
||||
vim.keymap.set("n", "<leader>fl", links.follow_link, { desc = "Try to follow current link" })
|
||||
|
||||
vim.keymap.set("n", "<leader>lf", links.insert_brainstore_link, { desc = "Link Brainstore file" })
|
||||
vim.keymap.set("n", "<leader>lm", links.insert_mail_link, { desc = "Link Mail" })
|
||||
vim.keymap.set("n", "<leader>lp", links.insert_project_link, { desc = "Link Project" })
|
||||
vim.keymap.set("n", "<leader>lc", links.insert_contact_link, { desc = "Link Contact" })
|
||||
vim.keymap.set("n", "<leader>ld", links.insert_date_link, { desc = "Link Contact" })
|
||||
end
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,28 +1,5 @@
|
||||
-- Prefilled with lsp that have no dependencies
|
||||
local servers = { "lua_ls", "rust_analyzer", "denols" }
|
||||
|
||||
local function populate_servers()
|
||||
if vim.fn.executable("go") == 1 then
|
||||
table.insert(servers, "gopls")
|
||||
else
|
||||
vim.notify("[mason] Skipping gopls (go not found)", vim.log.levels.WARN)
|
||||
end
|
||||
|
||||
if vim.fn.executable("npm") == 1 then
|
||||
table.insert(servers, "pyright")
|
||||
table.insert(servers, "clangd")
|
||||
table.insert(servers, "bashls")
|
||||
else
|
||||
vim.notify("[mason] Skipping install of some lsp (npm not found)", vim.log.levels.WARN)
|
||||
end
|
||||
|
||||
if vim.fn.executable("cargo") == 1 then
|
||||
table.insert(servers, "nil_ls")
|
||||
else
|
||||
vim.notify("[mason] Skipping nil (cargo not found)", vim.log.levels.WARN)
|
||||
end
|
||||
end
|
||||
populate_servers()
|
||||
-- Prefilled with servers that have no dependencies
|
||||
local servers = require("utils.functions").get_lsp_servers()
|
||||
|
||||
return {
|
||||
{
|
||||
@@ -77,7 +54,7 @@ return {
|
||||
dependencies = {
|
||||
"williamboman/mason-lspconfig.nvim"
|
||||
},
|
||||
priority = -10;
|
||||
priority = -10,
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
|
||||
@@ -185,7 +162,7 @@ return {
|
||||
|
||||
-- Add text in diagnostics
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
virtual_text = false,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
return {
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets"
|
||||
},
|
||||
version = "v2.*",
|
||||
build = "make install_jsregexp",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
local ls = require("luasnip")
|
||||
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
require("luasnip.loaders.from_lua").lazy_load({ paths = "~/.config/nvim/snippets" })
|
||||
|
||||
ls.config.setup({
|
||||
enable_autosnippets = true,
|
||||
store_selection_keys = '<Tab>',
|
||||
|
||||
@@ -7,7 +7,9 @@ return {
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
configs.setup({
|
||||
sync_install = true,
|
||||
ensure_installed = { "typst" },
|
||||
ensure_installed = { "typst", "go", "bash", "python", "nix" },
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user