irongit

nvim from scratch is usable

huncholanehuncholaneauthored
parent bbc1e0acommit 617a96c6119942d0efa9665670dfc19726b66a8cBrowse files

74 files changed, +606 -2294

+1-1kitty/kitty.conf
@@ -4,7 +4,7 @@
44 include ./kitty-themes/AdventureTime.conf
55
66 font_size 14
7-font_family JetBrainsMono Nerd Font
7+font_family Iosevka Nerd Font
88 bold_font auto
99 italic_font auto
1010 bold_italic_font auto
+0-13nvim/LICENSE
@@ -1,13 +0,0 @@
1-Copyright (c) 2015 Rui Abreu Ferreira <raf-ep@gmx.com>
2-
3-Permission to use, copy, modify, and/or distribute this software for any
4-purpose with or without fee is hereby granted, provided that the above
5-copyright notice and this permission notice appear in all copies.
6-
7-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
9-FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13-PERFORMANCE OF THIS SOFTWARE.
+0-140nvim/README.md
@@ -1,140 +0,0 @@
1-# Hygo Vim
2-
3-If you use vim style coding in any editor, this will help you instantly
4-convert to neovim.
5-
6-## Prerequisites
7-
8-- If you are using a mac, you need to use iterm2. The default terminal doesn't support true color, so all the colorschemes will look terrible and unreadable.
9-- Kitty terminal works best with neovim.
10-- Install a [NerdFont Font](https://www.nerdfonts.com/font-downloads)
11-- [FD-Find](https://github.com/sharkdp/fd)
12-
13-```bash
14-sudo apt install fd-find
15-```
16-
17-- [ripgrep](https://github.com/BurntSushi/ripgrep)
18-
19-```bash
20-sudo apt install ripgrep
21-```
22-
23-- Install Neovim
24- - Download for linux
25-
26-```bash
27-curl -L -o ~/nvim.appimage https://github.com/neovim/neovim/releases/download/v0.11.0/nvim-linux-x86_64.appimage
28-```
29-
30-- Add this to bashrc
31-
32-```bash
33-alias nvim='~/nvim.appimage'
34-alias nv=nvim
35-alias vim=nvim
36-```
37-
38-- Set up win32yank for wsl to paste like an absolute gangster
39- - Note use yanky `<leader>p` to paste if you delete before pasting cuz we use unnamedplus default keyboard
40-
41-```bash
42-curl -o win32yank.zip https://github.com/equalsraf/win32yank/releases/download/v0.1.1/win32yank-x86.zip -L
43-unzip win32yank.zip
44-chmod +x win32yank.exe
45-sudo mkdir /mnt/c/tools/
46-sudo cp win32yank.exe /mnt/c/tools/
47-rm win32yank*
48-```
49-
50-## Tmux like a pro
51-
52-- Add this to .tmux.conf
53-
54-```conf
55-source-file ~/.config/nvim/tmux.conf
56-```
57-
58-## Setup toggle term `~/.config/nvim/lua/plugins/toggleterm.lua`
59-
60-```lua
61-return {
62- "akinsho/toggleterm.nvim",
63- keys = {
64- -- Creates name group for which-key
65- {
66- "<leader>t",
67- desc = "toggleterm",
68- },
69- -- Creates a new floating terminal
70- {
71- "<leader>tf",
72- "<cmd>TermNew direction=float<cr>",
73- desc = "Create New Floating Terminal",
74- },
75- -- Creates a new tabbed terminal
76- {
77- "<leader>tt",
78- "<cmd>TermNew direction=tab<cr>",
79- desc = "Create New Tabbed Terminal",
80- },
81- -- Selects a terminal
82- {
83- "<leader>ts",
84- "<cmd>TermSelect<cr>",
85- desc = "Select Terminal",
86- },
87- },
88- opts = {
89- open_mapping = [[<c-\>]],
90- },
91-}
92-```
93-
94-## Setup autosave `~/.config/nvim/lua/config/autocmds.lua`
95-
96-- Add this to autocmd
97-
98-````lua
99--- autosave on focus lost and buffer change
100-local group = vim.api.nvim_create_augroup("autosave_group", { clear = true })
101-vim.api.nvim_create_autocmd({ "FocusLost", "BufLeave" }, {
102- group = group,
103- callback = function(opts)
104- if vim.bo.modifiable and not vim.bo.readonly and vim.bo.modified then
105- local file = vim.fn.expand("%t")
106- vim.cmd("silent! write")
107- vim.notify("Autosaved " .. file .. "\nSource " .. opts.event)
108- end
109- end,
110-}) ```
111-
112-## Vim In Your Browser `~/.config/nvim/lua/plugins/firenvim.lua`
113-
114-```lua
115-return {
116- -- enable firenvim
117- {
118- "glacambre/firenvim",
119- build = ":call firenvim#install(0)",
120- config = function()
121- if vim.g.started_by_firenvim then
122- vim.cmd("colorscheme tokyonight-day")
123- end
124- vim.g.firenvim_config = {
125- globalSettings = { alt = "all" },
126- localSettings = {
127- [".*"] = {
128- takeover = "never",
129- },
130- },
131- }
132- end,
133- },
134- -- disable extnsions based on firenvim
135- {
136- "folke/noice.nvim",
137- enabled = not vim.g.started_by_firenvim,
138- },
139-}
140-````
+0-3nvim/after/ftplugin/markdown.lua
@@ -1,3 +0,0 @@
1-local utils = require("utils.formatting")
2-
3-utils.set_tabs(2)
+0-28nvim/bashrc.sh
@@ -1,28 +0,0 @@
1-# Make nvim takeover everything
2-alias nvim='~/nvim.appimage'
3-alias vim=nvim
4-alias nv=nvim
5-export EDITOR=~/nvim.appimage
6-
7-# Make nice fzf for tmux prefix Keys
8-alias fzf-tmux-prefix='tmux list-keys -T prefix | grep -Po "(?<=prefix\s).*" | fzf --header="Prefixed Keys" --preview="echo {}" --border --preview-window=down:3:wrap | awk '\''{first = $1; $1=""; print $0}'\'' | sed '\''s/^ //g'\'
9-
10-# fzf tools
11-alias fzf-hist='fc -nl | fzf'
12-
13-# Add the go path
14-export GOPATH=$(go env GOPATH)
15-export PATH="$GOPATH/bin:$PATH"
16-
17-# wezterm
18-alias wezterm=wezterm.exe
19-function wezterm_osc7_cwd() {
20- printf "\033]7;file://%s%s\033\\" "$(hostname)" "$PWD"
21-}
22-PROMPT_COMMAND="wezterm_osc7_cwd; $PROMPT_COMMAND"
23-
24-# remove stupid zone identifier files
25-alias rmzif='sudo find . -name "*.Identifier" -type f -delete'
26-
27-# copy last command
28-alias clc='fc -ln -1 | clip.exe'
+0-1nvim/blocks.txt
@@ -1 +0,0 @@
1-█▓▒░▀▄▌▐▁▂▃▄▅▆▇█▇▆▅▄▃▂▁
+10-13nvim/init.lua
@@ -1,14 +1,11 @@
1-local function has_flag(flag)
2- for _, arg in ipairs(vim.v.argv) do
3- if arg == flag then
4- return true
5- end
6- end
7- return false
8-end
1+vim.o.number = true
2+vim.opt.expandtab = true
3+vim.g.mapleader = " "
4+vim.g.maplocalleader = ","
5+require("utils.general").set_tabs(4)
6+require("clipboard")
97
10-if has_flag("-R") then
11- require("config.vr")
12-else
13- require("config.lazy")
14-end
8+require("plugins.zzz")
9+require("filetypes.zzz")
10+require("autocmds")
11+require("keymaps")
+0-59nvim/lazy-lock.json
@@ -1,59 +0,0 @@
1-{
2- "CopilotChat.nvim": { "branch": "main", "commit": "a6576949e821e7abf9d0135e87576a51ec0e2e68" },
3- "LazyVim": { "branch": "main", "commit": "25abbf546d564dc484cf903804661ba12de45507" },
4- "LuaSnip": { "branch": "master", "commit": "de10d8414235b0a8cabfeba60d07c24304e71f5c" },
5- "SchemaStore.nvim": { "branch": "main", "commit": "8e74c08998fd786239caba373344f4e4601e21fe" },
6- "Toggleterm": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" },
7- "alpha-nvim": { "branch": "main", "commit": "2b3cbcdd980cae1e022409289245053f62fb50f6" },
8- "auto-session": { "branch": "main", "commit": "3b5d8947cf16ac582ef00443ede4cdd3dfa23af9" },
9- "blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" },
10- "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
11- "catppuccin": { "branch": "main", "commit": "30fa4d122d9b22ad8b2e0ab1b533c8c26c4dde86" },
12- "conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" },
13- "copilot.lua": { "branch": "master", "commit": "9d4bd5e89ce8b03d8ce99f841ad23ee3323506bf" },
14- "crates.nvim": { "branch": "main", "commit": "ac9fa498a9edb96dc3056724ff69d5f40b898453" },
15- "dotenv.nvim": { "branch": "main", "commit": "7d516e9293c6e3ac21830fb10a4e8674c02747c6" },
16- "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
17- "firenvim": { "branch": "master", "commit": "0c3b81444944ed51e9eb50b158b71ee26b611575" },
18- "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
19- "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
20- "gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" },
21- "grug-far.nvim": { "branch": "main", "commit": "385d1949dc21d0c39e7a74b4f4a25da18817bc86" },
22- "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
23- "hydra.nvim": { "branch": "main", "commit": "8c4a9f621ec7cdc30411a1f3b6d5eebb12b469dc" },
24- "jq-playground.nvim": { "branch": "main", "commit": "1f86010c463bbede6b6259952c51b61aac184010" },
25- "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
26- "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
27- "leetcode.nvim": { "branch": "master", "commit": "10f63d67201f6e988467485e6cf32d08176fcad2" },
28- "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" },
29- "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
30- "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
31- "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
32- "mini.ai": { "branch": "main", "commit": "45a26d032d8703f280c69c2ed9fb4e1bfc8f24f9" },
33- "mini.icons": { "branch": "main", "commit": "f9a177c11daa7829389b7b6eaaec8b8a5c47052d" },
34- "mini.pairs": { "branch": "main", "commit": "6e1cc569130f25b2c6fa16d8b21b31ddb1420a4a" },
35- "multicursors.nvim": { "branch": "main", "commit": "72225ea9e4443c3f4b9df91d0193e07c4ee8d382" },
36- "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
37- "none-ls.nvim": { "branch": "main", "commit": "53ec77181d96494b9dc9457110dd62dc623cc78d" },
38- "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
39- "nvim-lint": { "branch": "master", "commit": "f126af5345c7472e9a0cdbe1d1a29209be72c4c4" },
40- "nvim-lspconfig": { "branch": "master", "commit": "52364267cd7edbc0e9b25ab3bfb1c8f45dd58fde" },
41- "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
42- "nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" },
43- "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
44- "persistence.nvim": { "branch": "main", "commit": "166a79a55bfa7a4db3e26fc031b4d92af71d0b51" },
45- "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
46- "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" },
47- "render-markdown.nvim": { "branch": "main", "commit": "f626e90bbc4b3d8f4fd29c909d958b165af13f4a" },
48- "rustaceanvim": { "branch": "master", "commit": "e9c5aaba16fead831379d5f44617547a90b913c7" },
49- "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
50- "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
51- "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
52- "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
53- "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
54- "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
55- "ts-comments.nvim": { "branch": "main", "commit": "1bd9d0ba1d8b336c3db50692ffd0955fe1bb9f0c" },
56- "venv-selector.nvim": { "branch": "regexp", "commit": "5abc3354f7302b4319829e95f4bb3104fcec5325" },
57- "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" },
58- "yanky.nvim": { "branch": "main", "commit": "04775cc6e10ef038c397c407bc17f00a2f52b378" }
59-}
+0-28nvim/lazyvim.json
@@ -1,28 +0,0 @@
1-{
2- "extras": [
3- "lazyvim.plugins.extras.coding.luasnip",
4- "lazyvim.plugins.extras.coding.yanky",
5- "lazyvim.plugins.extras.editor.harpoon2",
6- "lazyvim.plugins.extras.editor.telescope",
7- "lazyvim.plugins.extras.lang.docker",
8- "lazyvim.plugins.extras.lang.git",
9- "lazyvim.plugins.extras.lang.go",
10- "lazyvim.plugins.extras.lang.json",
11- "lazyvim.plugins.extras.lang.markdown",
12- "lazyvim.plugins.extras.lang.python",
13- "lazyvim.plugins.extras.lang.rust",
14- "lazyvim.plugins.extras.lang.tailwind",
15- "lazyvim.plugins.extras.lang.toml",
16- "lazyvim.plugins.extras.lang.typescript",
17- "lazyvim.plugins.extras.lsp.none-ls",
18- "lazyvim.plugins.extras.ui.alpha",
19- "lazyvim.plugins.extras.util.dot",
20- "lazyvim.plugins.extras.util.gitui",
21- "lazyvim.plugins.extras.util.project"
22- ],
23- "install_version": 8,
24- "news": {
25- "NEWS.md": "10960"
26- },
27- "version": 8
28-}
+0-23nvim/logo.svg
@@ -1,23 +0,0 @@
1-<?xml version="1.0" encoding="UTF-8"?>
2-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3-<!-- Creator: CorelDRAW 2020 (64-Bit) -->
4-<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="29.6332mm" height="29.6332mm" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
5-viewBox="0 0 2963.32 2963.32"
6- xmlns:xlink="http://www.w3.org/1999/xlink"
7- xmlns:xodm="http://www.corel.com/coreldraw/odm/2003">
8- <defs>
9- <style type="text/css">
10- <![CDATA[
11- .fil0 {fill:url(#id0)}
12- ]]>
13- </style>
14- <linearGradient id="id0" gradientUnits="userSpaceOnUse" x1="1905.63" y1="1404.24" x2="-301.13" y2="-802.52">
15- <stop offset="0" style="stop-opacity:1; stop-color:#ED364D"/>
16- <stop offset="1" style="stop-opacity:1; stop-color:#E8A52F"/>
17- </linearGradient>
18- </defs>
19- <g id="Layer_x0020_1">
20- <metadata id="CorelCorpID_0Corel-Layer"/>
21- <path class="fil0" d="M600.98 99.59l0 0c76.63,-76.63 202.56,-76.01 278.57,0l123.97 123.97c76,76 76.63,201.94 0,278.57l0 0c-76.63,76.63 -201.94,76.63 -278.57,0l-123.97 -123.96c-76.63,-76.63 -76.63,-201.95 0,-278.58zm509.21 509.21l0 0c76.63,-76.63 202.31,-76.26 278.57,0l1176.31 1176.31c76.27,76.26 76.63,201.94 0,278.57l0 0c-76.63,76.63 -201.94,76.63 -278.57,0l-577.67 -577.67c-76.63,-76.63 -201.96,-76.61 -278.59,0.02l0 0c-76.61,76.61 -76.42,202.16 0,278.57l229.37 229.37c76.63,76.63 76.63,201.94 0,278.57l0 0c-76.63,76.63 -201.94,76.63 -278.57,0l-982.65 -982.65c-76.63,-76.63 -76.65,-201.96 -0.02,-278.59l0 0c76.63,-76.63 201.96,-76.61 278.59,0.02l277.36 277.36c76.63,76.63 201.96,76.61 278.57,0l0 0c76.63,-76.63 76.65,-201.96 0.02,-278.59l-122.72 -122.72c-76.63,-76.63 -76.63,-201.94 0,-278.57zm629.85 1744.18l0 0c76.63,-76.63 202.18,-76.4 278.57,0l231.97 231.96c76.42,76.42 76.63,201.94 0,278.57l0 0c-76.63,76.63 -201.94,76.63 -278.57,0l-231.97 -231.96c-76.63,-76.63 -76.63,-201.94 0,-278.57z"/>
22- </g>
23-</svg>
+0-7nvim/logo.txt
@@ -1,7 +0,0 @@
1- ▄▄ ▄▄ ▄▄▄ ▄▄▄ ▄▄▄▄ ▄▄▄▄
2- ██ ██ ██▄ ▄██ ██▀▀▀▀█ ██▀▀██
3- ██ ██ ██▄▄██ ██ ██ ██
4- ████████ ▀██▀ ██ ▄▄▄▄ ██ ██
5- ██ ██ ██ ██ ▀▀██ ██ ██
6- ██ ██ ██ ██▄▄▄██ ██▄▄██
7- ▀▀ ▀▀ ▀▀ ▀▀▀▀ ▀▀▀▀
+14-0nvim/lua/autocmds.lua
@@ -0,0 +1,14 @@
1+local function autosave()
2+ local ignore_ft = { "neo-tree", "", "gitcommit", "help", "qf", "dashboard", "jq", "oil", "TelescopePrompt" }
3+ if not vim.bo.readonly and vim.bo.modified and not vim.tbl_contains(ignore_ft, vim.bo.filetype) then
4+ vim.cmd("write")
5+ end
6+end
7+
8+vim.api.nvim_create_autocmd("BufLeave", {
9+ callback = autosave,
10+})
11+
12+vim.api.nvim_create_autocmd({ "FocusLost", "WinLeave" }, {
13+ callback = autosave,
14+})
+27-0nvim/lua/clipboard.lua
@@ -0,0 +1,27 @@
1+local clipboards = {
2+ xclip = {
3+ name = "xclip",
4+ copy = {
5+ ["+"] = "xclip -selection clipboard",
6+ ["*"] = "xclip -selection primary",
7+ },
8+ paste = {
9+ ["+"] = "xclip -selection clipboard -o",
10+ ["*"] = "xclip -selection primary -o",
11+ },
12+ cache_enabled = 1,
13+ },
14+ wayland = {
15+ name = "wl-clipboard",
16+ copy = { ["+"] = "wl-copy", ["*"] = "wl-copy" },
17+ paste = {
18+ ["+"] = "wl-paste --no-newline",
19+ ["*"] = "wl-paste --no-newline",
20+ },
21+ cache_enabled = 1,
22+ },
23+}
24+-- wayland settings
25+if vim.fn.getenv("WAYLAND_DISPLAY") ~= vim.NIL then
26+ vim.g.clipboard = clipboards.wayland
27+end
+0-93nvim/lua/config/autocmds/init.lua
@@ -1,93 +0,0 @@
1--- Autocmds are automatically loaded on the VeryLazy event
2--- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
3---
4--- Add any additional autocmds here
5--- with `vim.api.nvim_create_autocmd`
6---
7--- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults)
8--- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell")
9-local general = vim.api.nvim_create_augroup("autosave_group", { clear = true })
10-
11-vim.api.nvim_create_autocmd({ "FocusLost", "BufLeave", "CmdlineEnter", "QuitPre" }, {
12- group = general,
13- callback = function(opts)
14- local ignore_ft = {
15- "neo-tree",
16- "lazy",
17- "TelescopePrompt",
18- "gitcommit",
19- "help",
20- "qf",
21- "dashboard",
22- "jq",
23- }
24-
25- local ft = vim.bo.filetype
26- if vim.bo.modifiable and not vim.bo.readonly and vim.bo.modified and not vim.tbl_contains(ignore_ft, ft) then
27- local file = vim.fn.expand("%t")
28- vim.cmd("LazyFormat")
29- vim.cmd("silent! write")
30- vim.notify("Autosaved " .. file .. "\nSource " .. opts.event)
31- end
32- end,
33-})
34-
35--- tmux files as bash filetype
36-vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
37- pattern = "*.tmux",
38- callback = function()
39- vim.bo.filetype = "bash"
40- end,
41-})
42-
43--- stop making comments on new lines
44-vim.opt.formatoptions:remove({ "c", "r", "o" })
45-vim.api.nvim_create_autocmd("FileType", {
46- pattern = "*",
47- callback = function()
48- -- Disable comment on new line
49- vim.opt.formatoptions:remove({ "c", "r", "o" })
50- end,
51- group = general,
52- desc = "Disable New Line Comment",
53-})
54-
55--- disable mouse dynamically
56-vim.api.nvim_create_autocmd({ "FocusGained" }, {
57- group = general,
58- callback = function()
59- vim.opt.mouse = "a"
60- end,
61-})
62-vim.api.nvim_create_autocmd({ "FocusLost" }, {
63- group = general,
64- callback = function()
65- vim.opt.mouse = ""
66- end,
67-})
68-
69--- disable guicursor in terminal
70-local guicursor = vim.opt.guicursor
71-vim.api.nvim_create_autocmd("TermEnter", {
72- group = general,
73- callback = function()
74- vim.opt.guicursor = ""
75- end,
76-})
77-vim.api.nvim_create_autocmd("TermLeave", {
78- group = general,
79- callback = function()
80- vim.opt.guicursor = guicursor
81- end,
82-})
83-
84--- vim command for setting tabs
85-vim.api.nvim_create_user_command("SetTabs", function(opts)
86- local length = tonumber(opts.args)
87- if length then
88- require("utils.formatting").set_tabs(length)
89- vim.notify("Set tabs to " .. length)
90- else
91- vim.notify("Invalid number", vim.log.levels.ERROR)
92- end
93-end, { desc = "Set tab width for current buffer.", nargs = 1 })
+0-94nvim/lua/config/keymaps/init.lua
@@ -1,94 +0,0 @@
1--- Keymaps are automatically loaded on the VeryLazy event
2--- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
3--- Add any additional keymaps here
4-require("config.keymaps.lazy")
5-
6--- Toggle markdown
7-vim.keymap.set("n", "<leader>ch", function()
8- if vim.wo.conceallevel > 0 then
9- vim.wo.conceallevel = 0
10- vim.notify("Conceal ON")
11- else
12- vim.wo.conceallevel = 2
13- vim.notify("Conceal OFF")
14- end
15-end, { desc = "Toggle Markdown Conceal" })
16-
17--- Toggle inlay hints
18-vim.keymap.set({ "n" }, "<leader>ci", function()
19- vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
20- if vim.lsp.inlay_hint.is_enabled() then
21- vim.notify("Enabled inlay hint")
22- else
23- vim.notify("Disabled inlay hint")
24- end
25-end, { desc = "Toggle Inlay Hints" })
26-
27--- Remove carriage
28-vim.keymap.set("n", "<leader>cu", function()
29- vim.cmd(":%s/\r//g")
30-end, { desc = "Remove carriage return" })
31-
32--- restart lsp
33-vim.keymap.set("n", "<leader>cz", function()
34- vim.notify("Running LspRestart")
35- vim.cmd("LspRestart")
36-end, { desc = "Restart lsp" })
37-
38--- Telescope document symbols
39-vim.keymap.set("n", "<leader>cd", function()
40- vim.cmd("Telescope lsp_document_symbols")
41-end, { desc = "Telescope Document Symbols" })
42-
43--- Telescope treesitter keymap
44-vim.keymap.set("n", "<leader>ct", function()
45- vim.cmd("Telescope treesitter")
46-end, { desc = "Telescope Treesitter" })
47-
48--- Telescope hidden files
49-vim.keymap.set("n", "<leader>fi", function()
50- vim.cmd("Telescope find_files no_ignore=true")
51-end, { desc = "Telescope Hidden" })
52-
53--- Force comment folding
54-vim.keymap.set("n", "zk", function()
55- _G.in_docstring = false
56- vim.cmd("UseFoldComment")
57- vim.cmd("normal zx")
58- vim.cmd("normal zM")
59-end, { desc = "Forcefully fold comments" })
60-
61--- Make sure leader space uses smart picker
62-vim.keymap.set("n", "<leader><space>", function()
63- Snacks.picker.smart()
64-end, { desc = "Smart Snacks Picker" })
65-
66--- Make sure leader / user picker grep
67-vim.keymap.set("n", "<leader>/", function()
68- Snacks.picker.grep()
69-end, { desc = "Snacks Grep" })
70-
71--- map window controls i insert mode
72-vim.keymap.set("i", "<C-J>", "<Esc><C-W>j", { desc = "Go down window" })
73-vim.keymap.set("i", "<C-H>", "<Esc><C-W>h", { desc = "Go left window" })
74-vim.keymap.set("i", "<C-K>", "<Esc><C-W>k", { desc = "Go up window" })
75-vim.keymap.set("i", "<C-L>", "<Esc><C-W>l", { desc = "Go right window" })
76-
77--- Load snippets
78-require("luasnip.loaders.from_lua").lazy_load({ paths = { "~/.config/nvim/lua/snippets" } })
79-
80-vim.keymap.set({ "i", "n" }, "<F1>", "<Nop>", { silent = true })
81-
82-vim.keymap.set("n", "<leader>cx", ":!chmod +x %<cr>", { desc = "Make executable" })
83-
84-vim.keymap.set({ "n", "i" }, "<C-b>", function()
85- vim.cmd("w")
86-end, { desc = "Save with tmux prefix" })
87-
88--- Toggle marked final in git
89-vim.keymap.set("n", "<leader>gf", "", { desc = "Final" })
90-vim.keymap.set("n", "<leader>gfm", ":!git update-index --assume-unchanged %<cr>", { desc = "Mark final" })
91-vim.keymap.set("n", "<leader>gfu", ":!git update-index --no-assume-unchanged %<cr>", { desc = "Unmark final" })
92-
93---restart rust analyzer
94-vim.keymap.set("n", "<leader>cg", ":RustAnalyzer restart<cr>", { desc = "Restart Rust Analyzer" })
+0-64nvim/lua/config/keymaps/lazy.lua
@@ -1,64 +0,0 @@
1-local function telescope_config(path)
2- require("telescope.builtin").find_files({
3- cwd = vim.fn.stdpath("config") .. path,
4- })
5-end
6-
7--- open lazy extra
8-vim.keymap.set("n", "<leader>le", function()
9- vim.cmd("LazyExtra")
10-end, { desc = "Extras" })
11-
12--- reload current file as plugin
13-vim.keymap.set("n", "<leader>lr", function()
14- vim.cmd("silent! write")
15- local file = vim.fn.expand("%:p")
16- local result = dofile(file)
17- local plugins = {}
18- -- add plugin to table
19- local function handleplugin(plugin)
20- local name = plugin[1] or plugin.name
21- local _, repo = (plugin[1] or plugin.name):match("([^/]+)/([^/]+)")
22- if repo then
23- plugin = repo
24- else
25- plugin = name
26- end
27- table.insert(plugins, plugin)
28- end
29- -- add all the plugins to table
30- if type(result[1]) == "table" then
31- for _, plugin in ipairs(result) do
32- handleplugin(plugin)
33- end
34- else
35- handleplugin(result)
36- end
37- -- reload each plugin
38- for _, plugin in ipairs(plugins) do
39- vim.cmd("Lazy reload " .. plugin)
40- end
41-end, { desc = "Reload File Plugins" })
42-
43--- edit keymaps
44-vim.keymap.set("n", "<leader>lk", function()
45- telescope_config("/lua/config/keymaps")
46-end, { desc = "Browse Keymaps" })
47-
48--- edit options
49-vim.keymap.set("n", "<leader>lo", function()
50- vim.cmd("e ~/.config/nvim/lua/config/options.lua")
51-end, { desc = "Edit Options" })
52-
53--- telescope user defined plugins
54-vim.keymap.set("n", "<leader>lp", function()
55- telescope_config("/lua/plugins")
56-end, { desc = "Browse Plugins" })
57-
58--- source the current file
59-vim.keymap.set("n", "<leader>ls", function()
60- vim.cmd("silent! write")
61- local filename = vim.api.nvim_buf_get_name(0)
62- vim.notify("Source " .. filename)
63- vim.cmd.source(filename)
64-end, { desc = "Source Current File (:so %)" })
+0-53nvim/lua/config/lazy.lua
@@ -1,53 +0,0 @@
1-local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
2-if not (vim.uv or vim.loop).fs_stat(lazypath) then
3- local lazyrepo = "https://github.com/folke/lazy.nvim.git"
4- local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
5- if vim.v.shell_error ~= 0 then
6- vim.api.nvim_echo({
7- { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
8- { out, "WarningMsg" },
9- { "\nPress any key to exit..." },
10- }, true, {})
11- vim.fn.getchar()
12- os.exit(1)
13- end
14-end
15-vim.opt.rtp:prepend(lazypath)
16-
17-require("lazy").setup({
18- spec = {
19- -- add LazyVim and import its plugins
20- { "LazyVim/LazyVim", import = "lazyvim.plugins" },
21- -- import/override with your plugins
22- { import = "plugins" },
23- },
24- defaults = {
25- -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
26- -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
27- lazy = false,
28- -- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
29- -- have outdated releases, which may break your Neovim install.
30- version = false, -- always use the latest git commit
31- -- version = "*", -- try installing the latest stable version for plugins that support semver
32- },
33- install = { colorscheme = { "tokyonight", "habamax" } },
34- checker = {
35- enabled = true, -- check for plugin updates periodically
36- notify = false, -- notify on update
37- }, -- automatically check for plugin updates
38- performance = {
39- rtp = {
40- -- disable some rtp plugins
41- disabled_plugins = {
42- "gzip",
43- -- "matchit",
44- -- "matchparen",
45- -- "netrwPlugin",
46- "tarPlugin",
47- "tohtml",
48- "tutor",
49- "zipPlugin",
50- },
51- },
52- },
53-})
+0-60nvim/lua/config/options.lua
@@ -1,60 +0,0 @@
1--- Options are automatically loaded before lazy.nvim startup
2--- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
3--- Add any additional options here
4-
5--- disable completions with ai
6-vim.g.ai_cmp = false
7-
8--- disable swap files, not needed with autosession
9-vim.opt.swapfile = false
10-
11-local clipboards = {
12- xclip = {
13- name = "xclip",
14- copy = {
15- ["+"] = "xclip -selection clipboard",
16- ["*"] = "xclip -selection primary",
17- },
18- paste = {
19- ["+"] = "xclip -selection clipboard -o",
20- ["*"] = "xclip -selection primary -o",
21- },
22- cache_enabled = 1,
23- },
24- wayland = {
25- name = "wl-clipboard",
26- copy = { ["+"] = "wl-copy", ["*"] = "wl-copy" },
27- paste = {
28- ["+"] = "wl-paste --no-newline",
29- ["*"] = "wl-paste --no-newline",
30- },
31- cache_enabled = 1,
32- },
33-}
34--- wayland settings
35-if vim.fn.getenv("WAYLAND_DISPLAY") ~= vim.NIL then
36- vim.g.clipboard = clipboards.wayland
37-end
38-
39--- disable animations
40-vim.g.snacks_animate = false
41-
42--- set normal numbers
43-vim.cmd("set norelativenumber")
44-
45--- fold basic comments
46--- vim.opt.foldmethod = "expr"
47--- vim.opt.foldopen = ""
48--- vim.opt.foldexpr = "v:lua.CommentFoldExpr()"
49-
50--- add suggested options for autosession
51-vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
52-
53-vim.api.nvim_create_autocmd("BufReadPost", {
54- callback = function(args)
55- local bufname = vim.api.nvim_buf_get_name(args.buf)
56- if bufname:match("site%-packages") then
57- vim.diagnostic.enable(false, { bufnr = args.buf })
58- end
59- end,
60-})
+0-25nvim/lua/config/vr.lua
@@ -1,25 +0,0 @@
1-vim.keymap.set("n", "q", "<cmd>qa!<CR>", { noremap = true, silent = true })
2-vim.keymap.set("v", "q", "<cmd>qa!<CR>", { noremap = true, silent = true })
3-vim.keymap.set("n", "<C-c>", "<cmd>qa!<CR>", { noremap = true, silent = true })
4-vim.keymap.set("v", "<C-c>", "<cmd>qa!<CR>", { noremap = true, silent = true })
5-vim.o.number = true
6--- wayland settings
7-if vim.fn.getenv("WAYLAND_DISPLAY") ~= vim.NIL then
8- -- vim.notify("Wayland detected")
9-
10- vim.g.clipboard = {
11- name = "wl-clipboard",
12- copy = {
13- ["+"] = "wl-copy --foreground --type text/plain",
14- ["*"] = "wl-copy --foreground --primary --type text/plain",
15- },
16- paste = {
17- ["+"] = "wl-paste --no-newline",
18- ["*"] = "wl-paste --primary --no-newline",
19- },
20- cache_enabled = 1,
21- }
22-end
23-vim.o.clipboard = "unnamedplus"
24-
25-vim.o.foldmethod = "syntax"
+1-0nvim/lua/filetypes/lua.lua
@@ -0,0 +1 @@
1+require("utils.general").set_tabs(2)
+0-0nvim/test_files/main.py → nvim/lua/filetypes/python.lua

No content changes (mode or rename only).

+0-0nvim/lua/filetypes/rust.lua

No content changes (mode or rename only).

+18-0nvim/lua/filetypes/zzz.lua
@@ -0,0 +1,18 @@
1+-- Get the path to your config/filetypes directory
2+local base_dir = vim.fn.stdpath("config") .. "/lua/filetypes"
3+
4+-- Enumerate all .lua files inside that folder
5+for _, file in ipairs(vim.fn.readdir(base_dir, [[v:val =~ '\.lua$']])) do
6+ -- Strip the `.lua` extension
7+ local ft = file:gsub("%.lua$", "")
8+ if ft ~= "zzz" then
9+ -- Create an autocmd for this filetype
10+ vim.api.nvim_create_autocmd("FileType", {
11+ pattern = ft,
12+ group = vim.api.nvim_create_augroup("filetype_autocommands", { clear = false }),
13+ callback = function()
14+ require("filetypes." .. ft)
15+ end,
16+ })
17+ end
18+end
+17-0nvim/lua/keymaps.lua
@@ -0,0 +1,17 @@
1+local builtin = require("telescope.builtin")
2+local mason_ui = require("mason.ui")
3+
4+vim.keymap.set("n", "<leader><Space>", builtin.find_files, { desc = "Find File" })
5+vim.keymap.set("n", "<leader>b", builtin.buffers, { desc = "Find Buffer" })
6+vim.keymap.set("n", "<leader>k", builtin.keymaps, { desc = "Find Keymap" })
7+vim.keymap.set("n", "<leader>q", require("utils.general").safe_exit, { desc = "Quit All" })
8+vim.keymap.set("n", "<leader>,", ":b#<cr>", { desc = "Last Buffer" })
9+vim.keymap.set("n", "<leader>m", mason_ui.open, { desc = "Mason UI" })
10+
11+vim.keymap.set("n", "<M-h>", ":bp<cr>", { desc = "Prev Buffer" })
12+vim.keymap.set("n", "<M-l>", ":bn<cr>", { desc = "Next Buffer" })
13+
14+vim.keymap.set("n", "<C-s>", ":w<cr>", { desc = "Save" })
15+vim.keymap.set("i", "<C-s>", "<Esc>:w<cr>", { desc = "Save" })
16+
17+vim.keymap.set("n", "q:", ":", { desc = "Remove stupid ass command" })
+0-6nvim/lua/plugins/auto-session.lua
@@ -1,6 +0,0 @@
1-return {
2- "rmagatti/auto-session",
3- config = function()
4- require("auto-session").setup()
5- end,
6-}
+33-0nvim/lua/plugins/blink.lua
@@ -0,0 +1,33 @@
1+require("utils.plugin").install({ src = "https://github.com/hrsh7th/nvim-lspconfig" })
2+require("utils.plugin").install({ src = "https://github.com/hrsh7th/cmp-nvim-lsp" })
3+require("utils.plugin").install({ src = "https://github.com/hrsh7th/cmp-buffer" })
4+require("utils.plugin").install({ src = "https://github.com/hrsh7th/cmp-path" })
5+require("utils.plugin").install({ src = "https://github.com/hrsh7th/cmp-cmdline" })
6+require("utils.plugin").install({ src = "https://github.com/hrsh7th/nvim-cmp" })
7+
8+require("utils.plugin").install({ src = "https://github.com/hrsh7th/cmp-vsnip" })
9+require("utils.plugin").install({ src = "https://github.com/hrsh7th/vim-vsnip" })
10+
11+local cmp = require("cmp")
12+cmp.setup({
13+ window = {
14+ -- completion = cmp.config.window.bordered(),
15+ -- documentation = cmp.config.window.bordered(),
16+ },
17+ mapping = cmp.mapping.preset.insert({
18+ ["<C-b>"] = cmp.mapping.scroll_docs(-4),
19+ ["<C-f>"] = cmp.mapping.scroll_docs(4),
20+ ["<C-Space>"] = cmp.mapping.complete(),
21+ ["<C-e>"] = cmp.mapping.abort(),
22+ ["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
23+ }),
24+ sources = cmp.config.sources({
25+ { name = "nvim_lsp" },
26+ { name = "vsnip" }, -- For vsnip users.
27+ -- { name = 'luasnip' }, -- For luasnip users.
28+ -- { name = 'ultisnips' }, -- For ultisnips users.
29+ -- { name = 'snippy' }, -- For snippy users.
30+ }, {
31+ { name = "buffer" },
32+ }),
33+})
+0-5nvim/lua/plugins/cfg_linters/global.markdownlint-cli2.jsonc
@@ -1,5 +0,0 @@
1-{
2- "config": {
3- "MD013": false
4- }
5-}
+22-0nvim/lua/plugins/conform.lua
@@ -0,0 +1,22 @@
1+require("utils.plugin").install({ src = "https://github.com/stevearc/conform.nvim" })
2+
3+require("conform").setup({
4+ formatters_by_ft = {
5+ lua = { "stylua" },
6+ python = { "black" },
7+ rust = { "cargo_fix", "rustfmt" },
8+ },
9+ formatters = {
10+ cargo_fix = {
11+ command = "cargo",
12+ args = { "fix", "--allow-dirty" },
13+ stdin = false,
14+ },
15+ },
16+})
17+
18+vim.api.nvim_create_autocmd("BufWritePre", {
19+ callback = function()
20+ require("conform").format()
21+ end,
22+})
+0-140nvim/lua/plugins/copilot.lua
@@ -1,140 +0,0 @@
1-return {
2- -- copilot
3- {
4- "zbirenbaum/copilot.lua",
5- cmd = "Copilot",
6- enabled = false,
7- build = ":Copilot auth",
8- event = "BufReadPost",
9- opts = {
10- suggestion = {
11- enabled = not vim.g.ai_cmp,
12- auto_trigger = false,
13- hide_during_completion = vim.g.ai_cmp,
14- keymap = {
15- accept = false, -- handled by nvim-cmp / blink.cmp
16- next = "<M-]>",
17- prev = "<M-[>",
18- },
19- },
20- panel = { enabled = false },
21- filetypes = {
22- markdown = true,
23- help = true,
24- },
25- },
26- },
27-
28- -- chat config
29- {
30- "CopilotC-Nvim/CopilotChat.nvim",
31- branch = "main",
32- enabled = false,
33- cmd = "CopilotChat",
34- opts = function()
35- local user = vim.env.USER or "User"
36- user = user:sub(1, 1):upper() .. user:sub(2)
37- return {
38- prompts = {
39- Docs = {
40- prompt = "Add docstrings that clearly explain parameters and returns with the correct format.",
41- system = "You write good docs.",
42- description = "Add structured, language-aware documentation",
43- },
44- },
45- auto_insert_mode = true,
46- question_header = " " .. user .. " ",
47- answer_header = " Copilot ",
48- model = "gpt-4o",
49- window = {
50- width = 0.4,
51- },
52- }
53- end,
54- keys = {
55- { "<c-s>", "<CR>", ft = "copilot-chat", desc = "Submit Prompt", remap = true },
56- { "<leader>a", "", desc = "+ai", mode = { "n", "v" } },
57- {
58- "<leader>af",
59- function()
60- local cpc = require("CopilotChat")
61- vim.cmd("normal vaf")
62- cpc.open({ include_contexts_in_prompt = true })
63- end,
64- desc = "Query function",
65- },
66- {
67- "<leader>ad",
68- function()
69- local cpc = require("CopilotChat")
70- vim.cmd("normal vaf")
71- cpc.ask(
72- "Add docstrings that clearly explain parameters and returns with the correct indentations using tabs and newlines."
73- )
74- end,
75- desc = "Add docs to function",
76- mode = "n",
77- },
78- {
79- "<leader>aa",
80- function()
81- return require("CopilotChat").toggle()
82- end,
83- desc = "Toggle (CopilotChat)",
84- mode = { "n", "v" },
85- },
86- {
87- "<leader>ax",
88- function()
89- return require("CopilotChat").reset()
90- end,
91- desc = "Clear (CopilotChat)",
92- mode = { "n", "v" },
93- },
94- {
95- "<leader>aq",
96- function()
97- vim.ui.input({
98- prompt = "Quick Chat: ",
99- }, function(input)
100- if input ~= "" then
101- require("CopilotChat").ask(input)
102- end
103- end)
104- end,
105- desc = "Quick Chat (CopilotChat)",
106- mode = { "n", "v" },
107- },
108- {
109- "<leader>ap",
110- function()
111- require("CopilotChat").select_prompt()
112- end,
113- desc = "Prompt Actions (CopilotChat)",
114- mode = { "n", "v" },
115- },
116- {
117- "<C-a>",
118- "<Esc><C-y>q",
119- ft = "copilot-chat",
120- desc = "Submit and close",
121- mode = { "n", "i" },
122- remap = true,
123- },
124- },
125- config = function(_, opts)
126- vim.env.OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
127- local chat = require("CopilotChat")
128-
129- vim.api.nvim_create_autocmd("BufEnter", {
130- pattern = "copilot-chat",
131- callback = function()
132- vim.opt_local.relativenumber = false
133- vim.opt_local.number = false
134- end,
135- })
136-
137- chat.setup(opts)
138- end,
139- },
140-}
+0-10nvim/lua/plugins/dotenv.lua
@@ -1,10 +0,0 @@
1-return {
2- "ellisonleao/dotenv.nvim",
3- config = function()
4- require("dotenv").setup({
5- enable_on_load = true,
6- verbose = false,
7- file_name = ".env",
8- })
9- end,
10-}
+0-25nvim/lua/plugins/firenvim.lua
@@ -1,25 +0,0 @@
1-return {
2- -- enable firenvim
3- {
4- "glacambre/firenvim",
5- build = ":call firenvim#install(0)",
6- config = function()
7- if vim.g.started_by_firenvim then
8- vim.cmd("colorscheme tokyonight-day")
9- end
10- vim.g.firenvim_config = {
11- globalSettings = { alt = "all" },
12- localSettings = {
13- [".*"] = {
14- takeover = "never",
15- },
16- },
17- }
18- end,
19- },
20- -- disable extnsions based on firenvim
21- {
22- "folke/noice.nvim",
23- enabled = not vim.g.started_by_firenvim,
24- },
25-}
+0-58nvim/lua/plugins/folding.lua.disabled
@@ -1,58 +0,0 @@
1-local general = vim.api.nvim_create_augroup("Folding", { clear = true })
2-
3--- use comments for fold expression
4--- use comments for fold expression
5--- use comments for fold expression
6--- use comments for fold expression
7-_G.CommentFoldExpr = function()
8- local line = vim.fn.getline(vim.v.lnum)
9- local ft = vim.bo.filetype
10- local cs = vim.bo.commentstring:gsub("%%s", ""):gsub(" ", ""):gsub("([^%w])", "%%%1")
11- local should_fold = line:match("^%s*" .. cs) or _G.in_docstring
12- -- python docstrings
13- if ft == "python" then
14- if line:match('""".*"""') then
15- return "0"
16- end
17- if line:match('"""') then
18- if _G.in_docstring then
19- _G.in_docstring = false
20- else
21- _G.in_docstring = true
22- should_fold = true
23- end
24- end
25- end
26- -- lua docstrings
27- if ft == "lua" then
28- if line:match("--%[%[") then
29- _G.in_docstring = true
30- -- should_fold = true
31- end
32- if line:match("--%]%]") and _G.in_docstring then
33- _G.in_docstring = false
34- end
35- end
36- if should_fold then
37- return 1
38- end
39- return 0
40-end
41-local foldexpr = "v:lua.CommentFoldExpr()"
42-vim.api.nvim_create_user_command("UseFoldTreesitter", function()
43- vim.opt_local.foldexpr = foldexpr
44-end, { desc = "Set fold expression to treesitter" })
45-vim.api.nvim_create_user_command("UseFoldComment", function()
46- foldexpr = "v:lua.CommentFoldExpr()"
47- vim.opt_local.foldexpr = foldexpr
48-end, { desc = "Set foldexpr to comments" })
49-vim.api.nvim_create_autocmd({ "BufReadPost", "FileType" }, {
50- group = general,
51- pattern = "*",
52- callback = function()
53- vim.opt_local.foldmethod = "expr"
54- vim.opt_local.foldexpr = foldexpr
55- end,
56-})
57-
58-return {}
+0-36nvim/lua/plugins/jq-playground.lua
@@ -1,36 +0,0 @@
1-return {
2- "yochem/jq-playground.nvim",
3- event = "VeryLazy",
4- config = function()
5- local function toggle_jq_playground()
6- local closed_any = false
7- for _, win in ipairs(vim.api.nvim_list_wins()) do
8- local buf = vim.api.nvim_win_get_buf(win)
9- local name = vim.api.nvim_buf_get_name(buf)
10- if name:match("jq query editor") or name:match("jq output") then
11- closed_any = true
12- vim.api.nvim_win_close(win, true)
13- vim.api.nvim_buf_delete(buf, { force = true })
14- end
15- end
16- if not closed_any then
17- vim.cmd("JqPlayground")
18- end
19- end
20-
21- vim.api.nvim_create_autocmd("BufEnter", {
22- pattern = { "jq query editor", "jq output" },
23- callback = function() end,
24- })
25-
26- vim.api.nvim_create_autocmd("FileType", {
27- pattern = "jq",
28- callback = function()
29- vim.keymap.set({ "i", "n" }, "<C-c>", function()
30- toggle_jq_playground()
31- end, { buffer = true, desc = "Close jq" })
32- end,
33- })
34- vim.keymap.set("n", "<leader>cj", toggle_jq_playground, { desc = "Toggle Jq Playground" })
35- end,
36-}
+0-55nvim/lua/plugins/leetcode.lua
@@ -1,55 +0,0 @@
1--- wipes all the keys for the given startswith after leader
2-local function wipe_leader_keys(startswith)
3- local m = vim.api.nvim_get_keymap("n")
4- local leader = vim.g.mapleader
5-
6- for _, k in ipairs(m) do
7- if k.lhs:find("^" .. leader .. startswith) then
8- vim.api.nvim_del_keymap("n", k.lhs)
9- end
10- end
11-end
12-
13-return {
14- {
15- "kawre/leetcode.nvim",
16- event = "VeryLazy",
17- dependencies = {
18- "nvim-telescope/telescope.nvim",
19- "nvim-lua/plenary.nvim",
20- "MunifTanjim/nui.nvim",
21- },
22- opts = {
23- lang = "python3",
24- },
25- config = function(_, opts)
26- vim.api.nvim_create_user_command("LC", "%bd|enew|Leet", {})
27- vim.api.nvim_create_autocmd("BufEnter", {
28- callback = function()
29- local has_leetcode = false
30- for _, buf in ipairs(vim.api.nvim_list_bufs()) do
31- if vim.bo[buf].filetype == "leetcode.nvim" then
32- has_leetcode = true
33- end
34- end
35-
36- if has_leetcode then
37- vim.bo.omnifunc = ""
38- vim.bo.formatexpr = ""
39- vim.diagnostic.enable(false)
40- wipe_leader_keys("l")
41- vim.api.nvim_set_keymap("n", "<leader>l", "", { desc = "LeetCode" })
42- vim.api.nvim_set_keymap("n", "<leader>ls", "<cmd>Leet submit<cr>", { desc = "Submit" })
43- vim.api.nvim_set_keymap("n", "<leader>lt", "<cmd>Leet test<cr>", { desc = "Test" })
44- vim.api.nvim_set_keymap("n", "<Leader>ll", "<cmd>Leet list<cr>", { desc = "List" })
45- vim.api.nvim_set_keymap("n", "<leader>lc", "<cmd>Leet console<cr>", { desc = "Console" })
46- vim.api.nvim_set_keymap("n", "<leader>ly", "<cmd>Leet yank<cr>", { desc = "Yank" })
47- vim.api.nvim_set_keymap("n", "<leader>lo", "<cmd>Leet open<cr>", { desc = "Open" })
48- vim.api.nvim_set_keymap("n", "<leader>lq", "<cmd>Leet test<cr>q", { desc = "Quiet test" })
49- end
50- end,
51- })
52- require("leetcode").setup(opts)
53- end,
54- },
55-}
+16-51nvim/lua/plugins/lspconfig.lua
@@ -1,51 +1,16 @@
1-if false then
2- require("lazy.types")
3- require("lspconfig")
4-end
5----@type LazySpec
6-return {
7- {
8- "neovim/nvim-lspconfig",
9- opts = {
10- diagnostics = {
11- underline = true,
12- },
13- servers = {
14- basedpyright = {
15- enabled = true,
16- settings = {
17- basedpyright = {
18- analysis = {
19- typeCheckingMode = "basic",
20- diagnosticMode = "workspace",
21- exclude = { "**/__pycache__", "**/node_modules", "**/venv", "**/.mypycache", "**/site-packages" },
22- ignore = { "**/site-packages/**" },
23- logLevel = "Error",
24- },
25- },
26- python = {},
27- },
28- },
29- pyright = {
30- enabled = false,
31- settings = {
32- python = {
33- analysis = {},
34- },
35- },
36- },
37- sourcekit = {
38- enabled = true,
39- cmd = { "sourcekit-lsp" },
40- filetypes = { "swift" },
41- },
42- },
43- inlay_hints = {
44- enabled = false,
45- },
46- },
47- },
48- {
49- "nvimtools/none-ls.nvim",
50- },
51-}
1+require("utils.plugin").install({ src = "https://github.com/neovim/nvim-lspconfig" })
2+vim.lsp.enable("pyright")
3+vim.lsp.config("lua_ls", {
4+ settings = {
5+ Lua = {
6+ diagnostics = {
7+ globals = { "vim" }, -- stop "undefined global 'vim'"
8+ },
9+ workspace = {
10+ library = vim.api.nvim_get_runtime_file("", true),
11+ checkThirdParty = false,
12+ },
13+ },
14+ },
15+})
16+vim.lsp.enable("lua_ls")
+15-0nvim/lua/plugins/mason.lua
@@ -0,0 +1,15 @@
1+require("utils.plugin").install({ src = "https://github.com/mason-org/mason.nvim" })
2+local mason = require("mason")
3+--vim.keymap.set("n", "<leader>m", require("mason.ui").ui.open())
4+
5+local config = {
6+ ui = {
7+ icons = {
8+ package_installed = "✓",
9+ package_pending = "➜",
10+ package_uninstalled = "✗",
11+ },
12+ },
13+}
14+
15+mason.setup(config)
+2-0nvim/lua/plugins/mini-icons.lua
@@ -0,0 +1,2 @@
1+require("utils.plugin").install({src="https://github.com/nvim-mini/mini.icons"})
2+require("mini.icons").setup()
+0-26nvim/lua/plugins/mini.lua
@@ -1,26 +0,0 @@
1-local mpairs = require("mini.pairs")
2-
3---- Applies a function to a filetype
4---- @param filetype string The filetype to apply to
5---- @param f fun() The function to apply
6-local function apply_to_filetype(filetype, f)
7- vim.api.nvim_create_autocmd("FileType", {
8- pattern = filetype,
9- callback = f,
10- })
11-
12- -- Also run immediately if current buffer already matches
13- if vim.bo.filetype == filetype then
14- f()
15- end
16-end
17-
18---- @type LazySpec
19-return {
20- "echasnovski/mini.pairs",
21- opts = function(_, _)
22- apply_to_filetype("rust", function()
23- mpairs.unmap("i", "'", "'")
24- end)
25- end,
26-}
+0-17nvim/lua/plugins/multicorsors.lua
@@ -1,17 +0,0 @@
1-return {
2- "smoka7/multicursors.nvim",
3- event = "VeryLazy",
4- dependencies = {
5- "nvimtools/hydra.nvim",
6- },
7- opts = {},
8- cmd = { "MCstart", "MCvisual", "MCclear", "MCpattern", "MCvisualPattern", "MCunderCursor" },
9- keys = {
10- {
11- mode = { "v", "n" },
12- "<Leader>m",
13- "<cmd>MCstart<cr>",
14- desc = "Create a selection for selected text or word under the cursor",
15- },
16- },
17-}
+0-22nvim/lua/plugins/neotree.lua
@@ -1,22 +0,0 @@
1-return {
2- -- https://github.com/nvim-neo-tree/neo-tree.nvim/wiki/Recipes#open-with-system-viewer
3- "nvim-neo-tree/neo-tree.nvim",
4- enabled = false,
5- opts = {
6- filesystem = {
7- hijack_netrw_behavior = "disabled",
8- window = {
9- mappings = {
10- ["O"] = "system_open",
11- },
12- },
13- },
14- commands = {
15- system_open = function(state)
16- local node = state.tree:get_node()
17- local path = node:get_id()
18- vim.fn.jobstart({ "wslview", path }, { detach = true })
19- end,
20- },
21- },
22-}
+0-8nvim/lua/plugins/nvim-cmp.lua
@@ -1,8 +0,0 @@
1-if false then
2- require("lazy.types")
3-end
4----@type LazySpec
5-return {
6- "hrsh7th/nvim-cmp",
7- enabled = false,
8-}
+0-17nvim/lua/plugins/nvim-lint.lua
@@ -1,17 +0,0 @@
1-return {
2- "mfussenegger/nvim-lint",
3- opts = {
4- linters_by_ft = {
5- markdown = { "markdownlint-cli2" },
6- },
7- linters = {
8- ["markdownlint-cli2"] = {
9- args = {
10- "--config",
11- vim.fn.stdpath("config") .. "/lua/plugins/cfg_linters/global.markdownlint-cli2.jsonc",
12- "--",
13- },
14- },
15- },
16- },
17-}
+0-32nvim/lua/plugins/nvim-tree.lua
@@ -1,32 +0,0 @@
1-return {
2- "nvim-tree/nvim-tree.lua",
3- enabled = false,
4- config = function()
5- local nvim_tree = require("nvim-tree")
6- local api = require("nvim-tree.api")
7-
8- -- Setup first
9- nvim_tree.setup()
10-
11- -- Track last known root
12- local last_root = vim.fn.getcwd()
13- vim.api.nvim_create_autocmd("BufEnter", {
14- pattern = "NvimTree_*",
15- callback = function()
16- local root = api.tree.get_root()
17- if root and root.absolute_path then
18- last_root = root.absolute_path
19- vim.notify("move root to " .. last_root)
20- end
21- end,
22- })
23- -- -- Smart toggle with saved root
24- -- vim.keymap.set("n", "<leader>e", function()
25- -- if api.tree.is_visible() then
26- -- api.tree.close()
27- -- else
28- -- api.tree.open({ path = last_root })
29- -- end
30- -- end, { desc = "Toggle Nvim-Tree at last location" })
31- end,
32-}
+31-0nvim/lua/plugins/oil-git-status.lua
@@ -0,0 +1,31 @@
1+require("utils.plugin").install({src="https://github.com/refractalize/oil-git-status.nvim"})
2+
3+require('oil-git-status').setup({
4+ show_ignored = true, -- show files that match gitignore with !!
5+ symbols = { -- customize the symbols that appear in the git status columns
6+ index = {
7+ ["!"] = "!",
8+ ["?"] = "?",
9+ ["A"] = "A",
10+ ["C"] = "C",
11+ ["D"] = "D",
12+ ["M"] = "M",
13+ ["R"] = "R",
14+ ["T"] = "T",
15+ ["U"] = "U",
16+ [" "] = " ",
17+ },
18+ working_tree = {
19+ ["!"] = "!",
20+ ["?"] = "?",
21+ ["A"] = "A",
22+ ["C"] = "C",
23+ ["D"] = "D",
24+ ["M"] = "M",
25+ ["R"] = "R",
26+ ["T"] = "T",
27+ ["U"] = "U",
28+ [" "] = " ",
29+ },
30+ },
31+})
+11-0nvim/lua/plugins/oil-git.lua
@@ -0,0 +1,11 @@
1+require("utils.plugin").install({ src = "https://github.com/benomahony/oil-git.nvim" })
2+
3+require("oil-git").setup({
4+ highlights = {
5+ OilGitAdded = { fg = "#a6e3a1" }, -- green
6+ OilGitModified = { fg = "#f9e2af" }, -- yellow
7+ OilGitRenamed = { fg = "#cba6f7" }, -- purple
8+ OilGitUntracked = { fg = "#89b4fa" }, -- blue
9+ OilGitIgnored = { fg = "#6c7086" }, -- gray
10+ },
11+})
+1-0nvim/lua/plugins/oil-lsp-diagnostics.lua
@@ -0,0 +1 @@
1+require("utils.plugin").install({src="https://github.com/JezerM/oil-lsp-diagnostics.nvim"})
+184-0nvim/lua/plugins/oil.lua
@@ -0,0 +1,184 @@
1+require("utils.plugin").install({ src = "https://github.com/stevearc/oil.nvim.git" })
2+
3+vim.keymap.set("n", "<leader>o", require("oil").open, { desc = "Open Oil" })
4+
5+--- @type oil.setupOpts
6+local setup = {
7+ default_file_explorer = true,
8+ columns = {
9+ "icon",
10+ -- "permissions",
11+ -- "size",
12+ -- "mtime",
13+ },
14+ buf_options = {
15+ buflisted = false,
16+ bufhidden = "hide",
17+ },
18+ -- Window-local options to use for oil buffers
19+ win_options = {
20+ wrap = false,
21+ signcolumn = "yes:2",
22+ cursorcolumn = true,
23+ foldcolumn = "0",
24+ spell = false,
25+ list = false,
26+ conceallevel = 3,
27+ concealcursor = "nvic",
28+ },
29+ delete_to_trash = false,
30+ skip_confirm_for_simple_edits = true,
31+ prompt_save_on_select_new_entry = false,
32+ cleanup_delay_ms = 2000,
33+ lsp_file_methods = {
34+ enabled = true,
35+ timeout_ms = 1000,
36+ autosave_changes = true,
37+ },
38+ constrain_cursor = "editable",
39+ watch_for_changes = true,
40+ -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
41+ -- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" })
42+ -- Additionally, if it is a string that matches "actions.<name>",
43+ -- it will use the mapping at require("oil.actions").<name>
44+ -- Set to `false` to remove a keymap
45+ -- See :help oil-actions for a list of all available actions
46+ keymaps = {
47+ ["g?"] = { "actions.show_help", mode = "n" },
48+ ["<CR>"] = "actions.select",
49+ ["<C-s>"] = "actions.select",
50+ ["<C-h>"] = { "actions.select", opts = { horizontal = true } },
51+ ["<C-t>"] = { "actions.select", opts = { tab = true } },
52+ ["<C-p>"] = "actions.preview",
53+ ["<C-c>"] = { "actions.close", mode = "i" },
54+ ["q"] = { "actions.close", mode = "n" },
55+ ["<C-l>"] = "actions.refresh",
56+ ["-"] = { "actions.parent", mode = "n" },
57+ ["_"] = { "actions.open_cwd", mode = "n" },
58+ ["`"] = { "actions.cd", mode = "n" },
59+ ["~"] = { "actions.cd", opts = { scope = "tab" }, mode = "n" },
60+ ["gs"] = { "actions.change_sort", mode = "n" },
61+ ["gx"] = "actions.open_external",
62+ ["g."] = { "actions.toggle_hidden", mode = "n" },
63+ ["g\\"] = { "actions.toggle_trash", mode = "n" },
64+ },
65+ use_default_keymaps = true,
66+ view_options = {
67+ show_hidden = false,
68+ is_hidden_file = function(name, bufnr)
69+ local m = name:match("^%.")
70+ return m ~= nil
71+ end,
72+ is_always_hidden = function(name, bufnr)
73+ return false
74+ end,
75+ natural_order = "fast",
76+ case_insensitive = false,
77+ sort = {
78+ -- sort order can be "asc" or "desc"
79+ -- see :help oil-columns to see which columns are sortable
80+ { "type", "asc" },
81+ { "name", "asc" },
82+ },
83+ -- Customize the highlight group for the file name
84+ highlight_filename = function(entry, is_hidden, is_link_target, is_link_orphan)
85+ return nil
86+ end,
87+ },
88+ -- Extra arguments to pass to SCP when moving/copying files over SSH
89+ extra_scp_args = {},
90+ -- EXPERIMENTAL support for performing file operations with git
91+ git = {
92+ -- Return true to automatically git add/mv/rm files
93+ add = function(path)
94+ return false
95+ end,
96+ mv = function(src_path, dest_path)
97+ return false
98+ end,
99+ rm = function(path)
100+ return false
101+ end,
102+ },
103+ -- Configuration for the floating window in oil.open_float
104+ float = {
105+ -- Padding around the floating window
106+ padding = 2,
107+ -- max_width and max_height can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
108+ max_width = 0,
109+ max_height = 0,
110+ border = "rounded",
111+ win_options = {
112+ winblend = 0,
113+ },
114+ -- optionally override the oil buffers window title with custom function: fun(winid: integer): string
115+ get_win_title = nil,
116+ -- preview_split: Split direction: "auto", "left", "right", "above", "below".
117+ preview_split = "auto",
118+ -- This is the config that will be passed to nvim_open_win.
119+ -- Change values here to customize the layout
120+ override = function(conf)
121+ return conf
122+ end,
123+ },
124+ -- Configuration for the file preview window
125+ preview_win = {
126+ -- Whether the preview window is automatically updated when the cursor is moved
127+ update_on_cursor_moved = true,
128+ -- How to open the preview window "load"|"scratch"|"fast_scratch"
129+ preview_method = "fast_scratch",
130+ -- A function that returns true to disable preview on a file e.g. to avoid lag
131+ disable_preview = function(filename)
132+ return false
133+ end,
134+ -- Window-local options to use for preview window buffers
135+ win_options = {},
136+ },
137+ -- Configuration for the floating action confirmation window
138+ confirmation = {
139+ -- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
140+ -- min_width and max_width can be a single value or a list of mixed integer/float types.
141+ -- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total"
142+ max_width = 0.9,
143+ -- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total"
144+ min_width = { 40, 0.4 },
145+ -- optionally define an integer/float for the exact width of the preview window
146+ width = nil,
147+ -- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
148+ -- min_height and max_height can be a single value or a list of mixed integer/float types.
149+ -- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total"
150+ max_height = 0.9,
151+ -- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total"
152+ min_height = { 5, 0.1 },
153+ -- optionally define an integer/float for the exact height of the preview window
154+ height = nil,
155+ border = "rounded",
156+ win_options = {
157+ winblend = 0,
158+ },
159+ },
160+ -- Configuration for the floating progress window
161+ progress = {
162+ max_width = 0.9,
163+ min_width = { 40, 0.4 },
164+ width = nil,
165+ max_height = { 10, 0.9 },
166+ min_height = { 5, 0.1 },
167+ height = nil,
168+ border = "rounded",
169+ minimized_border = "none",
170+ win_options = {
171+ winblend = 0,
172+ },
173+ },
174+ -- Configuration for the floating SSH window
175+ ssh = {
176+ border = "rounded",
177+ },
178+ -- Configuration for the floating keymaps help window
179+ keymaps_help = {
180+ border = "rounded",
181+ },
182+}
183+
184+require("oil").setup(setup)
+2-0nvim/lua/plugins/plenary.lua
@@ -0,0 +1,2 @@
1+require("utils.plugin").install({src="https://github.com/nvim-lua/plenary.nvim"})
2+
+0-6nvim/lua/plugins/project.lua
@@ -1,6 +0,0 @@
1-return {
2- {
3- "ahmedkhalf/project.nvim",
4- opt = {},
5- },
6-}
+0-41nvim/lua/plugins/rustaceanvim.lua
@@ -1,41 +0,0 @@
1-return {
2- {
3- "mrcjkb/rustaceanvim",
4- version = "^5", -- make sure you're on the current branch
5- ft = { "rust" },
6- opts = {
7- server = {
8- settings = {
9- ["rust-analyzer"] = {
10- procMacro = {
11- enable = true, -- <== this is the big one
12- },
13- cargo = {
14- allFeatures = true,
15- },
16- checkOnSave = {
17- command = "clippy",
18- },
19- },
20- },
21- },
22- },
23- config = function(_, opts)
24- -- Pass settings into rustaceanvim
25- vim.g.rustaceanvim = opts
26-
27- -- keymap to expand macros under cursor
28- vim.keymap.set("n", "<leader>me", function()
29- local params = vim.lsp.util.make_position_params(0, "utf-8")
30- vim.lsp.buf_request(0, "experimental/expandMacro", params, function(_, result)
31- if not result then
32- return
33- end
34- local buf = vim.api.nvim_create_buf(false, true)
35- vim.api.nvim_buf_set_lines(buf, 0, -1, false, vim.split(result.expansion, "\n"))
36- vim.api.nvim_set_current_buf(buf)
37- end)
38- end, { desc = "Expand Rust macro" })
39- end,
40- },
41-}
+27-0nvim/lua/plugins/sessions.lua
@@ -0,0 +1,27 @@
1+local sessionfile = vim.fn.stdpath("state") .. "/autosession.vim"
2+
3+-- Save session
4+local function save_session()
5+ vim.schedule(function()
6+ vim.cmd("mksession! " .. vim.fn.fnameescape(sessionfile))
7+ end)
8+end
9+
10+-- Restore session
11+local function restore_session()
12+ if vim.fn.filereadable(sessionfile) == 1 then
13+ vim.cmd("source " .. vim.fn.fnameescape(sessionfile))
14+ vim.cmd("doautocmd BufReadPost")
15+ end
16+end
17+
18+-- Autocmd: save on write
19+vim.api.nvim_create_autocmd("BufWritePost", {
20+ callback = save_session,
21+})
22+
23+-- Optional: auto-restore on start
24+vim.api.nvim_create_autocmd("VimEnter", {
25+ once = true,
26+ callback = restore_session,
27+})
+0-577nvim/lua/plugins/snacks.lua
@@ -1,577 +0,0 @@
1-local cwd = vim.fn.getcwd()
2-return {
3- "folke/snacks.nvim",
4- priority = 1000,
5- lazy = false,
6- ---@type snacks.Config
7- opts = {
8- bigfile = { enabled = true },
9- image = { enabled = true },
10- dashboard = {
11- enabled = true,
12- preset = {
13- header = [[
14-███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗
15-████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║
16-██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║
17-██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║
18-██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║
19-╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝]],
20- keys = {
21- { icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" },
22- { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" },
23- { icon = " ", key = "g", desc = "Find Text", action = ":lua Snacks.dashboard.pick('live_grep')" },
24- { icon = " ", key = "r", desc = "Recent Files", action = ":lua Snacks.dashboard.pick('oldfiles')" },
25- {
26- icon = " ",
27- key = "c",
28- desc = "Config",
29- action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})",
30- },
31- { icon = " ", key = "s", desc = "Restore Session", section = "session" },
32- { icon = "󰒲 ", key = "L", desc = "Lazy", action = ":Lazy", enabled = package.loaded.lazy ~= nil },
33- { icon = " ", key = "q", desc = "Quit", action = ":qa" },
34- { icon = "", key = "z", desc = "LeetCode", action = ":Leet" },
35- },
36- },
37- },
38- explorer = { enabled = true },
39- indent = { enabled = true },
40- input = { enabled = true },
41- notifier = {
42- enabled = true,
43- timeout = 3000,
44- },
45- picker = { enabled = true },
46- quickfile = { enabled = true },
47- scope = { enabled = true },
48- scroll = { enabled = true },
49- statuscolumn = { enabled = true },
50- words = { enabled = true },
51- styles = {},
52- },
53- keys = {
54- -- Top Pickers & Explorer
55- {
56- "<leader><space>",
57- function()
58- Snacks.picker.smart()
59- end,
60- desc = "Smart Find Files",
61- },
62- {
63- "<leader>,",
64- function()
65- Snacks.picker.buffers()
66- end,
67- desc = "Buffers",
68- },
69- {
70- "<leader>/",
71- function()
72- Snacks.picker.grep()
73- end,
74- desc = "Grep",
75- },
76- {
77- "<leader>:",
78- function()
79- Snacks.picker.command_history()
80- end,
81- desc = "Command History",
82- },
83- {
84- "<leader>n",
85- function()
86- Snacks.picker.notifications()
87- end,
88- desc = "Notification History",
89- },
90- {
91- "<leader>e",
92- function()
93- Snacks.explorer({ cwd = cwd })
94- end,
95- desc = "File Explorer",
96- },
97- {
98- "<leader>E",
99- function()
100- Snacks.explorer()
101- end,
102- desc = "Root File Explorer",
103- },
104- -- find
105- {
106- "<leader>fb",
107- function()
108- Snacks.picker.buffers()
109- end,
110- desc = "Buffers",
111- },
112- {
113- "<leader>fc",
114- function()
115- Snacks.picker.files({ cwd = vim.fn.stdpath("config") })
116- end,
117- desc = "Find Config File",
118- },
119- {
120- "<leader>ff",
121- function()
122- Snacks.picker.files()
123- end,
124- desc = "Find Files",
125- },
126- {
127- "<leader>fg",
128- function()
129- Snacks.picker.git_files()
130- end,
131- desc = "Find Git Files",
132- },
133- {
134- "<leader>fp",
135- function()
136- Snacks.picker.projects()
137- end,
138- desc = "Projects",
139- },
140- {
141- "<leader>fr",
142- function()
143- Snacks.picker.recent()
144- end,
145- desc = "Recent",
146- },
147- -- git
148- {
149- "<leader>gb",
150- function()
151- Snacks.picker.git_branches()
152- end,
153- desc = "Git Branches",
154- },
155- {
156- "<leader>gl",
157- function()
158- Snacks.picker.git_log()
159- end,
160- desc = "Git Log",
161- },
162- {
163- "<leader>gL",
164- function()
165- Snacks.picker.git_log_line()
166- end,
167- desc = "Git Log Line",
168- },
169- {
170- "<leader>gs",
171- function()
172- Snacks.picker.git_status()
173- end,
174- desc = "Git Status",
175- },
176- {
177- "<leader>gS",
178- function()
179- Snacks.picker.git_stash()
180- end,
181- desc = "Git Stash",
182- },
183- {
184- "<leader>gd",
185- function()
186- Snacks.picker.git_diff()
187- end,
188- desc = "Git Diff (Hunks)",
189- },
190- {
191- "<leader>gf",
192- function()
193- Snacks.picker.git_log_file()
194- end,
195- desc = "Git Log File",
196- },
197- -- Grep
198- {
199- "<leader>sb",
200- function()
201- Snacks.picker.lines()
202- end,
203- desc = "Buffer Lines",
204- },
205- {
206- "<leader>sB",
207- function()
208- Snacks.picker.grep_buffers()
209- end,
210- desc = "Grep Open Buffers",
211- },
212- {
213- "<leader>sg",
214- function()
215- Snacks.picker.grep()
216- end,
217- desc = "Grep",
218- },
219- {
220- "<leader>sw",
221- function()
222- Snacks.picker.grep_word()
223- end,
224- desc = "Visual selection or word",
225- mode = { "n", "x" },
226- },
227- -- search
228- {
229- '<leader>s"',
230- function()
231- Snacks.picker.registers()
232- end,
233- desc = "Registers",
234- },
235- {
236- "<leader>s/",
237- function()
238- Snacks.picker.search_history()
239- end,
240- desc = "Search History",
241- },
242- {
243- "<leader>sa",
244- function()
245- Snacks.picker.autocmds()
246- end,
247- desc = "Autocmds",
248- },
249- {
250- "<leader>sb",
251- function()
252- Snacks.picker.lines()
253- end,
254- desc = "Buffer Lines",
255- },
256- {
257- "<leader>sc",
258- function()
259- Snacks.picker.command_history()
260- end,
261- desc = "Command History",
262- },
263- {
264- "<leader>sC",
265- function()
266- Snacks.picker.commands()
267- end,
268- desc = "Commands",
269- },
270- {
271- "<leader>sd",
272- function()
273- Snacks.picker.diagnostics()
274- end,
275- desc = "Diagnostics",
276- },
277- {
278- "<leader>sD",
279- function()
280- Snacks.picker.diagnostics_buffer()
281- end,
282- desc = "Buffer Diagnostics",
283- },
284- {
285- "<leader>sh",
286- function()
287- Snacks.picker.help()
288- end,
289- desc = "Help Pages",
290- },
291- {
292- "<leader>sH",
293- function()
294- Snacks.picker.highlights()
295- end,
296- desc = "Highlights",
297- },
298- {
299- "<leader>si",
300- function()
301- Snacks.picker.icons()
302- end,
303- desc = "Icons",
304- },
305- {
306- "<leader>sj",
307- function()
308- Snacks.picker.jumps()
309- end,
310- desc = "Jumps",
311- },
312- {
313- "<leader>sk",
314- function()
315- Snacks.picker.keymaps()
316- end,
317- desc = "Keymaps",
318- },
319- {
320- "<leader>sl",
321- function()
322- Snacks.picker.loclist()
323- end,
324- desc = "Location List",
325- },
326- {
327- "<leader>sm",
328- function()
329- Snacks.picker.marks()
330- end,
331- desc = "Marks",
332- },
333- {
334- "<leader>sM",
335- function()
336- Snacks.picker.man()
337- end,
338- desc = "Man Pages",
339- },
340- {
341- "<leader>sp",
342- function()
343- Snacks.picker.lazy()
344- end,
345- desc = "Search for Plugin Spec",
346- },
347- {
348- "<leader>sq",
349- function()
350- Snacks.picker.qflist()
351- end,
352- desc = "Quickfix List",
353- },
354- {
355- "<leader>sR",
356- function()
357- Snacks.picker.resume()
358- end,
359- desc = "Resume",
360- },
361- {
362- "<leader>su",
363- function()
364- Snacks.picker.undo()
365- end,
366- desc = "Undo History",
367- },
368- {
369- "<leader>uC",
370- function()
371- Snacks.picker.colorschemes()
372- end,
373- desc = "Colorschemes",
374- },
375- -- LSP
376- {
377- "gd",
378- function()
379- Snacks.picker.lsp_definitions()
380- end,
381- desc = "Goto Definition",
382- },
383- {
384- "gD",
385- function()
386- Snacks.picker.lsp_declarations()
387- end,
388- desc = "Goto Declaration",
389- },
390- {
391- "gr",
392- function()
393- Snacks.picker.lsp_references()
394- end,
395- nowait = true,
396- desc = "References",
397- },
398- {
399- "gI",
400- function()
401- Snacks.picker.lsp_implementations()
402- end,
403- desc = "Goto Implementation",
404- },
405- {
406- "gy",
407- function()
408- Snacks.picker.lsp_type_definitions()
409- end,
410- desc = "Goto T[y]pe Definition",
411- },
412- {
413- "<leader>ss",
414- function()
415- Snacks.picker.lsp_symbols()
416- end,
417- desc = "LSP Symbols",
418- },
419- {
420- "<leader>sS",
421- function()
422- Snacks.picker.lsp_workspace_symbols()
423- end,
424- desc = "LSP Workspace Symbols",
425- },
426- -- Other
427- {
428- "<leader>z",
429- function()
430- Snacks.zen()
431- end,
432- desc = "Toggle Zen Mode",
433- },
434- {
435- "<leader>Z",
436- function()
437- Snacks.zen.zoom()
438- end,
439- desc = "Toggle Zoom",
440- },
441- {
442- "<leader>.",
443- function()
444- Snacks.scratch()
445- end,
446- desc = "Toggle Scratch Buffer",
447- },
448- {
449- "<leader>S",
450- function()
451- Snacks.scratch.select()
452- end,
453- desc = "Select Scratch Buffer",
454- },
455- {
456- "<leader>n",
457- function()
458- Snacks.notifier.show_history()
459- end,
460- desc = "Notification History",
461- },
462- {
463- "<leader>bd",
464- function()
465- Snacks.bufdelete()
466- end,
467- desc = "Delete Buffer",
468- },
469- {
470- "<leader>cR",
471- function()
472- Snacks.rename.rename_file()
473- end,
474- desc = "Rename File",
475- },
476- {
477- "<leader>gB",
478- function()
479- Snacks.gitbrowse()
480- end,
481- desc = "Git Browse",
482- mode = { "n", "v" },
483- },
484- {
485- "<leader>gg",
486- function()
487- Snacks.lazygit()
488- end,
489- desc = "Lazygit",
490- },
491- {
492- "<leader>un",
493- function()
494- Snacks.notifier.hide()
495- end,
496- desc = "Dismiss All Notifications",
497- },
498- {
499- "<c-/>",
500- function()
501- Snacks.terminal()
502- end,
503- desc = "Toggle Terminal",
504- },
505- {
506- "<c-_>",
507- function()
508- Snacks.terminal()
509- end,
510- desc = "which_key_ignore",
511- },
512- {
513- "]]",
514- function()
515- Snacks.words.jump(vim.v.count1)
516- end,
517- desc = "Next Reference",
518- mode = { "n", "t" },
519- },
520- {
521- "[[",
522- function()
523- Snacks.words.jump(-vim.v.count1)
524- end,
525- desc = "Prev Reference",
526- mode = { "n", "t" },
527- },
528- {
529- "<leader>N",
530- desc = "Neovim News",
531- function()
532- Snacks.win({
533- file = vim.api.nvim_get_runtime_file("doc/news.txt", false)[1],
534- width = 0.6,
535- height = 0.6,
536- wo = {
537- spell = false,
538- wrap = false,
539- signcolumn = "yes",
540- statuscolumn = " ",
541- conceallevel = 3,
542- },
543- })
544- end,
545- },
546- },
547- init = function()
548- vim.api.nvim_create_autocmd("User", {
549- pattern = "VeryLazy",
550- callback = function()
551- -- Setup some globals for debugging (lazy-loaded)
552- _G.dd = function(...)
553- Snacks.debug.inspect(...)
554- end
555- _G.bt = function()
556- Snacks.debug.backtrace()
557- end
558- vim.print = _G.dd -- Override print to use snacks for `:=` command
559-
560- -- Create some toggle mappings
561- Snacks.toggle.option("spell", { name = "Spelling" }):map("<leader>us")
562- Snacks.toggle.option("wrap", { name = "Wrap" }):map("<leader>uw")
563- Snacks.toggle.option("relativenumber", { name = "Relative Number" }):map("<leader>uL")
564- Snacks.toggle.diagnostics():map("<leader>ud")
565- Snacks.toggle.line_number():map("<leader>ul")
566- Snacks.toggle
567- .option("conceallevel", { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 })
568- :map("<leader>uc")
569- Snacks.toggle.treesitter():map("<leader>uT")
570- Snacks.toggle.option("background", { off = "light", on = "dark", name = "Dark Background" }):map("<leader>ub")
571- Snacks.toggle.inlay_hints():map("<leader>uh")
572- Snacks.toggle.indent():map("<leader>ug")
573- Snacks.toggle.dim():map("<leader>uD")
574- end,
575- })
576- end,
577-}
+0-39nvim/lua/plugins/syncmap.lua.bak
@@ -1,39 +0,0 @@
1-if false then
2- require("syncmap.types")
3- require("lazy.types")
4-end
5-
6-local use_dev = true
7-
8----@type SyncmapOpts
9-local opts = {
10- map = {
11- { "~/.dotfiles/nvim/", "~/.config/nvim/" },
12- { "~/.dotfiles/tmux/", "~/.config/tmux/" },
13- { "~/.dotfiles/hypr/", "~/.config/hypr/" },
14- { "~/.dotfiles/kitty/", "~/.config/kitty/" },
15- { "~/.dotfiles/tmux-powerline/", "~/.config/tmux-powerline/" },
16- { "~/.dotfiles/waybar/", "~/.config/waybar/" },
17- { "~/.dotfiles/wezterm/", "~/.config/wezterm/" },
18- { "~/.dotfiles/.oh-my-zsh/", "~/.oh-my-zsh/" },
19- { "~/.dotfiles/.zshrc", "~/.zshrc" },
20- },
21- exclude_from = ".gitignore",
22- log_level = "info",
23-}
24-
25----@type LazySpec
26-local dev = {
27- dir = vim.fn.expand("~/code/nvim-plugins/syncmap/"),
28- name = "syncmap.nvim",
29- opts = opts,
30-}
31-
32----@type LazySpec
33-local prod = {
34- "huncholane/syncmap.nvim",
35- ---@type SyncmapOpts
36- opts = opts,
37-}
38-
39-return use_dev and dev or prod
+14-0nvim/lua/plugins/telescope.lua
@@ -0,0 +1,14 @@
1+require("utils.plugin").install({ src = "https://github.com/nvim-telescope/telescope.nvim" })
2+require("utils.plugin").install({ src = "https://github.com/xiyaowong/telescope-emoji.nvim" })
3+local telescope = require("telescope")
4+
5+telescope.setup({
6+ extensions = {
7+ emoji = {
8+ action = function(emoji)
9+ vim.fn.setreg("*", emoji.value)
10+ vim.api.nvim_put({ emoji.value }, "c", false, true)
11+ end,
12+ },
13+ },
14+})
+0-57nvim/lua/plugins/toggleterm.lua
@@ -1,57 +0,0 @@
1--- https://github.com/akinsho/toggleterm.nvim
2----@type LazySpec
3-return {
4- {
5- "akinsho/toggleterm.nvim",
6- event = "VeryLazy",
7- name = "Toggleterm",
8- keys = {
9- -- Creates a new floating terminal
10- {
11- "<leader>tf",
12- "<cmd>TermNew direction=float<cr>",
13- desc = "Create New Floating Terminal",
14- },
15- -- Creates a new tabbed terminal
16- {
17- "<leader>tt",
18- "<cmd>TermNew direction=tab<cr>",
19- desc = "Create New Tabbed Terminal",
20- },
21- -- Selects a terminal
22- {
23- "<leader>ts",
24- "<cmd>TermSelect<cr>",
25- desc = "Select Terminal",
26- },
27- -- Normal mode
28- {
29- mode = "t",
30- "<C-]>",
31- [[<C-\><C-n>]],
32- desc = "Terminal mode to normal mode",
33- },
34- },
35- -- opts
36- opts = {
37- direction = "float",
38- open_mapping = [[<c-\>]],
39- start_in_insert = true,
40- float_opts = {
41- border = "curved",
42- winblend = 3,
43- highlights = {
44- border = "Normal",
45- background = "Normal",
46- },
47- },
48- },
49- -- config
50- config = function(_, opts)
51- require("which-key").add({
52- { "<leader>t", group = "Toggleterm" },
53- })
54- require("toggleterm").setup(opts)
55- end,
56- },
57-}
+2-0nvim/lua/plugins/tokyo-night.lua
@@ -0,0 +1,2 @@
1+require("utils.plugin").install({src="https://github.com/folke/tokyonight.nvim"})
2+vim.cmd[[colorscheme tokyonight-storm]]
+2-0nvim/lua/plugins/vim-airline.lua
@@ -0,0 +1,2 @@
1+require("utils.plugin").install({ src = "https://github.com/vim-airline/vim-airline" })
2+vim.g["airline#extensions#tabline#enabled"] = 1
+32-0nvim/lua/plugins/which-key.lua
@@ -0,0 +1,32 @@
1+require("utils.plugin").install({ src = "https://github.com/folke/which-key.nvim" })
2+
3+-- vim.keymap.add("n", "<Leader>q",
4+-- vim.wk.add({
5+-- { "<leader>w", proxy = "<c-w>", group = "windows" }, -- proxy to window mappings
6+-- {
7+-- "<leader>b",
8+-- group = "buffers",
9+-- expand = function()
10+-- return require("which-key.extras").expand.buf()
11+-- end,
12+-- },
13+-- { "<leader>bb", ":b#<cr>", desc = "Last Buffer" },
14+-- {
15+-- "<C-s>",
16+-- function()
17+-- vim.cmd("write")
18+-- end,
19+-- desc = "Save",
20+-- mode = { "n", "i" },
21+-- },
22+--
23+-- {
24+-- "<leader>q",
25+-- function()
26+-- require("utils.buffer").clear_nameless()
27+-- vim.cmd("wqa")
28+-- end,
29+-- desc = "Quit",
30+-- mode = "n",
31+-- },
32+-- })
+24-0nvim/lua/plugins/zzz.lua
@@ -0,0 +1,24 @@
1+local function safe_require(mod)
2+ local ok, m = pcall(require, mod)
3+ if not ok then
4+ vim.notify("Failed to load " .. mod .. ": " .. m, vim.log.levels.WARN)
5+ return nil
6+ end
7+ return m
8+end
9+
10+safe_require("plugins.sessions")
11+safe_require("plugins.tokyo-night")
12+safe_require("plugins.plenary")
13+safe_require("plugins.which-key")
14+safe_require("plugins.mason")
15+safe_require("plugins.lspconfig")
16+safe_require("plugins.telescope")
17+safe_require("plugins.blink")
18+safe_require("plugins.conform")
19+safe_require("plugins.vim-airline")
20+safe_require("plugins.mini-icons")
21+safe_require("plugins.oil")
22+safe_require("plugins.oil-git")
23+safe_require("plugins.oil-git-status")
24+safe_require("plugins.oil-lsp-diagnostics")
+0-53nvim/lua/snippets/python.lua
@@ -1,53 +0,0 @@
1-local ls = require("luasnip")
2-local s = ls.snippet
3-local t = ls.text_node
4-local i = ls.insert_node
5-local f = ls.function_node
6-
7--- Utility to insert import if not present
8----@param import_string string # The import string
9-local function insert_import(import_string)
10- local cur = vim.api.nvim_win_get_cursor(0)
11- local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
12- for _, line in ipairs(lines) do
13- if line == import_string then
14- return {} -- already imported
15- end
16- end
17- -- Insert at top
18- table.insert(lines, 1, import_string)
19- vim.api.nvim_buf_set_lines(0, 0, -1, false, lines)
20- vim.schedule(function()
21- vim.api.nvim_win_set_cursor(0, { cur[1] + 1, cur[2] })
22- end)
23- return {}
24-end
25-
26-local function insert_dt_import()
27- insert_import("import datetime as dt")
28-end
29-
30-local function insert_pd_import()
31- insert_import("import pandas as pd")
32-end
33-
34-local function insert_np_import()
35- insert_import("import numpy as np")
36-end
37-
38-return {
39- -- Simple triple-quote docstring
40- s("ds", {
41- t({ '"""' }),
42- i(1, "Summary."),
43- t({ '"""' }),
44- }),
45- s("dt", f(insert_dt_import)),
46- s("pd", f(insert_pd_import)),
47- s("np", f(insert_np_import)),
48- s("urlpatterns", {
49- t({ "urlpatterns = [", "\t" }),
50- i(1, "path(...)"),
51- t({ "", "]" }),
52- }),
53-}
+0-122nvim/lua/snippets/rust.lua
@@ -1,122 +0,0 @@
1-local ls = require("luasnip")
2-local s = ls.snippet
3-local t = ls.text_node
4-local i = ls.insert_node
5-local rep = require("luasnip.extras").rep
6-
7-return {
8- -- Derive macro skeleton
9- s("pmd", {
10- t({
11- "#[proc_macro_derive(",
12- }),
13- i(1, "MyDerive"),
14- t({ ")]", "pub fn " }),
15- i(2, "my_derive"),
16- t({
17- "(input: proc_macro::TokenStream) -> proc_macro::TokenStream {",
18- " let input = syn::parse_macro_input!(input as syn::DeriveInput);",
19- " let name = &input.ident;",
20- "",
21- " quote! {",
22- " // generated code here",
23- " }.into()",
24- "}",
25- }),
26- }),
27-
28- -- Attribute macro skeleton
29- s("pma", {
30- t({
31- "#[proc_macro_attribute]",
32- "pub fn ",
33- }),
34- i(1, "with_field"),
35- t({
36- "(_attr: proc_macro::TokenStream, item: proc_macro::TokenStream) -> proc_macro::TokenStream {",
37- " let ast = syn::parse_macro_input!(item as syn::ItemStruct);",
38- " // modify ast.fields here",
39- " proc_macro::TokenStream::from(quote!(#ast))",
40- "}",
41- }),
42- }),
43-
44- --- Procedural macro attr expand function
45- s({
46- trig = "pmae",
47- name = "Proc Macro Attr Expand",
48- dscr = "Boilerplate for expansion function to be used later in a #[proc_macro_attribute]",
49- }, {
50- t({
51- "pub fn expand(",
52- "\tattr: proc_macro::TokenStream,",
53- "\titem: proc_macro::TokenStream,",
54- ") -> proc_macro::TokenStream {",
55- "\tlet ast = syn::parse_macro_input!(item as syn::ItemStruct);",
56- "\tquote::quote! {}.into()",
57- "}",
58- }),
59- }),
60-
61- --- Procedural macro derive expand function
62- s({
63- trig = "pmde",
64- name = "Proc Macro Derive Expand",
65- dscr = "Boilerplate for expansion function to be used later in #[proc_macro_derive]",
66- }, {
67- t({
68- "pub fn expand(item: proc_macro::TokenStream) -> proc_macro::TokenStream {",
69- "\tlet input = syn::parse_macro_input!(item as syn::DeriveInput);",
70- "\tquote::quote! {}.into()",
71- "}",
72- }),
73- }),
74-
75- --- Procedural macro attr import function
76- s({
77- trig = "pmai",
78- name = "Proc Macro Attr Import",
79- dscr = "Used to import procedural macro defined in another function with pmae",
80- }, {
81- t({
82- "#[proc_macro_attribute]",
83- "pub fn with_",
84- }),
85- i(1, "import"),
86- t({
87- "(",
88- "\tattr: proc_macro::TokenStream,",
89- "\titem: proc_macro::TokenStream,",
90- ") -> proc_macro::TokenStream {",
91- "\t",
92- }),
93- rep(1),
94- t({
95- "::expand(attr, item)",
96- "}",
97- }),
98- }),
99-
100- --- Procedural macro derive import function
101- s({
102- trig = "pmdi",
103- name = "Proc Macro Derive Import",
104- dscr = "Used to import from another file with pmde",
105- }, {
106- t({
107- "#[proc_macro_derive(",
108- }),
109- i(1, "MyDerive"),
110- t({ ")]", "pub fn derive_" }),
111- i(2, "import"),
112- t({
113- "(item: proc_macro::TokenStream) -> proc_macro::TokenStream {",
114- "\t",
115- }),
116- rep(2),
117- t({
118- "::expand(item)",
119- "}",
120- }),
121- }),
122-}
+0-80nvim/lua/types/lazy-spec.lua.trash
@@ -1,80 +0,0 @@
1----The keys property can be a string or string[] for simple normal-mode mappings, or it can be a LazyKeysSpec table with the following key-value pairs:
2----@class LazyKeysSpec : vim.keymap.set.Opts
3----@field [1] string # lhs
4----@field [2]? string # rhs
5----@field mode? string|string[] # defaults to "n"
6----@field ft? string|string[] # filetype for buffer-local keymaps
7-
8----Config table for Lazyvim plugin files
9----@class LazySpec
10----Short plugin url. Will be expanded using
11----config.git.url_format. Can also be a url or dir.
12----@field [1]? string
13----A directory pointing to a local plugin
14----@field dir? string
15----A custom git url where the plugin is hosted
16----@field url? boolean
17----A custom name for the plugin used for the local plugin directory and as the display name
18----@field name? string
19----A list of plugin names or plugin specs that should be loaded when the
20----plugin loads. Dependencies are always lazy-loaded unless specified otherwise.
21----When specifying a name, make sure the plugin spec has been defined somewhere else.
22----@field dependencies? LazySpec
23----When false, or if the function returns false, then this plugin
24----will not be included in the spec
25----@field enabled? boolean|fun():boolean
26----Behaves the same as enabled, but won't uninstall the plugin when the condition is false.
27----Useful to disable some plugins in vscode, or firenvim for example.
28----@field cond? boolean|fun():boolean
29----Only useful for start plugins (lazy=false) to force loading certain plugins first.
30----Default priority is 50. It's recommended to set this to a high number for colorschemes.
31----@field priority? number
32----init functions are always executed during startup. Mostly useful for setting vim.g.* configuration used by Vim plugins startup
33----@field init fun(LazyPlugin)
34----
35----opts should be a table (will be merged with parent specs), return a table (replaces parent specs) or should change a table. The table will be passed to the Plugin.config() function. Setting this value will imply Plugin.config()
36----@field opts table|fun(LazyPlugin, opts:table)
37----
38----config is executed when the plugin loads.The default implementation will automatically run require(MAIN).setup(opts) if opts or config = true is set. Lazy uses several heuristics to determine the plugin's MAIN module automatically based on the plugin's name. (opts is the recommended way to configure plugins).
39----@field config fun(spec:LazySpec, opts:table)|true
40----You can specify the main module to use for config() and opts(), in case it can not be determined automatically. See config()
41----@field main? string
42----build is executed when a plugin is installed or updated. See [Building](https://lazy.folke.io/developers#building) for more information.
43----@field build fun(spec:LazySpec)|string|false|table
44----When true, the plugin will only be loaded when needed. Lazy-loaded plugins are automatically loaded when their Lua modules are required, or when one of the lazy-loading handlers triggers
45----@field lazy? boolean
46----Lazy-load on event. Events can be specified as BufEnter or with a pattern like BufEnter *.lua
47----@field event? string|string[]|fun(self:LazySpec,event:string[]):string|{event:string[]|string,pattern?:string[]|string}
48----Lazy-load on command
49----@field cmd? string|string[]|fun(self:LazySpec,cmd:string[]):string[]
50----Lazy-load on filetype
51----@field ft? string|string[]|fun(self:LazySpec,ft:string[]):string[]
52----Lazy-load on [key mapping](https://lazy.folke.io/spec/lazy_loading#%EF%B8%8F-lazy-key-mappings)
53----@field keys? string|string[]|LazyKeysSpec|fun(self:LazySpec,keys:string[]):(string|LazyKeysSpec)[]
54----Branch of the repository
55----@field branch? string
56----Tag of the repository
57----@field tag? string
58----Commit of the repository
59----@field commit? string
60----Version to use from the repository. Full Semver ranges are supported
61----@field version? string|false
62----When true, this plugin will not be included in updates
63----@field pin? boolean
64----When false, git submodules will not be fetched. Defaults to true
65----@field submodules? boolean
66----
67----When a spec is tagged optional, it will only be included in the final spec, when the same plugin has been specified at least once somewhere else without optional. This is mainly useful for Neovim distros, to allow setting options on plugins that may/may not be part of the user's plugins.
68----@field optional? boolean
69----
70----A list of plugin specs defined in the scope of the plugin. This is mainly useful for Neovim distros, to allow setting options on plugins that may/may not be part of the user's plugins. When the plugin is disabled, none of the scoped specs will be included in the final spec. Similar to dependencies without the automatic loading of the specs.
71----@field specs LazySpec
72----Do not automatically load this Lua module when it's required somewhere
73----@field module? false
74----Import the given spec module.
75----@field import? string
76-
77----@type LazySpec
78-local hello = {
79- keys = {},
80-}
+0-0nvim/lua/usercmds.lua

No content changes (mode or rename only).

+17-0nvim/lua/utils/buffer.lua
@@ -0,0 +1,17 @@
1+local M = {}
2+
3+function M.clear_nameless()
4+ for _, buf in ipairs(vim.api.nvim_list_bufs()) do
5+ if vim.api.nvim_buf_is_loaded(buf) and vim.bo[buf].buftype == "" and vim.fn.bufname(buf) == "" then
6+ vim.api.nvim_buf_delete(buf, { force = true })
7+ end
8+ end
9+end
10+
11+function M.wipe()
12+ for _, buf in ipairs(vim.api.nvim_list_bufs()) do
13+ vim.api.nvim_buf_delete(buf, { force = true })
14+ end
15+end
16+
17+return M
+0-23nvim/lua/utils/formatting.lua
@@ -1,23 +0,0 @@
1-local M = {}
2-
3--- tabs function
4-function M.set_tabs(length)
5- vim.bo.tabstop = length
6- vim.bo.shiftwidth = length
7- vim.bo.softtabstop = length
8- vim.bo.expandtab = true
9-end
10-
11--- configure a language
12-function M.config_lang(filetype, func)
13- if vim.bo.filetype == filetype then
14- func()
15- end
16- local augroup = vim.api.nvim_create_augroup(filetype .. "Options", { clear = true })
17- vim.api.nvim_create_autocmd("Filetype", {
18- group = augroup,
19- callback = func,
20- })
21-end
22-
23-return M
+14-0nvim/lua/utils/general.lua
@@ -0,0 +1,14 @@
1+local M = {}
2+
3+function M.set_tabs(tabs)
4+ vim.opt.shiftwidth = tabs
5+ vim.opt.tabstop = tabs
6+ vim.opt.softtabstop = tabs
7+end
8+
9+function M.safe_exit()
10+ require("utils.buffer").clear_nameless()
11+ vim.cmd("wq")
12+end
13+
14+return M
+63-0nvim/lua/utils/plugin.lua
@@ -0,0 +1,63 @@
1+local M = {}
2+
3+-- install directory
4+-- data = ~/.local/share/nvim
5+local install_dir = vim.fn.stdpath("data") .. "/site/pack/plugins/opt"
6+
7+-- ensure install_dir exists
8+if vim.fn.isdirectory(install_dir) == 0 then
9+ vim.fn.mkdir(install_dir, "p")
10+end
11+
12+-- helper: get last path segment
13+local function stem(src)
14+ return src:match("([^/]+)$"):gsub("%.git$", "")
15+end
16+
17+local function run_async(cmd, on_exit)
18+ vim.fn.jobstart(cmd, {
19+ stdout_buffered = true,
20+ stderr_buffered = true,
21+ on_stdout = function(_, data)
22+ if data then
23+ vim.notify(table.concat(data, "\n"))
24+ end
25+ end,
26+ on_stderr = function(_, data)
27+ if data then
28+ vim.notify(table.concat(data, "\n"), vim.log.levels.ERROR)
29+ end
30+ end,
31+ on_exit = function(_, code)
32+ if on_exit then
33+ on_exit(code)
34+ end
35+ end,
36+ })
37+end
38+
39+M.install = function(settings)
40+ local name = settings.name or stem(settings.src)
41+ local target = install_dir .. "/" .. name
42+
43+ -- GitHub source
44+ if settings.src:match("github.com") then
45+ if vim.fn.isdirectory(target) == 0 then
46+ vim.notify("Installing " .. name .. " from GitHub", vim.log.levels.INFO)
47+ vim.fn.system({ "git", "clone", settings.src, target })
48+ end
49+
50+ -- Local source
51+ else
52+ if vim.fn.isdirectory(target) == 0 then
53+ vim.notify("Installing " .. name .. " from local path", vim.log.levels.INFO)
54+ vim.fn.system({ "cp", "-r", settings.src, target })
55+ else
56+ run_async({ "rsync", "-a", settings.src .. "/", target })
57+ end
58+ end
59+
60+ vim.cmd("packadd " .. name)
61+end
62+
63+return M
+6-0nvim/sample_files/sample.py
@@ -0,0 +1,6 @@
1+def hello(name: str):
2+ """says hello to the name"""
3+ print(f"Hello {name}")
4+
5+
6+hello("Lane")
+0-0nvim/sample_files/sample.rs

No content changes (mode or rename only).

+0-0nvim/sample_files/sample.ts

No content changes (mode or rename only).

+0-0nvim/sample_files/sample.tsx

No content changes (mode or rename only).

+0-3nvim/stylua.toml
@@ -1,3 +0,0 @@
1-indent_type = "Spaces"
2-indent_width = 2
3-column_width = 120
+0-4nvim/test_files/test.json
@@ -1,4 +0,0 @@
1-{
2- "hello": "world",
3- "goal": "Be the best"
4-}
+0-76nvim/tmux.conf
@@ -1,76 +0,0 @@
1-# Settings
2-set -g mouse on
3-set -g status on # Enable the status line
4-set -g pane-border-status top # Show titles at the top of each pane
5-set -g pane-border-format "#{pane_index} #{pane_title}" # Customize the title format
6-setw -g mode-keys vi # Use vi keybindings in copy mode
7-set -g focus-events on
8-set -g status-right '#{ip_address} | #H'
9-setw -g pane-border-format ' #{=/-20/…:pane_title} [#{=/-20/…:pane_current_command}] #(pgrep -P "#{pane_pid}" | tr "\n" " ")#{pane_current_path} #{?alternate_on,<Alt Mode> ,}'
10-set -g @treemux-tree-nvim-init-file '~/.tmux/plugins/treemux/configs/treemux_init.lua'
11-set -g @continuum-restore 'on'
12-set -g xterm-keys on
13-set -g set-clipboard on
14-set -g automatic-rename on
15-set -g automatic-rename-format "#{b:pane_current_path##*/} → #{pane_current_command}"
16-set -g default-terminal "tmux-256color"
17-set -ag terminal-overrides ",xterm-256color:Tc,smcup@:rmcup@"
18-TMUX_FZF_MENU=\
19-"foo\necho 'Hello!'\n"\
20-"bar\nls ~\n"\
21-"sh\nsh ~/test.sh\n"
22-TMUX_FZF_LAUNCH_KEY="C-f"
23-
24-
25-# Prefix keybindings
26-bind r source-file ~/.tmux.conf \; display "Reloaded the config"
27-bind c new-window -c "#{pane_current_path}" \; display "Opened new window in #{pane_current_path}"
28-bind a attach-session -c "#{pane_current_path}" \; display "Attached current session to #{pane_current_path}"
29-bind e show-environment
30-bind g display-popup -E -w 90% -h 90% -d "#{pane_current_path}" 'lazygit'
31-
32-
33-# Repeatable
34-set -s repeat-time 500 # Slow down repeat time
35-bind -r C-h resize-pane -L 5
36-bind -r C-j resize-pane -D 5
37-bind -r C-k resize-pane -U 5
38-bind -r C-l resize-pane -R 5
39-
40-
41-# Keybindings
42-bind -n MouseDown3Pane resize-pane -Z
43-bind -n M-h select-pane -L # Move left a pane
44-bind -n M-j select-pane -D # Move down a pane
45-bind -n M-k select-pane -U # Move up a pane
46-bind -n M-l select-pane -R # Move right a pane
47-bind -n M-m resize-pane -Z # Maximize/minimize current pane
48-bind -n M-i previous-window # Move to previous window
49-bind -n M-o next-window # Move to next window
50-bind -n M-, switch-client -p # Switch to previous session
51-bind -n M-. switch-client -n # Switch to next session
52-
53-
54-# Display
55-# Inactive pane border
56-set -g pane-border-style "fg=default"
57-set -g pane-active-border-style "fg=orange"
58-
59-
60-# List of plugins
61-set -g @plugin 'erikw/tmux-powerline'
62-set -g @plugin 'tmux-plugins/tpm'
63-set -g @plugin 'tmux-plugins/tmux-sensible'
64-set -g @plugin 'tmux-plugins/tmux-resurrect'
65-set -g @plugin 'tmux-plugins/tmux-continuum'
66-set -g @plugin 'anghootys/tmux-ip-address'
67-set -g @plugin 'alexwforsythe/tmux-which-key'
68-set -g @plugin 'kiyoon/treemux'
69-set -g @plugin 'sainnhe/tmux-fzf'
70-set -g @plugin 'imomaliev/tmux-keyboard-layout'
71-set -g @plugin 'joshmedeski/tmux-nerd-font-window-name'
72-set -g @plugin 'huncholane/tmux-fzf-keys'
73-set -g @plugin 'huncholane/tmux-env-menu'
74-
75-# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
76-run '~/.tmux/plugins/tpm/tpm'