feat!: replace packer with lazy

main
Ian Mancini 1 year ago
parent 4053f19333
commit 9b7d9a60a3

1
.gitignore vendored

@ -1 +1,2 @@
plugin/
.DS_Store

@ -1,17 +1,20 @@
vim.g.python3_host_prog = '/usr/bin/python'
vim.g.mapleader = ' '
vim.g.python3_host_prog = "/usr/bin/python"
vim.g.mapleader = " "
-- Setup packer
local fn = vim.fn
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({
'git', 'clone', '--depth', '1',
'https://github.com/wbthomason/packer.nvim', install_path
})
vim.cmd 'packadd packer.nvim'
-- Setup lazy.nvim
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)
-- Source settings
require('plugins')
require('settings')
require("settings")
require("lazy").setup("plugins")

@ -0,0 +1,88 @@
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"LuaSnip": { "branch": "master", "commit": "0b4950a237ce441a6a3a947d501622453f6860ea" },
"aerial.nvim": { "branch": "master", "commit": "fc04a097d0b0e828dfd508f9b079774bd072431e" },
"clipboard-image.nvim": { "branch": "main", "commit": "d1550dc26729b7954f95269952e90471b838fa25" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
"cmp-git": { "branch": "main", "commit": "f900a4cf117300fdc3ba31d26f8b6223ccd9c574" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
"cmp-omni": { "branch": "main", "commit": "9436e6cdd7c5dfa24a99a60d9280b24dbdea3649" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"colorbuddy.vim": { "branch": "master", "commit": "cdb5b0654d3cafe61d2a845e15b2b4b0e78e752a" },
"copilot-cmp": { "branch": "master", "commit": "11eb015fbf9f07ad1c72dbdc9d830ebac610b5cd" },
"copilot.lua": { "branch": "master", "commit": "2c942f33ba5c621c906e625e00a1bb504b65e2f0" },
"diffview.nvim": { "branch": "main", "commit": "7e5a85c186027cab1e825d018f07c350177077fc" },
"doom-one.nvim": { "branch": "main", "commit": "a43528cbd7908ccec7af4587ec8e18be149095bd" },
"dressing.nvim": { "branch": "master", "commit": "c1e1d5fa44fe08811b6ef4aadac2b50e602f9504" },
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
"friendly-snippets": { "branch": "main", "commit": "ebf6d6e83494cdd88a54a429340256f4dbb6a052" },
"git-blame.nvim": { "branch": "master", "commit": "41e22dc843c6821a410db57be0b7025154f9d8ec" },
"gitsigns.nvim": { "branch": "main", "commit": "d927caa075df63bf301d92f874efb72fd22fd3b4" },
"hex.nvim": { "branch": "master", "commit": "63411ffe59fb8ecc3611367731cf13effc4d706f" },
"incline.nvim": { "branch": "main", "commit": "fdd7e08a6e3d0dd8d9aa02428861fa30c37ba306" },
"indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" },
"lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" },
"leap.nvim": { "branch": "main", "commit": "5efe985cf68fac3b6a6dfe7a75fbfaca8db2af9c" },
"lspkind-nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "dfdd771b792fbb4bad8e057d72558255695aa1a7" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "031903fefbf59371502092ef9e22cab9161d90ba" },
"mason.nvim": { "branch": "main", "commit": "ee6a7f179ebf8aa9da9d53b1cf1b57d292ea0182" },
"material.nvim": { "branch": "main", "commit": "1ecaa2d065a1ea308bd7702a77c2bf35ede8f536" },
"mini.nvim": { "branch": "stable", "commit": "707dca4f4152c2d9c9b4c5e02635f78dfd33db50" },
"mkdnflow.nvim": { "branch": "main", "commit": "a728a3533bb57502fdfd6fdb4e5839fc87430edc" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "9b5b4c874b13e372500f07c37187ba06c0c1ac0a" },
"neoconf.nvim": { "branch": "main", "commit": "9873bc90d7e6bee70ec8f552b4663c3ff51ec7f6" },
"neodev.nvim": { "branch": "main", "commit": "dcd34653b0f1d3e7ea9aeb3e37dc7c8da445c4fe" },
"neogit": { "branch": "master", "commit": "69482aa8404bf8b4775110393c8248e784fccbf1" },
"neotest": { "branch": "master", "commit": "bec7be0f13ee19c85561943fc5f7b8daa4f4d465" },
"neotest-go": { "branch": "main", "commit": "f2580cad67ef0181403cf65858ab638ffd3ede9f" },
"neotest-jest": { "branch": "main", "commit": "ae559fbd405084ee38dd711eede6d74f3dc1d463" },
"neotest-python": { "branch": "master", "commit": "81d2265efac717bb567bc15cc652ae10801286b3" },
"nui.nvim": { "branch": "main", "commit": "aa1b4c1e05983ff7debd2b4b2788651db099de2f" },
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
"nvim-autopairs": { "branch": "master", "commit": "35493556b895f54c129918aca43ae9a63af42a1f" },
"nvim-base16": { "branch": "master", "commit": "6247ca9aa9f34644dfa290a6df3f6feefb73eb97" },
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
"nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" },
"nvim-dap": { "branch": "master", "commit": "31e1ece773e10448dcb616d5144290946a6264b7" },
"nvim-dap-ui": { "branch": "master", "commit": "85b16ac2309d85c88577cd8ee1733ce52be8227e" },
"nvim-lightbulb": { "branch": "master", "commit": "8f00b89dd1b1dbde16872bee5fbcee2e58c9b8e9" },
"nvim-lspconfig": { "branch": "master", "commit": "499314f76fa6e8f82f7cfd116578906d61ba2560" },
"nvim-treesitter": { "branch": "master", "commit": "95d02cdafe704fa5b86eac81f2eb1de3d8f52330" },
"nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "9bff161dfece6ecf3459e6e46ca42e49f9ed939f" },
"nvim-ufo": { "branch": "main", "commit": "890b94870f052773d77175d07a51f2e083210632" },
"nvim-web-devicons": { "branch": "master", "commit": "bc11ee2498de2310de5776477dd9dce65d03b464" },
"octo.nvim": { "branch": "master", "commit": "d1e52f9b3c755fcebb93d635821663a2c0f53281" },
"onebuddy": { "branch": "main", "commit": "7e16006e7dde15e3cb72889f736c49409db6ff42" },
"orgmode": { "branch": "master", "commit": "6cbebbdeb4e6e2b76c6dff338c294eb1fc037427" },
"package-info.nvim": { "branch": "master", "commit": "4d98c8cc90d970d87c472c04bf7ca712336cc753" },
"plenary.nvim": { "branch": "master", "commit": "0dbe561ae023f02c2fb772b879e905055b939ce3" },
"project.nvim": { "branch": "main", "commit": "ceb3fc7606c5599b70a21f9bf79b860ef61d1790" },
"promise-async": { "branch": "main", "commit": "e94f35161b8c5d4a4ca3b6ff93dd073eb9214c0e" },
"refactoring.nvim": { "branch": "master", "commit": "2ec9bc0fb5f3c8c6a0f776f0159dd2a3b1663554" },
"rest.nvim": { "branch": "main", "commit": "22673c848768ff25517154a5aebfebc0c77d0b4f" },
"rnvimr": { "branch": "main", "commit": "5f0483d1c107ab1fe7e0af08cdf7900aa0dcb40e" },
"schemastore.nvim": { "branch": "main", "commit": "9d7b4c8d1c2ad029234d531871a55c075a116b7d" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "ad7b637c72549713b9aaed7c4f9c79c62bcbdff0" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "62ea5e58c7bbe191297b983a9e7e89420f581369" },
"telescope.nvim": { "branch": "master", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" },
"todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" },
"toggleterm.nvim": { "branch": "main", "commit": "b90a1381e9b5b8596f49070ee86c71db267ac868" },
"tokyonight.nvim": { "branch": "main", "commit": "9a01eada39558dc3243278e6805d90e8dff45dc0" },
"trouble.nvim": { "branch": "main", "commit": "3f85d8ed30e97ceeddbbcf80224245d347053711" },
"twilight.nvim": { "branch": "main", "commit": "a4843e6e67092a1e6fa9666f02bf0ab59174c1df" },
"typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" },
"vim-blade": { "branch": "master", "commit": "5d729f9be29cdf2ceb3b541e605fa5ef57321daf" },
"vim-eunuch": { "branch": "master", "commit": "67f3dd32b4dcd1c427085f42ff5f29c7adc645c6" },
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
"vim-table-mode": { "branch": "master", "commit": "9555a3e6e5bcf285ec181b7fc983eea90500feb4" },
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" },
"zen-mode.nvim": { "branch": "main", "commit": "68f554702de63f4b7b6b6d4bcb10178f41a0acc7" },
"zk-nvim": { "branch": "main", "commit": "797618aa07f58ceba6f79fb6e777e8e45c51e1ce" }
}

@ -1,5 +0,0 @@
local utils = require('utils')
utils.opt('o', 'termguicolors', true)
vim.g.tokyonight_style = 'night'
vim.cmd('colorscheme tokyonight')

@ -1,4 +0,0 @@
local utils = require("utils")
utils.map("n", "<C-l>", "<cmd>noh<CR>") -- Clear highlights
utils.map("n", "]q", "<cmd>cn<CR>")
utils.map("n", "[q", "<cmd>cp<CR>")

@ -0,0 +1,159 @@
local setup_cmp = function()
local lspkind = require("lspkind")
local luasnip = require("luasnip")
local cmp = require("cmp")
local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
cmp.setup({
confirm_opts = {
behavior = cmp.ConfirmBehavior.Replace,
select = false,
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
formatting = {
format = lspkind.cmp_format({
mode = "symbol_text",
maxwidth = 50,
before = function(_, vim_item)
return vim_item
end,
}),
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({
select = false,
}),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
-- cmp.complete()
fallback()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
}),
sources = cmp.config.sources({
{ name = "copilot" },
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "nvim_lsp_signature_help" },
{ name = "nvim_lua" },
{ name = "orgmode" },
{ name = "path" },
{ name = "buffer" },
}),
})
-- Set configuration for specific filetype.
cmp.setup.filetype("gitcommit", {
sources = cmp.config.sources({
{ name = "cmp_git" },
}, {
{ name = "buffer" },
}),
})
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ "/", "?" }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{
name = "buffer",
},
},
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{
name = "path",
},
}, {
{
name = "cmdline",
},
}),
})
end
return {
{
"windwp/nvim-autopairs",
event = "InsertEnter",
config = true,
},
"onsails/lspkind-nvim", -- Pretty icons
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"hrsh7th/cmp-omni",
"hrsh7th/cmp-nvim-lsp-signature-help",
{ "petertriho/cmp-git", config = true },
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
build = ":Copilot auth",
opts = {
suggestion = { enabled = false },
panel = { enabled = false },
filetypes = {
markdown = true,
help = true,
},
},
},
{
"zbirenbaum/copilot-cmp",
dependencies = { "zbirenbaum/copilot.lua" },
config = true,
},
{
"hrsh7th/nvim-cmp",
init = function()
vim.o.completeopt = "menu,menuone,noselect"
end,
config = setup_cmp,
},
{
"L3MON4D3/LuaSnip",
version = "2.*",
build = "make install_jsregexp",
dependencies = { "rafamadriz/friendly-snippets" },
},
"saadparwaiz1/cmp_luasnip",
}

@ -0,0 +1,10 @@
return {
{
"Th3Whit3Wolf/onebuddy",
dependencies = { "tjdevries/colorbuddy.vim" },
},
"RRethy/nvim-base16",
"NTBBloodbath/doom-one.nvim",
"folke/tokyonight.nvim",
"marko-cerovac/material.nvim",
}

@ -0,0 +1,13 @@
return {
{
"numToStr/Comment.nvim",
config = true,
opts = {
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
},
dependencies = {
"JoosepAlviste/nvim-ts-context-commentstring",
},
lazy = false,
},
}

@ -1,120 +1,139 @@
local dap = require("dap")
local init_dap = function()
local wk = require("which-key")
require("dap").adapters["pwa-node"] = {
type = "server",
host = "localhost",
port = "${port}",
executable = {
command = vim.env.HOME .. "/.asdf/installs/nodejs/lts/bin/node",
args = {
vim.fn.stdpath("data") .. "/mason/packages/js-debug-adapter/js-debug/src/dapDebugServer.js",
"${port}",
},
},
}
wk.register({
d = {
name = "Debug",
b = {
function()
require("dap").toggle_breakpoint()
end,
"Toggle breakpoint",
},
c = {
function()
require("dap").continue()
end,
"Launch or resume session",
},
o = {
function()
require("dap").step_over()
end,
"Step over",
},
i = {
function()
require("dap").step_into()
end,
"Step into",
},
p = {
function()
require("dap.ext.vscode").load_launchjs(
nil,
{ ["pwa-node"] = { "typescriptreact", "typescript", "javascript", "javascriptreact", "json" } }
)
end,
"Load project config",
},
P = {
function()
local config_dir = vim.loop.cwd() .. "/.vscode"
local config_file = config_dir .. "/launch.json"
if not vim.fn.filereadable(config_file) then
vim.ui.input(
{ prompt = "Debugger config not found at " .. config_file .. ". Create? [Y/n]" },
function(input)
if input == "" or input == "y" or input == "Y" then
vim.fn.mkdir(config_dir)
end
end
)
end
for _, language in ipairs({ "typescript", "javascript" }) do
dap.configurations[language] = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = require("dap.utils").pick_process,
cwd = "${workspaceFolder}",
},
{
type = "pwa-node",
request = "launch",
name = "Debug Jest Tests",
-- trace = true, -- include debugger info
runtimeExecutable = "node",
runtimeArgs = {
"./node_modules/jest/bin/jest.js",
"--runInBand",
},
rootPath = "${workspaceFolder}",
cwd = "${workspaceFolder}",
console = "integratedTerminal",
internalConsoleOptions = "neverOpen",
},
}
if vim.fn.filereadable(config_file) then
vim.cmd("edit " .. config_file)
end
end,
"Open project config",
},
},
}, {
prefix = "<leader>",
})
end
require("dapui").setup()
local setup_dap = function()
local dap = require("dap")
require("dap").adapters["pwa-node"] = {
type = "server",
host = "localhost",
port = "${port}",
executable = {
command = vim.env.HOME .. "/.asdf/installs/nodejs/lts/bin/node",
args = {
vim.fn.stdpath("data") .. "/mason/packages/js-debug-adapter/js-debug/src/dapDebugServer.js",
"${port}",
},
},
}
for _, language in ipairs({ "typescript", "javascript" }) do
dap.configurations[language] = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = require("dap.utils").pick_process,
cwd = "${workspaceFolder}",
},
{
type = "pwa-node",
request = "launch",
name = "Debug Jest Tests",
-- trace = true, -- include debugger info
runtimeExecutable = "node",
runtimeArgs = {
"./node_modules/jest/bin/jest.js",
"--runInBand",
},
rootPath = "${workspaceFolder}",
cwd = "${workspaceFolder}",
console = "integratedTerminal",
internalConsoleOptions = "neverOpen",
},
}
end
end
local wk = require("which-key")
local setup_dap_ui = function()
local wk = require("which-key")
wk.register({
d = {
name = "Debug",
d = {
function()
require("dapui").toggle()
end,
"Toggle debugger UI",
},
b = {
function()
require("dap").toggle_breakpoint()
end,
"Toggle breakpoint",
},
c = {
function()
require("dap").continue()
end,
"Launch or resume session",
},
o = {
function()
require("dap").step_over()
end,
"Step over",
},
i = {
function()
require("dap").step_into()
end,
"Step into",
},
p = {
function()
require("dap.ext.vscode").load_launchjs(
nil,
{ ["pwa-node"] = { "typescriptreact", "typescript", "javascript", "javascriptreact", "json" } }
)
end,
"Load project config",
},
P = {
function()
local config_dir = vim.loop.cwd() .. "/.vscode"
local config_file = config_dir .. "/launch.json"
if not vim.fn.filereadable(config_file) then
vim.ui.input(
{ prompt = "Debugger config not found at " .. config_file .. ". Create? [Y/n]" },
function(input)
if input == "" or input == "y" or input == "Y" then
vim.fn.mkdir(config_dir)
end
end
)
end
wk.register({
d = {
name = "Debug",
d = {
function()
require("dapui").toggle()
end,
"Toggle debugger UI",
},
},
}, {
prefix = "<leader>",
})
end
if vim.fn.filereadable(config_file) then
vim.cmd("edit " .. config_file)
end
end,
"Open project config",
},
},
}, {
prefix = "<leader>",
})
return {
{ "mfussenegger/nvim-dap", init = init_dap, config = setup_dap },
{ "rcarriga/nvim-dap-ui", init = setup_dap_ui },
}

@ -0,0 +1,46 @@
return {
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
cmd = "Neotree",
config = true,
opts = {
filesystem = {
use_libuv_file_watcher = true,
follow_current_file = {
enabled = false, -- This will find and focus the file in the active buffer every time
},
},
},
init = function()
local wk = require("which-key")
wk.register({
o = {
p = { "<cmd>Neotree<CR>", "Open project sidebar" },
},
}, {
prefix = "<leader>",
})
end,
},
{
"kevinhwang91/rnvimr",
init = function()
local wk = require("which-key")
wk.register({
f = {
r = { "<cmd>RnvimrToggle<CR>", "Toggle Ranger" },
},
}, {
prefix = "<leader>",
})
vim.g.rnvimr_enable_ex = 0
vim.g.rnvimr_enable_picker = 1
vim.g.rnvimr_enable_bw = 0
end,
cmd = "RnvimrToggle",
},
}

@ -0,0 +1,114 @@
local init_orgmode = function()
local wk = require("which-key")
vim.api.nvim_create_autocmd("BufEnter", {
pattern = "*.org",
callback = function()
vim.wo.foldexpr = "nvim_treesitter#foldexpr()"
vim.wo.foldmethod = "expr"
end,
})
local wk_open_org_agenda = {
[[<cmd>lua require('orgmode').action("agenda.prompt")<CR>]],
"Org agenda",
}
wk.register({
O = {
name = "Org mode",
a = wk_open_org_agenda,
f = {
[[<cmd>lua require('telescope.builtin').find_files{ cwd = '~/.org' }<CR>]],
"Find file in notes",
},
n = {
[[<cmd>lua require('orgmode').action("capture.prompt")<CR>]],
"Org capture",
},
s = {
[[<cmd>lua require('telescope.builtin').live_grep{ cwd = '~/.org' }<CR>]],
"Search notes",
},
},
}, {
prefix = "<leader>",
})
end
local init_package_info = function()
local augroup = vim.api.nvim_create_augroup("PackageJson", {})
local patt = { "package.json" }
local wk = require("which-key")
vim.api.nvim_clear_autocmds({ group = augroup })
vim.api.nvim_create_autocmd("BufEnter", {
group = augroup,
pattern = patt,
callback = function(bufnr)
wk.register({
s = {
function()
require("package-info").toggle()
end,
"Toggle package versions",
},
d = {
function()
require("package-info").delete()
end,
"Delete dependency",
},
c = {
function()
require("package-info").change_version()
end,
"Change dependency version",
},
a = {
function()
require("package-info").install()
end,
"Add new dependency",
},
u = {
function()
require("package-info").update()
end,
"Update dependency",
},
}, {
mode = "n",
bufnr = bufnr,
prefix = "<localleader>",
})
end,
})
end
return {
{ "RaafatTurki/hex.nvim", config = true },
"Eduruiz/vim-blade",
{
"nvim-orgmode/orgmode",
opts = {
org_agenda_files = {
"~/.org/work/*",
"~/.org/learning/*",
"~/.org/projects/*",
"~/.org/calendars/*",
"~/.org/conferences/*",
},
org_default_notes_file = "~/.org/refile.org",
},
init = init_orgmode,
},
{
"vuki656/package-info.nvim",
dependencies = {
"MunifTanjim/nui.nvim",
},
init = init_package_info,
},
}

@ -0,0 +1,125 @@
local init = function()
local wk = require("which-key")
local actions = require("telescope.actions")
local M = {}
M.project_files = function()
local opts = {}
local ok = pcall(require("telescope.builtin").git_files, opts)
if not ok then
require("telescope.builtin").find_files(opts)
end
end
M.file_browser = function()
require("telescope").extensions.file_browser.file_browser({
cwd = vim.fn.expand("%:p:h"),
})
end
require("telescope").setup({
defaults = {
mappings = {
i = {
["<esc>"] = actions.close,
},
},
},
pickers = {
git_files = {
show_untracked = true,
},
find_files = {
hidden = true,
follow = true,
},
live_grep = {
hidden = true,
follow = true,
},
},
extensions = {
file_browser = {
hidden = true,
follow = true,
},
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case",
},
},
})
require("telescope").load_extension("file_browser")
require("telescope").load_extension("ui-select")
require("telescope").load_extension("fzf")
require("telescope").load_extension("projects")
local browse_files = {
function()
M.file_browser()
end,
"Browse files",
}
local find_file_in_project = {
function()
M.project_files()
end,
"Find file in project",
}
wk.register({
f = {
f = { "<cmd>Telescope find_files<cr>", "Find file" },
p = {
[[<cmd>lua require('telescope.builtin').git_files{ cwd = '~/.config/nvim/' }<CR>]],
"Find config file",
},
o = { "<cmd>Telescope oldfiles<cr>", "Open recent file" },
b = browse_files,
},
b = {
b = { "<cmd>Telescope buffers<CR>", "Switch buffer" },
},
h = {
h = { "<cmd>Telescope help_tags<CR>", "Vim help tags" },
m = { "<cmd>Telescope man_pages<CR>", "Man pages" },
},
p = {
p = { "<cmd>Telescope projects<CR>", "Switch to project" },
f = find_file_in_project,
},
g = {
c = { "<cmd>Telescope git_commits<CR>", "Checkout commit" },
C = { "<cmd>Telescope git_bcommits<CR>", "Checkout buffer commit" },
B = { "<cmd>Telescope git_branches<CR>", "Switch branch" },
s = { "<cmd>Telescope git_stash<CR>", "Apply stash" },
},
["<space>"] = find_file_in_project,
["."] = browse_files,
[","] = { "<cmd>Telescope buffers<CR>", "Switch buffer" },
["/"] = { "<cmd>Telescope live_grep<CR>", "Live grep" },
}, {
prefix = "<leader>",
})
end
return {
{
"nvim-telescope/telescope.nvim",
tag = "0.1.2",
dependencies = {
"nvim-lua/plenary.nvim",
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
},
"nvim-telescope/telescope-file-browser.nvim",
"nvim-telescope/telescope-ui-select.nvim",
},
init = init,
},
}

@ -0,0 +1,50 @@
return {
{
"kevinhwang91/nvim-ufo",
opts = {
provider_selector = function(bufnr, filetype, buftype)
return { "treesitter", "indent" }
end,
fold_virt_text_handler = function(virtText, lnum, endLnum, width, truncate)
local newVirtText = {}
local suffix = (" 󰁂 %d "):format(endLnum - lnum)
local sufWidth = vim.fn.strdisplaywidth(suffix)
local targetWidth = width - sufWidth
local curWidth = 0
for _, chunk in ipairs(virtText) do
local chunkText = chunk[1]
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
if targetWidth > curWidth + chunkWidth then
table.insert(newVirtText, chunk)
else
chunkText = truncate(chunkText, targetWidth - curWidth)
local hlGroup = chunk[2]
table.insert(newVirtText, { chunkText, hlGroup })
chunkWidth = vim.fn.strdisplaywidth(chunkText)
-- str width returned from truncate() may less than 2nd argument, need padding
if curWidth + chunkWidth < targetWidth then
suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth)
end
break
end
curWidth = curWidth + chunkWidth
end
table.insert(newVirtText, { suffix, "MoreMsg" })
return newVirtText
end,
},
init = function()
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
vim.o.foldmethod = "manual"
vim.o.foldenable = true
vim.o.foldcolumn = "0"
vim.o.foldlevel = 99
vim.o.foldlevelstart = 99
vim.keymap.set("n", "zR", require("ufo").openAllFolds)
vim.keymap.set("n", "zM", require("ufo").closeAllFolds)
end,
dependencies = { "nvim-treesitter/nvim-treesitter", "kevinhwang91/promise-async" },
},
}

