initial import
This commit is contained in:
commit
f9f53656f7
32 changed files with 1064 additions and 0 deletions
12
.editorconfig
Normal file
12
.editorconfig
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.lua]
|
||||
max_line_length = 120
|
||||
align_array_table = false
|
||||
1
init.lua
Normal file
1
init.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
require("config")
|
||||
28
lazy-lock.json
Normal file
28
lazy-lock.json
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"blink.cmp": { "branch": "main", "commit": "49f211fe5d729df53df4c042d7c3464cf47d199e" },
|
||||
"commander.nvim": { "branch": "main", "commit": "84101e8eb1613a72bbdec655b734f891d8a00694" },
|
||||
"flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
||||
"fzf-lua": { "branch": "main", "commit": "ac6a34ea39831ec71c14f72075facf377ea9a00d" },
|
||||
"glance.nvim": { "branch": "master", "commit": "cb19b86349cbe634eec0ea768b9a27fdd6d24f34" },
|
||||
"hurl.nvim": { "branch": "main", "commit": "bf00b4ee56dc8026dd7cd068236fb2c01bb1e307" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lspsaga.nvim": { "branch": "main", "commit": "778d56ff9b387dacd14ae648ed5604394b486f51" },
|
||||
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
|
||||
"mini.files": { "branch": "main", "commit": "01001e0cfc1e79f581d055ae3f70fbac96a2f378" },
|
||||
"mini.statusline": { "branch": "main", "commit": "1b0edf76fe2af015f8c989385ff949f1db7aade2" },
|
||||
"namu.nvim": { "branch": "main", "commit": "fc9632d7deb81c737577ecfa5879aa3bd1fc0433" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "9b5d67119c46e3262ffe1508fe6d8540b79ad75d" },
|
||||
"none-ls.nvim": { "branch": "main", "commit": "a117163db44c256d53c3be8717f3e1a2a28e6299" },
|
||||
"nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "6522027785b305269fa17088395dfc0f456cedd2" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "85168f15808d89b0222313652b9d2777eda3cb08" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "4c3a5848ee0b09ecdea73adcd2a689190aeb728c" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "84d413b0c432adaeaf3dcaac646638bd99d06aa6" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
|
||||
}
|
||||
4
lsp/eslint.lua
Normal file
4
lsp/eslint.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
cmd = { "vscode-eslint-language-server", "--stdio" },
|
||||
filetypes = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx", "vue", "svelte", "astro" }
|
||||
}
|
||||
4
lsp/gopls.lua
Normal file
4
lsp/gopls.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
cmd = { "gopls" },
|
||||
filetypes = { "go", "gomod", "gowork", "gotmpl" }
|
||||
}
|
||||
4
lsp/lemminx.lua
Normal file
4
lsp/lemminx.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
cmd = { "lemminx" },
|
||||
filetypes = { "xml", "xsd", "xsl", "xslt", "svg" }
|
||||
}
|
||||
4
lsp/lua_ls.lua
Normal file
4
lsp/lua_ls.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
cmd = { "lua-language-server" },
|
||||
filetypes = { "lua" }
|
||||
}
|
||||
14
lsp/pyright.lua
Normal file
14
lsp/pyright.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
cmd = { "pyright-langserver", "--stdio" },
|
||||
filetypes = { "python" },
|
||||
settings = {
|
||||
python = {
|
||||
analysis = {
|
||||
autoSearchPaths = true,
|
||||
diagnosticMode = "openFilesOnly",
|
||||
useLibraryCodeForTypes = true
|
||||
}
|
||||
}
|
||||
},
|
||||
single_file_support = true
|
||||
}
|
||||
4
lsp/ruff.lua
Normal file
4
lsp/ruff.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
cmd = { "ruff", "server" },
|
||||
filetypes = { "python" }
|
||||
}
|
||||
26
lsp/tailwindcss.lua
Normal file
26
lsp/tailwindcss.lua
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
return {
|
||||
cmd = { "tailwindcss-language-server", "--stdio" },
|
||||
filetypes = { "aspnetcorerazor", "astro", "astro-markdown", "blade", "clojure", "django-html", "htmldjango", "edge", "eelixir", "elixir", "ejs", "erb", "eruby", "gohtml", "gohtmltmpl", "haml", "handlebars", "hbs", "html", "htmlangular", "html-eex", "heex", "jade", "leaf", "liquid", "markdown", "mdx", "mustache", "njk", "nunjucks", "php", "razor", "slim", "twig", "css", "less", "postcss", "sass", "scss", "stylus", "sugarss", "javascript", "javascriptreact", "reason", "rescript", "typescript", "typescriptreact", "vue", "svelte", "templ" },
|
||||
settings = {
|
||||
tailwindCSS = {
|
||||
classAttributes = { "class", "className", "classList", "class:list", "ngClass", "pathClassName" },
|
||||
experimental = {
|
||||
classRegex = {
|
||||
{
|
||||
"(?:clsx|cva|cx)\\(([^)(]*(?:\\([^)(]*(?:\\([^)(]*(?:\\([^)(]*\\)[^)(]*)*\\)[^)(]*)*\\)[^)(]*)*)\\)",
|
||||
"'([^']*)'",
|
||||
},
|
||||
{
|
||||
"(?:clsx|cva|cx)\\(([^)(]*(?:\\([^)(]*(?:\\([^)(]*(?:\\([^)(]*\\)[^)(]*)*\\)[^)(]*)*\\)[^)(]*)*)\\)",
|
||||
'"([^"]*)"',
|
||||
},
|
||||
{
|
||||
"(?:clsx|cva|cx)\\(([^)(]*(?:\\([^)(]*(?:\\([^)(]*(?:\\([^)(]*\\)[^)(]*)*\\)[^)(]*)*\\)[^)(]*)*)\\)",
|
||||
"`([^`]*)`",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
4
lsp/vtsls.lua
Normal file
4
lsp/vtsls.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
cmd = { "vtsls", "--stdio" },
|
||||
filetypes = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" }
|
||||
}
|
||||
2
lua/config/init.lua
Normal file
2
lua/config/init.lua
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
require("config.settings")
|
||||
require("config.lazy")
|
||||
24
lua/config/lazy.lua
Normal file
24
lua/config/lazy.lua
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ import = "plugins" },
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
61
lua/config/settings.lua
Normal file
61
lua/config/settings.lua
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
local opt = vim.opt
|
||||
|
||||
local wo = vim.wo
|
||||
local cmd = vim.cmd
|
||||
local g = vim.g
|
||||
|
||||
g.mapleader = "\\"
|
||||
g.maplocalleader = " "
|
||||
|
||||
opt.cindent = true
|
||||
opt.colorcolumn = "80"
|
||||
opt.clipboard:append({ "unnamed", "unnamedplus" })
|
||||
opt.expandtab = true
|
||||
opt.exrc = true
|
||||
opt.foldmethod = "syntax"
|
||||
opt.foldcolumn = "1"
|
||||
opt.foldlevelstart = 20
|
||||
opt.ignorecase = true
|
||||
opt.incsearch = true
|
||||
opt.inccommand = "split"
|
||||
opt.mouse = "a"
|
||||
opt.completeopt = "menuone,noselect"
|
||||
wo.wrap = false
|
||||
opt.number = true
|
||||
opt.path = { "." }
|
||||
opt.signcolumn = "yes"
|
||||
opt.shiftwidth = 2
|
||||
opt.smartcase = true
|
||||
opt.smarttab = true
|
||||
opt.spell = false
|
||||
opt.spelllang = "en_us"
|
||||
opt.scrolloff = 8
|
||||
opt.relativenumber = true
|
||||
opt.tabstop = 2
|
||||
opt.wildignore = {
|
||||
"node_modules/**",
|
||||
".git/**",
|
||||
".settings/**",
|
||||
".mvn/**",
|
||||
"*.pyc",
|
||||
}
|
||||
opt.wildcharm = vim.fn.char2nr("<C-z>")
|
||||
opt.list = true
|
||||
opt.listchars = "eol:↩,tab: "
|
||||
|
||||
opt.title = true
|
||||
opt.showmode = false
|
||||
|
||||
vim.o.updatetime = 250
|
||||
vim.o.ch = 0
|
||||
|
||||
opt.syntax = "enable"
|
||||
|
||||
vim.opt.swapfile = false
|
||||
vim.opt.backup = false
|
||||
vim.opt.undodir = vim.fn.expand("~/.vim/undodir")
|
||||
vim.opt.undofile = true
|
||||
|
||||
if vim.fn.has("termguicolors") == 1 then
|
||||
opt.termguicolors = true
|
||||
end
|
||||
21
lua/plugins/blink.lua
Normal file
21
lua/plugins/blink.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
return {
|
||||
{
|
||||
'saghen/blink.cmp',
|
||||
dependencies = 'rafamadriz/friendly-snippets',
|
||||
version = '*',
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
keymap = { preset = 'default' },
|
||||
appearance = {
|
||||
use_nvim_cmp_as_default = true,
|
||||
nerd_font_variant = 'mono'
|
||||
},
|
||||
signature = { enabled = true },
|
||||
completion = {
|
||||
documentation = { auto_show = true, auto_show_delay_ms = 500 },
|
||||
},
|
||||
},
|
||||
opts_extend = { "sources.default" },
|
||||
} }
|
||||
|
||||
154
lua/plugins/commander.lua
Normal file
154
lua/plugins/commander.lua
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
return {
|
||||
{
|
||||
"FeiyouG/commander.nvim",
|
||||
dependencies = { "nvim-telescope/telescope.nvim" },
|
||||
init = function()
|
||||
require("commander").setup({
|
||||
integration = {
|
||||
telescope = {
|
||||
enable = true,
|
||||
theme = require("telescope.themes").commander,
|
||||
},
|
||||
lazy = {
|
||||
enable = true,
|
||||
set_plugin_name_as_cat = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
require("commander").add({
|
||||
{
|
||||
desc = "Find git files",
|
||||
cmd = ":FzfLua git_files<CR>",
|
||||
},
|
||||
{
|
||||
cmd = ":FzfLua files<CR>",
|
||||
desc = "Find files",
|
||||
},
|
||||
{
|
||||
cmd = ":FzfLua buffers<CR>",
|
||||
desc = "Buffer list",
|
||||
},
|
||||
{
|
||||
cmd = ":FzfLua quickfix<CR>",
|
||||
desc = "Quickfix",
|
||||
},
|
||||
{
|
||||
cmd = ":FzfLua quickfix_stack<CR>",
|
||||
desc = "Quickfix History",
|
||||
},
|
||||
{
|
||||
cmd = ":FzfLua command_history<CR>",
|
||||
desc = "Command History",
|
||||
},
|
||||
{
|
||||
cmd = ":FzfLua git_commits<CR>",
|
||||
desc = "Git commits",
|
||||
},
|
||||
{
|
||||
cmd = ":FzfLua git_bcommits<CR>",
|
||||
desc = "Git buffer commits",
|
||||
},
|
||||
{
|
||||
cmd = ":FzfLua git_branches<CR>",
|
||||
desc = "Git branches",
|
||||
},
|
||||
{
|
||||
cmd = ":GV<CR>",
|
||||
desc = "Git log",
|
||||
},
|
||||
{
|
||||
cmd = ":Git blame",
|
||||
desc = "Git blame",
|
||||
},
|
||||
{
|
||||
cmd = ":DiffviewOpen<CR>",
|
||||
desc = "Diff view",
|
||||
},
|
||||
{
|
||||
cmd = ":UndotreeToggle<CR>",
|
||||
desc = "Undotree",
|
||||
},
|
||||
{
|
||||
cmd = ":EslintFixAll<CR>",
|
||||
desc = "ESLint: autofix all problems",
|
||||
},
|
||||
{
|
||||
cmd = ":'<,'>sort",
|
||||
desc = "Sort",
|
||||
},
|
||||
{
|
||||
cmd = ":Fidget history<CR>",
|
||||
desc = "Error/notification history",
|
||||
},
|
||||
{
|
||||
cmd = ":lua Snacks.terminal.toggle()<CR>",
|
||||
desc = "Terminal",
|
||||
keys = { "n", "<leader>t" },
|
||||
set = false,
|
||||
},
|
||||
{
|
||||
cmd = ":GitConflicts<CR>",
|
||||
desc = "Git conflicts to quickfix",
|
||||
},
|
||||
{
|
||||
cmd = ":LastCommitToQuickfix<CR>",
|
||||
desc = "Last Commit To quickfix",
|
||||
},
|
||||
{
|
||||
cmd = ":ForkToQuickfix<CR>",
|
||||
desc = "Branch commits to quickfix",
|
||||
},
|
||||
{
|
||||
cmd = ":Trouble diagnostics toggle focus=false filter.buf=0<CR>",
|
||||
desc = "Diagnostic window (current buffer)",
|
||||
},
|
||||
{
|
||||
cmd = ":Trouble symbols toggle pinned=true results.win.relative=win results.win.position=right<CR>",
|
||||
desc = "Symbols",
|
||||
},
|
||||
{
|
||||
cmd = ":PackageInfoShow<CR>",
|
||||
desc = "Show package.json versions",
|
||||
},
|
||||
{
|
||||
cmd = ":PackageInfoHide<CR>",
|
||||
desc = "Hide package.json versions",
|
||||
},
|
||||
{
|
||||
cmd = ":PackageInfoUpdate<CR>",
|
||||
desc = "Update package.json dependency",
|
||||
},
|
||||
{
|
||||
cmd = ":CoAuthor<CR>",
|
||||
desc = "Add Git CoAuthor",
|
||||
},
|
||||
{
|
||||
cmd = ":TailwindConcealToggle<CR>",
|
||||
desc = "Toggle conceal tailwind classes",
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command("Commander", function(args)
|
||||
require("commander").show()
|
||||
end, {
|
||||
desc = "Show commands",
|
||||
nargs = "*",
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command("LastCommitToQuickfix", function(args)
|
||||
require("utils.telescope").last_commit_to_quickfix()
|
||||
end, {
|
||||
desc = "Last Commit To quickfix",
|
||||
nargs = "?",
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command("ForkToQuickfix", function(args)
|
||||
require("utils.telescope").fork_to_quickfix(args.fargs[1])
|
||||
end, {
|
||||
desc = "Branch changes to quickfix",
|
||||
nargs = "?",
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
5
lua/plugins/flash.nvim.lua
Normal file
5
lua/plugins/flash.nvim.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
return {{
|
||||
"folke/flash.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
}}
|
||||
14
lua/plugins/fzf-lua.lua
Normal file
14
lua/plugins/fzf-lua.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
{
|
||||
"ibhagwan/fzf-lua",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
require("fzf-lua").setup({
|
||||
keymap = {
|
||||
fzf = {
|
||||
["ctrl-q"] = "select-all+accept",
|
||||
},
|
||||
},
|
||||
})
|
||||
end
|
||||
} }
|
||||
50
lua/plugins/glance.lua
Normal file
50
lua/plugins/glance.lua
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
return {
|
||||
"dnlhc/glance.nvim",
|
||||
config = function()
|
||||
local glance = require("glance")
|
||||
local actions = glance.actions
|
||||
glance.setup({
|
||||
border = {
|
||||
enable = true,
|
||||
},
|
||||
folds = {
|
||||
fold_closed = "",
|
||||
fold_open = "",
|
||||
folded = false, -- Automatically fold list on startup
|
||||
},
|
||||
mappings = {
|
||||
list = {
|
||||
["j"] = actions.next, -- Bring the cursor to the next item in the list
|
||||
["k"] = actions.previous, -- Bring the cursor to the previous item in the list
|
||||
["<Down>"] = actions.next,
|
||||
["<Up>"] = actions.previous,
|
||||
["J"] = actions.next_location,
|
||||
["K"] = actions.previous_location,
|
||||
["<C-u>"] = actions.preview_scroll_win(5),
|
||||
["<C-d>"] = actions.preview_scroll_win(-5),
|
||||
["v"] = actions.jump_vsplit,
|
||||
["s"] = actions.jump_split,
|
||||
["t"] = actions.jump_tab,
|
||||
["<CR>"] = actions.jump,
|
||||
["<TAB>"] = actions.enter_win("preview"), -- Focus preview window
|
||||
["q"] = actions.close,
|
||||
["Q"] = actions.close,
|
||||
["<Esc>"] = actions.close,
|
||||
["<C-q>"] = actions.quickfix,
|
||||
-- ['<Esc>'] = false -- disable a mapping
|
||||
},
|
||||
preview = {
|
||||
["Q"] = actions.close,
|
||||
["q"] = actions.close,
|
||||
["J"] = actions.next_location,
|
||||
["K"] = actions.previous_location,
|
||||
["<TAB>"] = actions.enter_win("list"), -- Focus list window
|
||||
},
|
||||
},
|
||||
winbar = {
|
||||
enable = false,
|
||||
},
|
||||
use_trouble_qf = true,
|
||||
})
|
||||
end
|
||||
}
|
||||
86
lua/plugins/hurl.nvim.lua
Normal file
86
lua/plugins/hurl.nvim.lua
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
local function load_env(file)
|
||||
local env_vars = {}
|
||||
local env_file = io.open(file, "r")
|
||||
if not env_file then return env_vars end
|
||||
|
||||
for line in env_file:lines() do
|
||||
local key, value = line:match("([^=]+)=([^=]+)")
|
||||
if key and value then
|
||||
env_vars[key] = value
|
||||
vim.fn.setenv(key, value) -- Optionally set it in Neovim's environment
|
||||
end
|
||||
end
|
||||
|
||||
env_file:close()
|
||||
return env_vars
|
||||
end
|
||||
|
||||
return {
|
||||
"jellydn/hurl.nvim",
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
-- Optional, for markdown rendering with render-markdown.nvim
|
||||
{
|
||||
'MeanderingProgrammer/render-markdown.nvim',
|
||||
opts = {
|
||||
file_types = { "markdown" },
|
||||
},
|
||||
ft = { "markdown" },
|
||||
},
|
||||
},
|
||||
ft = "hurl",
|
||||
opts = {
|
||||
-- Show debugging info
|
||||
debug = false,
|
||||
-- Show notification on run
|
||||
show_notification = false,
|
||||
-- Show response in popup or split
|
||||
mode = "split",
|
||||
-- Default formatter
|
||||
formatters = {
|
||||
json = { 'jq' }, -- Make sure you have install jq in your system, e.g: brew install jq
|
||||
html = {
|
||||
'prettier', -- Make sure you have install prettier in your system, e.g: npm install -g prettier
|
||||
'--parser',
|
||||
'html',
|
||||
},
|
||||
xml = {
|
||||
'tidy', -- Make sure you have installed tidy in your system, e.g: brew install tidy-html5
|
||||
'-xml',
|
||||
'-i',
|
||||
'-q',
|
||||
},
|
||||
},
|
||||
mappings = {
|
||||
close = 'q', -- Close the response popup or split view
|
||||
next_panel = '<C-n>', -- Move to the next response popup window
|
||||
prev_panel = '<C-p>', -- Move to the previous response popup window
|
||||
},
|
||||
fixture_vars = {
|
||||
{
|
||||
name = 'CARBONCENTRAL_FIREBASE_TOKEN',
|
||||
callback = function()
|
||||
local vars = load_env("vars.env")
|
||||
local firebaseUrl = vars["FIREBASE_URL"]
|
||||
local firebaseKey = vars["FIREBASE_KEY"]
|
||||
local email = vars["FIREBASE_EMAIL"]
|
||||
local password = vars["FIREBASE_PASSWORD"]
|
||||
|
||||
local h = io.popen(
|
||||
"curl --header \"Content-Type: application/json\" --request POST --data '{\"returnSecureToken\":true,\"email\":\"" ..
|
||||
email ..
|
||||
"\",\"password\":\"" ..
|
||||
password ..
|
||||
"\",\"clientType\":\"CLIENT_TYPE_WEB\"}' " .. firebaseUrl .. "?key=" ..
|
||||
firebaseKey)
|
||||
local rawdata = h:read("all")
|
||||
h:close()
|
||||
local t = vim.json.decode(rawdata)
|
||||
return t["idToken"]
|
||||
end
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
86
lua/plugins/lsp.lua
Normal file
86
lua/plugins/lsp.lua
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
local format_on_save = function(client, 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()
|
||||
vim.lsp.buf.format({
|
||||
bufnr = bufnr,
|
||||
async = false,
|
||||
})
|
||||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
local configs = {}
|
||||
for _, v in ipairs(vim.api.nvim_get_runtime_file('lsp/*', true)) do
|
||||
local name = vim.fn.fnamemodify(v, ':t:r')
|
||||
configs[name] = true
|
||||
end
|
||||
vim.lsp.enable(vim.tbl_keys(configs))
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
callback = function(args)
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if not client then return end
|
||||
|
||||
if vim.bo.filetype == "lua" or client.name == "jdtls" then
|
||||
-- Format the current buffer on save
|
||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||
buffer = args.buf,
|
||||
callback = function()
|
||||
vim.lsp.buf.format({ bufnr = args.buf, id = client.id })
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_lines = true
|
||||
})
|
||||
|
||||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
tools_to_install = {
|
||||
"lua-language-server", "vtsls", "ruff", "mypy", "black", "pyright", "tailwindcss-language-server",
|
||||
"eslint-lsp", "lemminx", "gopls"
|
||||
}
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("mason").setup()
|
||||
local mason_registry = require("mason-registry")
|
||||
mason_registry.refresh()
|
||||
for _, tool in pairs(opts.tools_to_install) do
|
||||
local package = mason_registry.get_package(tool)
|
||||
if not package:is_installed() then
|
||||
package:install()
|
||||
end
|
||||
end
|
||||
end
|
||||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
config = function(_, opts)
|
||||
local null_ls = require("null-ls")
|
||||
null_ls.setup({
|
||||
on_attach = function(client, bufnr)
|
||||
format_on_save(client, bufnr)
|
||||
end,
|
||||
sources = {
|
||||
null_ls.builtins.formatting.prettier,
|
||||
},
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
44
lua/plugins/lspsaga.nvim.lua
Normal file
44
lua/plugins/lspsaga.nvim.lua
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
return
|
||||
{
|
||||
'nvimdev/lspsaga.nvim',
|
||||
config = function()
|
||||
require('lspsaga').setup({
|
||||
symbol_in_winbar = {
|
||||
enable = true,
|
||||
hide_keyboard = true,
|
||||
},
|
||||
lightbulb = {
|
||||
enable = true,
|
||||
enable_in_insert = true,
|
||||
cache_code_action = true,
|
||||
sign = true,
|
||||
update_time = 150,
|
||||
sign_priority = 20,
|
||||
virtual_text = false,
|
||||
},
|
||||
diagnostic = {
|
||||
extend_relatedInformation = true,
|
||||
},
|
||||
finder = {
|
||||
keys = {
|
||||
vsplit = "s",
|
||||
split = "v",
|
||||
toggle_or_open = "<CR>",
|
||||
shuttle = "<TAB>",
|
||||
},
|
||||
},
|
||||
outline = {
|
||||
keys = {
|
||||
toggle_or_jump = "<CR>",
|
||||
},
|
||||
},
|
||||
implement = {
|
||||
enable = false,
|
||||
},
|
||||
})
|
||||
end,
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
}
|
||||
}
|
||||
3
lua/plugins/mini.files.lua
Normal file
3
lua/plugins/mini.files.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
{ 'echasnovski/mini.files', version = '*', opts = {} }
|
||||
}
|
||||
3
lua/plugins/mini.statusline.lua
Normal file
3
lua/plugins/mini.statusline.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
{ 'echasnovski/mini.statusline', version = '*',opts = {} },
|
||||
}
|
||||
24
lua/plugins/namu.nvim.lua
Normal file
24
lua/plugins/namu.nvim.lua
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
return {
|
||||
{
|
||||
"bassamsdata/namu.nvim",
|
||||
config = function()
|
||||
require("namu").setup({
|
||||
-- Enable the modules you want
|
||||
namu_symbols = {
|
||||
enable = true,
|
||||
options = {}, -- here you can configure namu
|
||||
},
|
||||
-- Optional: Enable other modules if needed
|
||||
ui_select = { enable = false }, -- vim.ui.select() wrapper
|
||||
colorscheme = {
|
||||
enable = false,
|
||||
options = {
|
||||
-- NOTE: if you activate persist, then please remove any vim.cmd("colorscheme ...") in your config, no needed anymore
|
||||
persist = true, -- very efficient mechanism to Remember selected colorscheme
|
||||
write_shada = false, -- If you open multiple nvim instances, then probably you need to enable this
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
}
|
||||
18
lua/plugins/neo-tree.nvim.lua
Normal file
18
lua/plugins/neo-tree.nvim.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
opts = {
|
||||
close_if_last_window = true,
|
||||
filesystem = {
|
||||
follow_current_file = {
|
||||
enabled = true,
|
||||
leave_dirs_open = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
7
lua/plugins/nvim-autopairs.lua
Normal file
7
lua/plugins/nvim-autopairs.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
opts = {},
|
||||
}
|
||||
}
|
||||
14
lua/plugins/snacks.nvim.lua
Normal file
14
lua/plugins/snacks.nvim.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
return { {
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
|
||||
opts = {
|
||||
notifier = { enabled = true },
|
||||
terminal = { enabled = true },
|
||||
indent = { enabled = true, only_scope = true, only_current = false },
|
||||
git = { enabled = true },
|
||||
bufdelete = { enabled = true },
|
||||
},
|
||||
} }
|
||||
|
||||
9
lua/plugins/tokyonight.lua
Normal file
9
lua/plugins/tokyonight.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
init = function()
|
||||
require("tokyonight").setup({transparent = true, dim_inactive = true, lualine_bold = true})
|
||||
vim.cmd("colo tokyonight-night")
|
||||
end
|
||||
}
|
||||
32
lua/plugins/treesitter.lua
Normal file
32
lua/plugins/treesitter.lua
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = ':TSUpdate',
|
||||
config = function()
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
|
||||
configs.setup({
|
||||
ensure_installed = {
|
||||
"c",
|
||||
"lua",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"query",
|
||||
"elixir",
|
||||
"heex",
|
||||
"javascript",
|
||||
"html",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"html",
|
||||
"jsdoc",
|
||||
"hurl",
|
||||
"typescript"
|
||||
},
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
auto_install = true,
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
1
lua/plugins/vim-fugitive.lua
Normal file
1
lua/plugins/vim-fugitive.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
return {{"tpope/vim-fugitive"}}
|
||||
301
lua/plugins/which-key.nvim.lua
Normal file
301
lua/plugins/which-key.nvim.lua
Normal file
|
|
@ -0,0 +1,301 @@
|
|||
return {
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
init = function()
|
||||
local wk = require("which-key")
|
||||
wk.add({
|
||||
{ "<A-j>", ":m .+1<cr>==", desc = "Move line down" },
|
||||
{ "<A-k>", ":m .-2<cr>==", desc = "Move line up" },
|
||||
{
|
||||
mode = "v",
|
||||
{ "<A-j>", ":m '>+1<CR>gv=gv", desc = "Move line down" },
|
||||
{ "<A-k>", ":m '<-2<CR>gv=gv", desc = "Move line up" },
|
||||
},
|
||||
{
|
||||
mode = "i",
|
||||
{ "<A-j>", "<Esc>:m .+1<CR>==gi", desc = "Move line down" },
|
||||
{ "<A-k>", "<Esc>:m .-2<CR>==gi", desc = "Move line up" },
|
||||
},
|
||||
|
||||
{ "<c-\\>", "<cmd>Commander<cr>", desc = "Commander" },
|
||||
|
||||
{ "<C-p>", "<cmd>FzfLua git_files<cr>", desc = "Find git files" },
|
||||
|
||||
{ ",", group = "Search" },
|
||||
{ ",p", "<cmd>FzfLua files<cr>", desc = "Files files" },
|
||||
{ ",b", "<cmd>FzfLua buffers<cr>", desc = "Buffer List" },
|
||||
{ ",q", "<cmd>FzfLua quickfix<cr>", desc = "Quickfix" },
|
||||
{ ",c", "<cmd>FzfLua command_history<cr>", desc = "Quickfix" },
|
||||
{ ",e", ":e **/*<C-z><S-Tab>", desc = "Open with autocomplete" },
|
||||
{ ",f", ":find **/*<C-z><S-Tab>", desc = "Find with autocomplete" },
|
||||
|
||||
{ "<leader>p", group = "Search" },
|
||||
{ "<leader>pc", "<cmd>FzfLua git_commits<cr>", desc = "Git commits" },
|
||||
{ "<leader>pf", "<cmd>FzfLua git_bcommits<cr>", desc = "Git file history" },
|
||||
{ "<leader>pb", "<cmd>FzfLua git_branches<cr>", desc = "Git branches" },
|
||||
{ "<leader>ph", "<cmd>FzfLua git_statuscr>", desc = "Git status" },
|
||||
{
|
||||
"<leader>ps",
|
||||
"<cmd>FzfLua live_grep<cr>",
|
||||
desc = "Project search"
|
||||
},
|
||||
|
||||
-- {
|
||||
-- "<leader>ds",
|
||||
-- function()
|
||||
-- require("utils.telescope").search_dotfiles()
|
||||
-- end,
|
||||
-- desc = "Search dot files 🔭",
|
||||
-- },
|
||||
|
||||
{ "K", "<cmd>Lspsaga hover_doc<cr>", desc = "Show documentation" },
|
||||
{ "<C-k>", "<cmd>Lspsaga hover_doc ++keep<cr>", desc = "Show documentation (keep)" },
|
||||
{ "<f2>", "<cmd>Lspsaga rename<cr>", desc = "Rename variable" },
|
||||
{ "g", group = "Go to" },
|
||||
{ "gd", ":Lspsaga goto_definition<cr>", desc = "Go to definition" },
|
||||
{
|
||||
"gD",
|
||||
function()
|
||||
vim.lsp.buf.declaration()
|
||||
end,
|
||||
desc = "Go to declaration",
|
||||
},
|
||||
{ "gt", ":Lspsaga goto_type_definition<cr>", desc = "Go to type definition" },
|
||||
{ "gh", ":Lspsaga finder<cr>", desc = "LSP Finder" },
|
||||
{ "gH", ":Lspsaga finder ++normal<cr>", desc = "LSP Finder (keep)" },
|
||||
{ "gj", ":Lspsaga diagnostic_jump_next<cr>", desc = "Next diagnostic message" },
|
||||
{ "gk", ":Lspsaga diagnostic_jump_prev<cr>", desc = "Previous diagnostic message" },
|
||||
|
||||
{ "<localleader>a", group = "Local File Actions" },
|
||||
{ "<localleader>ac", "<cmd>Lspsaga code_action<cr>", desc = "Code action" },
|
||||
{
|
||||
"<localleader>ag",
|
||||
function()
|
||||
vim.diagnostic.open_float(0, { scope = "line", focusable = false })
|
||||
end,
|
||||
desc = "Show line diagnostics",
|
||||
},
|
||||
{
|
||||
"<localleader>ad",
|
||||
"<cmd>Glance definitions<cr>",
|
||||
desc = "Definitions",
|
||||
},
|
||||
{
|
||||
"<localleader>ar",
|
||||
"<cmd>Glance references<cr>",
|
||||
desc = "References",
|
||||
},
|
||||
{
|
||||
"<localleader>ai",
|
||||
"<cmd>Glance implementations<cr>",
|
||||
desc = "References",
|
||||
},
|
||||
{
|
||||
"<localleader>at",
|
||||
"<cmd>Glance type_definitions<cr>",
|
||||
desc = "Type definitions",
|
||||
},
|
||||
{
|
||||
"<localleader>aI",
|
||||
"<cmd>Lspsaga incoming_calls<cr>",
|
||||
desc = "Incoming calls",
|
||||
},
|
||||
{
|
||||
"<localleader>aO",
|
||||
"<cmd>Lspsaga outgoing_calls<cr>",
|
||||
desc = "Outgoing calls",
|
||||
},
|
||||
|
||||
{
|
||||
"<localleader>O",
|
||||
"<cmd>Lspsaga outline<cr>",
|
||||
desc = "Toggle Outline",
|
||||
icon = "",
|
||||
},
|
||||
|
||||
{
|
||||
"<leader>g",
|
||||
group = "Git",
|
||||
},
|
||||
{
|
||||
"<leader>gd",
|
||||
"<cmd>DiffviewOpen<cr>",
|
||||
desc = "Diff view",
|
||||
},
|
||||
|
||||
{
|
||||
"»",
|
||||
"]",
|
||||
noremap = false,
|
||||
},
|
||||
{
|
||||
"«",
|
||||
"[",
|
||||
noremap = false,
|
||||
},
|
||||
{ "<localleader>h", group = "git signs" },
|
||||
{
|
||||
"<localleader>hs",
|
||||
function()
|
||||
require("gitsigns").stage_hunk()
|
||||
end,
|
||||
desc = "Stage hunk",
|
||||
},
|
||||
{
|
||||
"<localleader>hu",
|
||||
function()
|
||||
require("gitsigns").undo_stage_hunk()
|
||||
end,
|
||||
desc = "Undo stage hunk",
|
||||
},
|
||||
{
|
||||
"<localleader>hv",
|
||||
function()
|
||||
require("gitsigns").preview_hunk()
|
||||
end,
|
||||
desc = "Preview hunk",
|
||||
},
|
||||
{
|
||||
"<localleader>hb",
|
||||
function()
|
||||
require("gitsigns").blame_line()
|
||||
end,
|
||||
desc = "Blame line",
|
||||
},
|
||||
{
|
||||
"<localleader>hR",
|
||||
function()
|
||||
require("gitsigns").reset_buffer()
|
||||
end,
|
||||
desc = "Reset buffer",
|
||||
},
|
||||
{
|
||||
"<localleader>hr",
|
||||
function()
|
||||
require("gitsigns").reset_hunk()
|
||||
end,
|
||||
desc = "Reset hunk",
|
||||
},
|
||||
{
|
||||
"<localleader>hS",
|
||||
function()
|
||||
require("gitsigns").stage_buffer()
|
||||
end,
|
||||
desc = "Stage buffer",
|
||||
},
|
||||
{
|
||||
"<localleader>hU",
|
||||
function()
|
||||
require("gitsigns").reset_buffer_index()
|
||||
end,
|
||||
desc = "Reset buffer index",
|
||||
},
|
||||
{
|
||||
mode = "v",
|
||||
{
|
||||
"<localleader>hs",
|
||||
function()
|
||||
require("gitsigns").stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||
end,
|
||||
desc = "Stage hunk",
|
||||
},
|
||||
{
|
||||
"<localleader>hr",
|
||||
function()
|
||||
require("gitsigns").reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||
end,
|
||||
desc = "Reset hunk",
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"]c",
|
||||
function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal({ "]c", bang = true })
|
||||
else
|
||||
vim.schedule(function()
|
||||
require("gitsigns").nav_hunk("next")
|
||||
end)
|
||||
end
|
||||
end,
|
||||
desc = "Next hunk",
|
||||
},
|
||||
{
|
||||
"[c",
|
||||
function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal({ "[c", bang = true })
|
||||
else
|
||||
vim.schedule(function()
|
||||
require("gitsigns").nav_hunk("prev")
|
||||
end)
|
||||
end
|
||||
end,
|
||||
desc = "Previous hunk",
|
||||
},
|
||||
|
||||
{ "<leader>u", "<cmd>UndotreeToggle<cr>", desc = "Undotree", icon = "" },
|
||||
|
||||
{ "<leader>c", group = "quickfix" },
|
||||
{ "<leader>co", "<cmd>copen<cr>", desc = "Open" },
|
||||
{ "<leader>cf", "<cmd>cfirst<cr>", desc = "First result" },
|
||||
{ "<leader>cl", "<cmd>clast<cr>", desc = "Last result" },
|
||||
{ "<leader>cn", "<cmd>cnext<cr>", desc = "Next result" },
|
||||
{ "<leader>cp", "<cmd>cprevious<cr>", desc = "Previous result" },
|
||||
{ "<leader>cc", "<cmd>cclose<cr>", desc = "Close" },
|
||||
|
||||
{ "<localleader>c", group = "Location List" },
|
||||
{ "<localleader>co", "<cmd>lopen<cr>", desc = "Open" },
|
||||
{ "<localleader>cf", "<cmd>lfirst<cr>", desc = "First result" },
|
||||
{ "<localleader>cl", "<cmd>llast<cr>", desc = "Last result" },
|
||||
{ "<localleader>cn", "<cmd>lnext<cr>", desc = "Next result" },
|
||||
{ "<localleader>cp", "<cmd>lprevious<cr>", desc = "Previous result" },
|
||||
{ "<localleader>cc", "<cmd>lclose<cr>", desc = "Close" },
|
||||
|
||||
{ "<C-n>", "<cmd>Neotree toggle<cr>", desc = "Toggle neo-tree" },
|
||||
|
||||
{ "<leader>t", "<cmd>lua Snacks.terminal.toggle()<cr>", desc = "Toggle Terminal" },
|
||||
{ mode = { "t" }, { "<leader>t", "<cmd>lua Snacks.terminal.toggle()<cr>", desc = "Toggle Terminal" } },
|
||||
|
||||
{
|
||||
mode = { "n", "x", "o" },
|
||||
{
|
||||
"s",
|
||||
function()
|
||||
require("flash").jump()
|
||||
end,
|
||||
desc = "Flash ⚡",
|
||||
},
|
||||
{
|
||||
"S",
|
||||
function()
|
||||
require("flash").treesitter()
|
||||
end,
|
||||
desc = "Flash Treesitter ⚡",
|
||||
},
|
||||
},
|
||||
{
|
||||
mode = { "o", "x" },
|
||||
{
|
||||
"R",
|
||||
function()
|
||||
require("flash").treesitter_search()
|
||||
end,
|
||||
desc = "Flash Treesitter search ⚡",
|
||||
},
|
||||
},
|
||||
{
|
||||
mode = "c",
|
||||
{
|
||||
"<C-s>",
|
||||
function()
|
||||
require("flash").toggle()
|
||||
end,
|
||||
desc = "Toggle Flash Search ⚡",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue