merge
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
{
|
||||
|
||||
options.custom = {
|
||||
nvim.enable = lib.mkEnableOption "enable nvim - symlink config files";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.custom.nvim.enable {
|
||||
home.packages = with pkgs; [
|
||||
neovim
|
||||
fzf
|
||||
];
|
||||
|
||||
xdg.configFile."nvim".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos-config/modules/home-manager/nvim/nvim";
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
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 stayle release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
vim.g.language = "en_US"
|
||||
|
||||
require("lazy").setup("plugins")
|
||||
require("jpporta.autocommands")
|
||||
require("jpporta.remaps")
|
||||
require("jpporta.sets")
|
||||
require("jpporta.lsp")
|
||||
require("jpporta.theme")
|
||||
require("jpporta.snippets")
|
||||
require("jpporta.macros")
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" },
|
||||
"base16-nvim": { "branch": "master", "commit": "21233d5fd574439ae1e2f5e4bfbc574214f4ab3d" },
|
||||
"catppuccin": { "branch": "main", "commit": "05e8787020dcfdb937bf2ff23855ea2415b4e072" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"cobalt2.nvim": { "branch": "main", "commit": "0cc17f3491feba19ed62b2d9622577f7822a0113" },
|
||||
"colorbuddy.nvim": { "branch": "master", "commit": "cdb5b0654d3cafe61d2a845e15b2b4b0e78e752a" },
|
||||
"copilot.vim": { "branch": "release", "commit": "a12fd5672110c8aa7e3c8419e28c96943ca179be" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
|
||||
"dracula.nvim": { "branch": "main", "commit": "ae752c13e95fb7c5f58da4b5123cb804ea7568ee" },
|
||||
"everforest": { "branch": "master", "commit": "85a86eb62409e3ec88713bff3d1b9d7374e112e4" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
|
||||
"git-blame.nvim": { "branch": "main", "commit": "5c536e2d4134d064aa3f41575280bc8a2a0e03d7" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "eb60cc7b94c46005237fd34170d76f3a089a90aa" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "154eb5ff5b96d0641307113fa385eaf0d36d9796" },
|
||||
"icalendar.vim": { "branch": "master", "commit": "542fff45385b1b5ad9781b0ad4878ba3b7ee9d5f" },
|
||||
"kanagawa.nvim": { "branch": "master", "commit": "bb85e4bfc8d89b0e62c8fa53ccdd13d12e2f77b3" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||
"lazygit.nvim": { "branch": "main", "commit": "a04ad0dbc725134edbee3a5eea29290976695357" },
|
||||
"leetcode.nvim": { "branch": "master", "commit": "4e8b3683940a8377379ce9398e7f329e3560b42c" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "c7274c48137396526b59d86232eabcdc7fed8a32" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" },
|
||||
"lush.nvim": { "branch": "main", "commit": "9c60ec2279d62487d942ce095e49006af28eed6e" },
|
||||
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
||||
"marks.nvim": { "branch": "master", "commit": "f353e8c08c50f39e99a9ed474172df7eddd89b72" },
|
||||
"mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" },
|
||||
"mini.comment": { "branch": "main", "commit": "27a29d6b949b9497f80a0a03421e89fed71d8c37" },
|
||||
"mini.nvim": { "branch": "main", "commit": "928971c3cfe99ddf29659acc31214cfa836fabe4" },
|
||||
"monochrome.nvim": { "branch": "main", "commit": "2de78d9688ea4a177bcd9be554ab9192337d35ff" },
|
||||
"monokai.nvim": { "branch": "master", "commit": "b8bd44d5796503173627d7a1fc51f77ec3a08a63" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "ebd66767191714e008ce73b769518a763ff31bdc" },
|
||||
"neoformat": { "branch": "master", "commit": "9d95e5ca3ab263363758d5b1d7a174a30556ab2d" },
|
||||
"neovim": { "branch": "main", "commit": "ff483051a47e27d84bdef47703538df1ed9f4a47" },
|
||||
"neovim-ayu": { "branch": "master", "commit": "e5a9f0fa2918d6b5f57c21b3ac014314ee5e41c8" },
|
||||
"nightfox.nvim": { "branch": "main", "commit": "4dacd3f0185a2227bdf3b6c0975a8f0bf87cac9a" },
|
||||
"none-ls-extras.nvim": { "branch": "main", "commit": "27681d797a26f1b4d6119296df42f5204c88a2dc" },
|
||||
"none-ls.nvim": { "branch": "main", "commit": "01f8e62ea11603e59ad9ff7afcfa94fd183f76d6" },
|
||||
"nord.nvim": { "branch": "master", "commit": "80c1e5321505aeb22b7a9f23eb82f1e193c12470" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "664c0b7cea1de71f8b65dfe951b7996fc3e6ccde" },
|
||||
"nvim-lsp-file-operations": { "branch": "master", "commit": "b9c795d3973e8eec22706af14959bc60c579e771" },
|
||||
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
|
||||
"nvim-parinfer": { "branch": "master", "commit": "3968e669d9f02589aa311d33cb475b16b27c5fbb" },
|
||||
"nvim-silicon": { "branch": "main", "commit": "7f66bda8f60c97a5bf4b37e5b8acb0e829ae3c32" },
|
||||
"nvim-snazzy": { "branch": "main", "commit": "2d53dc44eac2e13cb205270cb534a500971d3ad5" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "dad71387de386a946b123079d0e53f23028f3abd" },
|
||||
"oil.nvim": { "branch": "master", "commit": "b73018b75affd13fa38e2fc94ef753b465f770d7" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
||||
"quicker.nvim": { "branch": "master", "commit": "4a6883cb13fe097a20a046eb55f6dffd239276e3" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "f422cb5c6855f150e2ddcfaf44e7157b98b34f6a" },
|
||||
"rustaceanvim": { "branch": "main", "commit": "3ace64feb1ce3cf3c63e6297e1378a82fe548618" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "882c996cf28183f4d63640de0b4c02ec886d01f2" },
|
||||
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" },
|
||||
"telescope-emoji": { "branch": "master", "commit": "86248d97be84a1ce83f0541500ef9edc99ea2aa1" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" },
|
||||
"transparent.nvim": { "branch": "main", "commit": "e00ca1cf09caef575edf8da7e5a8b9193893b4c7" },
|
||||
"vim-markdown": { "branch": "master", "commit": "f9f845f28f4da33a7655accb22f4ad21f7d9fb66" },
|
||||
"vim-polyglot": { "branch": "master", "commit": "f061eddb7cdcc614c8406847b2bfb53099832a4e" },
|
||||
"vim-tmux-navigator": { "branch": "master", "commit": "e41c431a0c7b7388ae7ba341f01a0d217eb3a432" },
|
||||
"vimwiki": { "branch": "dev", "commit": "a54a3002e229c4b43d69ced170ff77663a5b2c40" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" },
|
||||
"zk": { "branch": "main", "commit": "bca7e4a119353f18f2a819385fb7ce10269ef747" }
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
return {
|
||||
cmd = { 'gopls' },
|
||||
filetypes = {
|
||||
'go',
|
||||
'gomod',
|
||||
'gowork',
|
||||
'gotmpl',
|
||||
'gosum'
|
||||
},
|
||||
root_markers = {
|
||||
'go.mod',
|
||||
'go.work',
|
||||
'.git'
|
||||
},
|
||||
settings = {
|
||||
gopls = {
|
||||
gofumpt = true,
|
||||
hints = {
|
||||
assignVariableTypes = true,
|
||||
compositeLiteralFields = true,
|
||||
compositeLiteralTypes = true,
|
||||
functionTypeParameters = true,
|
||||
parameterNames = true,
|
||||
rangeVariableTypes = true,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
local function insert_package_json(root_files, field, fname)
|
||||
local pkg_path = vim.fs.find("package.json", { upward = true, path = fname })[1]
|
||||
if pkg_path then
|
||||
local ok, content = pcall(vim.fn.readfile, pkg_path)
|
||||
if ok then
|
||||
local json = table.concat(content, "\n")
|
||||
if string.find(json, '"' .. field .. '"') then
|
||||
table.insert(root_files, pkg_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
return root_files
|
||||
end
|
||||
|
||||
local function root_markers_with_field(root_files, files, field, fname)
|
||||
for _, f in ipairs(files) do
|
||||
local path = vim.fs.find(f, { upward = true, path = fname })[1]
|
||||
if path then
|
||||
local ok, content = pcall(vim.fn.readfile, path)
|
||||
if ok then
|
||||
local text = table.concat(content, "\n")
|
||||
if string.find(text, field) then
|
||||
table.insert(root_files, path)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return root_files
|
||||
end
|
||||
---@brief
|
||||
--- https://github.com/tailwindlabs/tailwindcss-intellisense
|
||||
---
|
||||
--- Tailwind CSS Language Server can be installed via npm:
|
||||
---
|
||||
--- npm install -g @tailwindcss/language-server
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { "tailwindcss-language-server", "--stdio" },
|
||||
-- filetypes copied and adjusted from tailwindcss-intellisense
|
||||
filetypes = {
|
||||
-- html
|
||||
"aspnetcorerazor",
|
||||
"astro",
|
||||
"astro-markdown",
|
||||
"blade",
|
||||
"clojure",
|
||||
"django-html",
|
||||
"htmldjango",
|
||||
"edge",
|
||||
"eelixir", -- vim ft
|
||||
"elixir",
|
||||
"ejs",
|
||||
"erb",
|
||||
"eruby", -- vim ft
|
||||
"gohtml",
|
||||
"gohtmltmpl",
|
||||
"haml",
|
||||
"handlebars",
|
||||
"hbs",
|
||||
"html",
|
||||
"htmlangular",
|
||||
"html-eex",
|
||||
"heex",
|
||||
"jade",
|
||||
"leaf",
|
||||
"liquid",
|
||||
"markdown",
|
||||
"mdx",
|
||||
"mustache",
|
||||
"njk",
|
||||
"nunjucks",
|
||||
"php",
|
||||
"razor",
|
||||
"slim",
|
||||
"twig",
|
||||
-- css
|
||||
"css",
|
||||
"less",
|
||||
"postcss",
|
||||
"sass",
|
||||
"scss",
|
||||
"stylus",
|
||||
"sugarss",
|
||||
-- js
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"reason",
|
||||
"rescript",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
-- mixed
|
||||
"vue",
|
||||
"svelte",
|
||||
"templ",
|
||||
},
|
||||
settings = {
|
||||
tailwindCSS = {
|
||||
validate = true,
|
||||
lint = {
|
||||
cssConflict = "warning",
|
||||
invalidApply = "error",
|
||||
invalidScreen = "error",
|
||||
invalidVariant = "error",
|
||||
invalidConfigPath = "error",
|
||||
invalidTailwindDirective = "error",
|
||||
recommendedVariantOrder = "warning",
|
||||
},
|
||||
classAttributes = {
|
||||
"class",
|
||||
"className",
|
||||
"class:list",
|
||||
"classList",
|
||||
"ngClass",
|
||||
},
|
||||
includeLanguages = {
|
||||
eelixir = "html-eex",
|
||||
elixir = "phoenix-heex",
|
||||
eruby = "erb",
|
||||
heex = "phoenix-heex",
|
||||
htmlangular = "html",
|
||||
templ = "html",
|
||||
},
|
||||
},
|
||||
},
|
||||
before_init = function(_, config)
|
||||
if not config.settings then
|
||||
config.settings = {}
|
||||
end
|
||||
if not config.settings.editor then
|
||||
config.settings.editor = {}
|
||||
end
|
||||
if not config.settings.editor.tabSize then
|
||||
config.settings.editor.tabSize = vim.lsp.util.get_effective_tabstop()
|
||||
end
|
||||
end,
|
||||
workspace_required = true,
|
||||
root_dir = function(bufnr, on_dir)
|
||||
local root_files = {
|
||||
-- Generic
|
||||
"tailwind.config.js",
|
||||
"tailwind.config.cjs",
|
||||
"tailwind.config.mjs",
|
||||
"tailwind.config.ts",
|
||||
"postcss.config.js",
|
||||
"postcss.config.cjs",
|
||||
"postcss.config.mjs",
|
||||
"postcss.config.ts",
|
||||
-- Django
|
||||
"theme/static_src/tailwind.config.js",
|
||||
"theme/static_src/tailwind.config.cjs",
|
||||
"theme/static_src/tailwind.config.mjs",
|
||||
"theme/static_src/tailwind.config.ts",
|
||||
"theme/static_src/postcss.config.js",
|
||||
-- Fallback for tailwind v4, where tailwind.config.* is not required anymore
|
||||
".git",
|
||||
}
|
||||
local fname = vim.api.nvim_buf_get_name(bufnr)
|
||||
root_files = insert_package_json(root_files, "tailwindcss", fname)
|
||||
root_files = root_markers_with_field(root_files, { "mix.lock", "Gemfile.lock" }, "tailwind", fname)
|
||||
on_dir(vim.fs.dirname(vim.fs.find(root_files, { path = fname, upward = true })[1]))
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
cmd = { "tinymist" },
|
||||
filetypes = { "typst" },
|
||||
settings = {
|
||||
formatterMode = "typstyle"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
return {
|
||||
init_options = { hostInfo = 'neovim' },
|
||||
cmd = { 'typescript-language-server', '--stdio' },
|
||||
filetypes = {
|
||||
'javascript',
|
||||
'javascriptreact',
|
||||
'javascript.jsx',
|
||||
'typescript',
|
||||
'typescriptreact',
|
||||
'typescript.tsx',
|
||||
},
|
||||
root_markers = { 'tsconfig.json', 'jsconfig.json', 'package.json', '.git' },
|
||||
handlers = {
|
||||
-- handle rename request for certain code actions like extracting functions / types
|
||||
['_typescript.rename'] = function(_, result, ctx)
|
||||
local client = assert(vim.lsp.get_client_by_id(ctx.client_id))
|
||||
vim.lsp.util.show_document({
|
||||
uri = result.textDocument.uri,
|
||||
range = {
|
||||
start = result.position,
|
||||
['end'] = result.position,
|
||||
},
|
||||
}, client.offset_encoding)
|
||||
vim.lsp.buf.rename()
|
||||
return vim.NIL
|
||||
end,
|
||||
},
|
||||
commands = {
|
||||
['editor.action.showReferences'] = function(command, ctx)
|
||||
local client = assert(vim.lsp.get_client_by_id(ctx.client_id))
|
||||
local file_uri, position, references = unpack(command.arguments)
|
||||
|
||||
local quickfix_items = vim.lsp.util.locations_to_items(references, client.offset_encoding)
|
||||
vim.fn.setqflist({}, ' ', {
|
||||
title = command.title,
|
||||
items = quickfix_items,
|
||||
context = {
|
||||
command = command,
|
||||
bufnr = ctx.bufnr,
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.util.show_document({
|
||||
uri = file_uri,
|
||||
range = {
|
||||
start = position,
|
||||
['end'] = position,
|
||||
},
|
||||
}, client.offset_encoding)
|
||||
|
||||
vim.cmd('botright copen')
|
||||
end,
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
-- ts_ls provides `source.*` code actions that apply to the whole file. These only appear in
|
||||
-- `vim.lsp.buf.code_action()` if specified in `context.only`.
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspTypescriptSourceAction', function()
|
||||
local source_actions = vim.tbl_filter(function(action)
|
||||
return vim.startswith(action, 'source.')
|
||||
end, client.server_capabilities.codeActionProvider.codeActionKinds)
|
||||
|
||||
vim.lsp.buf.code_action({
|
||||
context = {
|
||||
only = source_actions,
|
||||
},
|
||||
})
|
||||
end, {})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { pattern = "*.http", command = "set ft=http" })
|
||||
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { pattern = "*.templ", command = "set ft=templ" })
|
||||
vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
|
||||
pattern = "**/inbox/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].md",
|
||||
callback = function()
|
||||
-- Run `date` and capture output
|
||||
local handle = io.popen('date "+%H:%M"')
|
||||
local time = handle:read("*l")
|
||||
handle:close()
|
||||
|
||||
-- Build the line with a trailing colon and space
|
||||
local line = time .. ": "
|
||||
|
||||
-- Append it at the bottom
|
||||
local last_line = vim.api.nvim_buf_line_count(0)
|
||||
vim.api.nvim_buf_set_lines(0, last_line, last_line, false, { line })
|
||||
|
||||
-- Place cursor at the end of the inserted line
|
||||
vim.api.nvim_win_set_cursor(0, { last_line + 1, #line })
|
||||
|
||||
-- Enter insert mode
|
||||
vim.cmd("startinsert")
|
||||
end,
|
||||
})
|
||||
|
||||
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
group = highlight_group,
|
||||
pattern = "*",
|
||||
})
|
||||
@@ -0,0 +1,154 @@
|
||||
return {
|
||||
kind = {
|
||||
Array = " ",
|
||||
Boolean = " ",
|
||||
Class = " ",
|
||||
Color = " ",
|
||||
Constant = " ",
|
||||
Constructor = " ",
|
||||
Enum = " ",
|
||||
EnumMember = " ",
|
||||
Event = " ",
|
||||
Field = " ",
|
||||
File = " ",
|
||||
Folder = " ",
|
||||
Function = " ",
|
||||
Interface = " ",
|
||||
Key = " ",
|
||||
Keyword = " ",
|
||||
Method = " ",
|
||||
Module = " ",
|
||||
Namespace = " ",
|
||||
Null = " ",
|
||||
Number = " ",
|
||||
Object = " ",
|
||||
Operator = " ",
|
||||
Package = " ",
|
||||
Property = " ",
|
||||
Reference = " ",
|
||||
Snippet = " ",
|
||||
String = " ",
|
||||
Struct = " ",
|
||||
Text = " ",
|
||||
TypeParameter = " ",
|
||||
Unit = " ",
|
||||
Value = " ",
|
||||
Variable = " "
|
||||
},
|
||||
git = {
|
||||
LineAdded = " ",
|
||||
LineModified = " ",
|
||||
LineRemoved = " ",
|
||||
FileDeleted = " ",
|
||||
FileIgnored = "◌",
|
||||
FileRenamed = " ",
|
||||
FileStaged = "S",
|
||||
FileUnmerged = "",
|
||||
FileUnstaged = "",
|
||||
FileUntracked = "U",
|
||||
Diff = " ",
|
||||
Repo = " ",
|
||||
Octoface = " ",
|
||||
Branch = ""
|
||||
},
|
||||
ui = {
|
||||
ArrowCircleDown = "",
|
||||
ArrowCircleLeft = "",
|
||||
ArrowCircleRight = "",
|
||||
ArrowCircleUp = "",
|
||||
BoldArrowDown = "",
|
||||
BoldArrowLeft = "",
|
||||
BoldArrowRight = "",
|
||||
BoldArrowUp = "",
|
||||
BoldClose = "",
|
||||
BoldDividerLeft = "",
|
||||
BoldDividerRight = "",
|
||||
BoldLineLeft = "▎",
|
||||
BookMark = "",
|
||||
BoxChecked = " ",
|
||||
Bug = " ",
|
||||
Stacks = "",
|
||||
Scopes = "",
|
||||
Watches = "",
|
||||
DebugConsole = " ",
|
||||
Calendar = " ",
|
||||
Check = "",
|
||||
ChevronRight = "",
|
||||
ChevronShortDown = "",
|
||||
ChevronShortLeft = "",
|
||||
ChevronShortRight = "",
|
||||
ChevronShortUp = "",
|
||||
Circle = " ",
|
||||
Close = "",
|
||||
CloudDownload = " ",
|
||||
Code = "",
|
||||
Comment = "",
|
||||
Dashboard = "",
|
||||
DividerLeft = "",
|
||||
DividerRight = "",
|
||||
DoubleChevronRight = "»",
|
||||
Ellipsis = "",
|
||||
EmptyFolder = " ",
|
||||
EmptyFolderOpen = " ",
|
||||
File = " ",
|
||||
FileSymlink = "",
|
||||
Files = " ",
|
||||
FindFile = "",
|
||||
FindText = "",
|
||||
Fire = "",
|
||||
Folder = " ",
|
||||
FolderOpen = " ",
|
||||
FolderSymlink = " ",
|
||||
Forward = " ",
|
||||
Gear = " ",
|
||||
History = " ",
|
||||
Lightbulb = " ",
|
||||
LineLeft = "▏",
|
||||
LineMiddle = "│",
|
||||
List = " ",
|
||||
Lock = " ",
|
||||
NewFile = " ",
|
||||
Note = " ",
|
||||
Package = " ",
|
||||
Pencil = " ",
|
||||
Plus = " ",
|
||||
Project = " ",
|
||||
Search = " ",
|
||||
SignIn = " ",
|
||||
SignOut = " ",
|
||||
Tab = " ",
|
||||
Table = " ",
|
||||
Target = " ",
|
||||
Telescope = " ",
|
||||
Text = " ",
|
||||
Tree = "",
|
||||
Triangle = "",
|
||||
TriangleShortArrowDown = "",
|
||||
TriangleShortArrowLeft = "",
|
||||
TriangleShortArrowRight = "",
|
||||
TriangleShortArrowUp = ""
|
||||
},
|
||||
diagnostics = {
|
||||
BoldError = "",
|
||||
Error = "",
|
||||
BoldWarning = "",
|
||||
Warning = "",
|
||||
BoldInformation = "",
|
||||
Information = "",
|
||||
BoldQuestion = "",
|
||||
Question = "",
|
||||
BoldHint = "",
|
||||
Hint = "",
|
||||
Debug = "",
|
||||
Trace = "✎"
|
||||
},
|
||||
misc = {
|
||||
Robot = " ",
|
||||
Squirrel = " ",
|
||||
Tag = " ",
|
||||
Watch = "",
|
||||
Smiley = " ",
|
||||
Package = " ",
|
||||
CircuitBoard = " "
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
vim.lsp.enable("ts_ls")
|
||||
vim.lsp.enable("gopls")
|
||||
-- vim.lsp.enable("tailwindcss")
|
||||
|
||||
-- Auto complete
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
callback = function(args)
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
-- if client:supports_method("textDocument/completion") then
|
||||
-- vim.opt.completeopt = { "menu", "menuone", "noinsert", "fuzzy", "popup" }
|
||||
-- vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = true })
|
||||
-- vim.keymap.set("i", "<C-Space>", function()
|
||||
-- vim.lsp.completion.get()
|
||||
-- end)
|
||||
-- end
|
||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
vim.api.nvim_clear_autocmds({ group = augroup, buffer = args.buf })
|
||||
-- vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
-- group = augroup,
|
||||
-- buffer = args.buf,
|
||||
-- callback = function()
|
||||
-- vim.cmd("Neoformat")
|
||||
-- end,
|
||||
-- })
|
||||
if client:supports_method("textDocument/inlayHint") then
|
||||
vim.lsp.inlay_hint.enable(true)
|
||||
|
||||
vim.keymap.set("n", "gp", function()
|
||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
|
||||
end, {
|
||||
desc = "Toggle Inlay Hints",
|
||||
})
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "gd", function()
|
||||
vim.lsp.buf.type_definition()
|
||||
end, {
|
||||
desc = "Go to Type Definition",
|
||||
})
|
||||
vim.keymap.set("n", "gi", function()
|
||||
vim.lsp.buf.implementation()
|
||||
end, {
|
||||
desc = "Go to Implementation",
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = {
|
||||
spacing = 4,
|
||||
},
|
||||
signs = {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = " ",
|
||||
[vim.diagnostic.severity.WARN] = " ",
|
||||
[vim.diagnostic.severity.INFO] = " ",
|
||||
[vim.diagnostic.severity.HINT] = " ",
|
||||
},
|
||||
},
|
||||
update_in_insert = false,
|
||||
severity_sort = true,
|
||||
})
|
||||
@@ -0,0 +1,4 @@
|
||||
local esc = vim.api.nvim_replace_termcodes("<Esc>", true, true, true)
|
||||
local ret = vim.api.nvim_replace_termcodes("<CR>", true, true, true)
|
||||
|
||||
vim.fn.setreg('o', "jjo€ - " ..esc.. "p4j0f:llv$hP3j0wv$hP" ..esc.. ":w" ..ret)
|
||||
@@ -0,0 +1,27 @@
|
||||
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
|
||||
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic message" })
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Go to next diagnostic message" })
|
||||
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostics list" })
|
||||
|
||||
vim.keymap.set("n", "<leader>qq", function()
|
||||
local wins = vim.fn.getwininfo()
|
||||
for _, win in pairs(wins) do
|
||||
if win["quickfix"] == 1 then
|
||||
vim.cmd.cclose()
|
||||
return
|
||||
end
|
||||
end
|
||||
vim.cmd.copen()
|
||||
end, { desc = "Toggle quickfix list" })
|
||||
|
||||
vim.keymap.set("n", "<leader>bo", "<cmd>%bd|e#<cr>", { desc = "Close all buffers but the current one" }) -- https://stackoverflow.com/a/42071865/516188
|
||||
|
||||
vim.keymap.set("n", "<leader>tt", function()
|
||||
vim.cmd("TransparentToggle")
|
||||
source_matugen()
|
||||
end, { desc = "Toggle transparency" })
|
||||
@@ -0,0 +1,39 @@
|
||||
vim.opt.guicursor = ""
|
||||
vim.opt.relativenumber = true
|
||||
vim.o.hlsearch = false
|
||||
vim.wo.number = true
|
||||
vim.o.mouse = "a"
|
||||
vim.o.clipboard = "unnamedplus"
|
||||
vim.o.breakindent = true
|
||||
vim.o.undofile = true
|
||||
vim.o.ignorecase = true
|
||||
vim.o.smartcase = true
|
||||
vim.wo.signcolumn = "yes"
|
||||
vim.o.updatetime = 250
|
||||
vim.o.tabstop = 2
|
||||
vim.o.shiftwidth = 4
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
vim.opt.scrolloff = 8
|
||||
vim.o.completeopt = "menuone,noselect"
|
||||
vim.o.termguicolors = true
|
||||
vim.o.swapfile = false
|
||||
vim.o.cursorline = true
|
||||
vim.cmd.set("cursorline")
|
||||
vim.cmd.set("cursorcolumn")
|
||||
vim.opt.conceallevel = 2
|
||||
vim.opt.colorcolumn = "80"
|
||||
vim.api.nvim_create_user_command("CpFullPath", function()
|
||||
local path = vim.fn.expand("%:p")
|
||||
vim.fn.setreg("+", path)
|
||||
vim.notify('Copied "' .. path .. '" to the clipboard!')
|
||||
end, {})
|
||||
|
||||
vim.api.nvim_create_user_command("CpRelPath", function()
|
||||
local path = vim.fn.expand("%")
|
||||
vim.fn.setreg("+", path)
|
||||
vim.notify('Copied "' .. path .. '" to the clipboard!')
|
||||
end, {})
|
||||
|
||||
vim.g.neoformat_try_node_exe = 1
|
||||
vim.opt.winborder = 'rounded'
|
||||
@@ -0,0 +1,31 @@
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local i = ls.insert_node
|
||||
local t = ls.text_node
|
||||
local extras = require("luasnip.extras")
|
||||
local rep = extras.rep
|
||||
|
||||
vim.keymap.set({ "i", "s" }, "<A-k>", function()
|
||||
if ls.expand_or_jumpable() then
|
||||
ls.expand_or_jump()
|
||||
end
|
||||
end, { silent = true })
|
||||
|
||||
vim.keymap.set({ "i", "s" }, "<A-j>", function()
|
||||
if ls.jumpable(-1) then
|
||||
ls.jump(-1)
|
||||
end
|
||||
end, { silent = true })
|
||||
|
||||
local console_log_snippet = s("cl", {
|
||||
t("console.log('"),
|
||||
i(1, "var"),
|
||||
t(":', "),
|
||||
rep(1),
|
||||
t(");"),
|
||||
})
|
||||
|
||||
ls.add_snippets("typescript", { console_log_snippet })
|
||||
ls.add_snippets("javascript", { console_log_snippet })
|
||||
ls.add_snippets("typescriptreact", { console_log_snippet })
|
||||
ls.add_snippets("javascriptreact", { console_log_snippet })
|
||||
@@ -0,0 +1,18 @@
|
||||
function source_matugen()
|
||||
local matugen_path = os.getenv("HOME") .. "/.config/nvim/lua/jpporta/themes/gruvbox-dark.lua"
|
||||
-- dofile doesn't expand $HOME or ~
|
||||
|
||||
dofile(matugen_path)
|
||||
end
|
||||
-- local function auxiliary_function()
|
||||
-- source_matugen()
|
||||
-- vim.cmd("TransparentEnable")
|
||||
-- end
|
||||
--
|
||||
-- -- Register an autocmd to listen for matugen updates
|
||||
-- vim.api.nvim_create_autocmd("Signal", {
|
||||
-- pattern = "SIGUSR1",
|
||||
-- callback = auxiliary_function,
|
||||
-- })
|
||||
|
||||
source_matugen()
|
||||
@@ -0,0 +1,2 @@
|
||||
vim.o.background = "dark"
|
||||
vim.cmd("colorscheme ayu-dark")
|
||||
@@ -0,0 +1,2 @@
|
||||
vim.o.background = "light"
|
||||
vim.cmd("colorscheme ayu-light")
|
||||
@@ -0,0 +1,2 @@
|
||||
vim.o.background = "light"
|
||||
vim.cmd("colorscheme catppuccin-latte")
|
||||
@@ -0,0 +1,2 @@
|
||||
vim.o.background = "dark"
|
||||
vim.cmd("colorscheme catppuccin-mocha")
|
||||
@@ -0,0 +1,2 @@
|
||||
vim.o.background = "dark"
|
||||
vim.cmd("colorscheme cobalt2")
|
||||
@@ -0,0 +1,2 @@
|
||||
vim.o.background = "dark"
|
||||
vim.cmd("colorscheme dracula")
|
||||
@@ -0,0 +1,2 @@
|
||||
vim.o.background = "dark"
|
||||
vim.cmd("colorscheme gruvbox")
|
||||
@@ -0,0 +1,2 @@
|
||||
vim.o.background = "light"
|
||||
vim.cmd("colorscheme gruvbox")
|
||||
@@ -0,0 +1,2 @@
|
||||
vim.o.background = "dark"
|
||||
vim.cmd("colorscheme monokai_pro")
|
||||
@@ -0,0 +1,2 @@
|
||||
vim.o.background = "light"
|
||||
vim.cmd("colorscheme monokai_ristretto")
|
||||
@@ -0,0 +1,2 @@
|
||||
vim.o.background = "dark"
|
||||
vim.cmd("colorscheme rose-pine")
|
||||
@@ -0,0 +1,2 @@
|
||||
vim.o.background = "light"
|
||||
vim.cmd("colorscheme rose-pine")
|
||||
@@ -0,0 +1,2 @@
|
||||
vim.o.background = "dark"
|
||||
vim.cmd("colorscheme snazzy")
|
||||
@@ -0,0 +1,2 @@
|
||||
vim.o.background = "dark"
|
||||
vim.cmd("colorscheme tokyonight")
|
||||
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
"OlegGulevskyy/better-ts-errors.nvim",
|
||||
dependencies = { "MunifTanjim/nui.nvim" },
|
||||
opts = {
|
||||
keymaps = {
|
||||
toggle = "<leader>dd",
|
||||
go_to_definition = "<leader>dx",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
return {
|
||||
{
|
||||
"folke/zen-mode.nvim",
|
||||
opts = {
|
||||
window = {
|
||||
width = 80,
|
||||
},
|
||||
plugins = {
|
||||
options = {
|
||||
ruler = false,
|
||||
enabled = true,
|
||||
},
|
||||
kitty = {
|
||||
enabled = true,
|
||||
},
|
||||
gitsigns = {
|
||||
enabled = true,
|
||||
},
|
||||
tmux = { enabled = true },
|
||||
twilight = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>zm",
|
||||
":ZenMode<CR>",
|
||||
desc = "Zen Mode",
|
||||
mode = "n",
|
||||
},
|
||||
},
|
||||
cmd = {
|
||||
"ZenMode",
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/twilight.nvim",
|
||||
opts = {},
|
||||
cmd = { "Twilight" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>tw",
|
||||
":Twilight<CR>",
|
||||
desc = "Twilight",
|
||||
mode = "n",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"preservim/vim-pencil",
|
||||
cmd = { "Pencil", "NoPencil", "TogglePencil", "SoftPencil", "HardPencil" },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
local js_based_languages = {
|
||||
"typescript",
|
||||
"javascript",
|
||||
"typescriptreact",
|
||||
"javascriptreact",
|
||||
"vue",
|
||||
}
|
||||
|
||||
return {
|
||||
"rcarriga/nvim-dap-ui",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
{ "mfussenegger/nvim-dap" },
|
||||
{ "nvim-neotest/nvim-nio" },
|
||||
{
|
||||
"microsoft/vscode-js-debug",
|
||||
-- After install, build it and rename the dist directory to out
|
||||
build = "npm install --legacy-peer-deps --no-save && npx gulp vsDebugServerBundle && rm -rf out && mv dist out",
|
||||
version = "1.*",
|
||||
},
|
||||
{
|
||||
"mxsdev/nvim-dap-vscode-js",
|
||||
config = function()
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
require("dap-vscode-js").setup({
|
||||
debugger_path = vim.fn.resolve(vim.fn.stdpath("data") .. "/lazy/vscode-js-debug"),
|
||||
adapters = {
|
||||
"chrome",
|
||||
"pwa-node",
|
||||
"pwa-chrome",
|
||||
"pwa-msedge",
|
||||
"pwa-extensionHost",
|
||||
"node-terminal",
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"Joakker/lua-json5",
|
||||
build = "./install.sh",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
dapui.setup()
|
||||
-- ADAPTERS
|
||||
for _, language in ipairs(js_based_languages) do
|
||||
dap.configurations[language] = {
|
||||
-- Debug single nodejs files
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "launch",
|
||||
name = "Launch file",
|
||||
program = "${file}",
|
||||
cwd = vim.fn.getcwd(),
|
||||
sourceMaps = true,
|
||||
},
|
||||
-- Debug nodejs processes (make sure to add --inspect when you run the process)
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "attach",
|
||||
name = "Attach",
|
||||
processId = require("dap.utils").pick_process,
|
||||
cwd = vim.fn.getcwd(),
|
||||
sourceMaps = true,
|
||||
},
|
||||
-- Debug web applications (client side)
|
||||
{
|
||||
type = "pwa-chrome",
|
||||
request = "launch",
|
||||
name = "Launch & Debug Chrome",
|
||||
url = function()
|
||||
local co = coroutine.running()
|
||||
return coroutine.create(function()
|
||||
vim.ui.input({
|
||||
prompt = "Enter URL: ",
|
||||
default = "http://localhost:3000",
|
||||
}, function(url)
|
||||
if url == nil or url == "" then
|
||||
return
|
||||
else
|
||||
coroutine.resume(co, url)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end,
|
||||
webRoot = vim.fn.getcwd(),
|
||||
protocol = "inspector",
|
||||
sourceMaps = true,
|
||||
userDataDir = false,
|
||||
},
|
||||
-- Divider for the launch.json derived configs
|
||||
{
|
||||
name = "----- ↓ launch.json configs ↓ -----",
|
||||
type = "",
|
||||
request = "launch",
|
||||
},
|
||||
}
|
||||
end
|
||||
-- EVENT LISTENERS
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dapui.close()
|
||||
end
|
||||
|
||||
-- MAPPINGS
|
||||
vim.keymap.set("n", "<leader>db", "<cmd>DapToggleBreakpoint<CR>", { desc = "[D]ap [B]reakpoint" })
|
||||
vim.keymap.set("n", "<leader>dc", "<cmd>DapContinue<CR>", { desc = "[D]ap [C]ontinue" })
|
||||
vim.keymap.set("n", "<leader>da", function()
|
||||
if vim.fn.filereadable(".vscode/launch.json") then
|
||||
local dap_vscode = require("dap.ext.vscode")
|
||||
dap_vscode.load_launchjs(nil, {
|
||||
["pwa-node"] = js_based_languages,
|
||||
["chrome"] = js_based_languages,
|
||||
["pwa-chrome"] = js_based_languages,
|
||||
})
|
||||
end
|
||||
require("dap").continue()
|
||||
end, { desc = "[D]ap [A]ttach" })
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"stevearc/dressing.nvim",
|
||||
event = "VeryLazy",
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
"folke/flash.nvim",
|
||||
event = "VeryLazy",
|
||||
---@type Flash.Config
|
||||
opts = {},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
|
||||
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
|
||||
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
|
||||
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
|
||||
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local conform = require("conform")
|
||||
conform.setup({
|
||||
formatters = {
|
||||
csharpier = {
|
||||
command = "csharpier",
|
||||
args = { "format" },
|
||||
},
|
||||
},
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
typescript = { "prettierd", "prettier", stop_after_first = true },
|
||||
javascriptreact = { "prettierd", "prettier", stop_after_first = true },
|
||||
typescriptreact = { "prettierd", "prettier", stop_after_first = true },
|
||||
json = { "prettierd", "prettier", stop_after_first = true },
|
||||
markdown = { "prettierd", "prettier", stop_after_first = true },
|
||||
go = { "gofmt" },
|
||||
nix = { "nixfmt" },
|
||||
templ = { "gofmt" },
|
||||
cs = { "csharpier" },
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
lsp_fomrat = "fallback",
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set({ "n", "v" }, "<leader>f", function()
|
||||
conform.format({
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 500,
|
||||
})
|
||||
end, { desc = "Format" })
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
return {
|
||||
"mhartington/formatter.nvim",
|
||||
event = "VeryLazy",
|
||||
keys = {
|
||||
{
|
||||
"<leader>f",
|
||||
":Format<CR>",
|
||||
desc = "Format file",
|
||||
mode = "n",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("formatter").setup({
|
||||
filetype = {
|
||||
javascript = { require("formatter.filetypes.javascript").prettierd },
|
||||
typescript = { require("formatter.filetypes.typescript").prettierd },
|
||||
javascriptreact = { require("formatter.filetypes.javascriptreact").prettierd },
|
||||
typescriptreact = { require("formatter.filetypes.typescriptreact").prettierd },
|
||||
json = { require("formatter.filetypes.json").jq },
|
||||
lua = { require("formatter.filetypes.lua").stylua },
|
||||
rust = { require("formatter.filetypes.rust").rustfmt },
|
||||
go = { require("formatter.filetypes.go").goimports },
|
||||
markdown = { require("formatter.filetypes.markdown").prettierd },
|
||||
html = { require("formatter.filetypes.html").prettierd },
|
||||
css = { require("formatter.filetypes.css").prettierd },
|
||||
nix = { require("formatter.filetypes.nix").nixpkgs_fmt },
|
||||
["*"] = {
|
||||
require("formatter.filetypes.any").remove_trailing_whitespace,
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.api.nvim_create_autocmd("BufWritePost", { command = "FormatWriteLock" })
|
||||
end,
|
||||
}
|
||||
-- return {
|
||||
-- "stevearc/conform.nvim",
|
||||
-- event = { "BufReadPre", "BufNewFile" },
|
||||
-- cmd = "ConformInfo",
|
||||
-- opts = {
|
||||
-- formatters_by_ft = {
|
||||
-- javascript = { { "prettier", "jsbeautify" } },
|
||||
-- typescript = { "prettier" },
|
||||
-- javascriptreact = { { "prettier", "jsbeautify" } },
|
||||
-- typescriptreact = { "prettier" },
|
||||
-- json = { "prettier" },
|
||||
-- lua = { "stylua" },
|
||||
-- rust = { "rustfmt" },
|
||||
-- go = { "goimports" },
|
||||
-- markdown = { { "deno_fmt", "prettier", "prettierd" } },
|
||||
-- html = { "prettier" },
|
||||
-- css = { "prettier" },
|
||||
-- },
|
||||
-- format_on_save = function(bufnr)
|
||||
-- -- Disable with a global or buffer-local variable
|
||||
-- if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
-- return
|
||||
-- end
|
||||
-- return { timeout_ms = 500, lsp_fallback = true }
|
||||
-- end,
|
||||
-- },
|
||||
-- keys = {
|
||||
-- {
|
||||
-- "<leader>f",
|
||||
-- function()
|
||||
-- require("conform").format({
|
||||
-- lsp_fallback = true,
|
||||
-- async = true,
|
||||
-- })
|
||||
-- end,
|
||||
-- desc = "Format file",
|
||||
-- },
|
||||
-- },
|
||||
-- config = function()
|
||||
-- local notify = require("notify")
|
||||
-- local function show_notification(message, level)
|
||||
-- notify(message, level, { title = "conform.nvim" })
|
||||
-- end
|
||||
-- vim.api.nvim_create_user_command("FormatToggle", function(args)
|
||||
-- local is_global = not args.bang
|
||||
-- if is_global then
|
||||
-- vim.g.disable_autoformat = not vim.g.disable_autoformat
|
||||
-- if vim.g.disable_autoformat then
|
||||
-- show_notification("Autoformat-on-save disabled globally", "info")
|
||||
-- else
|
||||
-- show_notification("Autoformat-on-save enabled globally", "info")
|
||||
-- end
|
||||
-- else
|
||||
-- vim.b.disable_autoformat = not vim.b.disable_autoformat
|
||||
-- if vim.b.disable_autoformat then
|
||||
-- show_notification("Autoformat-on-save disabled for this buffer", "info")
|
||||
-- else
|
||||
-- show_notification("Autoformat-on-save enabled for this buffer", "info")
|
||||
-- end
|
||||
-- end
|
||||
-- end, {
|
||||
-- desc = "Toggle autoformat-on-save",
|
||||
-- bang = true,
|
||||
-- })
|
||||
-- vim.api.nvim_create_user_command("Format", function(args)
|
||||
-- local range = nil
|
||||
-- if args.count ~= -1 then
|
||||
-- local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
|
||||
-- range = {
|
||||
-- start = { args.line1, 0 },
|
||||
-- ["end"] = { args.line2, end_line:len() },
|
||||
-- }
|
||||
-- end
|
||||
-- require("conform").format({ async = true, lsp_fallback = true, range = range })
|
||||
-- end, { range = true })
|
||||
-- end,
|
||||
-- }
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
"tpope/vim-fugitive",
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"gleam-lang/gleam.vim",
|
||||
ft = "gleam",
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
return { "ellisonleao/glow.nvim", config = true, cmd = "Glow" }
|
||||
@@ -0,0 +1,35 @@
|
||||
return {
|
||||
"nvimdev/guard.nvim",
|
||||
dependencies = { "nvimdev/guard-collection" },
|
||||
ft = {
|
||||
"typescript",
|
||||
"javascript",
|
||||
"typescriptreact",
|
||||
"json",
|
||||
"markdown",
|
||||
"lua",
|
||||
"go",
|
||||
},
|
||||
config = function()
|
||||
local ft = require("guard.filetype")
|
||||
local mdformat = {
|
||||
cmd = "mdformat",
|
||||
stdin = true,
|
||||
}
|
||||
|
||||
ft("typescript"):fmt("prettierd"):lint("eslint_d")
|
||||
ft("javascript"):fmt("prettierd"):lint("eslint_d")
|
||||
ft("typescriptreact"):fmt("prettierd"):lint("eslint_d")
|
||||
ft("json"):fmt("prettierd"):lint("eslint_d")
|
||||
ft("markdown"):fmt(mdformat):lint("eslint_d")
|
||||
ft("lua"):fmt("stylua")
|
||||
ft("go"):fmt("gofmt"):lint("golangci_lint")
|
||||
|
||||
vim.keymap.set("n", "<leader>f", "<cmd>Guard fmt<CR>", { desc = "Format" })
|
||||
|
||||
vim.g.guard_config = {
|
||||
fmt_on_save = true,
|
||||
save_on_fmt = false,
|
||||
}
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
return {
|
||||
"mfussenegger/nvim-lint",
|
||||
event = {
|
||||
"BufReadPre",
|
||||
"BufNewFile",
|
||||
},
|
||||
|
||||
opts = {
|
||||
-- other config
|
||||
linters = {
|
||||
eslint_d = {
|
||||
args = {
|
||||
"--no-warn-ignored", -- <-- this is the key argument
|
||||
"--format",
|
||||
"json",
|
||||
"--stdin",
|
||||
"--stdin-filename",
|
||||
function()
|
||||
return vim.api.nvim_buf_get_name(0)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
config = function()
|
||||
local lint = require("lint")
|
||||
lint.linters_by_ft = {
|
||||
javascript = { "eslint" },
|
||||
typescript = { "eslint" },
|
||||
javascriptreact = { "eslint" },
|
||||
typescriptreact = { "eslint" },
|
||||
json = { "eslint" },
|
||||
lua = { "luac" },
|
||||
go = { "golangcilint" },
|
||||
templ = { "golangcilint" },
|
||||
}
|
||||
|
||||
local lint_autogroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
group = lint_autogroup,
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
lint.try_lint("cspell")
|
||||
end,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>ll", function()
|
||||
lint.try_lint()
|
||||
end, { desc = "Trigger linting for current file" })
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
return {
|
||||
"mfussenegger/nvim-lint",
|
||||
event = {
|
||||
"BufReadPre",
|
||||
"BufNewFile",
|
||||
},
|
||||
config = function()
|
||||
local lint = require("lint")
|
||||
|
||||
lint.linters_by_ft = {
|
||||
javascript = { "eslint" },
|
||||
typescript = { "eslint" },
|
||||
javascriptreact = { "eslint" },
|
||||
typescriptreact = { "eslint" },
|
||||
json = { "eslint", "jsonlint" },
|
||||
go = { "golangcilint" },
|
||||
}
|
||||
|
||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
vim.api.nvim_create_autocmd({
|
||||
"BufEnter",
|
||||
"InsertLeave",
|
||||
}, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>l", function()
|
||||
lint.try_lint()
|
||||
end, { desc = "Lint current file" })
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
return {
|
||||
{ "williamboman/mason.nvim", lazy = false, config = true },
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
config = function()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
"html",
|
||||
"ts_ls",
|
||||
"tailwindcss",
|
||||
"gopls",
|
||||
"lua_ls",
|
||||
"csharp_ls",
|
||||
},
|
||||
automatic_installation = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = { "folke/neodev.nvim", "j-hui/fidget.nvim", "hrsh7th/cmp-nvim-lsp" },
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local keymap = vim.keymap
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
opts.buffer = bufnr
|
||||
opts.desc = "[G]oto [D]eclaration"
|
||||
keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
||||
opts.desc = "[C]ode [A]ction"
|
||||
keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
|
||||
opts.desc = "[G]oto [D]efinition"
|
||||
keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts)
|
||||
opts.desc = "[R]e[n]ame"
|
||||
keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
|
||||
opts.desc = "Diagnostics"
|
||||
keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts)
|
||||
opts.desc = "File [D]iagnostics"
|
||||
keymap.set("n", "<leader>D", "<cmd>Telescope diagnostics bufnr=0<CR>", opts)
|
||||
opts.desc = "Hover Documentation"
|
||||
keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
||||
opts.desc = "Type Definitions"
|
||||
keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts)
|
||||
opts.desc = "[G]oto [I]mplementation"
|
||||
keymap.set("n", "gI", "<cmd>Telescope lsp_implementations<CR>", opts)
|
||||
opts.desc = "Signature Documentation"
|
||||
keymap.set("n", "<C-i>", vim.lsp.buf.signature_help, opts)
|
||||
opts.desc = "[W]orkspace [L]ist Folders"
|
||||
keymap.set("n", "<leader>wl", function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, opts)
|
||||
opts.desc = "Restart LSP"
|
||||
keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts)
|
||||
end
|
||||
|
||||
vim.diagnostic.config({
|
||||
signs = {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = " ",
|
||||
[vim.diagnostic.severity.WARN] = " ",
|
||||
[vim.diagnostic.severity.INFO] = " ",
|
||||
[vim.diagnostic.severity.HINT] = " ",
|
||||
},
|
||||
linehl = {
|
||||
[vim.diagnostic.severity.ERROR] = "Error",
|
||||
[vim.diagnostic.severity.WARN] = "Warn",
|
||||
[vim.diagnostic.severity.INFO] = "Info",
|
||||
[vim.diagnostic.severity.HINT] = "Hint",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
-- local servers = {
|
||||
-- html = {
|
||||
-- "emmet-ls",
|
||||
-- },
|
||||
-- ts_ls = {
|
||||
-- filetypes = {
|
||||
-- "html",
|
||||
-- "css",
|
||||
-- "javascript",
|
||||
-- "typescript",
|
||||
-- "typescriptreact",
|
||||
-- "javascriptreact",
|
||||
-- },
|
||||
-- },
|
||||
-- tailwindcss = {
|
||||
-- filetypes = {
|
||||
-- "html",
|
||||
-- "css",
|
||||
-- "javascript",
|
||||
-- "typescript",
|
||||
-- "typescriptreact",
|
||||
-- "javascriptreact",
|
||||
-- },
|
||||
-- },
|
||||
-- gopls = {
|
||||
-- cmd = { "gopls" },
|
||||
-- filetypes = {
|
||||
-- "go",
|
||||
-- "gomod",
|
||||
-- "gowork",
|
||||
-- "gotmpl",
|
||||
-- },
|
||||
-- },
|
||||
-- lua_ls = {
|
||||
-- Lua = {
|
||||
-- workspace = { checkThirdParty = false },
|
||||
-- telemetry = { enable = false },
|
||||
-- diagnostics = { globals = { "vim" } },
|
||||
-- },
|
||||
-- },
|
||||
-- csharp_ls = {
|
||||
-- cmd = { "csharp-ls" },
|
||||
-- filetypes = {
|
||||
-- "cs",
|
||||
-- "csproj",
|
||||
-- },
|
||||
-- },
|
||||
-- }
|
||||
--
|
||||
-- for server, settings in pairs(servers) do
|
||||
-- lspconfig[server].setup({
|
||||
-- capabilities = capabilities,
|
||||
-- on_attach = on_attach,
|
||||
-- settings = settings,
|
||||
-- filetypes = (settings or {}).filetypes,
|
||||
-- })
|
||||
-- end
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
{
|
||||
"mracos/mermaid.vim",
|
||||
ft = "markdown",
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = {
|
||||
"MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop"
|
||||
},
|
||||
build = "cd app && yarn install",
|
||||
init = function() vim.g.mkdp_filetypes = {"markdown"} end,
|
||||
ft = {"markdown"},
|
||||
event="VeryLazy"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"williamboman/mason.nvim",
|
||||
opts = {},
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
return {
|
||||
"nvim-neorg/neorg",
|
||||
dependencies = { "vhyrro/luarocks.nvim", "nvim-treesitter" },
|
||||
lazy = false,
|
||||
version = "*",
|
||||
config = function()
|
||||
require("neorg").setup({
|
||||
load = {
|
||||
["core.defaults"] = {},
|
||||
["core.concealer"] = {},
|
||||
["core.dirman"] = {
|
||||
config = {
|
||||
workspaces = {
|
||||
notes = "~/Documents/notes",
|
||||
},
|
||||
default_workspace = "notes",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
return {
|
||||
"nvimtools/none-ls.nvim",
|
||||
dependencies = {
|
||||
"nvimtools/none-ls-extras.nvim",
|
||||
},
|
||||
config = function()
|
||||
local setup, null_ls = pcall(require, "null-ls")
|
||||
if not setup then
|
||||
return
|
||||
end
|
||||
|
||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
-- Completion
|
||||
null_ls.builtins.completion.spell,
|
||||
null_ls.builtins.completion.luasnip,
|
||||
null_ls.builtins.completion.nvim_snippets,
|
||||
-- Code Actions
|
||||
require("none-ls.code_actions.eslint_d"),
|
||||
-- Formatters
|
||||
null_ls.builtins.formatting.prettierd,
|
||||
null_ls.builtins.formatting.stylua,
|
||||
-- Diagnostics
|
||||
require("none-ls.diagnostics.eslint_d"),
|
||||
null_ls.builtins.diagnostics.golangci_lint,
|
||||
},
|
||||
-- configure format on save
|
||||
vim.keymap.set("n", "<leader>f", function()
|
||||
vim.lsp.buf.format({ async = true })
|
||||
end, { desc = "Format current buffer" }),
|
||||
on_attach = function(current_client, bufnr)
|
||||
if current_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()
|
||||
vim.lsp.buf.format({
|
||||
filter = function(client)
|
||||
-- only use null-ls for formatting instead of lsp server
|
||||
return client.name == "null-ls"
|
||||
end,
|
||||
bufnr = bufnr,
|
||||
})
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
return {
|
||||
"rcarriga/nvim-notify",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
timeout = 500,
|
||||
render = "compact",
|
||||
background_colour = "#000000",
|
||||
max_height = function()
|
||||
return math.floor(vim.o.lines * 0.75)
|
||||
end,
|
||||
max_width = function()
|
||||
return math.floor(vim.o.columns * 0.25)
|
||||
end,
|
||||
on_open = function(win)
|
||||
vim.api.nvim_win_set_config(win, { zindex = 100 })
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
return {
|
||||
"epwalsh/obsidian.nvim",
|
||||
version = "*",
|
||||
lazy = true,
|
||||
ft = "markdown",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>oo",
|
||||
function()
|
||||
vim.cmd("ObsidianToday")
|
||||
end,
|
||||
desc = "[O]bsidian T[o]day",
|
||||
},
|
||||
{
|
||||
"<leader>os",
|
||||
function()
|
||||
vim.cmd("ObsidianSearch")
|
||||
end,
|
||||
desc = "[O]bsidian [S]earch",
|
||||
},
|
||||
{
|
||||
"<leader>on",
|
||||
function()
|
||||
vim.cmd("ObsidianNew")
|
||||
end,
|
||||
desc = "[O]bsidian [N]ew",
|
||||
},
|
||||
{
|
||||
"<leader>oe",
|
||||
":ObsidianExtractNote<CR>",
|
||||
desc = "[O]bsidian [E]xtract",
|
||||
mode = "v",
|
||||
},
|
||||
{
|
||||
"<leader>ot",
|
||||
":ObsidianTemplate<CR>",
|
||||
desc = "[O]bsidian [T]emplate",
|
||||
mode = "n",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
|
||||
mappings = {
|
||||
-- Overrides the 'gf' mapping to work on markdown/wiki links within your vault.
|
||||
["gf"] = {
|
||||
action = function()
|
||||
return require("obsidian").util.gf_passthrough()
|
||||
end,
|
||||
opts = { noremap = false, expr = true, buffer = true },
|
||||
},
|
||||
-- Toggle check-boxes.
|
||||
["<leader>ch"] = {
|
||||
action = function()
|
||||
return require("obsidian").util.toggle_checkbox()
|
||||
end,
|
||||
opts = { buffer = true },
|
||||
},
|
||||
},
|
||||
templates = {
|
||||
subdir = "Templates",
|
||||
date_format = "%Y-%m-%d",
|
||||
time_format = "%H:%M",
|
||||
-- A map for custom variables, the key should be the variable and the value a function
|
||||
substitutions = {
|
||||
date_format = function()
|
||||
return os.date("%Y-%m-%d")
|
||||
end,
|
||||
date_full = function()
|
||||
return os.date("%B %-d, %Y")
|
||||
end,
|
||||
},
|
||||
},
|
||||
note_id_func = function(title)
|
||||
local suffix = ""
|
||||
if title ~= nil then
|
||||
-- If title is given, transform it into valid file name.
|
||||
suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
|
||||
else
|
||||
-- If title is nil, just add 4 random uppercase letters to the suffix.
|
||||
for _ = 1, 4 do
|
||||
suffix = suffix .. string.char(math.random(65, 90))
|
||||
end
|
||||
end
|
||||
return os.date("%s", os.time())
|
||||
end,
|
||||
note_frontmatter_func = function(note)
|
||||
-- This is equivalent to the default frontmatter function.
|
||||
local out = {
|
||||
tags = { "#note", "#journal" },
|
||||
created = os.date("%Y-%m-%d %H:%M:%S"),
|
||||
}
|
||||
-- `note.metadata` contains any manually added fields in the frontmatter.
|
||||
-- So here we just make sure those fields are kept in the frontmatter.
|
||||
if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then
|
||||
for k, v in pairs(note.metadata) do
|
||||
out[k] = v
|
||||
end
|
||||
end
|
||||
return out
|
||||
end,
|
||||
follow_url_func = function(url)
|
||||
-- vim.fn.jobstart({"xdg-open", url}) -- linux
|
||||
vim.ui.open(url) -- need Neovim 0.10.0+
|
||||
end,
|
||||
-- Optional, configure additional syntax highlighting / extmarks.
|
||||
ui = {
|
||||
enable = true, -- set to false to disable all additional syntax features
|
||||
update_debounce = 200, -- update delay after a text change (in milliseconds)
|
||||
-- Define how various check-boxes are displayed
|
||||
checkboxes = {
|
||||
-- NOTE: the 'char' value has to be a single character, and the highlight groups are defined below.
|
||||
[" "] = { char = "", hl_group = "ObsidianTodo" },
|
||||
["x"] = { char = "", hl_group = "ObsidianDone" },
|
||||
[">"] = { char = "", hl_group = "ObsidianRightArrow" },
|
||||
["<"] = { char = "", hl_group = "ObsidianLeftArrow" },
|
||||
["~"] = { char = "", hl_group = "ObsidianTilde" },
|
||||
["v"] = { char = "", hl_group = "ObsidianPlay" },
|
||||
["?"] = { char = "", hl_group = "ObsidianQuestion" },
|
||||
["I"] = { char = "", hl_group = "ObsidianIdea" },
|
||||
},
|
||||
external_link_icon = {
|
||||
char = "",
|
||||
hl_group = "ObsidianExtLinkIcon",
|
||||
},
|
||||
-- Replace the above with this if you don't have a patched font:
|
||||
-- external_link_icon = { char = "", hl_group = "ObsidianExtLinkIcon" },
|
||||
reference_text = { hl_group = "ObsidianRefText" },
|
||||
highlight_text = { hl_group = "ObsidianHighlightText" },
|
||||
tags = { hl_group = "ObsidianTag" },
|
||||
hl_groups = {
|
||||
-- The options are passed directly to `vim.api.nvim_set_hl()`. See `:help nvim_set_hl`.
|
||||
ObsidianTodo = { bold = true, fg = "#7f849c" },
|
||||
ObsidianDone = { bold = true, fg = "#a6e3a1" },
|
||||
ObsidianPlay = { bold = true, fg = "#89b4fa" },
|
||||
ObsidianRightArrow = { bold = true, fg = "#fab387" },
|
||||
ObsidianLeftArrow = { bold = true, fg = "#f5c2e7" },
|
||||
ObsidianTilde = { bold = true, fg = "#f38ba8" },
|
||||
ObsidianQuestion = { bold = true, fg = "#b4befe" },
|
||||
ObsidianIdea = { bold = true, fg = "#f9e2af" },
|
||||
ObsidianRefText = { underline = true, fg = "#c792ea" },
|
||||
ObsidianExtLinkIcon = { fg = "#c792ea" },
|
||||
ObsidianTag = { italic = true, fg = "#89ddff" },
|
||||
ObsidianHighlightText = { bg = "#75662e" },
|
||||
},
|
||||
},
|
||||
dir = "~/Documents/Notes",
|
||||
new_notes_location = "notes_subdir",
|
||||
notes_subdir = "",
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
return {
|
||||
'prettier/vim-prettier',
|
||||
ft = {
|
||||
'javascript',
|
||||
'javascriptreact',
|
||||
'javascript.jsx',
|
||||
'typescript',
|
||||
'typescriptreact',
|
||||
'typescript.tsx',
|
||||
"vue",
|
||||
"css",
|
||||
"scss",
|
||||
"less",
|
||||
"html",
|
||||
"json",
|
||||
"jsonc",
|
||||
"yaml",
|
||||
"markdown",
|
||||
"graphql",
|
||||
"handlebars",
|
||||
"svelte",
|
||||
"astro",
|
||||
"htmlangular",
|
||||
},
|
||||
config = function()
|
||||
vim.g["prettier#autoformat"] = 1
|
||||
vim.g["prettier#autoformat_require_pragma"] = 0
|
||||
vim.g["prettier#quickfix_enabled"] = 0
|
||||
-- use prettier with prettierd
|
||||
vim.b["prettier_exec_cmd"] = "prettierd"
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>f",
|
||||
function()
|
||||
vim.cmd("Prettier")
|
||||
end,
|
||||
desc = "Format with Prettier",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
"folke/trouble.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
opts = {},
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
return {
|
||||
init_options = { hostInfo = "neovim" },
|
||||
cmd = { "typescript-language-server", "--stdio" },
|
||||
filetypes = {
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
},
|
||||
root_markers = { "tsconfig.json", "jsconfig.json", "package.json", ".git" },
|
||||
handlers = {
|
||||
-- handle rename request for certain code actions like extracting functions / types
|
||||
["_typescript.rename"] = function(_, result, ctx)
|
||||
local client = assert(vim.lsp.get_client_by_id(ctx.client_id))
|
||||
vim.lsp.util.show_document({
|
||||
uri = result.textDocument.uri,
|
||||
range = {
|
||||
start = result.position,
|
||||
["end"] = result.position,
|
||||
},
|
||||
}, client.offset_encoding)
|
||||
vim.lsp.buf.rename()
|
||||
return vim.NIL
|
||||
end,
|
||||
},
|
||||
commands = {
|
||||
["editor.action.showReferences"] = function(command, ctx)
|
||||
local client = assert(vim.lsp.get_client_by_id(ctx.client_id))
|
||||
local file_uri, position, references = unpack(command.arguments)
|
||||
|
||||
local quickfix_items = vim.lsp.util.locations_to_items(references, client.offset_encoding)
|
||||
vim.fn.setqflist({}, " ", {
|
||||
title = command.title,
|
||||
items = quickfix_items,
|
||||
context = {
|
||||
command = command,
|
||||
bufnr = ctx.bufnr,
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.util.show_document({
|
||||
uri = file_uri,
|
||||
range = {
|
||||
start = position,
|
||||
["end"] = position,
|
||||
},
|
||||
}, client.offset_encoding)
|
||||
|
||||
vim.cmd("botright copen")
|
||||
end,
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
-- ts_ls provides `source.*` code actions that apply to the whole file. These only appear in
|
||||
-- `vim.lsp.buf.code_action()` if specified in `context.only`.
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "LspTypescriptSourceAction", function()
|
||||
local source_actions = vim.tbl_filter(function(action)
|
||||
return vim.startswith(action, "source.")
|
||||
end, client.server_capabilities.codeActionProvider.codeActionKinds)
|
||||
|
||||
vim.lsp.buf.code_action({
|
||||
context = {
|
||||
only = source_actions,
|
||||
},
|
||||
})
|
||||
end, {})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
"vim-scripts/icalendar.vim",
|
||||
setup = function()
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
ics = "icalendar",
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = { "InsertEnter", "CmdlineEnter" },
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"rafamadriz/friendly-snippets",
|
||||
"onsails/lspkind.nvim",
|
||||
"roobert/tailwindcss-colorizer-cmp.nvim",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
local lspkind = require("lspkind")
|
||||
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
|
||||
cmp.setup({
|
||||
completion = {
|
||||
autocomplete = { cmp.TriggerEvent.TextChanged },
|
||||
completeopt = "menu,menuone,noselect", -- standard Vim option
|
||||
},
|
||||
preselect = cmp.PreselectMode.Item,
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
["<C-u>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
|
||||
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
-- LSP completions first
|
||||
{ name = "nvim_lsp", priority = 1000 },
|
||||
{ name = "nvim_lsp_signature_help", priority = 900 },
|
||||
-- Snippets below LSP
|
||||
{ name = "luasnip", priority = 700 },
|
||||
-- Then none-ls / buffer / path
|
||||
{ name = "buffer", priority = 400 },
|
||||
{ name = "path", priority = 300 },
|
||||
{ name = "none-ls", priority = 200 },
|
||||
}),
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
-- lspkind icons
|
||||
vim_item.kind = lspkind.symbolic(vim_item.kind, { mode = "symbol_text" })
|
||||
|
||||
-- tailwindcss-colorizer
|
||||
if entry.source.name == "nvim_lsp" then
|
||||
local ok, tw = pcall(require, "tailwindcss-colorizer-cmp")
|
||||
if ok then
|
||||
vim_item = tw.formatter(entry, vim_item)
|
||||
end
|
||||
end
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
{
|
||||
"nvim-mini/mini.comment",
|
||||
version = false,
|
||||
},
|
||||
{ "windwp/nvim-autopairs", event = "InsertEnter", opts = {} },
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
"github/copilot.vim",
|
||||
config = function()
|
||||
vim.keymap.set("i", "<M-Space>", 'copilot#Accept("\\<CR>")', {
|
||||
expr = true,
|
||||
replace_keycodes = false,
|
||||
})
|
||||
vim.g.copilot_no_tab_map = true
|
||||
vim.cmd("Copilot disable")
|
||||
vim.keymap.set("n", "<leader>cd", ":Copilot disable<CR>")
|
||||
vim.keymap.set("n", "<leader>ce", ":Copilot enable<CR>")
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
return {
|
||||
"sbdchd/neoformat",
|
||||
cmd = { "Neoformat" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>f",
|
||||
function()
|
||||
vim.cmd("Neoformat")
|
||||
end,
|
||||
desc = "Format",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
vim.g.neoformat_try_node_exe = 1
|
||||
vim.g.neoformat_enabled_go = { "gofmt", "goimports" } -- tries gofmt first, then goimports
|
||||
|
||||
-- Optional: Configure specific formatter options
|
||||
-- For gofmt (usually no args needed)
|
||||
vim.g.neoformat_go_gofmt = {
|
||||
exe = "gofmt",
|
||||
args = {},
|
||||
stdin = 1, -- send buffer data via stdin
|
||||
}
|
||||
|
||||
-- For goimports (if you want to use it)
|
||||
vim.g.neoformat_go_goimports = {
|
||||
exe = "goimports",
|
||||
args = {},
|
||||
stdin = 1,
|
||||
}
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
return {'nvim-telescope/telescope-fzf-native.nvim', build = 'make', lazy=true}
|
||||
@@ -0,0 +1,18 @@
|
||||
return {
|
||||
{
|
||||
"f-person/git-blame.nvim",
|
||||
lazy = true,
|
||||
cmd = { "GitBlameEnable", "GitBlameDisable", "GitBlameToggle" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>gb",
|
||||
":GitBlameToggle<CR>",
|
||||
desc = "Toggle Git Blame",
|
||||
mode = "n",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"sindrets/diffview.nvim",
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
'lewis6991/gitsigns.nvim',
|
||||
opts = {
|
||||
signs = {
|
||||
add = {text = '+'},
|
||||
change = {text = '~'},
|
||||
delete = {text = '_'},
|
||||
topdelete = {text = '‾'},
|
||||
changedelete = {text = '~'}
|
||||
}
|
||||
},
|
||||
event="VeryLazy"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
'kdheepak/lazygit.nvim',
|
||||
config = function()
|
||||
|
||||
vim.keymap.set('n', '<leader>gg', function() vim.cmd('LazyGit') end,
|
||||
{desc = "LazyGit"})
|
||||
end,
|
||||
event = "VeryLazy"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
"kawre/leetcode.nvim",
|
||||
build = ":TSUpdate html",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"nvim-lua/plenary.nvim", -- required by telescope
|
||||
"MunifTanjim/nui.nvim",
|
||||
|
||||
-- optional
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"rcarriga/nvim-notify",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
cmd = "Leet",
|
||||
opts = {
|
||||
lang = "golang"
|
||||
-- configuration goes here
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "auto",
|
||||
component_separators = "|",
|
||||
section_separators = "",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
return {
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
build = "cd app && yarn install",
|
||||
init = function()
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
end,
|
||||
ft = { "markdown" },
|
||||
},
|
||||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-mini/mini.nvim" }, -- if you use the mini.nvim suite
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.icons' }, -- if you use standalone mini plugins
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
|
||||
---@module 'render-markdown'
|
||||
---@type render.md.UserConfig
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
return {'chentoast/marks.nvim', opts = {}}
|
||||
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"mason-org/mason.nvim",
|
||||
opts = {}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
return {
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- optional, but recommended
|
||||
},
|
||||
lazy = false, -- neo-tree will lazily load itself
|
||||
config = function()
|
||||
vim.keymap.set("n", "<leader>e", ":Neotree toggle right<CR>", { desc = "Toggle File Explorer" })
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
return {
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
dependencies = {
|
||||
"nvimtools/none-ls-extras.nvim",
|
||||
},
|
||||
config = function()
|
||||
local setup, null_ls = pcall(require, "null-ls")
|
||||
if not setup then
|
||||
return
|
||||
end
|
||||
|
||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
-- Code Actions
|
||||
require("none-ls.code_actions.eslint_d"),
|
||||
null_ls.builtins.code_actions.gitsigns, -- Optional: git-related code actions
|
||||
null_ls.builtins.code_actions.refactoring,
|
||||
-- Diagnostics
|
||||
require("none-ls.diagnostics.eslint_d"),
|
||||
null_ls.builtins.diagnostics.golangci_lint,
|
||||
-- Hover documentation (optional)
|
||||
null_ls.builtins.hover.dictionary,
|
||||
},
|
||||
vim.keymap.set("n", "<leader>rn", function()
|
||||
vim.lsp.buf.rename()
|
||||
end, { desc = "Rename Variable" }),
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mrcjkb/rustaceanvim",
|
||||
version = "^7", -- Recommended
|
||||
lazy = false, -- This plugin is already lazy
|
||||
},
|
||||
{
|
||||
{
|
||||
"antosha417/nvim-lsp-file-operations",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
-- Uncomment whichever supported plugin(s) you use
|
||||
-- "nvim-tree/nvim-tree.lua",
|
||||
-- "nvim-neo-tree/neo-tree.nvim",
|
||||
-- "simonmclean/triptych.nvim"
|
||||
},
|
||||
config = function()
|
||||
require("lsp-file-operations").setup()
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
return {
|
||||
"stevearc/oil.nvim",
|
||||
config = function()
|
||||
require("oil").setup({
|
||||
columns = { "icon" },
|
||||
keymaps = {
|
||||
["g?"] = "actions.show_help",
|
||||
["gs"] = "actions.change_sort",
|
||||
["<CR>"] = "actions.select",
|
||||
["<C-p>"] = "actions.preview",
|
||||
["<C-c>"] = "actions.close",
|
||||
["<C-l>"] = "actions.refresh",
|
||||
["-"] = "actions.parent",
|
||||
["_"] = "actions.open_cwd",
|
||||
["`"] = "actions.cd",
|
||||
["~"] = "actions.tcd",
|
||||
["g."] = "actions.toggle_hidden",
|
||||
},
|
||||
use_default_keymaps = false,
|
||||
view_options = {
|
||||
show_hidden = true,
|
||||
sort = { { "type", "asc" }, { "name", "asc" } },
|
||||
},
|
||||
skip_confirm_for_simple_edits = true,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "-", function(dir)
|
||||
require("oil").open(dir)
|
||||
end, { desc = "Open parent directory" })
|
||||
end,
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
'gpanders/nvim-parinfer'
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
'sheerun/vim-polyglot'
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
return { 'stevearc/quicker.nvim',
|
||||
event = "FileType qf",
|
||||
opts = {},
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
return {
|
||||
"michaelrommel/nvim-silicon",
|
||||
lazy = true,
|
||||
cmd = "Silicon",
|
||||
config = function()
|
||||
local get_visual = function()
|
||||
local curpos = vim.fn.getcurpos()
|
||||
local one = { row = curpos[2] - 1, col = curpos[3] - 1 }
|
||||
local two = { row = vim.fn.line("v") - 1, col = vim.fn.col("v") - 1 }
|
||||
|
||||
if one.row == two.row then
|
||||
if one.col > two.col then
|
||||
local tmp = one
|
||||
one = two
|
||||
two = tmp
|
||||
end
|
||||
elseif one.row > two.row then
|
||||
local tmp = one
|
||||
one = two
|
||||
two = tmp
|
||||
end
|
||||
|
||||
two.col = two.col + 1
|
||||
return one.row
|
||||
end
|
||||
require("nvim-silicon").setup({
|
||||
font = "JetBrainsMono Nerd Font=24",
|
||||
no_window_controls = true,
|
||||
no_line_number = false,
|
||||
line_offset = get_visual() + 1,
|
||||
to_clipboard = true,
|
||||
window_title = function()
|
||||
return vim.fn.fnamemodify(vim.fn.bufname(vim.fn.bufnr()), ":~:.") .. " - @jpporta"
|
||||
end,
|
||||
language = function()
|
||||
return vim.bo.filetype
|
||||
end,
|
||||
})
|
||||
vim.keymap.set("v", "<leader>cs", "<cmd>'<,'>Silicon<CR>", { desc = "[C]ode [S]elfie" })
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
return {
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
bigfile = { enabled = true },
|
||||
dashboard = { enabled = true },
|
||||
explorer = { enabled = false },
|
||||
indent = { enabled = false },
|
||||
input = { enabled = true },
|
||||
picker = { enabled = true },
|
||||
notifier = { enabled = true },
|
||||
quickfile = { enabled = true },
|
||||
scope = { enabled = true },
|
||||
scroll = { enabled = false },
|
||||
statuscolumn = { enabled = true },
|
||||
words = { enabled = true },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
{
|
||||
"NvChad/nvim-colorizer.lua",
|
||||
opts = {
|
||||
user_default_options = {
|
||||
tailwind = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
version = "*",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"xiyaowong/telescope-emoji",
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
opts = {
|
||||
defaults = { mappings = { i = { ["<C-u>"] = false, ["<C-d>"] = false } } },
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true, -- false will only do exact matching
|
||||
override_generic_sorter = true, -- override the generic sorter
|
||||
override_file_sorter = true, -- override the file sorter
|
||||
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||
},
|
||||
},
|
||||
pickers = { colorscheme = { enable_preview = true } },
|
||||
},
|
||||
config = function()
|
||||
pcall(require("telescope").load_extension, "fzf")
|
||||
pcall(require("telescope").load_extension, "emoji")
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>?",
|
||||
require("telescope.builtin").oldfiles,
|
||||
{ desc = "[?] Find recently opened files" }
|
||||
)
|
||||
vim.keymap.set("n", "<leader><space>", function()
|
||||
require("telescope.builtin").buffers({
|
||||
sort_mru = true,
|
||||
ignore_current_buffer = true,
|
||||
})
|
||||
end, { desc = "[ ] Find existing buffers" })
|
||||
vim.keymap.set("n", "gr", require("telescope.builtin").lsp_references, { desc = "[G]oto [R]eferences" })
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>ds",
|
||||
require("telescope.builtin").lsp_document_symbols,
|
||||
{ desc = "[D]ocument [S]ymbols" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>ws",
|
||||
require("telescope.builtin").lsp_dynamic_workspace_symbols,
|
||||
{ desc = "[W]orkspace [S]ymbols" }
|
||||
)
|
||||
vim.keymap.set("n", "<leader>/", function()
|
||||
require("telescope.builtin").current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
}))
|
||||
end, { desc = "[/] Fuzzily search in current buffer" })
|
||||
vim.keymap.set("n", "<leader>sf", require("telescope.builtin").find_files, { desc = "[S]earch [F]iles" })
|
||||
vim.keymap.set("n", "<leader>sh", require("telescope.builtin").help_tags, { desc = "[S]earch [H]elp" })
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>sw",
|
||||
require("telescope.builtin").grep_string,
|
||||
{ desc = "[S]earch current [W]ord" }
|
||||
)
|
||||
vim.keymap.set("n", "<leader>sg", require("telescope.builtin").live_grep, { desc = "[S]earch by [G]rep" })
|
||||
vim.keymap.set("n", "<leader>sd", require("telescope.builtin").diagnostics, { desc = "[S]earch [D]iagnostics" })
|
||||
vim.keymap.set("n", "<leader>ss", require("telescope.builtin").git_files, { desc = "Search Git Files" })
|
||||
vim.keymap.set("n", "<leader>sb", ":Telescope file_browser<CR>", { desc = "File browser" })
|
||||
vim.keymap.set("n", "<leader>st", ":Telescope colorscheme<CR>", { desc = "Switch Theme" })
|
||||
vim.keymap.set("n", "<leader>se", ":Telescope emoji<CR>", { desc = "Search Emoji" })
|
||||
end,
|
||||
event = "VeryLazy",
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
return {
|
||||
-- {
|
||||
-- "rebelot/kanagawa.nvim", -- neorg needs a colorscheme with treesitter support
|
||||
-- config = function()
|
||||
-- vim.cmd.colorscheme("kanagawa")
|
||||
-- end,
|
||||
-- },
|
||||
{
|
||||
"RRethy/base16-nvim",
|
||||
priority = 1000,
|
||||
},
|
||||
{
|
||||
"EdenEast/nightfox.nvim",
|
||||
priority = 1000, -- Ensure it loads first
|
||||
},
|
||||
{
|
||||
"shaunsingh/nord.nvim",
|
||||
priority = 1000, -- Ensure it loads first
|
||||
},
|
||||
{
|
||||
"Mofiqul/dracula.nvim",
|
||||
priority = 1000, -- Ensure it loads first
|
||||
},
|
||||
-- {
|
||||
-- "olimorris/onedarkpro.nvim",
|
||||
-- priority = 1000, -- Ensure it loads first
|
||||
-- },
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
priority = 1000,
|
||||
},
|
||||
{ "sainnhe/everforest", priority = 1000 },
|
||||
{ "kdheepak/monochrome.nvim", priority = 1000 },
|
||||
{ "ellisonleao/gruvbox.nvim", priority = 1000 },
|
||||
{
|
||||
"xiyaowong/transparent.nvim",
|
||||
priority = 1000,
|
||||
opts = {
|
||||
groups = {
|
||||
"Normal",
|
||||
"NormalNC",
|
||||
"Comment",
|
||||
"Constant",
|
||||
"Special",
|
||||
"Identifier",
|
||||
"Statement",
|
||||
"PreProc",
|
||||
"Type",
|
||||
"Underlined",
|
||||
"Todo",
|
||||
"String",
|
||||
"Function",
|
||||
"Conditional",
|
||||
"Repeat",
|
||||
"Operator",
|
||||
"Structure",
|
||||
"LineNr",
|
||||
"NonText",
|
||||
"SignColumn",
|
||||
"CursorLine",
|
||||
"CursorLineNr",
|
||||
"StatusLine",
|
||||
"StatusLineNC",
|
||||
"EndOfBuffer",
|
||||
},
|
||||
extra_groups = {
|
||||
"NormalFloat", -- plugins which have float panel such as Lazy, Mason, LspInfo
|
||||
"NvimTreeNormal", -- NvimTree
|
||||
},
|
||||
},
|
||||
},
|
||||
-- {
|
||||
-- "fynnfluegge/monet.nvim",
|
||||
-- name = "monet",
|
||||
-- opts = {
|
||||
-- tranparent_background = true,
|
||||
-- dark_mode = true,
|
||||
-- },
|
||||
-- },
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
priority = 1000,
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"rebelot/kanagawa.nvim",
|
||||
priority = 1000,
|
||||
},
|
||||
-- { "kepano/flexoki-neovim", priority = 1000, name = "flexoki" },
|
||||
-- { "jacoborus/tender.vim", priority = 1000, name = "tender" },
|
||||
-- { "bluz71/vim-moonfly-colors", name = "moonfly", lazy = false, priority = 1000 },
|
||||
-- {
|
||||
-- "scottmckendry/cyberdream.nvim",
|
||||
-- lazy = false,
|
||||
-- priority = 1000,
|
||||
-- config = function()
|
||||
-- require("cyberdream").setup({
|
||||
-- -- Recommended - see "Configuring" below for more config options
|
||||
-- transparent = true,
|
||||
-- italic_comments = true,
|
||||
-- hide_fillchars = true,
|
||||
-- borderless_telescope = true,
|
||||
-- terminal_colors = true,
|
||||
-- })
|
||||
-- vim.cmd("colorscheme cyberdream") -- set the colorscheme
|
||||
-- end,
|
||||
-- },
|
||||
{ "rose-pine/neovim", as = "rose-pine" },
|
||||
{ "Shatur/neovim-ayu" },
|
||||
{
|
||||
"lalitmee/cobalt2.nvim",
|
||||
dependencies = { "tjdevries/colorbuddy.nvim", tag = "v1.0.0" },
|
||||
},
|
||||
{ "tanvirtin/monokai.nvim" },
|
||||
|
||||
{
|
||||
"alexwu/nvim-snazzy",
|
||||
dependencies = { "rktjmp/lush.nvim" },
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {},
|
||||
event = "VeryLazy",
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
return {
|
||||
{
|
||||
-- Highlight, edit, and navigate code
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
dependencies = { "tpope/vim-markdown" },
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
require("nvim-treesitter").setup({
|
||||
disable = { "markdown" },
|
||||
auto_install = true,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true, disable = { "python" } },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<c-space>",
|
||||
node_incremental = "<c-space>",
|
||||
scope_incremental = "<c-s>",
|
||||
node_decremental = "<M-space>",
|
||||
},
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
["aa"] = "@parameter.outer",
|
||||
["ia"] = "@parameter.inner",
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true,
|
||||
goto_next_start = {
|
||||
["]m"] = "@function.outer",
|
||||
["]]"] = "@class.outer",
|
||||
},
|
||||
goto_next_end = {
|
||||
["]M"] = "@function.outer",
|
||||
["]["] = "@class.outer",
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[m"] = "@function.outer",
|
||||
["[["] = "@class.outer",
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[M"] = "@function.outer",
|
||||
["[]"] = "@class.outer",
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = { ["<leader>sa"] = "@parameter.inner" },
|
||||
swap_previous = { ["<leader>sA"] = "@parameter.inner" },
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
"christoomey/vim-tmux-navigator",
|
||||
cmd = {
|
||||
"TmuxNavigateLeft", "TmuxNavigateDown", "TmuxNavigateUp",
|
||||
"TmuxNavigateRight", "TmuxNavigatePrevious"
|
||||
},
|
||||
keys = {
|
||||
{"<M-h>", "<cmd>TmuxNavigateLeft<cr>"},
|
||||
{"<M-j>", "<cmd>TmuxNavigateDown<cr>"},
|
||||
{"<M-k>", "<cmd>TmuxNavigateUp<cr>"},
|
||||
{"<M-l>", "<cmd>TmuxNavigateRight<cr>"},
|
||||
{"<M-\\>", "<cmd>TmuxNavigatePrevious<cr>"}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
'folke/which-key.nvim',
|
||||
opts = {},
|
||||
event="VeryLazy"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"vimwiki/vimwiki",
|
||||
init = function()
|
||||
vim.g.vimwiki_path = "~/docs/Wiki/"
|
||||
vim.g.vimwiki_syntax = "markdown"
|
||||
vim.g.vimwiki_ext = "md"
|
||||
vim.g.vimwiki_global_ext = 0
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
return {
|
||||
"zk-org/zk-nvim",
|
||||
name = "zk",
|
||||
opts = {
|
||||
-- Can be "telescope", "fzf", "fzf_lua", "minipick", "snacks_picker",
|
||||
-- or select" (`vim.ui.select`).
|
||||
picker = "select",
|
||||
|
||||
lsp = {
|
||||
-- `config` is passed to `vim.lsp.start(config)`
|
||||
config = {
|
||||
name = "zk",
|
||||
cmd = { "zk", "lsp" },
|
||||
filetypes = { "markdown" },
|
||||
-- on_attach = ...
|
||||
-- etc, see `:h vim.lsp.start()`
|
||||
},
|
||||
|
||||
-- automatically attach buffers in a zk notebook that match the given filetypes
|
||||
auto_attach = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
websocket
|
||||
telehealth
|
||||
diarization
|
||||
Veradigm
|
||||
EMR
|
||||
cronjob
|
||||
JSON
|
||||
Serverless
|
||||
serverless
|
||||
colorschemes
|
||||
Avodah
|
||||
Gitea
|
||||
Unescapable
|
||||
Binary file not shown.
Reference in New Issue
Block a user