@ -1,153 +1,52 @@
local wk = require("which-key")
local wk_toggle_git_blame = { "<cmd>GitBlameToggle<CR>", "Toggle git blame" }
wk.register({
t = {
b = wk_toggle_git_blame,
},
g = {
n = { "<cmd>Neogit<CR>", "Neogit status" },
f = { "<cmd>Git<CR>", "Fugitive status" },
b = wk_toggle_git_blame,
},
}, {
prefix = "<leader>",
})
return {
{
"pwntester/octo.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
"nvim-tree/nvim-web-devicons",
},
cmd = "Octo",
config = true,
},
{
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
"sindrets/diffview.nvim",
},
cmd = "Neogit",
config = true,
},
{
"lewis6991/gitsigns.nvim",
config = true,
},
{
"f-person/git-blame.nvim",
init = function()
vim.g.gitblame_enabled = 0
local wk_toggle_git_blame = { "<cmd>GitBlameToggle<CR>", "Toggle git blame" }
local neogit = require("neogit")
neogit.setup()
-- gitsigns
require("gitsigns").setup()
-- git-blame
vim.g.gitblame_enabled = 0
-- octo
require("octo").setup({
default_remote = { "origin" }, -- order to try remotes
ssh_aliases = {}, -- SSH aliases. e.g. `ssh_aliases = {["github.com-work"] = "github.com"}`
reaction_viewer_hint_icon = "", -- marker for user reactions
user_icon = "", -- user icon
timeline_marker = "", -- timeline marker
timeline_indent = "2", -- timeline indentation
right_bubble_delimiter = "", -- Bubble delimiter
left_bubble_delimiter = "", -- Bubble delimiter
snippet_context_lines = 4, -- number or lines around commented lines
file_panel = {
size = 10, -- changed files panel rows
use_icons = true, -- use web-devicons in file panel (if false, nvim-web-devicons does not need to be installed)
},
mappings = {
issue = {
close_issue = { lhs = "<space>ic", desc = "close issue" },
reopen_issue = { lhs = "<space>io", desc = "reopen issue" },
list_issues = { lhs = "<space>il", desc = "list open issues on same repo" },
reload = { lhs = "<C-r>", desc = "reload issue" },
open_in_browser = { lhs = "<C-b>", desc = "open issue in browser" },
copy_url = { lhs = "<C-y>", desc = "copy url to system clipboard" },
add_assignee = { lhs = "<space>aa", desc = "add assignee" },
remove_assignee = { lhs = "<space>ad", desc = "remove assignee" },
create_label = { lhs = "<space>lc", desc = "create label" },
add_label = { lhs = "<space>la", desc = "add label" },
remove_label = { lhs = "<space>ld", desc = "remove label" },
goto_issue = { lhs = "<space>gi", desc = "navigate to a local repo issue" },
add_comment = { lhs = "<space>ca", desc = "add comment" },
delete_comment = { lhs = "<space>cd", desc = "delete comment" },
next_comment = { lhs = "]c", desc = "go to next comment" },
prev_comment = { lhs = "[c", desc = "go to previous comment" },
react_hooray = { lhs = "<space>rp", desc = "add/remove 🎉 reaction" },
react_heart = { lhs = "<space>rh", desc = "add/remove ❤️ reaction" },
react_eyes = { lhs = "<space>re", desc = "add/remove 👀 reaction" },
react_thumbs_up = { lhs = "<space>r+", desc = "add/remove 👍 reaction" },
react_thumbs_down = { lhs = "<space>r-", desc = "add/remove 👎 reaction" },
react_rocket = { lhs = "<space>rr", desc = "add/remove 🚀 reaction" },
react_laugh = { lhs = "<space>rl", desc = "add/remove 😄 reaction" },
react_confused = { lhs = "<space>rc", desc = "add/remove 😕 reaction" },
},
pull_request = {
checkout_pr = { lhs = "<space>po", desc = "checkout PR" },
merge_pr = { lhs = "<space>pm", desc = "merge commit PR" },
squash_and_merge_pr = { lhs = "<space>psm", desc = "squash and merge PR" },
list_commits = { lhs = "<space>pc", desc = "list PR commits" },
list_changed_files = { lhs = "<space>pf", desc = "list PR changed files" },
show_pr_diff = { lhs = "<space>pd", desc = "show PR diff" },
add_reviewer = { lhs = "<space>va", desc = "add reviewer" },
remove_reviewer = { lhs = "<space>vd", desc = "remove reviewer request" },
close_issue = { lhs = "<space>ic", desc = "close PR" },
reopen_issue = { lhs = "<space>io", desc = "reopen PR" },
list_issues = { lhs = "<space>il", desc = "list open issues on same repo" },
reload = { lhs = "<C-r>", desc = "reload PR" },
open_in_browser = { lhs = "<C-b>", desc = "open PR in browser" },
copy_url = { lhs = "<C-y>", desc = "copy url to system clipboard" },
goto_file = { lhs = "gf", desc = "go to file" },
add_assignee = { lhs = "<space>aa", desc = "add assignee" },
remove_assignee = { lhs = "<space>ad", desc = "remove assignee" },
create_label = { lhs = "<space>lc", desc = "create label" },
add_label = { lhs = "<space>la", desc = "add label" },
remove_label = { lhs = "<space>ld", desc = "remove label" },
goto_issue = { lhs = "<space>gi", desc = "navigate to a local repo issue" },
add_comment = { lhs = "<space>ca", desc = "add comment" },
delete_comment = { lhs = "<space>cd", desc = "delete comment" },
next_comment = { lhs = "]c", desc = "go to next comment" },
prev_comment = { lhs = "[c", desc = "go to previous comment" },
react_hooray = { lhs = "<space>rp", desc = "add/remove 🎉 reaction" },
react_heart = { lhs = "<space>rh", desc = "add/remove ❤️ reaction" },
react_eyes = { lhs = "<space>re", desc = "add/remove 👀 reaction" },
react_thumbs_up = { lhs = "<space>r+", desc = "add/remove 👍 reaction" },
react_thumbs_down = { lhs = "<space>r-", desc = "add/remove 👎 reaction" },
react_rocket = { lhs = "<space>rr", desc = "add/remove 🚀 reaction" },
react_laugh = { lhs = "<space>rl", desc = "add/remove 😄 reaction" },
react_confused = { lhs = "<space>rc", desc = "add/remove 😕 reaction" },
},
review_thread = {
goto_issue = { lhs = "<space>gi", desc = "navigate to a local repo issue" },
add_comment = { lhs = "<space>ca", desc = "add comment" },
add_suggestion = { lhs = "<space>sa", desc = "add suggestion" },
delete_comment = { lhs = "<space>cd", desc = "delete comment" },
next_comment = { lhs = "]c", desc = "go to next comment" },
prev_comment = { lhs = "[c", desc = "go to previous comment" },
select_next_entry = { lhs = "]q", desc = "move to previous changed file" },
select_prev_entry = { lhs = "[q", desc = "move to next changed file" },
close_review_tab = { lhs = "<C-c>", desc = "close review tab" },
react_hooray = { lhs = "<space>rp", desc = "add/remove 🎉 reaction" },
react_heart = { lhs = "<space>rh", desc = "add/remove ❤️ reaction" },
react_eyes = { lhs = "<space>re", desc = "add/remove 👀 reaction" },
react_thumbs_up = { lhs = "<space>r+", desc = "add/remove 👍 reaction" },
react_thumbs_down = { lhs = "<space>r-", desc = "add/remove 👎 reaction" },
react_rocket = { lhs = "<space>rr", desc = "add/remove 🚀 reaction" },
react_laugh = { lhs = "<space>rl", desc = "add/remove 😄 reaction" },
react_confused = { lhs = "<space>rc", desc = "add/remove 😕 reaction" },
},
submit_win = {
approve_review = { lhs = "<C-a>", desc = "approve review" },
comment_review = { lhs = "<C-m>", desc = "comment review" },
request_changes = { lhs = "<C-r>", desc = "request changes review" },
close_review_tab = { lhs = "<C-c>", desc = "close review tab" },
},
review_diff = {
add_review_comment = { lhs = "<space>ca", desc = "add a new review comment" },
add_review_suggestion = { lhs = "<space>sa", desc = "add a new review suggestion" },
focus_files = { lhs = "<leader>e", desc = "move focus to changed file panel" },
toggle_files = { lhs = "<leader>b", desc = "hide/show changed files panel" },
next_thread = { lhs = "]t", desc = "move to next thread" },
prev_thread = { lhs = "[t", desc = "move to previous thread" },
select_next_entry = { lhs = "]q", desc = "move to previous changed file" },
select_prev_entry = { lhs = "[q", desc = "move to next changed file" },
close_review_tab = { lhs = "<C-c>", desc = "close review tab" },
toggle_viewed = { lhs = "<leader><space>", desc = "toggle viewer viewed state" },
},
file_panel = {
next_entry = { lhs = "j", desc = "move to next changed file" },
prev_entry = { lhs = "k", desc = "move to previous changed file" },
select_entry = { lhs = "<cr>", desc = "show selected changed file diffs" },
refresh_files = { lhs = "R", desc = "refresh changed files panel" },
focus_files = { lhs = "<leader>e", desc = "move focus to changed file panel" },
toggle_files = { lhs = "<leader>b", desc = "hide/show changed files panel" },
select_next_entry = { lhs = "]q", desc = "move to previous changed file" },
select_prev_entry = { lhs = "[q", desc = "move to next changed file" },
close_review_tab = { lhs = "<C-c>", desc = "close review tab" },
toggle_viewed = { lhs = "<leader><space>", desc = "toggle viewer viewed state" },
},
},
})
wk.register({
t = {
b = wk_toggle_git_blame,
},
g = {
n = { "<cmd>Neogit<CR>", "Neogit status" },
f = { "<cmd>Git<CR>", "Fugitive status" },
b = wk_toggle_git_blame,
},
}, {
prefix = "<leader>",
})
end,
},
{
"sindrets/diffview.nvim",
cmd = { "DiffviewOpen", "DiffviewFileHistory" },
},
}

@ -0,0 +1,89 @@
local setup_indent_blankline = function()
vim.g.indent_blankline_use_treesitter = true
vim.g.indent_blankline_filetype_exclude = {
"help",
"dashboard",
"dashpreview",
"coc-explorer",
"startify",
"vista",
"sagahover",
"lspinfo",
}
vim.opt.list = true
vim.opt.listchars:append("space:⋅")
vim.opt.listchars:append("eol:↴")
require("indent_blankline").setup({
space_char_blankline = " ",
show_current_context = true,
show_current_context_start = true,
})
local wk = require("which-key")
wk.register({
t = {
i = {
function()
vim.cmd("IndentBlanklineToggle!")
if vim.g.indent_blankline_enabled then
vim.opt.list = true
else
vim.opt.list = false
end
end,
"Indent guides",
},
},
}, {
prefix = "<leader>",
})
end
local setup_zen_mode = function()
require("zen-mode").setup()
local wk = require("which-key")
wk.register({
t = {
z = { "<cmd>ZenMode<CR>", "Zen mode" },
},
}, {
prefix = "<leader>",
})
end
local setup_twilight = function()
require("twilight").setup({
treesitter = true,
expand = {
"function",
"method",
"table",
"if_statement",
},
})
local wk = require("which-key")
wk.register({
t = {
t = { "<cmd>Twilight<CR>", "Twilight" },
},
}, {
prefix = "<leader>",
})
end
return {
{ "stevearc/dressing.nvim", event = "VeryLazy" },
{ "lukas-reineke/indent-blankline.nvim", event = "VeryLazy", init = setup_indent_blankline },
{ "folke/zen-mode.nvim", init = setup_zen_mode },
{ "folke/twilight.nvim", init = setup_twilight },
{ "folke/todo-comments.nvim", requires = "nvim-lua/plenary.nvim" },
{ "nvim-tree/nvim-web-devicons", opts = { default = true } },
"norcalli/nvim-colorizer.lua",
}

@ -1 +0,0 @@
require("hex").setup()

@ -1,41 +0,0 @@
vim.g.indent_blankline_use_treesitter = true
vim.g.indent_blankline_filetype_exclude = {
"help",
"dashboard",
"dashpreview",
"coc-explorer",
"startify",
"vista",
"sagahover",
"lspinfo",
}
vim.opt.list = true
vim.opt.listchars:append("space:⋅")
vim.opt.listchars:append("eol:↴")
require("indent_blankline").setup({
space_char_blankline = " ",
show_current_context = true,
show_current_context_start = true,
})
local wk = require("which-key")
wk.register({
t = {
i = {
function()
vim.cmd("IndentBlanklineToggle!")
if vim.g.indent_blankline_enabled then
vim.opt.list = true
else
vim.opt.list = false
end
end,
"Indent guides",
},
},
}, {
prefix = "<leader>",
})

@ -1,329 +0,0 @@
---@diagnostic disable: undefined-global
return require("packer").startup(function()
use("wbthomason/packer.nvim")
use("antoinemadec/FixCursorHold.nvim")
-- Project management
use({
"ahmedkhalf/project.nvim",
config = [[require('plugins.project-nvim')]],
})
-- GUI
use("stevearc/dressing.nvim")
-- Fuzzy finder
use({
{
"nvim-telescope/telescope-fzf-native.nvim",
run = "make",
},
"nvim-telescope/telescope-file-browser.nvim",
"nvim-telescope/telescope-ui-select.nvim",
{
"nvim-telescope/telescope.nvim",
requires = { "nvim-lua/plenary.nvim" },
config = [[require('plugins.telescope-nvim')]],
},
})
-- File explorer
use({
"kevinhwang91/rnvimr",
config = [[require('plugins.rnvimr')]],
})
use({
"kyazdani42/nvim-tree.lua",
config = [[require('plugins.nvim-tree')]],
})
-- Refactor
use({
"ThePrimeagen/refactoring.nvim",
requires = {
{ "nvim-lua/plenary.nvim" },
{ "nvim-treesitter/nvim-treesitter" },
},
config = [[ require('refactoring').setup({}) ]],
})
-- LSP
use({
"folke/lsp-colors.nvim", -- Color groups
"WhoIsSethDaniel/mason-tool-installer.nvim",
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"folke/neodev.nvim", -- Lua
"jose-elias-alvarez/typescript.nvim", -- Typsecript
"jose-elias-alvarez/null-ls.nvim", -- Tooling
"stevearc/aerial.nvim", -- Outline
"b0o/schemastore.nvim", -- JSON schemas
"folke/trouble.nvim", -- Diagnostics
"kosayoda/nvim-lightbulb", -- Lightbulb
"j-hui/fidget.nvim", -- LSP Status indicator
{
"neovim/nvim-lspconfig", -- Config
config = [[require('plugins.lsp')]],
},
})
-- Buffer line
-- use {
-- 'akinsho/bufferline.nvim',
-- tag = "v2.*",
-- requires = 'kyazdani42/nvim-web-devicons',
-- config = function() require("bufferline").setup {} end
-- }
-- Completion
use({
"onsails/lspkind-nvim", -- Pretty icons
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"hrsh7th/cmp-omni",
"petertriho/cmp-git",
"hrsh7th/cmp-nvim-lsp-signature-help",
{
"zbirenbaum/copilot-cmp",
requires = { "zbirenbaum/copilot.lua" },
},
{
"hrsh7th/nvim-cmp",
config = [[require('plugins.nvim-cmp')]],
},
})
-- Snippets
use("L3MON4D3/LuaSnip")
use("saadparwaiz1/cmp_luasnip")
use("rafamadriz/friendly-snippets")
-- Comments
use({
"numToStr/Comment.nvim",
config = function()
require("Comment").setup()
end,
})
-- Autopairs
use({
"windwp/nvim-autopairs",
config = function()
require("nvim-autopairs").setup()
end,
})
-- Tree-sitter
use({
"JoosepAlviste/nvim-ts-context-commentstring",
"windwp/nvim-ts-autotag", -- XML-like auto tags
{
"nvim-treesitter/nvim-treesitter",
run = ":TSUpdate",
config = [[require('plugins.nvim-treesitter')]],
},
{
"nvim-orgmode/orgmode",
config = [[require('plugins.orgmode-nvim')]],
},
})
-- Note taking
use({
{
"jakewvincent/mkdnflow.nvim",
rocks = "luautf8",
},
"ekickx/clipboard-image.nvim",
{
"mickael-menu/zk-nvim",
config = [[require('plugins.notes')]],
},
})
-- Terminal
use({
"akinsho/toggleterm.nvim",
tag = "v2.*",
config = [[require('plugins.term')]],
})
-- Git
use({
{
"lewis6991/gitsigns.nvim",
requires = "nvim-lua/plenary.nvim",
},
"tpope/vim-fugitive",
"TimUntersberger/neogit",
"f-person/git-blame.nvim",
{
"sindrets/diffview.nvim",
requires = "nvim-lua/plenary.nvim",
},
{
"pwntester/octo.nvim",
requires = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
"kyazdani42/nvim-web-devicons",
},
config = [[require('plugins.git')]],
},
})
-- Indent lines
use({
"lukas-reineke/indent-blankline.nvim",
config = [[require('plugins.indent-blankline-nvim')]],
})
-- Handy stuff
use({
"echasnovski/mini.nvim",
branch = "stable",
config = function()
require("mini.jump").setup({})
require("mini.bufremove").setup({})
end,
})
use({
"ggandor/leap.nvim",
requires = {
"tpope/vim-repeat",
},
config = function()
require("leap").set_default_keymaps()
end,
})
use({
"ygm2/rooter.nvim",
config = function()
vim.g.outermost_root = false
end,
})
use({ "dhruvasagar/vim-table-mode" })
use({ "tpope/vim-eunuch" })
use({
"folke/which-key.nvim",
config = [[require('plugins.which-key')]],
})
use({
"folke/zen-mode.nvim",
config = [[require('plugins.zen-mode-nvim')]],
})
use({
"folke/twilight.nvim",
config = [[require('plugins.twilight-nvim')]],
})
use({
"folke/todo-comments.nvim",
requires = "nvim-lua/plenary.nvim",
config = function()
require("todo-comments").setup()
end,
})
-- Statusline
-- use {
-- 'ojroques/nvim-hardline',
-- config = [[require('plugins.hardline')]]
-- }
use({
"b0o/incline.nvim",
{
"hoob3rt/lualine.nvim",
requires = {
"kyazdani42/nvim-web-devicons",
opt = true,
},
config = [[require('plugins.lualine')]],
},
})
-- Folding
-- use({
-- "kevinhwang91/nvim-ufo",
-- requires = "kevinhwang91/promise-async",
-- config = [[require('plugins.nvim-ufo')]],
-- })
-- Color highlighting
use({
"norcalli/nvim-colorizer.lua",
config = function()
require("colorizer").setup()
end,
})
-- Colorschemes
use({
"Th3Whit3Wolf/onebuddy",
requires = { "tjdevries/colorbuddy.vim" },
})
use({ "RRethy/nvim-base16" })
use({ "NTBBloodbath/doom-one.nvim" })
use({ "folke/tokyonight.nvim" })
use({ "marko-cerovac/material.nvim" })
use({
"kyazdani42/nvim-web-devicons",
config = [[require('plugins.nvim-web-devicons')]],
})
-- package.json
use("vuki656/package-info.nvim")
-- Blade
use({ "Eduruiz/vim-blade" })
-- DAP
use({
"mfussenegger/nvim-dap",
{
"rcarriga/nvim-dap-ui",
config = [[require('plugins.debugging')]],
},
})
-- Test runner
use({
"nvim-neotest/neotest",
requires = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"antoinemadec/FixCursorHold.nvim",
-- {
-- "nvim-neotest/neotest-jest",
-- commit = "219033658bf8de6b91e201036a5cc5456905d9d2",
-- },
"nvim-neotest/neotest-jest",
"nvim-neotest/neotest-go",
"nvim-neotest/neotest-python",
},
config = [[require('plugins.testing')]],
})
-- REST
use({
"rest-nvim/rest.nvim",
config = [[require('plugins.rest')]],
})
-- Hex
use({
"RaafatTurki/hex.nvim",
config = [[require('plugins.hex')]],
})
end)

@ -0,0 +1,81 @@
local init = function()
local wk = require("which-key")
wk.register({
f = {
name = "File",
C = {
function()
vim.api.nvim_input(":Copy " .. vim.fn.expand("%"))
end,
"Copy file",
},
R = {
function()
vim.api.nvim_input(":Move " .. vim.fn.expand("%"))
end,
"Rename/move file",
},
D = {
function()
vim.api.nvim_input(":Delete")
end,
"Delete file",
},
P = {
function()
print(vim.fn.expand("%:p"))
end,
"Print absolute path",
},
},
b = {
name = "Buffer",
d = { "<cmd>bdel<CR>", "Delete buffer" },
s = { "<cmd>write<CR>", "Save buffer" },
},
c = {
name = "Code",
},
h = {
name = "Help",
},
p = {
name = "Project",
},
n = {
name = "Note",
},
t = {
name = "Toggle",
},
g = {
name = "Git",
},
r = {
name = "Run",
},
o = {
name = "Open",
t = { '<cmd>exe v:count1 . "ToggleTerm"<CR>', "Open terminal" },
T = { "<cmd>terminal<CR>", "Open terminal here" },
},
w = {
name = "Window",
d = { "<cmd>close<CR>", "Close window" },
v = { "<cmd>vsplit<CR>", "Vertical split" },
s = { "<cmd>split<CR>", "Horizontal split" },
},
q = {
name = "Quit",
q = { "<cmd>qa<CR>", "Quit nvim" },
},
}, {
prefix = "<leader>",
})
end
return {
"folke/which-key.nvim",
init = init,
}

@ -1,9 +0,0 @@
local utils = require('utils')
local opts = { noremap = true, silent = true }
utils.map('n', '<leader>gg', '<cmd>LazyGit<CR>', opts)
utils.map('n', '<leader>gc', '<cmd>LazyGitConfig<CR>', opts)
vim.env.GIT_EDITOR = 'nvr --remote-wait'
vim.g.lazygit_floating_window_use_plenary = 1
vim.g.lazygit_use_neovim_remote = 1

@ -1,261 +1,295 @@
local null_ls = require("null-ls")
local wk = require("which-key")
require("mason").setup()
require("mason-tool-installer").setup({
ensure_installed = {
"stylua",
"shellcheck",
"shfmt",
"editorconfig-checker",
"eslint_d",
"prettier",
"prettierd",
"flake8",
"black",
"js-debug-adapter",
},
})
require("mason-lspconfig").setup({
automatic_installation = true,
})
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
border = "rounded",
close_events = { "CursorMoved", "BufHidden", "InsertCharPre" },
})
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = "rounded",
})
require("aerial").setup({})
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
local lsp_rename_mapping = {
function()
vim.lsp.buf.rename()
end,
"Rename LSP symbol",
}
local lsp_references_mapping = {
"<cmd>TroubleToggle lsp_references<CR>",
"LSP references",
}
local on_attach = function(client, bufnr)
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
-- Normal mappings
wk.register({
c = {
a = { "<cmd>lua vim.lsp.buf.code_action()<CR>", "Code action" },
r = lsp_rename_mapping,
f = {
"<cmd>lua vim.lsp.buf.format()<CR>",
"Format file",
},
o = { "<cmd>AerialToggle!<CR>", "Toggle outline" },
x = { "<cmd>lua vim.diagnostic.open_float({source= true})<CR>", "Show line diagnostics" },
R = lsp_references_mapping,
t = {
name = "Trouble",
t = { "<cmd>TroubleToggle<CR>", "Trouble Toggle" },
r = lsp_references_mapping,
w = { "<cmd>TroubleToggle lsp_workspace_diagnostics<CR>", "Workspace diagnostics" },
d = { "<cmd>TroubleToggle lsp_document_diagnostics<CR>", "Document diagnostics" },
q = { "<cmd>TroubleToggle quickfix<CR>", "Quickfix" },
l = { "<cmd>TroubleToggle loclist<CR>", "Location list" },
},
g = {
name = "Go to",
D = { "<cmd>lua vim.lsp.buf.declaration()<CR>", "Go to declaration" },
d = { "<cmd>lua vim.lsp.buf.definition()<CR>", "Go to definition" },
i = { "<cmd>lua vim.lsp.buf.implementation()<CR>", "Go to implementation" },
t = { "<cmd>lua vim.lsp.buf.type_definition()<CR>", "Go to type definition" },
},
},
}, {
prefix = "<leader>",
buffer = bufnr,
})
-- Visual mappings
wk.register({
c = {
a = { "<cmd>lua vim.lsp.buf.code_action()<CR>", "Range code action" },
f = {
"<cmd>lua vim.lsp.buf.format()<CR>",
"Range formatting",
},
},
}, {
mode = "v",
prefix = "<leader>",
buffer = bufnr,
})
-- No leader mappings
wk.register({
gd = { "<cmd>lua vim.lsp.buf.definition()<CR>", "Go to definition" },
K = { "<cmd>lua vim.lsp.buf.hover()<CR>", "LSP Hover" },
["<C-k"] = { "<cmd>lua vim.lsp.buf.signature_help()<CR>", "LSP Signature" },
["<f2>"] = lsp_rename_mapping,
["[["] = { "<cmd>AerialPrevUp<CR>", "Outline previous" },
["]]"] = { "<cmd>AerialNext<CR>", "Outline next" },
}, {
buffer = bufnr,
})
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
if vim.g.format_on_save == 1 then
vim.lsp.buf.format({ bufnr = bufnr })
end
end,
})
end
local config_lsp = function()
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
border = "rounded",
close_events = { "CursorMoved", "BufHidden", "InsertCharPre" },
})
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = "rounded",
})
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
local lsp_rename_mapping = {
function()
vim.lsp.buf.rename()
end,
"Rename LSP symbol",
}
local lsp_references_mapping = {
"<cmd>TroubleToggle lsp_references<CR>",
"LSP references",
}
local on_attach = function(client, bufnr)
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
-- Normal mappings
wk.register({
c = {
a = { "<cmd>lua vim.lsp.buf.code_action()<CR>", "Code action" },
r = lsp_rename_mapping,
f = {
"<cmd>lua vim.lsp.buf.format()<CR>",
"Format file",
},
o = { "<cmd>AerialToggle!<CR>", "Toggle outline" },
x = { "<cmd>lua vim.diagnostic.open_float({source= true})<CR>", "Show line diagnostics" },
R = lsp_references_mapping,
t = {
name = "Trouble",
t = { "<cmd>TroubleToggle<CR>", "Trouble Toggle" },
r = lsp_references_mapping,
w = { "<cmd>TroubleToggle lsp_workspace_diagnostics<CR>", "Workspace diagnostics" },
d = { "<cmd>TroubleToggle lsp_document_diagnostics<CR>", "Document diagnostics" },
q = { "<cmd>TroubleToggle quickfix<CR>", "Quickfix" },
l = { "<cmd>TroubleToggle loclist<CR>", "Location list" },
},
g = {
name = "Go to",
D = { "<cmd>lua vim.lsp.buf.declaration()<CR>", "Go to declaration" },
d = { "<cmd>lua vim.lsp.buf.definition()<CR>", "Go to definition" },
i = { "<cmd>lua vim.lsp.buf.implementation()<CR>", "Go to implementation" },
t = { "<cmd>lua vim.lsp.buf.type_definition()<CR>", "Go to type definition" },
},
},
}, {
prefix = "<leader>",
buffer = bufnr,
})
-- Visual mappings
wk.register({
c = {
a = { "<cmd>lua vim.lsp.buf.code_action()<CR>", "Range code action" },
f = {
"<cmd>lua vim.lsp.buf.format()<CR>",
"Range formatting",
},
},
}, {
mode = "v",
prefix = "<leader>",
buffer = bufnr,
})
-- No leader mappings
wk.register({
gd = { "<cmd>lua vim.lsp.buf.definition()<CR>", "Go to definition" },
K = { "<cmd>lua vim.lsp.buf.hover()<CR>", "LSP Hover" },
["<C-k"] = { "<cmd>lua vim.lsp.buf.signature_help()<CR>", "LSP Signature" },
["<f2>"] = lsp_rename_mapping,
["[["] = { "<cmd>AerialPrevUp<CR>", "Outline previous" },
["]]"] = { "<cmd>AerialNext<CR>", "Outline next" },
}, {
buffer = bufnr,
})
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
if vim.g.format_on_save == 1 then
vim.lsp.buf.format({ bufnr = bufnr })
end
end,
})
end
end
local settings = {
capabilities = capabilities,
on_attach = on_attach,
}
local servers = {
"clangd",
"pyright",
"rust_analyzer",
"gopls",
"tailwindcss",
"jsonls",
"lua_ls",
}
for _, lsp in pairs(servers) do
require("lspconfig")[lsp].setup(settings)
end
-- JSON
require("lspconfig").jsonls.setup(vim.tbl_deep_extend("force", settings, {
settings = {
json = {
schemas = require("schemastore").json.schemas(),
validate = {
enable = true,
},
},
},
}))
-- Typescript
require("typescript").setup({
disable_commands = false,
debug = false,
server = settings,
})
end
local settings = {
capabilities = capabilities,
on_attach = on_attach,
return {
{
"williamboman/mason.nvim",
config = true,
},
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
config = true,
opts = {
ensure_installed = {
"stylua",
"shellcheck",
"shfmt",
"editorconfig-checker",
"eslint_d",
"prettierd",
"flake8",
"black",
"js-debug-adapter",
},
},
},
{
"williamboman/mason-lspconfig.nvim",
config = true,
opts = {
automatic_installation = true,
},
},
{
"j-hui/fidget.nvim",
tag = "legacy",
event = "LspAttach",
opts = {},
},
{
"kosayoda/nvim-lightbulb",
opts = {
autocmd = {
enabled = false,
},
sign = {
enabled = false,
},
virtual_text = {
enabled = false,
},
},
},
{
"stevearc/aerial.nvim",
opts = {},
cmd = "AerialToggle",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons",
},
},
{ "folke/trouble.nvim", config = true, cmd = { "TroubleToggle", "Trouble" } },
{
"jose-elias-alvarez/null-ls.nvim",
dependencies = { "mason.nvim" },
event = { "BufReadPre", "BufNewFile" },
init = function()
vim.g.format_on_save = 1
function _G.toggle_format_on_save()
if vim.g.format_on_save == 1 then
vim.g.format_on_save = 0
print("Disabled format on save")
else
vim.g.format_on_save = 1
print("Enabled format on save")
end
end
end,
opts = {
timeout_ms = 5000,
sources = {
-- General
null_ls.builtins.code_actions.refactoring,
null_ls.builtins.completion.spell,
null_ls.builtins.diagnostics.trail_space,
null_ls.builtins.formatting.trim_newlines,
null_ls.builtins.formatting.trim_whitespace,
-- Git
null_ls.builtins.code_actions.gitrebase,
null_ls.builtins.code_actions.gitsigns,
-- GitHub
null_ls.builtins.diagnostics.actionlint,
-- Shell
null_ls.builtins.code_actions.shellcheck,
null_ls.builtins.diagnostics.shellcheck,
null_ls.builtins.formatting.shfmt,
-- C/C++
null_ls.builtins.formatting.clang_format,
null_ls.builtins.formatting.cmake_format,
-- Web
null_ls.builtins.formatting.prettier,
-- null_ls.builtins.code_actions.eslint_d,
null_ls.builtins.code_actions.eslint,
null_ls.builtins.diagnostics.eslint,
-- null_ls.builtins.formatting.eslint,
null_ls.builtins.diagnostics.stylelint,
null_ls.builtins.formatting.stylelint,
null_ls.builtins.formatting.rustywind,
-- Markdown
null_ls.builtins.formatting.remark,
-- Lua
-- null_ls.builtins.diagnostics.luacheck,
null_ls.builtins.formatting.stylua,
-- Python
null_ls.builtins.diagnostics.flake8,
null_ls.builtins.formatting.black,
null_ls.builtins.formatting.isort,
-- PHP
null_ls.builtins.diagnostics.phpstan,
-- Go
null_ls.builtins.formatting.gofmt,
-- Rust
null_ls.builtins.formatting.rustfmt,
},
},
},
{
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
{ "folke/neoconf.nvim", cmd = "Neoconf", config = false, dependencies = { "nvim-lspconfig" } },
{ "folke/neodev.nvim", opts = {} },
"mason.nvim",
"williamboman/mason-lspconfig.nvim",
"hrsh7th/cmp-nvim-lsp",
"b0o/schemastore.nvim",
"jose-elias-alvarez/typescript.nvim",
},
config = config_lsp,
},
}
-- Neovim
require("neodev").setup({})
local servers = {
"clangd",
"pyright",
"rust_analyzer",
"gopls",
"tailwindcss",
"jsonls",
"lua_ls",
}
for _, lsp in pairs(servers) do
require("lspconfig")[lsp].setup(settings)
end
-- JSON
require("lspconfig").jsonls.setup(vim.tbl_deep_extend("force", settings, {
settings = {
json = {
schemas = require("schemastore").json.schemas(),
validate = {
enable = true,
},
},
},
}))
-- Typescript
require("typescript").setup({
disable_commands = false,
debug = false,
server = settings,
})
-- null-ls
local null_ls = require("null-ls")
vim.g.format_on_save = 1
function _G.toggle_format_on_save()
if vim.g.format_on_save == 1 then
vim.g.format_on_save = 0
print("Disabled format on save")
else
vim.g.format_on_save = 1
print("Enabled format on save")
end
end
require("null-ls").setup({
timeout_ms = 5000,
sources = {
-- General
null_ls.builtins.code_actions.refactoring,
null_ls.builtins.completion.spell,
null_ls.builtins.diagnostics.trail_space,
null_ls.builtins.formatting.trim_newlines,
null_ls.builtins.formatting.trim_whitespace,
-- Git
null_ls.builtins.code_actions.gitrebase,
null_ls.builtins.code_actions.gitsigns,
-- GitHub
null_ls.builtins.diagnostics.actionlint,
-- Shell
null_ls.builtins.code_actions.shellcheck,
null_ls.builtins.diagnostics.shellcheck,
null_ls.builtins.formatting.shfmt,
-- C/C++
null_ls.builtins.formatting.clang_format,
null_ls.builtins.formatting.cmake_format,
-- Web
null_ls.builtins.formatting.prettier,
-- null_ls.builtins.code_actions.eslint_d,
null_ls.builtins.code_actions.eslint,
null_ls.builtins.diagnostics.eslint,
-- null_ls.builtins.formatting.eslint,
null_ls.builtins.diagnostics.stylelint,
null_ls.builtins.formatting.stylelint,
null_ls.builtins.formatting.rustywind,
-- Markdown
null_ls.builtins.formatting.remark,
-- Lua
-- null_ls.builtins.diagnostics.luacheck,
null_ls.builtins.formatting.stylua,
-- Python
null_ls.builtins.diagnostics.flake8,
null_ls.builtins.formatting.black,
null_ls.builtins.formatting.isort,
-- PHP
null_ls.builtins.diagnostics.phpstan,
-- Go
null_ls.builtins.formatting.gofmt,
-- Rust
null_ls.builtins.formatting.rustfmt,
},
})
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
vim.bo[args.buf].formatexpr = nil
end,
})
require("nvim-lightbulb").setup({
autocmd = {
enabled = false,
},
sign = {
enabled = false,
},
virtual_text = {
enabled = false,
},
})
require("fidget").setup({})

@ -1,42 +0,0 @@
local lualine = require("lualine")
local conditions = {
buffer_not_empty = function()
return vim.fn.empty(vim.fn.expand("%:t")) ~= 1
end,
}
-- Config
local config = {
options = {
-- Disable sections and component separators
component_separators = "",
section_separators = "",
disabled_filetypes = { "NvimTree" },
globalstatus = true,
theme = tokyonight,
},
sections = {
-- these are to remove the defaults
lualine_a = { "mode" },
lualine_b = { "branch", "diff" },
lualine_c = {},
lualine_x = { "location", "progress" },
lualine_y = { "diagnostics", "filetype" },
lualine_z = {},
},
}
table.insert(config.sections.lualine_c, {
"filename",
condition = conditions.buffer_not_empty,
path = 1,
})
lualine.setup(config)
require("incline").setup({
hide = {
cursorline = true,
},
})

@ -1,179 +1,202 @@
require("zk").setup({ picker = "telescope" })
require("mkdnflow").setup({
mappings = {
MkdnEnter = { { "n", "v" }, "<CR>" },
MkdnTab = false,
MkdnSTab = false,
MkdnNextLink = { "n", "<Tab>" },
MkdnPrevLink = { "n", "<S-Tab>" },
MkdnNextHeading = { "n", "]]" },
MkdnPrevHeading = { "n", "[[" },
MkdnGoBack = { "n", "<BS>" },
MkdnGoForward = { "n", "<Del>" },
MkdnCreateLink = false, -- see MkdnEnter
MkdnCreateLinkFromClipboard = { { "n", "v" }, "<leader>p" }, -- see MkdnEnter
MkdnFollowLink = false, -- see MkdnEnter
MkdnDestroyLink = { "n", "<M-CR>" },
MkdnTagSpan = { "v", "<M-CR>" },
MkdnMoveSource = { "n", "<F2>" },
MkdnYankAnchorLink = { "n", "ya" },
MkdnYankFileAnchorLink = { "n", "yfa" },
MkdnIncreaseHeading = { "n", "+" },
MkdnDecreaseHeading = { "n", "-" },
MkdnToggleToDo = { { "n", "v" }, "<C-Space>" },
MkdnNewListItem = false,
MkdnNewListItemBelowInsert = { "n", "o" },
MkdnNewListItemAboveInsert = { "n", "O" },
MkdnExtendList = false,
-- MkdnUpdateNumbering = { "n", "<leader>nn" },
MkdnUpdateNumbering = false,
MkdnTableNextCell = { "i", "<Tab>" },
MkdnTablePrevCell = { "i", "<S-Tab>" },
MkdnTableNextRow = false,
MkdnTablePrevRow = { "i", "<M-CR>" },
MkdnTableNewRowBelow = { "n", "<leader>ir" },
MkdnTableNewRowAbove = { "n", "<leader>iR" },
MkdnTableNewColAfter = { "n", "<leader>ic" },
MkdnTableNewColBefore = { "n", "<leader>iC" },
MkdnFoldSection = { "n", "<leader>f" },
MkdnUnfoldSection = { "n", "<leader>F" },
},
})
require("clipboard-image").setup({
default = {
img_dir = { "%:p:h", "img" },
img_name = function()
vim.fn.inputsave()
local name = vim.fn.input("Name: ")
vim.fn.inputrestore()
return name
end,
},
})
require("telescope").load_extension("zk")
local init_zk = function()
require("telescope").load_extension("zk")
local wk = require("which-key")
local wk = require("which-key")
wk.register({
n = {
wk.register({
n = {
function()
vim.ui.input({ prompt = "Note title: " }, function(input)
require("zk.commands").get("ZkNew")({ title = input })
end)
end,
"Create new note",
},
d = {
function()
require("zk.commands").get("ZkNew")({ dir = "journal" })
end,
"Create or edit daily note",
},
f = {
function()
require("zk.commands").get("ZkNotes")()
end,
"Find note",
},
i = {
function()
require("zk.commands").get("ZkIndex")()
end,
"Index notes",
},
t = {
function()
require("zk.commands").get("ZkTag")()
end,
"Search by tag",
},
},
}, {
prefix = "<leader>",
})
local augroup = vim.api.nvim_create_augroup("MarkdownZk", {})
local ZK_NOTEBOOK_DIR = vim.env.ZK_NOTEBOOK_DIR
local patt = { ZK_NOTEBOOK_DIR .. "/*.md" }
vim.api.nvim_clear_autocmds({ group = augroup })
vim.api.nvim_create_autocmd("BufEnter", {
group = augroup,
pattern = patt,
callback = function(bufnr)
vim.cmd("lcd %:p:h")
wk.register({
t = {
n = {
function()
require("zk.commands").get("ZkNewFromTitleSelection")()
vim.ui.input({ prompt = "Note title: " }, function(input)
require("zk.commands").get("ZkNew")({ title = input })
end)
end,
"New note (selected as title)",
"Create new note",
},
c = {
d = {
function()
require("zk.commands").get("ZkNewFromContentSelection")()
require("zk.commands").get("ZkNew")({ dir = "journal" })
end,
"New note (selected as content)",
"Create or edit daily note",
},
m = {
f = {
function()
require("zk.commands").get("ZkMatch")()
require("zk.commands").get("ZkNotes")()
end,
"Find note match",
"Find note",
},
i = {
function()
require("zk").pick_notes(nil, nil, function(notes)
local vstartr, vstartc = unpack(vim.api.nvim_win_get_cursor(0))
local _, vendr, vendc, _ = unpack(vim.fn.getpos("v"))
local link = "[" .. notes[1].title .. "](" .. notes[1].path .. ")"
print(vstartr, vstartc, vendr, vendc, vstartc + #link)
vim.api.nvim_buf_set_text(0, vstartr - 1, vstartc - 2, vendr - 1, vendc, { link })
vim.api.nvim_win_set_cursor(0, { vendr, vstartc + #link - 3 })
end)
require("zk.commands").get("ZkIndex")()
end,
"Insert note link",
"Index notes",
},
}, {
mode = "v",
bufnr = bufnr,
prefix = "<localleader>",
})
wk.register({
b = {
t = {
function()
require("zk.commands").get("ZkBacklinks")()
require("zk.commands").get("ZkTag")()
end,
"Show note backlinks",
"Search by tag",
},
l = {
function()
require("zk.commands").get("ZkLinks")()
end,
"Show note links",
},
}, {
prefix = "<leader>",
})
local augroup = vim.api.nvim_create_augroup("MarkdownZk", {})
local ZK_NOTEBOOK_DIR = vim.env.ZK_NOTEBOOK_DIR
local patt = { ZK_NOTEBOOK_DIR .. "/*.md" }
vim.api.nvim_clear_autocmds({ group = augroup })
vim.api.nvim_create_autocmd("BufEnter", {
group = augroup,
pattern = patt,
callback = function(bufnr)
vim.cmd("lcd %:p:h")
wk.register({
t = {
function()
require("zk.commands").get("ZkNewFromTitleSelection")()
end,
"New note (selected as title)",
},
c = {
function()
require("zk.commands").get("ZkNewFromContentSelection")()
end,
"New note (selected as content)",
},
m = {
function()
require("zk.commands").get("ZkMatch")()
end,
"Find note match",
},
i = {
function()
require("zk").pick_notes(nil, nil, function(notes)
local vstartr, vstartc = unpack(vim.api.nvim_win_get_cursor(0))
local _, vendr, vendc, _ = unpack(vim.fn.getpos("v"))
local link = "[" .. notes[1].title .. "](" .. notes[1].path .. ")"
print(vstartr, vstartc, vendr, vendc, vstartc + #link)
vim.api.nvim_buf_set_text(0, vstartr - 1, vstartc - 2, vendr - 1, vendc, { link })
vim.api.nvim_win_set_cursor(0, { vendr, vstartc + #link - 3 })
end)
end,
"Insert note link",
},
}, {
mode = "v",
bufnr = bufnr,
prefix = "<localleader>",
})
wk.register({
b = {
function()
require("zk.commands").get("ZkBacklinks")()
end,
"Show note backlinks",
},
l = {
function()
require("zk.commands").get("ZkLinks")()
end,
"Show note links",
},
i = {
function()
require("zk").pick_notes(nil, nil, function(notes)
local cur = vim.api.nvim_win_get_cursor(0)
local link = "[" .. notes[1].title .. "](" .. notes[1].path .. ")"
vim.api.nvim_buf_set_text(0, cur[1] - 1, cur[2], cur[1] - 1, cur[2], { link })
vim.api.nvim_win_set_cursor(0, { cur[1], cur[2] + #link })
end)
end,
"Insert note link",
},
}, {
mode = "n",
bufnr = bufnr,
prefix = "<localleader>",
})
end,
})
end
return {
{
"jakewvincent/mkdnflow.nvim",
rocks = "luautf8",
opts = {
mappings = {
MkdnEnter = { { "n", "v" }, "<CR>" },
MkdnTab = false,
MkdnSTab = false,
MkdnNextLink = { "n", "<Tab>" },
MkdnPrevLink = { "n", "<S-Tab>" },
MkdnNextHeading = { "n", "]]" },
MkdnPrevHeading = { "n", "[[" },
MkdnGoBack = { "n", "<BS>" },
MkdnGoForward = { "n", "<Del>" },
MkdnCreateLink = false, -- see MkdnEnter
MkdnCreateLinkFromClipboard = { { "n", "v" }, "<leader>p" }, -- see MkdnEnter
MkdnFollowLink = false, -- see MkdnEnter
MkdnDestroyLink = { "n", "<M-CR>" },
MkdnTagSpan = { "v", "<M-CR>" },
MkdnMoveSource = { "n", "<F2>" },
MkdnYankAnchorLink = { "n", "ya" },
MkdnYankFileAnchorLink = { "n", "yfa" },
MkdnIncreaseHeading = { "n", "+" },
MkdnDecreaseHeading = { "n", "-" },
MkdnToggleToDo = { { "n", "v" }, "<C-Space>" },
MkdnNewListItem = false,
MkdnNewListItemBelowInsert = { "n", "o" },
MkdnNewListItemAboveInsert = { "n", "O" },
MkdnExtendList = false,
-- MkdnUpdateNumbering = { "n", "<leader>nn" },
MkdnUpdateNumbering = false,
MkdnTableNextCell = { "i", "<Tab>" },
MkdnTablePrevCell = { "i", "<S-Tab>" },
MkdnTableNextRow = false,
MkdnTablePrevRow = { "i", "<M-CR>" },
MkdnTableNewRowBelow = { "n", "<leader>ir" },
MkdnTableNewRowAbove = { "n", "<leader>iR" },
MkdnTableNewColAfter = { "n", "<leader>ic" },
MkdnTableNewColBefore = { "n", "<leader>iC" },
MkdnFoldSection = { "n", "<leader>f" },
MkdnUnfoldSection = { "n", "<leader>F" },
},
i = {
function()
require("zk").pick_notes(nil, nil, function(notes)
local cur = vim.api.nvim_win_get_cursor(0)
local link = "[" .. notes[1].title .. "](" .. notes[1].path .. ")"
vim.api.nvim_buf_set_text(0, cur[1] - 1, cur[2], cur[1] - 1, cur[2], { link })
vim.api.nvim_win_set_cursor(0, { cur[1], cur[2] + #link })
end)
},
},
{
"ekickx/clipboard-image.nvim",
opts = {
default = {
img_dir = { "%:p:h", "img" },
img_name = function()
vim.fn.inputsave()
local name = vim.fn.input("Name: ")
vim.fn.inputrestore()
return name
end,
"Insert note link",
},
}, {
mode = "n",
bufnr = bufnr,
prefix = "<localleader>",
})
end,
})
},
},
{
"mickael-menu/zk-nvim",
init = init_zk,
config = function(_, opts)
require("zk").setup(opts)
end,
opts = {
picker = "telescope",
},
dependencies = {
"nvim-telescope/telescope.nvim",
},
},
}

@ -1,120 +0,0 @@
local utils = require("utils")
local lspkind = require("lspkind")
local luasnip = require("luasnip")
local cmp = require("cmp")
local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
utils.opt("o", "completeopt", "menu,menuone,noselect")
cmp.setup({
confirm_opts = {
behavior = cmp.ConfirmBehavior.Replace,
select = false,
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
formatting = {
format = lspkind.cmp_format({
mode = "symbol_text",
maxwidth = 50,
before = function(_, vim_item)
return vim_item
end,
}),
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({
select = false,
}),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
-- cmp.complete()
fallback()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
}),
sources = cmp.config.sources({
{ name = "copilot" },
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "nvim_lsp_signature_help" },
{ name = "nvim_lua" },
{ name = "orgmode" },
{ name = "path" },
{ name = "buffer" },
}),
})
-- Set configuration for specific filetype.
cmp.setup.filetype("gitcommit", {
sources = cmp.config.sources({
{ name = "cmp_git" },
}, {
{ name = "buffer" },
}),
})
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ "/", "?" }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{
name = "buffer",
},
},
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{
name = "path",
},
}, {
{
name = "cmdline",
},
}),
})
require("cmp_git").setup()
require("copilot").setup({
suggestion = { enabled = false },
panel = { enabled = false },
})
require("copilot_cmp").setup()

@ -1,85 +0,0 @@
local wk = require("which-key")
wk.register({
o = {
p = { "<cmd>NvimTreeToggle<CR>", "Open project sidebar" },
},
}, {
prefix = "<leader>",
})
require("nvim-tree").setup({
auto_reload_on_write = true,
create_in_closed_folder = false,
disable_netrw = false,
hijack_netrw = true,
hijack_unnamed_buffer_when_opening = false,
open_on_tab = false,
sort_by = "name",
update_cwd = true,
reload_on_bufenter = false,
respect_buf_cwd = true,
hijack_cursor = false,
update_focused_file = {
enable = true,
update_cwd = true,
ignore_list = {},
},
system_open = {
cmd = nil,
args = {},
},
view = {
width = 30,
side = "left",
signcolumn = "no",
mappings = {
custom_only = false,
list = {},
},
},
git = {
ignore = false,
},
renderer = {
special_files = {},
group_empty = false,
highlight_git = true,
icons = {
git_placement = "before",
show = {
file = true,
folder = true,
folder_arrow = true,
git = true,
},
glyphs = {
default = "",
symlink = "",
git = {
unstaged = "",
staged = "",
unmerged = "",
renamed = "",
untracked = "",
deleted = "",
ignored = "",
},
},
},
},
diagnostics = {
enable = false,
show_on_dirs = false,
icons = {
hint = "",
info = "",
warning = "",
error = "",
},
},
trash = {
cmd = "trash",
require_confirm = true,
},
})

@ -1,34 +0,0 @@
local utils = require("utils")
local tsconf = require("nvim-treesitter.configs")
require("orgmode").setup_ts_grammar()
require("nvim-ts-autotag").setup()
if not tsconf then
vim.cmd([[ echom 'Cannot load `nvim-treesitter.configs`' ]])
return
end
tsconf.setup({
ensure_installed = "all",
ignore_install = { "phpdoc" },
highlight = {
enable = true,
additional_vim_regex_highlighting = { "org" },
},
indent = {
enable = true,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
},
},
context_commentstring = {
enable = true,
},
})

@ -1,44 +0,0 @@
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
vim.o.foldenable = true
vim.o.foldmethod = "manual"
vim.o.foldcolumn = "1"
vim.o.foldlevel = 99
vim.o.foldlevelstart = 99
local handler = function(virtText, lnum, endLnum, width, truncate)
local newVirtText = {}
local suffix = ("  %d "):format(endLnum - lnum)
local sufWidth = vim.fn.strdisplaywidth(suffix)
local targetWidth = width - sufWidth
local curWidth = 0
for _, chunk in ipairs(virtText) do
local chunkText = chunk[1]
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
if targetWidth > curWidth + chunkWidth then
table.insert(newVirtText, chunk)
else
chunkText = truncate(chunkText, targetWidth - curWidth)
local hlGroup = chunk[2]
table.insert(newVirtText, { chunkText, hlGroup })
chunkWidth = vim.fn.strdisplaywidth(chunkText)
-- str width returned from truncate() may less than 2nd argument, need padding
if curWidth + chunkWidth < targetWidth then
suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth)
end
break
end
curWidth = curWidth + chunkWidth
end
table.insert(newVirtText, { suffix, "MoreMsg" })
return newVirtText
end
vim.keymap.set("n", "zR", require("ufo").openAllFolds)
vim.keymap.set("n", "zM", require("ufo").closeAllFolds)
require("ufo").setup({
provider_selector = function()
return { "treesitter", "indent" }
end,
})

@ -1,3 +0,0 @@
require'nvim-web-devicons'.setup {
default = true;
}

@ -1,46 +0,0 @@
local wk = require("which-key")
require("orgmode").setup({
org_agenda_files = {
"~/.org/work/*",
"~/org/learning/*",
"~/.org/projects/*",
"~/.org/calendars/*",
"~/.org/conferences/*",
},
org_default_notes_file = "~/.org/refile.org",
})
vim.api.nvim_create_autocmd("BufEnter", {
pattern = "*.org",
callback = function()
vim.wo.foldexpr = "nvim_treesitter#foldexpr()"
vim.wo.foldmethod = "expr"
end,
})
local wk_open_org_agenda = {
[[<cmd>lua require('orgmode').action("agenda.prompt")<CR>]],
"Org agenda",
}
wk.register({
O = {
name = "Org mode",
a = wk_open_org_agenda,
f = {
[[<cmd>lua require('telescope.builtin').find_files{ cwd = '~/.org' }<CR>]],
"Find file in notes",
},
n = {
[[<cmd>lua require('orgmode').action("capture.prompt")<CR>]],
"Org capture",
},
s = {
[[<cmd>lua require('telescope.builtin').live_grep{ cwd = '~/.org' }<CR>]],
"Search notes",
},
},
}, {
prefix = "<leader>",
})

@ -1,20 +0,0 @@
require("project_nvim").setup({
manual_mode = false,
detection_methods = { "lsp", "pattern" },
patterns = {
".git",
"_darcs",
".hg",
".bzr",
".svn",
"Makefile",
"package.json",
".luarc.json",
".zk",
},
ignore_lsp = {},
exclude_dirs = {},
show_hidden = true,
silent_chdir = true,
datapath = vim.fn.stdpath("data"),
})

@ -0,0 +1,26 @@
return {
{
-- "ahmedkhalf/project.nvim",
"hawk78/project.nvim",
config = function(_, opts)
require("project_nvim").setup(opts)
end,
opts = {
manual_mode = true,
detection_methods = { "lsp", "pattern" },
patterns = {
".git",
"Makefile",
"package.json",
".luarc.json",
"lazy-lock.json",
".zk",
},
ignore_lsp = {},
exclude_dirs = {},
show_hidden = true,
silent_chdir = true,
datapath = vim.fn.stdpath("data"),
},
},
}

@ -1,60 +1,68 @@
require("rest-nvim").setup({
-- Open request results in a horizontal split
result_split_horizontal = false,
-- Keep the http file buffer above|left when split horizontal|vertical
result_split_in_place = false,
-- Skip SSL verification, useful for unknown certificates
skip_ssl_verification = false,
-- Encode URL before making request
encode_url = true,
-- Highlight request on run
highlight = {
enabled = true,
timeout = 150,
},
result = {
-- toggle showing URL, HTTP info, headers at top the of result window
show_url = true,
show_http_info = true,
show_headers = true,
-- executables or functions for formatting response body [optional]
-- set them to false if you want to disable them
formatters = {
json = "jq",
html = function(body)
return vim.fn.system({ "tidy", "-i", "-q", "-" }, body)
end,
local config = function()
require("rest-nvim").setup({
-- Open request results in a horizontal split
result_split_horizontal = false,
-- Keep the http file buffer above|left when split horizontal|vertical
result_split_in_place = false,
-- Skip SSL verification, useful for unknown certificates
skip_ssl_verification = false,
-- Encode URL before making request
encode_url = true,
-- Highlight request on run
highlight = {
enabled = true,
timeout = 150,
},
},
-- Jump to request line on run
jump_to_request = false,
env_file = ".env",
custom_dynamic_variables = {},
yank_dry_run = true,
})
result = {
-- toggle showing URL, HTTP info, headers at top the of result window
show_url = true,
show_http_info = true,
show_headers = true,
-- executables or functions for formatting response body [optional]
-- set them to false if you want to disable them
formatters = {
json = "jq",
html = function(body)
return vim.fn.system({ "tidy", "-i", "-q", "-" }, body)
end,
},
},
-- Jump to request line on run
jump_to_request = false,
env_file = ".env",
custom_dynamic_variables = {},
yank_dry_run = true,
})
local wk = require("which-key")
local wk = require("which-key")
local augroup = vim.api.nvim_create_augroup("RestNvim", {})
vim.api.nvim_clear_autocmds({ group = augroup })
vim.api.nvim_create_autocmd("BufEnter", {
group = augroup,
pattern = { "*.http" },
callback = function(bufnr)
wk.register({
r = {
"<Plug>RestNvim",
"Run the request under the cursor",
},
p = {
"<Plug>RestNvimPreview",
"Preview the request cURL command",
},
l = { "<Plug>RestNvimLast", "Re-run the last request" },
}, {
mode = "n",
bufnr = bufnr,
prefix = "<localleader>",
})
end,
})
local augroup = vim.api.nvim_create_augroup("RestNvim", {})
vim.api.nvim_clear_autocmds({ group = augroup })
vim.api.nvim_create_autocmd("BufEnter", {
group = augroup,
pattern = { "*.http" },
callback = function(bufnr)
wk.register({
r = {
"<Plug>RestNvim",
"Run the request under the cursor",
},
p = {
"<Plug>RestNvimPreview",
"Preview the request cURL command",
},
l = { "<Plug>RestNvimLast", "Re-run the last request" },
}, {
mode = "n",
bufnr = bufnr,
prefix = "<localleader>",
})
end,
})
end
return {
"rest-nvim/rest.nvim",
init = setup,
event = "BufEnter *.lua",
}

@ -1,13 +0,0 @@
local wk = require("which-key")
wk.register({
f = {
r = {"<cmd>RnvimrToggle<CR>", "Toggle Ranger"}
}
}, {
prefix = "<leader>"
})
vim.g.rnvimr_enable_ex = 0
vim.g.rnvimr_enable_picker = 1
vim.g.rnvimr_enable_bw = 0

@ -0,0 +1,44 @@
return {
{
"b0o/incline.nvim",
opts = {
hide = {
cursorline = true,
},
},
lazy = false,
config = true,
},
{
"hoob3rt/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {
options = {
-- Disable sections and component separators
component_separators = "",
section_separators = "",
disabled_filetypes = { "neo-tree" },
globalstatus = true,
theme = "tokyonight",
},
sections = {
-- these are to remove the defaults
lualine_a = { "mode" },
lualine_b = { "branch", "diff" },
lualine_c = {
{
"filename",
condition = function()
return vim.fn.empty(vim.fn.expand("%:t")) ~= 1
end,
path = 1,
},
},
lualine_x = { "location", "progress" },
lualine_y = { "diagnostics", "filetype" },
lualine_z = {},
},
},
config = true,
},
}

@ -1,108 +0,0 @@
local wk = require("which-key")
local actions = require("telescope.actions")
local M = {}
M.project_files = function()
local opts = {}
local ok = pcall(require("telescope.builtin").git_files, opts)
if not ok then
require("telescope.builtin").find_files(opts)
end
end
M.file_browser = function()
require("telescope").extensions.file_browser.file_browser({
cwd = vim.fn.expand("%:p:h"),
})
end
require("telescope").setup({
defaults = {
mappings = {
i = {
["<esc>"] = actions.close,
},
},
},
pickers = {
git_files = {
show_untracked = true,
},
find_files = {
hidden = true,
follow = true,
},
live_grep = {
hidden = true,
follow = true,
},
},
extensions = {
file_browser = {
hidden = true,
follow = true,
},
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case",
},
},
})
require("telescope").load_extension("file_browser")
require("telescope").load_extension("ui-select")
require("telescope").load_extension("fzf")
require("telescope").load_extension("projects")
local browse_files = {
function()
M.file_browser()
end,
"Browse files",
}
local find_file_in_project = {
function()
M.project_files()
end,
"Find file in project",
}
wk.register({
f = {
f = { "<cmd>Telescope find_files<cr>", "Find file" },
p = {
[[<cmd>lua require('telescope.builtin').git_files{ cwd = '~/.config/nvim/' }<CR>]],
"Find config file",
},
o = { "<cmd>Telescope oldfiles<cr>", "Open recent file" },
b = browse_files,
},
b = {
b = { "<cmd>Telescope buffers<CR>", "Switch buffer" },
},
h = {
h = { "<cmd>Telescope help_tags<CR>", "Vim help tags" },
m = { "<cmd>Telescope man_pages<CR>", "Man pages" },
},
p = {
p = { "<cmd>Telescope projects<CR>", "Switch to project" },
f = find_file_in_project,
},
g = {
c = { "<cmd>Telescope git_commits<CR>", "Checkout commit" },
C = { "<cmd>Telescope git_bcommits<CR>", "Checkout buffer commit" },
B = { "<cmd>Telescope git_branches<CR>", "Switch branch" },
s = { "<cmd>Telescope git_stash<CR>", "Apply stash" },
},
["<space>"] = find_file_in_project,
["."] = browse_files,
[","] = { "<cmd>Telescope buffers<CR>", "Switch buffer" },
["/"] = { "<cmd>Telescope live_grep<CR>", "Live grep" },
}, {
prefix = "<leader>",
})
return M

@ -1,42 +1,49 @@
require("toggleterm").setup({
hide_numbers = true,
shade_terminals = true,
start_in_insert = true,
direction = "horizontal",
close_on_exit = false,
})
local init = function()
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new({
count = 999,
cmd = "lazygit",
hidden = true,
direction = "tab",
on_open = function(term)
vim.cmd("startinsert!")
vim.api.nvim_buf_set_keymap(term.bufnr, "t", "<esc>", "<esc>", { noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(term.bufnr, "t", "<C-c>", "", {
callback = function()
term:toggle()
end,
noremap = true,
silent = true,
})
end,
})
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new({
count = 999,
cmd = "lazygit",
hidden = true,
direction = "tab",
on_open = function(term)
vim.cmd("startinsert!")
vim.api.nvim_buf_set_keymap(term.bufnr, "t", "<esc>", "<esc>", { noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(term.bufnr, "t", "<C-c>", "", {
callback = function()
term:toggle()
end,
noremap = true,
silent = true,
})
end,
})
local wk = require("which-key")
local wk = require("which-key")
wk.register({
g = {
g = {
function()
lazygit:toggle()
end,
"Open lazygit",
},
},
o = {
t = { '<cmd>exe v:count1 . "ToggleTerm"<CR>', "Open terminal" },
},
}, { prefix = "<leader>" })
end
wk.register({
g = {
g = {
function()
lazygit:toggle()
end,
"Open lazygit",
},
},
o = {
t = { '<cmd>exe v:count1 . "ToggleTerm"<CR>', "Open terminal" },
},
}, { prefix = "<leader>" })
return {
"akinsho/toggleterm.nvim",
version = "*",
init = init,
opts = {
hide_numbers = true,
shade_terminals = true,
start_in_insert = true,
direction = "horizontal",
close_on_exit = false,
},
}

@ -1,57 +1,71 @@
local wk = require("which-key")
local init = function()
local wk = require("which-key")
require("neotest").setup({
adapters = {
require("neotest-jest"),
require("neotest-python"),
require("neotest-go"),
},
})
local run_current_test_keybiding = {
function()
require("neotest").run.run()
end,
"Current test",
}
local run_current_test_keybiding = {
function()
require("neotest").run.run()
end,
"Current test",
}
local keybindings = {
name = "Test",
t = run_current_test_keybiding,
T = {
function()
require("neotest").run.run(vim.fn.expand("%"))
end,
"Current file",
},
d = {
function()
require("neotest").run.run({ strategy = "dap" })
end,
"Debug current test",
},
s = {
function()
require("neotest").run.stop()
end,
"Stop running test",
},
a = {
function()
require("neotest").run.attach()
end,
"Attach to running test",
},
}
local keybindings = {
name = "Test",
t = run_current_test_keybiding,
T = {
function()
require("neotest").run.run(vim.fn.expand("%"))
end,
"Current file",
},
d = {
function()
require("neotest").run.run({ strategy = "dap" })
end,
"Debug current test",
},
s = {
function()
require("neotest").run.stop()
end,
"Stop running test",
},
a = {
function()
require("neotest").run.attach()
end,
"Attach to running test",
},
}
wk.register({
r = {
t = run_current_test_keybiding,
T = keybindings,
},
c = {
T = keybindings,
},
}, {
prefix = "<leader>",
})
end
wk.register({
r = {
t = run_current_test_keybiding,
T = keybindings,
},
c = {
T = keybindings,
},
}, {
prefix = "<leader>",
})
return {
{
"nvim-neotest/neotest",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"nvim-neotest/neotest-jest",
"nvim-neotest/neotest-go",
"nvim-neotest/neotest-python",
},
opts = {
adapters = {
require("neotest-jest"),
require("neotest-python"),
require("neotest-go"),
},
},
},
}

@ -0,0 +1,115 @@
return {
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local configs = require("nvim-treesitter.configs")
if not configs then
vim.cmd([[ echom 'Cannot load `nvim-treesitter.configs`' ]])
return
end
require("orgmode").setup_ts_grammar()
require("nvim-ts-autotag").setup()
configs.setup({
ensure_installed = {
"arduino",
"bash",
"bibtex",
"c",
"c_sharp",
"cmake",
"clojure",
"commonlisp",
"cpp",
"css",
"csv",
"dart",
"diff",
"dockerfile",
"dot",
"fennel",
"fish",
"gdscript",
"git_config",
"git_rebase",
"gitattributes",
"gitcommit",
"gitignore",
"go",
"gpg",
"graphql",
"html",
"http",
"ini",
"java",
"javascript",
"jq",
"jsdoc",
"json",
"json5",
"jsonc",
"kotlin",
"latex",
"llvm",
"lua",
"luadoc",
"luap",
"luau",
"make",
"markdown",
"markdown_inline",
"meson",
"ninja",
"nix",
"pem",
"perl",
"php",
"python",
"requirements",
"ruby",
"rust",
"scss",
"sql",
"toml",
"tsx",
"typescript",
"vim",
"vimdoc",
"vue",
"xml",
"yaml",
},
highlight = {
enable = true,
additional_vim_regex_highlighting = { "org" },
},
indent = {
enable = true,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
},
},
context_commentstring = {
enable = true,
},
autotag = {
enable = true,
},
})
end,
dependencies = {
"JoosepAlviste/nvim-ts-context-commentstring",
"windwp/nvim-ts-autotag",
"nvim-orgmode/orgmode",
},
},
}

@ -1,19 +0,0 @@
require("twilight").setup({
treesitter = true,
expand = {
"function",
"method",
"table",
"if_statement",
},
})
local wk = require("which-key")
wk.register({
t = {
t = { "<cmd>Twilight<CR>", "Twilight" },
},
}, {
prefix = "<leader>",
})

@ -0,0 +1,29 @@
return {
{
"echasnovski/mini.nvim",
branch = "stable",
config = function()
require("mini.jump").setup({})
require("mini.bufremove").setup({})
end,
},
{
"ggandor/leap.nvim",
dependencies = {
"tpope/vim-repeat",
},
config = function()
require("leap").add_default_mappings()
end,
},
"dhruvasagar/vim-table-mode",
"tpope/vim-eunuch",
{
"ThePrimeagen/refactoring.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
config = true,
},
}

@ -1,76 +0,0 @@
local wk = require("which-key")
wk.setup()
wk.register({
f = {
name = "File",
C = {
function()
vim.api.nvim_input(":Copy " .. vim.fn.expand("%"))
end,
"Copy file",
},
R = {
function()
vim.api.nvim_input(":Move " .. vim.fn.expand("%"))
end,
"Rename/move file",
},
D = {
function()
vim.api.nvim_input(":Delete")
end,
"Delete file",
},
P = {
function()
print(vim.fn.expand("%:p"))
end,
"Print absolute path",
},
},
b = {
name = "Buffer",
d = { "<cmd>bdel<CR>", "Delete buffer" },
s = { "<cmd>write<CR>", "Save buffer" },
},
c = {
name = "Code",
},
h = {
name = "Help",
},
p = {
name = "Project",
},
n = {
name = "Note",
},
t = {
name = "Toggle",
},
g = {
name = "Git",
},
r = {
name = "Run",
},
o = {
name = "Open",
t = { '<cmd>exe v:count1 . "ToggleTerm"<CR>', "Open terminal" },
T = { "<cmd>terminal<CR>", "Open terminal here" },
},
w = {
name = "Window",
d = { "<cmd>close<CR>", "Close window" },
v = { "<cmd>vsplit<CR>", "Vertical split" },
s = { "<cmd>split<CR>", "Horizontal split" },
},
q = {
name = "Quit",
q = { "<cmd>qa<CR>", "Quit nvim" },
},
}, {
prefix = "<leader>",
})

@ -1,11 +0,0 @@
require("zen-mode").setup()
local wk = require('which-key')
wk.register({
t = {
z = {"<cmd>ZenMode<CR>", "Zen mode"}
}
}, {
prefix = "<leader>"
})

@ -1,33 +1,31 @@
local utils = require("utils")
local cmd = vim.cmd
local indent = 2
cmd("syntax enable")
cmd("filetype plugin indent on")
utils.opt("b", "expandtab", true)
utils.opt("b", "shiftwidth", indent)
utils.opt("b", "smartindent", false)
utils.opt("b", "autoindent", true)
utils.opt("b", "softtabstop", indent)
utils.opt("b", "tabstop", indent)
utils.opt("o", "hidden", true)
utils.opt("w", "wrap", true)
utils.opt("o", "ignorecase", true)
utils.opt("o", "scrolloff", 10)
utils.opt("o", "shiftround", true)
utils.opt("o", "smartcase", true)
utils.opt("o", "splitbelow", true)
utils.opt("o", "splitright", true)
utils.opt("w", "number", true)
utils.opt("w", "relativenumber", true)
utils.opt("w", "cursorline", true)
utils.opt("o", "clipboard", "unnamed,unnamedplus")
utils.opt("o", "lazyredraw", true)
utils.opt("b", "undofile", true)
utils.opt("o", "mouse", "a")
utils.opt("o", "scrolloff", 10)
utils.opt("o", "laststatus", 3)
vim.cmd("syntax enable")
vim.cmd("filetype plugin indent on")
vim.o.expandtab = true
vim.o.shiftwidth = indent
vim.o.smartindent = false
vim.o.autoindent = true
vim.o.softtabstop = indent
vim.o.tabstop = indent
vim.o.hidden = true
vim.o.wrap = true
vim.o.ignorecase = true
vim.o.scrolloff = 10
vim.o.shiftround = true
vim.o.smartcase = true
vim.o.splitbelow = true
vim.o.splitright = true
vim.o.number = true
vim.o.relativenumber = true
vim.o.cursorline = true
vim.o.clipboard = "unnamed,unnamedplus"
vim.o.lazyredraw = true
vim.o.undofile = true
vim.o.mouse = "a"
vim.o.scrolloff = 10
vim.o.laststatus = 3
vim.o.termguicolors = true
vim.g.maplocalleader = ","
@ -37,14 +35,14 @@ vim.cmd("au TextYankPost * lua vim.highlight.on_yank {on_visual = false}")
-- Terminal
vim.api.nvim_create_augroup("Terminal", { clear = true })
vim.api.nvim_create_autocmd("TermOpen", {
group = "Terminal",
pattern = "*",
callback = function()
-- vim.bo.filetype = "terminal"
vim.api.nvim_buf_set_keymap(0, "t", "<esc>", [[<C-\><C-n>]], { noremap = true })
vim.cmd("startinsert")
end,
group = "Terminal",
pattern = "*",
callback = function()
-- vim.bo.filetype = "terminal"
vim.api.nvim_buf_set_keymap(0, "t", "<esc>", [[<C-\><C-n>]], { noremap = true })
vim.cmd("startinsert")
end,
})
require("keybindings")
require("colorscheme")
vim.g.tokyonight_style = "night"
vim.cmd("colorscheme tokyonight")

@ -1,15 +0,0 @@
local utils = { }
local scopes = {o = vim.o, b = vim.bo, w = vim.wo}
function utils.opt(scope, key, value)
scopes[scope][key] = value
if scope ~= 'o' then scopes['o'][key] = value end
end
function utils.map(mode, lhs, rhs, opts)
opts = opts or { noremap = true }
vim.api.nvim_set_keymap(mode, lhs, rhs, opts)
end
return utils
Loading…
Cancel
Save