├── .config └── nvim │ ├── .stylua.toml │ ├── init.lua │ ├── lazy-lock.json │ ├── lua │ ├── config │ │ ├── hls.lua │ │ ├── init.lua │ │ ├── keymaps.lua │ │ ├── lazy.lua │ │ ├── settings.lua │ │ └── tw.lua │ └── plugins │ │ ├── alpha.lua │ │ ├── autotag.lua │ │ ├── blink-cmp.lua │ │ ├── colorschemes.lua │ │ ├── comment.lua │ │ ├── commentstring.lua │ │ ├── conform.lua │ │ ├── dressing.lua │ │ ├── explorer.lua │ │ ├── fidget.lua │ │ ├── file-operations.lua │ │ ├── flash.lua │ │ ├── fzf.lua │ │ ├── git-signs.lua │ │ ├── guess-indent.lua │ │ ├── harpoon.lua │ │ ├── highlight-colors.lua │ │ ├── lsp-config.lua │ │ ├── lualine.lua │ │ ├── mason.lua │ │ ├── mini-icons.lua │ │ ├── neoscroll.lua │ │ ├── neotree.lua │ │ ├── nvim-lint.lua │ │ ├── quickfix.lua │ │ ├── scissors.lua │ │ ├── statuscolumn.lua │ │ ├── surround.lua │ │ ├── tmux.lua │ │ ├── treesitter.lua │ │ ├── typescript.lua │ │ ├── whichkey.lua │ │ └── wrapper.lua │ └── snippets │ ├── lua.json │ ├── package.json │ └── typescriptreact.json ├── .gitignore └── README.md /.config/nvim/.stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 100 2 | indent_type = "Spaces" 3 | indent_width = 2 4 | -------------------------------------------------------------------------------- /.config/nvim/init.lua: -------------------------------------------------------------------------------- 1 | require("config") 2 | 3 | if vim.g.neovide then 4 | vim.o.guifont = "Input Mono,Symbols Nerd Font Mono:h12" 5 | vim.opt.linespace = 3 6 | vim.g.neovide_show_border = true 7 | vim.g.neovide_scroll_animation_lenght = 0.1 8 | end 9 | 10 | local should_profile = os.getenv("NVIM_PROFILE") 11 | if should_profile then 12 | require("profile").instrument_autocmds() 13 | if should_profile:lower():match("^start") then 14 | require("profile").start("*") 15 | else 16 | require("profile").instrument("*") 17 | end 18 | end 19 | 20 | local function toggle_profile() 21 | local prof = require("profile") 22 | if prof.is_recording() then 23 | prof.stop() 24 | vim.ui.input( 25 | { prompt = "Save profile to:", completion = "file", default = "profile.json" }, 26 | function(filename) 27 | if filename then 28 | prof.export(filename) 29 | vim.notify(string.format("Wrote %s", filename)) 30 | end 31 | end 32 | ) 33 | else 34 | prof.start("blink*") 35 | end 36 | end 37 | vim.keymap.set("", "", toggle_profile) 38 | -------------------------------------------------------------------------------- /.config/nvim/lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, 3 | "alpha-nvim": { "branch": "main", "commit": "a35468cd72645dbd52c0624ceead5f301c566dff" }, 4 | "blink.cmp": { "branch": "main", "commit": "022521a8910a5543b0251b21c9e1a1e989745796" }, 5 | "comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, 6 | "commentstring.nvim": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, 7 | "conform.nvim": { "branch": "master", "commit": "b529dd4897c85c3188cc787084089a9d55843093" }, 8 | "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, 9 | "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, 10 | "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, 11 | "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, 12 | "fzf-lua": { "branch": "main", "commit": "6d1d81a5c7936d82a47a41a521958e482e499fde" }, 13 | "gitsigns.nvim": { "branch": "main", "commit": "d0f90ef51d4be86b824b012ec52ed715b5622e51" }, 14 | "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, 15 | "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, 16 | "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, 17 | "lualine.nvim": { "branch": "master", "commit": "0c6cca9f2c63dadeb9225c45bc92bb95a151d4af" }, 18 | "mason-lspconfig.nvim": { "branch": "main", "commit": "c2682b0d9732bf52cbc34862056f143e71dc4a6d" }, 19 | "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, 20 | "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, 21 | "neo-tree.nvim": { "branch": "main", "commit": "f3e8633f06007e015f855d3c1ec0cee23af14d8e" }, 22 | "neoscroll.nvim": { "branch": "master", "commit": "f957373912e88579e26fdaea4735450ff2ef5c9c" }, 23 | "nui.nvim": { "branch": "main", "commit": "7cd18e73cfbd70e1546931b7268b3eebaeff9391" }, 24 | "nvim-highlight-colors": { "branch": "main", "commit": "b42a5ccec7457b44e89f7ed3b3afb1b375bb2093" }, 25 | "nvim-lint": { "branch": "master", "commit": "81e8ba7655cc4395b1092ef4e1b6e83f54cd54ad" }, 26 | "nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" }, 27 | "nvim-lspconfig": { "branch": "master", "commit": "8adb3b5938f6074a1bcc36d3c3916f497d2e8ec4" }, 28 | "nvim-scissors": { "branch": "main", "commit": "8123690127a599b7d5669b074d572e6239222c45" }, 29 | "nvim-surround": { "branch": "main", "commit": "8dd9150ca7eae5683660ea20cec86edcd5ca4046" }, 30 | "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, 31 | "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, 32 | "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, 33 | "quicker.nvim": { "branch": "master", "commit": "51d3926f183c2d98fbc237cc237ae0926839af3a" }, 34 | "smart-splits.nvim": { "branch": "master", "commit": "e80bf81015a342b78e3e9ef0395a09ca91f666de" }, 35 | "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, 36 | "statuscolumn.nvim": { "branch": "main", "commit": "2020dc9e028295a304f98f9e59aa585c13a7279e" }, 37 | "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, 38 | "typescript-tools.nvim": { "branch": "master", "commit": "3c501d7c7f79457932a8750a2a1476a004c5c1a9" }, 39 | "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, 40 | "wrapping.nvim": { "branch": "master", "commit": "f26fdeabd17cf1bf5197badbdadc2e2f08b6ab0f" } 41 | } 42 | -------------------------------------------------------------------------------- /.config/nvim/lua/config/hls.lua: -------------------------------------------------------------------------------- 1 | function Get_hl_hex(name, option) 2 | if type(name) ~= "string" or (option ~= "fg" and option ~= "bg") then 3 | error("Invalid arguments. Usage: highlight(name: string, option: 'fg' | 'bg')") 4 | end 5 | local hl = vim.api.nvim_get_hl(0, { name = name }) 6 | local color = hl[option] 7 | if not color then 8 | print("No " .. option .. " color found for highlight group: " .. name) 9 | return nil 10 | end 11 | local hex_color = string.format("#%06x", color) 12 | return hex_color 13 | end 14 | 15 | vim.api.nvim_create_autocmd({ "ColorScheme", "VimEnter" }, { 16 | group = vim.api.nvim_create_augroup("Color", {}), 17 | pattern = "*", 18 | callback = function() 19 | vim.api.nvim_set_hl(0, "DiagnosticUnnecessary", { underline = true }) 20 | vim.api.nvim_set_hl(0, "WinSeparator", { link = "FloatBorder" }) 21 | 22 | vim.api.nvim_set_hl(0, "NeoTreeNormal", { link = "NormalFloat" }) 23 | vim.api.nvim_set_hl(0, "NeoTreeDirectoryIcon", { fg = Get_hl_hex("Function", "fg") }) 24 | vim.api.nvim_set_hl(0, "NeoTreeDirectoryName", { fg = Get_hl_hex("Function", "fg") }) 25 | vim.api.nvim_set_hl(0, "NeoTreeGitUnstaged", { link = "Changed" }) 26 | vim.api.nvim_set_hl(0, "NeoTreeGitModified", { link = "Changed" }) 27 | vim.api.nvim_set_hl(0, "NeoTreeGitUntracked", { link = "Added" }) 28 | vim.api.nvim_set_hl(0, "NeoTreeGitRenamed", { link = "Added" }) 29 | vim.api.nvim_set_hl(0, "NeoTreeGitConflict", { link = "Removed" }) 30 | 31 | -- vim.api.nvim_set_hl(0, "SnacksPickerGitStatusUnstaged", { link = "Changed" }) 32 | -- vim.api.nvim_set_hl(0, "SnacksPickerGitStatusModified", { link = "Changed" }) 33 | -- vim.api.nvim_set_hl(0, "SnacksPickerGitStatusUntracked", { link = "Added" }) 34 | -- vim.api.nvim_set_hl(0, "SnacksPickerGitStatusRenamed", { link = "Added" }) 35 | -- vim.api.nvim_set_hl(0, "SnacksPickerGitStatusConflict", { link = "Removed" }) 36 | end, 37 | }) 38 | 39 | -- highlight on yank 40 | local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true }) 41 | vim.api.nvim_create_autocmd("TextYankPost", { 42 | callback = function() 43 | vim.highlight.on_yank() 44 | end, 45 | group = highlight_group, 46 | pattern = "*", 47 | }) 48 | -------------------------------------------------------------------------------- /.config/nvim/lua/config/init.lua: -------------------------------------------------------------------------------- 1 | require("config.settings") 2 | require("config.keymaps") 3 | require("config.hls") 4 | require("config.lazy") 5 | require("config.tw") 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/config/keymaps.lua: -------------------------------------------------------------------------------- 1 | local function map(mode, keys, action, desc, opts) 2 | local defaults = { 3 | desc = desc or "", 4 | noremap = true, 5 | } 6 | 7 | local merged = vim.tbl_extend("force", defaults, opts or {}) 8 | vim.keymap.set(mode, keys, action, merged) 9 | end 10 | 11 | vim.g.mapleader = " " 12 | 13 | -- better manual indenting 14 | map("v", "<", "'<", "Inner indent while remaining in visual mode") 15 | map("v", ">", ">gv'<", "Outer indent while remaining in visual mode") 16 | 17 | -- search visual selection (very nice) 18 | map("v", "//", [[y:let@/='\V'.escape(@",'/\\')]], "Search visual selection", { silent = true }) 19 | 20 | -- repeat last macro 21 | map("n", "Q", "@@", "Repeat last macro") 22 | 23 | -- quickfix navigation 24 | map("n", "]q", "cnext", "Next quickfix item") 25 | map("n", "[q", "cprev", "Prev quickfix item") 26 | 27 | -- better end and start of the line 28 | map({ "n", "v" }, "j", "gj", "Up") 29 | map({ "n", "v" }, "k", "gk", "Down") 30 | map({ "n", "v" }, "L", "$", "End of the line") 31 | map({ "n", "v" }, "H", "g^", "Start of the line") 32 | 33 | -- replacing C-i because it mimics Tab 34 | map("n", "", "") 35 | 36 | -- move with J and K ith indents 37 | map("v", "J", ":m '>+1gv=gv", "Move line down", { silent = true }) 38 | map("v", "K", ":m '<-2gv=gv", "Move line up", { silent = true }) 39 | 40 | -- better terminal remaps 41 | map({ "c", "i", "t" }, "", "") 42 | map({ "c", "i", "t" }, "", "") 43 | map({ "c", "i", "t" }, "", "") 44 | 45 | -- terminal 'unbinds' 46 | map({ "c", "i", "t" }, "", "") 47 | map({ "c", "i", "t" }, "", "") 48 | map({ "n", "v", "i" }, "", "") 49 | 50 | -- keep cursor centered 51 | map("n", "J", "mzJ`z", "Move current line up") 52 | map("n", "n", "nzzzv", "Next result in search /") 53 | map("n", "N", "Nzzzv", "Previous result in search /") 54 | 55 | -- next greatest remap ever : asbjornHaland (yanking and pasting) 56 | map("v", "y", [["+y]], "Yank to clipboard") 57 | map("n", "yy", [["+yy]], "Yank line to clipboard") 58 | map("n", "Y", [["+yg_]], "Yank to end of line to clipboard") 59 | map({ "n", "v", "x" }, "p", '"+p', "Paste from clipboard") 60 | 61 | -- indow management 62 | map("n", "wv", "v", "Split window vertically") 63 | map("n", "wh", "s", "Split window horizontally") 64 | map("n", "we", "=", "Make splits equal size") 65 | map("n", "wr", "r", "Rotate splits") 66 | map("n", "wh", "H", "Send split to the right") 67 | map("n", "wj", "J", "Send split to the botton") 68 | map("n", "wk", "K", "Send split to the top") 69 | map("n", "wl", "L", "Send split to the left") 70 | map("n", "wx", "close", "Close current split") 71 | map("n", "wo", "on", "Close all other windows") 72 | 73 | -- tab management 74 | map("n", "to", "tabnew", "Open new tab") 75 | map("n", "tx", "tabclose", "Close current tab") 76 | map("n", "tn", "tabn", "Go to next tab") 77 | map("n", "tp", "tabp", "Go to previous tab") 78 | map("n", "tf", "tabnew %", "Open current buffer in new tab") 79 | 80 | local wrap_with_markdown = function(content) 81 | local path = vim.fn.expand("%:.") 82 | local filetype = vim.bo.filetype == "typescriptreact" and "jsx" or vim.bo.filetype 83 | local result = table.concat({ "- ", path, "\n```", filetype, "\n", content, "\n```" }) 84 | vim.fn.setreg("+", result) 85 | end 86 | 87 | map("n", "mf", function() 88 | local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false) 89 | local content = table.concat(lines, "\n") 90 | wrap_with_markdown(content) 91 | vim.notify("Entire file copied with MD formatting") 92 | end, "Yank file with filename as heading and wrap in md fence") 93 | 94 | map("v", "ms", function() 95 | local v_start = vim.fn.getpos("'<") 96 | local v_end = vim.fn.getpos("'>") 97 | local lines = vim.api.nvim_buf_get_lines(0, v_start[2] - 1, v_end[2], false) 98 | local content = table.concat(lines, "\n") 99 | 100 | wrap_with_markdown(content) 101 | vim.notify("Selection copied with MD formatting") 102 | end, "Yank selection with filename as heading and wrap in markdown") 103 | -------------------------------------------------------------------------------- /.config/nvim/lua/config/lazy.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 2 | if not vim.loop.fs_stat(lazypath) then 3 | vim.fn.system({ 4 | "git", 5 | "clone", 6 | "--filter=blob:none", 7 | "https://github.com/folke/lazy.nvim.git", 8 | "--branch=stable", -- latest stable release 9 | lazypath, 10 | }) 11 | end 12 | 13 | vim.opt.rtp:prepend(lazypath) 14 | 15 | require("lazy").setup({ 16 | { import = "plugins" }, 17 | -- { import = "testing" }, 18 | }, { 19 | ui = { 20 | border = "single", 21 | size = { 22 | width = 0.95, 23 | height = 0.9, 24 | }, 25 | }, 26 | }) 27 | -------------------------------------------------------------------------------- /.config/nvim/lua/config/settings.lua: -------------------------------------------------------------------------------- 1 | vim.loader.enable() 2 | vim.opt.mouse = "" 3 | 4 | -- folds 5 | vim.opt.foldenable = false 6 | vim.opt.foldmethod = "manual" 7 | 8 | -- wrap 9 | vim.opt.wrap = false 10 | vim.opt.linebreak = true 11 | vim.opt.breakat = " " 12 | vim.opt.textwidth = 80 13 | 14 | -- remove eof character 15 | vim.opt.fillchars = { eob = " " } 16 | 17 | -- Save undo history 18 | vim.opt.undofile = true 19 | 20 | -- always number line 21 | vim.opt.nu = true 22 | 23 | -- incremental search 24 | vim.opt.hlsearch = false 25 | vim.opt.incsearch = true 26 | 27 | -- term colors 28 | vim.opt.termguicolors = true 29 | 30 | -- least amount of lines while scrolling is 10 31 | vim.opt.scrolloff = 999 32 | vim.opt.signcolumn = "yes" 33 | 34 | -- fast update 35 | vim.opt.updatetime = 50 36 | 37 | -- better indentation 38 | vim.opt.tabstop = 2 39 | vim.opt.softtabstop = 2 40 | vim.opt.shiftwidth = 2 41 | vim.opt.expandtab = true 42 | vim.opt.smartindent = true 43 | vim.opt.autoindent = true 44 | 45 | -- Fix markdown indentation settings 46 | vim.g.markdown_recommended_style = 0 47 | 48 | -- Enable break indent 49 | vim.opt.breakindent = true 50 | 51 | -- Split direction 52 | vim.opt.splitright = true 53 | vim.opt.splitbelow = true 54 | 55 | -- indent symbols 56 | -- vim.opt.list = true 57 | -- vim.opt.listchars = { tab = "· ", trail = " ", nbsp = "␣" } 58 | -------------------------------------------------------------------------------- /.config/nvim/lua/config/tw.lua: -------------------------------------------------------------------------------- 1 | local rustywind = {} 2 | 3 | function rustywind.sort() 4 | vim.cmd('normal va"vF"') 5 | 6 | local line_start = vim.fn.getpos("'<") 7 | local line_end = vim.fn.getpos("'>") 8 | 9 | local row_start = line_start[2] - 1 10 | local row_end = line_end[2] 11 | local col_start = line_start[3] 12 | local col_end = line_end[3] 13 | 14 | local lines = table.concat(vim.api.nvim_buf_get_lines(0, row_start, row_end, true)) 15 | local selection = lines:sub(col_start, col_end) 16 | 17 | if selection:find("%b[]") then 18 | vim.notify("Rustywind error: Cannot sort due to arbitrary classes", vim.log.levels.ERROR) 19 | return 20 | end 21 | 22 | local shell_cmd = "echo " 23 | .. vim.fn.shellescape("className=" .. selection) 24 | .. " | rustywind --stdin" 25 | 26 | local output = vim.fn.system(shell_cmd) 27 | 28 | if vim.v.shell_error ~= 0 then 29 | vim.notify("Error running rustywind: " .. output, vim.log.levels.ERROR) 30 | return 31 | end 32 | 33 | local result = output:gsub("\n", ""):gsub("className=", ""):gsub('%b".-"', "") 34 | 35 | vim.api.nvim_buf_set_text(0, row_start, col_start - 1, row_start, col_end, { result }) 36 | 37 | vim.notify("Classes sorted successfully", vim.log.levels.INFO) 38 | end 39 | 40 | vim.keymap.set("n", "mt", rustywind.sort, { desc = "Sort Inline Tailwind Classes" }) 41 | 42 | return rustywind 43 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/alpha.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "goolord/alpha-nvim", 3 | config = function() 4 | local alpha = require("alpha") 5 | local dashboard = require("alpha.themes.dashboard") 6 | 7 | dashboard.section.header.val = { 8 | [[ . ]], 9 | [[ \\ ., ]], 10 | [[ '#\ .*/' ]], 11 | [[ .:::##*. '#\ *#/' ]], 12 | [[//' '':#\ \#. #/' ]], 13 | [[' \*#\ |#. #/ ./#####::. ]], 14 | [[ \*#\ |#: #/ /##/ '\ ]], 15 | [[ __##-= .=_***$*-. ===._ ]], 16 | [[ __::::###*.-*$######$*-. =::#*. ]], 17 | [[ --/' .-+*$########$*-. '::\ ]], 18 | [[//' ; .-+*$#######$*-. ':| ]], 19 | [[' ;#/ .-+*$####$*-. ':| ]], 20 | [[ :#/ .#. '-*##*-' ':| ]], 21 | [[ .#| |#. :/ ]], 22 | [[ :| |#: ' ]], 23 | [[ ' |: ]], 24 | [[ \: ]], 25 | [[ ' ]], 26 | } 27 | dashboard.section.buttons.val = {} 28 | dashboard.section.footer.val = 29 | { "In the midst of winter, I found there", "was, within me, an invincible summer." } 30 | 31 | alpha.setup(dashboard.opts) 32 | end, 33 | } 34 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/autotag.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "windwp/nvim-ts-autotag", 3 | event = { "InsertEnter" }, 4 | config = function() 5 | require("nvim-ts-autotag").setup({ 6 | opts = { 7 | -- Defaults 8 | enable_close = true, -- Auto close tags 9 | enable_rename = false, -- Auto rename pairs of tags 10 | enable_close_on_slash = true, -- Auto close on trailing "] = { "snippet_forward", "fallback" }, 89 | [""] = { "snippet_backward", "fallback" }, 90 | [""] = { 91 | function(list) 92 | list.show() 93 | end, 94 | }, 95 | }, 96 | 97 | completion = { 98 | list = { 99 | max_items = 20, 100 | selection = { 101 | preselect = false, 102 | }, 103 | }, 104 | documentation = { 105 | auto_show = true, 106 | auto_show_delay_ms = 200, 107 | window = { 108 | border = "single", 109 | max_height = 10, 110 | winhighlight = "Normal:BlinkCmpDoc,FloatBorder:FloatBorder,EndOfBuffer:BlinkCmpDoc", 111 | }, 112 | }, 113 | ghost_text = { 114 | enabled = false, 115 | }, 116 | menu = { 117 | draw = { 118 | components = { 119 | label = { 120 | width = { max = 30 }, 121 | text = function(ctx) 122 | return ctx.label 123 | end, 124 | highlight = "@variable", 125 | }, 126 | source_name = { 127 | width = { max = 30 }, 128 | text = function(ctx) 129 | return ctx.source_name 130 | end, 131 | highlight = "Special", 132 | }, 133 | }, 134 | columns = { 135 | { "kind_icon", "label", gap = 2, "source_name" }, 136 | }, 137 | }, 138 | border = "single", 139 | winhighlight = "Normal:BlinkCmpDoc,FloatBorder:FloatBorder,CursorLine:BlinkCmpMenuSelection,Search:None", 140 | }, 141 | }, 142 | 143 | appearance = { 144 | use_nvim_cmp_as_default = false, 145 | nerd_font_variant = "normal", 146 | 147 | kind_icons = { 148 | Text = "󰦨", 149 | Method = "󰊕", 150 | Function = "󰊕", 151 | Constructor = "󰒓", 152 | Field = "󰜢", 153 | Variable = "󰆦", 154 | Property = "", 155 | Class = "󱡠", 156 | Interface = "󱡠", 157 | Struct = "󱡠", 158 | Module = "󰅩", 159 | Unit = "󰪚", 160 | Value = "", 161 | Enum = "", 162 | EnumMember = "", 163 | Keyword = "󰌋", 164 | Constant = "󰏿", 165 | Snippet = "󰅪", 166 | Color = "󰏘", 167 | File = "󰈔", 168 | Reference = "󰬲", 169 | Folder = "󰉋", 170 | Event = "󱐋", 171 | Operator = "󰪚", 172 | TypeParameter = "", 173 | }, 174 | }, 175 | }) 176 | end, 177 | opts_extend = { "sources.default" }, 178 | } 179 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/colorschemes.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/tokyonight.nvim", 3 | lazy = false, 4 | priority = 1000, 5 | config = function() 6 | require("tokyonight").setup({ 7 | transparent = false, 8 | -- on_colors = function(colors) 9 | -- colors.bg = "#0D1017" 10 | -- colors.bg_dark = "#0D1017" 11 | -- colors.bg_float = "#131621" 12 | -- colors.bg_popup = "#131621" 13 | -- colors.bg_search = "#131621" 14 | -- colors.bg_sidebar = "#131621" 15 | -- colors.bg_statusline = "#131621" 16 | -- end, 17 | styles = { 18 | functions = { italic = true }, 19 | }, 20 | }) 21 | vim.cmd.colorscheme("tokyonight") 22 | end, 23 | } 24 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/comment.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "numToStr/Comment.nvim", 3 | event = { "BufReadPre", "BufNewFile" }, 4 | name = "comment.nvim", 5 | config = function() 6 | vim.g.skip_ts_context_commentstring_module = true 7 | 8 | require("Comment").setup({ 9 | pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(), 10 | }) 11 | 12 | require("ts_context_commentstring").setup({ 13 | enable_autocmd = false, 14 | padding = true, 15 | mappings = { 16 | basic = true, 17 | extra = false, 18 | }, 19 | }) 20 | end, 21 | } 22 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/commentstring.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "JoosepAlviste/nvim-ts-context-commentstring", 3 | event = { "BufReadPre", "BufNewFile" }, 4 | name = "commentstring.nvim", 5 | } 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conform.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "stevearc/conform.nvim", 3 | event = { "BufReadPre", "BufNewFile" }, 4 | config = function() 5 | local conform = require("conform") 6 | 7 | conform.formatters.biome = { 8 | append_args = { "--indent-style=space" }, 9 | } 10 | 11 | conform.formatters.deno_fmt = { 12 | append_args = { "--prose-wrap=never" }, 13 | } 14 | 15 | conform.setup({ 16 | formatters_by_ft = { 17 | javascript = { "biome", "rustywind" }, 18 | typescript = { "biome", "rustywind" }, 19 | javascriptreact = { "biome", "rustywind" }, 20 | typescriptreact = { "biome", "rustywind" }, 21 | svelte = { "biome", "rustywind" }, 22 | css = { "biome", "rustywind" }, 23 | html = { "biome", "rustywind" }, 24 | json = { "biome", "rustywind" }, 25 | yaml = { "biome", "rustywind" }, 26 | graphql = { "biome", "rustywind" }, 27 | 28 | markdown = { "deno_fmt" }, 29 | lua = { "stylua" }, 30 | sh = { "beautysh" }, 31 | python = { "black" }, 32 | nix = { "nixfmt" }, 33 | }, 34 | format_on_save = { 35 | lsp_fallback = true, 36 | timeout_ms = 2000, 37 | async = false, 38 | }, 39 | }) 40 | 41 | vim.keymap.set("n", "mp", function() 42 | conform.format({ 43 | lsp_fallback = true, 44 | async = false, 45 | timeout_ms = 2000, 46 | }) 47 | end, { desc = "Make Pretty" }) 48 | end, 49 | } 50 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/dressing.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "stevearc/dressing.nvim", 3 | enabled = false, 4 | event = "VeryLazy", 5 | config = function() 6 | require("dressing").setup({ 7 | input = { 8 | border = "single", 9 | }, 10 | select = { 11 | enabled = true, 12 | 13 | nui = { 14 | border = { 15 | style = "single", 16 | }, 17 | }, 18 | 19 | builtin = { 20 | border = "single", 21 | }, 22 | }, 23 | }) 24 | end, 25 | } 26 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/explorer.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/snacks.nvim", 3 | enabled = false, 4 | config = function() 5 | require("snacks").setup({ 6 | explorer = { 7 | enabled = true, 8 | replace_netrw = true, 9 | }, 10 | picker = { 11 | icons = { 12 | diagnostics = { 13 | Error = " ×", 14 | Warn = " •", 15 | Hint = " •", 16 | Info = " •", 17 | }, 18 | git = { 19 | commit = "󰜘", 20 | conflict = "", 21 | staged = "", 22 | added = "", 23 | deleted = "", 24 | modified = "", 25 | ignored = "", 26 | unstaged = "", 27 | renamed = "", 28 | untracked = "", 29 | }, 30 | }, 31 | layout = { 32 | auto_hide = { "input" }, 33 | }, 34 | ui_select = false, 35 | sources = { 36 | explorer = { 37 | include = { ".env*" }, 38 | auto_close = true, 39 | layout = { 40 | layout = { position = "right" }, 41 | auto_hide = { "input" }, 42 | }, 43 | win = { 44 | list = { 45 | keys = { 46 | [""] = { "edit_vsplit", mode = { "i", "n" } }, 47 | ["x"] = "explorer_move", 48 | ["c-t"] = false, 49 | ["m"] = false, 50 | ["P"] = false, 51 | }, 52 | }, 53 | }, 54 | }, 55 | }, 56 | }, 57 | }) 58 | 59 | vim.g.loaded_netrw = 1 60 | vim.g.loaded_netrwPlugin = 1 61 | local map = vim.keymap 62 | map.set("n", "fe", "lua Snacks.explorer()", { desc = "File Explorer" }) 63 | end, 64 | } 65 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/fidget.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "j-hui/fidget.nvim", 3 | enabled = true, 4 | event = "VeryLazy", 5 | config = function() 6 | vim.keymap.set("n", "nh", "Fidget history", { desc = "Notification history" }) 7 | vim.keymap.set("n", "ns", "Fidget suppress", { desc = "Notification supress" }) 8 | 9 | require("fidget").setup({ 10 | progress = { 11 | display = { 12 | done_ttl = 5, 13 | done_icon = " ", 14 | }, 15 | }, 16 | 17 | notification = { 18 | override_vim_notify = true, 19 | window = { 20 | x_padding = 0, 21 | y_padding = 0, 22 | winblend = 0, 23 | -- relative = "win", 24 | border = "single", 25 | normal_hl = "NormalFloat", 26 | }, 27 | }, 28 | }) 29 | end, 30 | } 31 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/file-operations.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "antosha417/nvim-lsp-file-operations", 3 | event = { "BufReadPre", "BufNewFile" }, 4 | dependencies = { 5 | "nvim-lua/plenary.nvim", 6 | "nvim-neo-tree/neo-tree.nvim", 7 | }, 8 | config = function() 9 | require("lsp-file-operations").setup() 10 | local lspconfig = require("lspconfig") 11 | 12 | -- Set global defaults for all servers 13 | lspconfig.util.default_config = vim.tbl_extend("force", lspconfig.util.default_config, { 14 | capabilities = vim.tbl_deep_extend( 15 | "force", 16 | vim.lsp.protocol.make_client_capabilities(), 17 | -- returns configured operations if setup() was already called 18 | -- or default operations if not 19 | require("lsp-file-operations").default_capabilities() 20 | ), 21 | }) 22 | end, 23 | } 24 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/flash.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/flash.nvim", 3 | event = { "BufReadPre", "BufNewFile" }, 4 | opts = { 5 | highlight = { 6 | backdrop = true, 7 | matches = true, 8 | priority = 5000, 9 | groups = { 10 | current = "PreProc", 11 | match = "Function", 12 | label = "Constant", 13 | --backdrop = "FlashBackdrop", 14 | }, 15 | }, 16 | modes = { 17 | char = { 18 | enabled = false, 19 | }, 20 | }, 21 | }, 22 | -- stylua: ignore 23 | keys = { 24 | { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, 25 | { "", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, 26 | { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, 27 | { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, 28 | { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, 29 | }, 30 | } 31 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/fzf.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "ibhagwan/fzf-lua", 3 | config = function() 4 | local fzf = require("fzf-lua") 5 | fzf.register_ui_select() 6 | 7 | fzf.setup({ 8 | hls = { 9 | border = "FloatBorder", 10 | preview_border = "FloatBorder", 11 | }, 12 | keymap = { fzf = { ["ctrl-y"] = "toggle+down" } }, 13 | actions = { 14 | files = { 15 | ["ctrl-v"] = fzf.actions.file_vsplit, 16 | ["ctrl-t"] = fzf.actions.file_tabedit, 17 | ["alt-q"] = fzf.actions.file_sel_to_qf, 18 | ["alt-Q"] = fzf.actions.file_sel_to_ll, 19 | ["alt-i"] = fzf.actions.toggle_ignore, 20 | ["alt-h"] = fzf.actions.toggle_hidden, 21 | ["alt-f"] = fzf.actions.toggle_follow, 22 | ["enter"] = fzf.actions.file_edit_or_qf, 23 | }, 24 | }, 25 | fzf_colors = { 26 | ["bg"] = { "bg", "FloatBorder" }, 27 | ["bg+"] = { "bg", "FloatBorder" }, 28 | 29 | ["fg"] = { "fg", "Comment" }, 30 | ["fg+"] = { "fg", "PreProc" }, 31 | 32 | ["hl"] = { "fg", "Constant" }, 33 | ["hl+"] = { "fg", "Constant" }, 34 | 35 | ["spinner"] = { "fg", "Label" }, 36 | ["marker"] = { "fg", "PreProc" }, 37 | ["pointer"] = { "fg", "PreProc" }, 38 | ["info"] = { "fg", "FloatBorder" }, 39 | ["prompt"] = { "fg", "FloatBorder" }, 40 | ["header"] = { "fg", "FloatBorder" }, 41 | ["separator"] = { "fg", "FloatBorder" }, 42 | ["scrollbar"] = { "fg", "FloatBorder" }, 43 | }, 44 | winopts = { 45 | border = "single", 46 | height = 15, 47 | width = 76, 48 | row = 0.2, 49 | col = 0.5, 50 | preview = { 51 | hidden = true, 52 | }, 53 | }, 54 | }) 55 | 56 | local builtin_opts = { 57 | winopts = { 58 | border = "single", 59 | preview = { 60 | border = "single", 61 | }, 62 | height = 8, 63 | width = 50, 64 | row = 0.4, 65 | col = 0.48, 66 | }, 67 | } 68 | 69 | local picker_opts = { 70 | header = false, 71 | file_icons = false, 72 | git_icons = false, 73 | color_icons = false, 74 | } 75 | 76 | local map = function(keys, picker, desc) 77 | local command 78 | if type(picker) == "string" then 79 | command = function() 80 | fzf[picker](picker_opts) 81 | end 82 | elseif type(picker) == "function" then 83 | command = picker 84 | else 85 | error("Invalid picker type: must be a string or function") 86 | end 87 | vim.keymap.set("n", keys, command, { desc = desc }) 88 | end 89 | 90 | local extend = function(table1, table2) 91 | return vim.tbl_extend("force", table1, table2) 92 | end 93 | 94 | map("sa", function() 95 | fzf.builtin(extend(builtin_opts, picker_opts)) 96 | end, "FZF") 97 | 98 | map("sf", "files", "Files") 99 | map("sh", "help_tags", "Help") 100 | map("sb", "buffers", "Buffers") 101 | map("sr", "oldfiles", "Recent files") 102 | map("sv", "grep_visual", "Grep Visual") 103 | map("sc", "grep_cword", "Current Word") 104 | map("sg", "live_grep_native", "Grep Word") 105 | map("sd", "diagnostics_document", "Diagnostics") 106 | 107 | --lsp 108 | map("gd", function() 109 | fzf.lsp_definitions(extend(picker_opts, { jump1 = true })) 110 | end, "LSP Definitions") 111 | 112 | map("lr", function() 113 | fzf.lsp_references( 114 | extend(picker_opts, { includeDeclaration = false, ignore_current_line = true }) 115 | ) 116 | end, "LSP References") 117 | 118 | map("lc", "lsp_code_actions", "LSP Code Actions") 119 | map("lt", "lsp_typedefs", "LSP Type Definitions") 120 | map("lI", "lsp_implementations", "LSP Implementations") 121 | end, 122 | } 123 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/git-signs.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "lewis6991/gitsigns.nvim", 3 | event = { "BufReadPre", "BufNewFile" }, 4 | 5 | config = function() 6 | local gitsigns = require("gitsigns") 7 | gitsigns.setup() 8 | 9 | local function map(mode, l, r, opts) 10 | opts = opts or {} 11 | vim.keymap.set(mode, l, r, opts) 12 | end 13 | 14 | -- Navigation 15 | map("n", "]c", function() 16 | if vim.wo.diff then 17 | vim.cmd.normal({ "]c", bang = true }) 18 | else 19 | gitsigns.nav_hunk("next") 20 | end 21 | end) 22 | 23 | map("n", "[c", function() 24 | if vim.wo.diff then 25 | vim.cmd.normal({ "[c", bang = true }) 26 | else 27 | gitsigns.nav_hunk("prev") 28 | end 29 | end) 30 | 31 | -- Actions 32 | map("n", "gs", gitsigns.stage_hunk, { desc = "Stage Hunk" }) 33 | map("n", "gr", gitsigns.reset_hunk, { desc = "Reset Hunk" }) 34 | map("v", "gs", function() 35 | gitsigns.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) 36 | end, { desc = "Stage selection" }) 37 | map("v", "gr", function() 38 | gitsigns.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) 39 | end, { desc = "Reset selection" }) 40 | 41 | map("n", "gS", gitsigns.stage_buffer, { desc = "Stage Buffer" }) 42 | map("n", "gR", gitsigns.reset_buffer, { desc = "Reset Buffer" }) 43 | map("n", "gp", gitsigns.preview_hunk, { desc = "Preview Hunk" }) 44 | 45 | map("n", "gb", gitsigns.toggle_current_line_blame, { desc = "Toggle Blame Line" }) 46 | 47 | map("n", "gd", function() 48 | gitsigns.diffthis("~", { vertical = true, split = "botright" }) 49 | end, { desc = "Show Diff" }) 50 | 51 | map("n", "gx", gitsigns.preview_hunk_inline, { desc = "Toggle Deleted" }) 52 | 53 | -- Text object 54 | map({ "o", "x" }, "ih", ":Gitsigns select_hunk", { desc = "Select Hunk" }) 55 | end, 56 | } 57 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/guess-indent.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "NMAC427/guess-indent.nvim", 3 | event = { "BufReadPre", "BufNewFile" }, 4 | opts = {}, 5 | } 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/harpoon.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "ThePrimeagen/harpoon", 3 | lazy = false, 4 | branch = "harpoon2", 5 | dependencies = { "nvim-lua/plenary.nvim" }, 6 | config = function() 7 | local harpoon = require("harpoon") 8 | harpoon:setup() 9 | 10 | local toggle_opts = { 11 | title = " Harpoon ", 12 | title_pos = "center", 13 | ui_max_width = 80, 14 | ui_width_ratio = 1, 15 | } 16 | 17 | vim.keymap.set("n", "M", function() 18 | harpoon.ui:toggle_quick_menu(harpoon:list(), toggle_opts) 19 | end) 20 | vim.keymap.set("n", "ma", function() 21 | harpoon:list():add() 22 | end) 23 | 24 | for i = 1, 5 do 25 | vim.keymap.set("n", "m" .. i, function() 26 | harpoon:list():select(i) 27 | end) 28 | end 29 | end, 30 | } 31 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/highlight-colors.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "brenoprata10/nvim-highlight-colors", 3 | event = { "BufReadPre", "BufNewFile" }, 4 | init = function() 5 | require("nvim-highlight-colors").setup({ 6 | render = "virtual", 7 | virtual_symbol = " ", 8 | virtual_symbol_suffix = "", 9 | virtual_symbol_position = "eol", 10 | }) 11 | end, 12 | } 13 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/lsp-config.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "neovim/nvim-lspconfig", 3 | event = { "BufReadPre", "BufNewFile" }, 4 | dependencies = { 5 | "saghen/blink.cmp", 6 | { "antosha417/nvim-lsp-file-operations", config = true }, 7 | { "j-hui/fidget.nvim", opts = {} }, 8 | }, 9 | 10 | config = function() 11 | vim.api.nvim_create_autocmd("LspAttach", { 12 | group = vim.api.nvim_create_augroup("lsp", { clear = true }), 13 | 14 | callback = function(event) 15 | local map = function(keys, func, desc) 16 | vim.keymap.set("n", keys, func, { buffer = event.buf, desc = desc }) 17 | end 18 | 19 | map("K", function() 20 | vim.lsp.buf.hover({ border = "single" }) 21 | end, "Hover LSP info") 22 | map("rn", vim.lsp.buf.rename, "Smart rename") 23 | 24 | -- Diagnostics 25 | map("d", function() 26 | vim.diagnostic.open_float({ border = "single" }) 27 | end, "Show line diagnostics") 28 | 29 | map("[d", function() 30 | vim.diagnostic.jump({ float = { border = "single" }, count = -1 }) 31 | end, "Go to previous diagnostic") 32 | 33 | map("]d", function() 34 | vim.diagnostic.jump({ float = { border = "single" }, count = -1 }) 35 | end, "Go to next diagnostic") 36 | end, 37 | }) 38 | 39 | vim.diagnostic.config({ 40 | virtual_text = { 41 | enabled = true, 42 | prefix = function(diagnostic) 43 | if diagnostic.severity == vim.diagnostic.severity.ERROR then 44 | return "🭰× " 45 | elseif diagnostic.severity == vim.diagnostic.severity.WARN then 46 | return "🭰▲ " 47 | else 48 | return "🭰• " 49 | end 50 | end, 51 | suffix = "🭵", 52 | }, 53 | underline = true, 54 | signs = { 55 | text = { 56 | [vim.diagnostic.severity.ERROR] = " ×", 57 | [vim.diagnostic.severity.WARN] = " ▲", 58 | [vim.diagnostic.severity.HINT] = " •", 59 | [vim.diagnostic.severity.INFO] = " •", 60 | }, 61 | }, 62 | }) 63 | 64 | vim.filetype.add({ 65 | extension = { 66 | env = "env", 67 | }, 68 | filename = { 69 | [".env"] = "env", 70 | }, 71 | pattern = { 72 | ["%.env%.[%w_.-]+"] = "env", 73 | }, 74 | }) 75 | 76 | local servers = { 77 | -- bash 78 | bashls = {}, 79 | 80 | -- zig, go and nix 81 | zls = { 82 | settings = { 83 | semantic_tokens = "none", 84 | }, 85 | }, 86 | gopls = {}, 87 | nil_ls = {}, 88 | 89 | -- python 90 | ruff = {}, 91 | basedpyright = { 92 | settings = { 93 | pyright = { 94 | disableOrganizeImports = true, 95 | }, 96 | python = { 97 | analysis = { 98 | ignore = { "*" }, 99 | }, 100 | }, 101 | }, 102 | }, 103 | 104 | -- js tooling 105 | biome = {}, 106 | eslint = {}, 107 | tailwindcss = { 108 | cmd = { 109 | "bunx", 110 | "--bun", 111 | "@tailwindcss/language-server", 112 | "--stdio", 113 | }, 114 | }, 115 | 116 | -- html, json, css 117 | html = {}, 118 | jsonls = {}, 119 | cssls = { 120 | settings = { 121 | css = { 122 | validate = true, 123 | lint = { 124 | unknownAtRules = "ignore", 125 | }, 126 | }, 127 | scss = { 128 | validate = true, 129 | lint = { 130 | unknownAtRules = "ignore", 131 | }, 132 | }, 133 | less = { 134 | validate = true, 135 | lint = { 136 | unknownAtRules = "ignore", 137 | }, 138 | }, 139 | }, 140 | }, 141 | 142 | -- lua 143 | lua_ls = { 144 | settings = { 145 | Lua = { 146 | completion = { 147 | callSnippet = "Replace", 148 | }, 149 | diagnostics = { 150 | globals = { "vim" }, 151 | disable = { "missing-fields" }, 152 | }, 153 | }, 154 | }, 155 | }, 156 | } 157 | 158 | for server, config in pairs(servers) do 159 | require("lspconfig")[server].setup(config) 160 | end 161 | end, 162 | } 163 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/lualine.lua: -------------------------------------------------------------------------------- 1 | local function lint_progress() 2 | local linters = require("lint").get_running() 3 | if #linters == 0 then 4 | return "" 5 | end 6 | return " " .. table.concat(linters, ", ") 7 | end 8 | 9 | local function harpoon() 10 | local mark = "" 11 | if package.loaded["harpoon"] then 12 | local current_file = vim.fn.expand("%:p") 13 | 14 | for id, item in ipairs(require("harpoon"):list().items) do 15 | local item_file = vim.fn.fnamemodify(item.value, ":p") 16 | 17 | if item_file == current_file then 18 | mark = id .. " " 19 | break 20 | end 21 | end 22 | end 23 | return mark 24 | end 25 | 26 | local function location() 27 | local line = vim.fn.line(".") 28 | local col = vim.fn.charcol(".") 29 | return line .. ":" .. col 30 | end 31 | 32 | return { 33 | "nvim-lualine/lualine.nvim", 34 | config = function() 35 | local colors = { 36 | white = Get_hl_hex("PreProc", "fg"), 37 | border = Get_hl_hex("Conceal", "fg"), 38 | background = Get_hl_hex("StatusLineNc", "bg"), 39 | } 40 | 41 | require("lualine").setup({ 42 | inactive_sections = { 43 | lualine_a = {}, 44 | lualine_b = {}, 45 | lualine_c = {}, 46 | lualine_x = {}, 47 | lualine_y = {}, 48 | lualine_z = {}, 49 | }, 50 | sections = { 51 | lualine_a = { 52 | { 53 | "filename", 54 | path = 0, 55 | symbols = { 56 | modified = " ", 57 | readonly = "", 58 | unnamed = "No name", 59 | newfile = "New file", 60 | }, 61 | }, 62 | { "branch", icon = { "", align = "right" } }, 63 | harpoon, 64 | }, 65 | lualine_b = {}, 66 | lualine_c = {}, 67 | lualine_x = {}, 68 | lualine_y = {}, 69 | lualine_z = { 70 | lint_progress, 71 | location, 72 | "progress", 73 | "vim.bo.filetype", 74 | { "diff", symbols = { added = "+", modified = "~", removed = "-" } }, 75 | }, 76 | }, 77 | 78 | options = { 79 | icons_enabled = true, 80 | globalstatus = true, 81 | disabled_filetypes = { "alpha" }, 82 | component_separators = " │ ", 83 | section_separators = "", 84 | 85 | theme = { 86 | normal = { 87 | a = { bg = colors.background, fg = colors.white }, 88 | b = { bg = colors.background, fg = colors.white }, 89 | c = { bg = colors.background, fg = colors.white }, 90 | }, 91 | }, 92 | }, 93 | 94 | extensions = { 95 | "nvim-tree", 96 | "neo-tree", 97 | "mason", 98 | "lazy", 99 | "fzf", 100 | }, 101 | }) 102 | end, 103 | } 104 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/mason.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "williamboman/mason.nvim", 3 | event = { "BufReadPre", "BufNewFile" }, 4 | cmd = "Mason", 5 | dependencies = { 6 | "williamboman/mason-lspconfig.nvim", 7 | }, 8 | config = function() 9 | require("mason").setup({ 10 | ui = { 11 | width = 0.95, 12 | height = 0.9, 13 | border = "single", 14 | icons = { 15 | package_installed = "¤", 16 | package_pending = "»", 17 | package_uninstalled = "×", 18 | }, 19 | }, 20 | }) 21 | end, 22 | } 23 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/mini-icons.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "echasnovski/mini.icons", 3 | opts = {}, 4 | specs = { 5 | { "nvim-tree/nvim-web-devicons", enabled = false, optional = true }, 6 | }, 7 | init = function() 8 | package.preload["nvim-web-devicons"] = function() 9 | require("mini.icons").mock_nvim_web_devicons() 10 | return package.loaded["nvim-web-devicons"] 11 | end 12 | end, 13 | config = function() 14 | require("mini.icons").setup({ 15 | file = { 16 | [".env"] = { glyph = "󰛸", hl = "MiniIconsBlue" }, 17 | [".envrc"] = { glyph = "󰛸", hl = "MiniIconsBlue" }, 18 | [".env.test"] = { glyph = "󰛸", hl = "MiniIconsBlue" }, 19 | [".env.local"] = { glyph = "󰛸", hl = "MiniIconsBlue" }, 20 | [".env.example"] = { glyph = "󰛸", hl = "MiniIconsBlue" }, 21 | [".env.template"] = { glyph = "󰛸", hl = "MiniIconsBlue" }, 22 | 23 | ["LICENSE"] = { glyph = "󰿃" }, 24 | }, 25 | filetype = { 26 | -- typescript = { glyph = "" }, 27 | -- javascript = { glyph = "" }, 28 | 29 | json = { glyph = "" }, 30 | jsonc = { glyph = "" }, 31 | 32 | hurl = { glyph = "", hl = "MiniIconsRed" }, 33 | sh = { glyph = "󰐣", hl = "MiniIconsBlue" }, 34 | zsh = { glyph = "󰐣" }, 35 | bash = { glyph = "󰐣" }, 36 | 37 | gomod = { glyph = "" }, 38 | gosum = { glyph = "" }, 39 | }, 40 | extension = { 41 | conf = { glyph = "󰛸", hl = "MiniIconsBlue" }, 42 | go = { glyph = "" }, 43 | }, 44 | }) 45 | end, 46 | } 47 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/neoscroll.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "karb94/neoscroll.nvim", 3 | event = { "UIEnter", "BufReadPre", "BufNewFile" }, 4 | opts = {}, 5 | } 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/neotree.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- dir = "~/vault/dev/neo-tree.nvim", 3 | -- enabled = false, 4 | "nvim-neo-tree/neo-tree.nvim", 5 | dependencies = { 6 | "nvim-lua/plenary.nvim", 7 | "MunifTanjim/nui.nvim", 8 | }, 9 | 10 | config = function() 11 | local keymap = vim.keymap 12 | keymap.set( 13 | "n", 14 | "fe", 15 | "Neotree toggle focus right reveal_force_cwd", 16 | { desc = "File Explorer" } 17 | ) 18 | 19 | vim.g.loaded_netrw = 1 20 | vim.g.loaded_netrwPlugin = 1 21 | 22 | require("neo-tree").setup({ 23 | retain_hidden_root_indent = false, 24 | hide_root_node = true, 25 | 26 | default_component_configs = { 27 | icon = { 28 | folder_closed = "", 29 | folder_open = "", 30 | folder_empty = "", 31 | }, 32 | indent = { 33 | indent_size = 2, 34 | marker_start_level = 1, 35 | -- with_expanders = true, 36 | -- expander_collapsed = "»", 37 | -- expander_expanded = "↓", 38 | }, 39 | modified = { 40 | symbol = "*", 41 | }, 42 | diagnostics = { 43 | symbols = { 44 | hint = "h", 45 | info = "i", 46 | warn = "w", 47 | error = "e", 48 | }, 49 | }, 50 | git_status = { 51 | symbols = { 52 | -- Change type 53 | added = "", 54 | deleted = "", 55 | modified = "", 56 | renamed = "", 57 | -- Status type 58 | untracked = "", 59 | unstaged = "", 60 | ignored = "", 61 | staged = "", 62 | conflict = "", 63 | }, 64 | }, 65 | }, 66 | 67 | popup_border_style = "single", 68 | event_handlers = { -- Close neo-tree when opening a file. 69 | { 70 | event = "file_opened", 71 | handler = function() 72 | require("neo-tree").close_all() 73 | end, 74 | }, 75 | }, 76 | 77 | filesystem = { 78 | filtered_items = { 79 | show_hidden_count = false, 80 | group_empty_dirs = true, 81 | hide_dotfiles = false, 82 | always_show = { 83 | ".env.local", 84 | ".envrc", 85 | ".env", 86 | }, 87 | never_show = { 88 | "__pycache__", 89 | ".DS_Store", 90 | ".git", 91 | }, 92 | }, 93 | bind_to_cwd = true, -- true creates a 2-way binding between vim's cwd and neo-tree's root 94 | window = { 95 | mappings = { 96 | [""] = "open_vsplit", 97 | ["n"] = "toggle_node", 98 | [""] = "none", 99 | }, 100 | }, 101 | }, 102 | }) 103 | 104 | vim.keymap.set("n", "0", "Lazy reload neo-tree.nvim", { desc = "Reload neo-tree" }) 105 | end, 106 | } 107 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/nvim-lint.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "mfussenegger/nvim-lint", 3 | lazy = true, 4 | enabled = false, 5 | event = { "BufReadPre", "BufNewFile" }, 6 | config = function() 7 | local lint = require("lint") 8 | 9 | lint.linters_by_ft = { 10 | sh = { "shellcheck" }, 11 | } 12 | 13 | local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) 14 | 15 | vim.api.nvim_create_autocmd( 16 | { "BufReadPre", "BufWritePost", "InsertEnter", "InsertLeave", "TextChanged" }, 17 | { 18 | group = lint_augroup, 19 | callback = function() 20 | lint.try_lint() 21 | end, 22 | } 23 | ) 24 | 25 | vim.keymap.set("n", "ml", function() 26 | lint.try_lint() 27 | end, { desc = "Make Linting" }) 28 | end, 29 | } 30 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/quickfix.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "stevearc/quicker.nvim", 3 | config = function() 4 | require("quicker").setup({ 5 | borders = { 6 | vert = " ╎ ", 7 | -- Strong headers separate results from different files 8 | strong_header = "━", 9 | strong_cross = "╋", 10 | strong_end = "┫", 11 | -- Soft headers separate results within the same file 12 | soft_header = "╌", 13 | soft_cross = "╂", 14 | soft_end = "┨", 15 | }, 16 | }) 17 | 18 | vim.api.nvim_set_hl(0, "QuickFixHeaderHard", { link = "Conceal" }) 19 | vim.api.nvim_set_hl(0, "QuickFixLineNr", { link = "@variable" }) 20 | end, 21 | } 22 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/scissors.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "chrisgrieser/nvim-scissors", 3 | event = { "BufNewFile", "BufReadPre" }, 4 | dependencies = "ibhagwan/fzf-lua", 5 | opts = { 6 | snippetDir = "$HOME/.config/nvim/snippets/", 7 | editSnippetPopup = { 8 | height = 0.4, 9 | width = 0.5, 10 | border = "single", 11 | }, 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/statuscolumn.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "JuanBaut/statuscolumn.nvim", 3 | config = function() 4 | require("statuscolumn").setup({ 5 | enable_border = true, 6 | gradient_hl = "PreProc", 7 | }) 8 | end, 9 | } 10 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/surround.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "kylechui/nvim-surround", 3 | version = "*", 4 | event = { "BufReadPre", "BufNewFile" }, 5 | config = function() 6 | require("nvim-surround").setup({ 7 | surrounds = { 8 | F = { 9 | add = { "<>", "" }, 10 | find = "<>.-", 11 | delete = "^(<>)().-()()$", 12 | change = { 13 | target = "^(<>)().-()()$", 14 | replacement = { "<>", "" }, 15 | }, 16 | }, 17 | }, 18 | }) 19 | end, 20 | } 21 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/tmux.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "mrjones2014/smart-splits.nvim", 3 | config = function() 4 | require("smart-splits").setup({ 5 | ignored_filetypes = { "neo-tree" }, 6 | at_edge = "stop", 7 | resize_mode = { 8 | -- key to exit persistent resize mode 9 | quit_key = "", 10 | -- keys to use for moving in resize mode 11 | -- in order of left, down, up' right 12 | resize_keys = { "h", "j", "k", "l" }, 13 | -- set to true to silence the notifications 14 | -- when entering/exiting persistent resize mode 15 | silent = false, 16 | -- must be functions, they will be executed when 17 | -- entering or exiting the resize mode 18 | hooks = { 19 | on_enter = nil, 20 | on_leave = nil, 21 | }, 22 | }, 23 | }) 24 | 25 | vim.keymap.set("n", "", require("smart-splits").resize_left) 26 | vim.keymap.set("n", "", require("smart-splits").resize_down) 27 | vim.keymap.set("n", "", require("smart-splits").resize_up) 28 | vim.keymap.set("n", "", require("smart-splits").resize_right) 29 | 30 | vim.keymap.set("n", "", require("smart-splits").move_cursor_left) 31 | vim.keymap.set("n", "", require("smart-splits").move_cursor_down) 32 | vim.keymap.set("n", "", require("smart-splits").move_cursor_up) 33 | vim.keymap.set("n", "", require("smart-splits").move_cursor_right) 34 | vim.keymap.set("n", "", require("smart-splits").move_cursor_previous) 35 | end, 36 | } 37 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-treesitter/nvim-treesitter", 3 | event = { "BufReadPre", "BufNewFile" }, 4 | build = ":TSUpdate", 5 | --dependencies = { 6 | -- "nvim-treesitter/nvim-treesitter-textobjects", 7 | --}, 8 | config = function() 9 | local treesitter = require("nvim-treesitter.configs") 10 | vim.treesitter.language.register("bash", "env") 11 | 12 | vim.filetype.add({ 13 | extension = { 14 | env = "env", 15 | }, 16 | filename = { 17 | [".env"] = "env", 18 | }, 19 | pattern = { 20 | ["%.env%.[%w_.-]+"] = "env", 21 | }, 22 | }) 23 | 24 | vim.treesitter.language.register("bash", "env") 25 | 26 | treesitter.setup({ 27 | highlight = { 28 | enable = true, 29 | }, 30 | indent = { enable = true }, 31 | ensure_installed = { 32 | "jsonc", 33 | "json", 34 | "javascript", 35 | "typescript", 36 | "tsx", 37 | "html", 38 | "css", 39 | "svelte", 40 | 41 | "gitignore", 42 | "query", 43 | "hurl", 44 | 45 | "markdown", 46 | "markdown_inline", 47 | 48 | "dockerfile", 49 | "yaml", 50 | "toml", 51 | "kdl", 52 | 53 | "nu", 54 | "bash", 55 | "python", 56 | 57 | "vim", 58 | "vimdoc", 59 | 60 | "luadoc", 61 | "lua", 62 | "zig", 63 | "go", 64 | }, 65 | }) 66 | end, 67 | } 68 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/typescript.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_create_autocmd("LspAttach", { 2 | pattern = { "*.ts", "*.tsx", "*.js", "*.jsx" }, 3 | callback = function() 4 | vim.keymap.set("n", "li", function() 5 | vim.notify("Organizing imports...") 6 | vim.cmd("TSToolsOrganizeImports") 7 | end, { desc = "Organize imports" }) 8 | end, 9 | }) 10 | 11 | vim.api.nvim_create_autocmd("LspAttach", { 12 | pattern = { "*.ts", "*.tsx", "*.js", "*.jsx" }, 13 | callback = function() 14 | vim.keymap.set("n", "la", function() 15 | vim.notify("Adding missing imports...") 16 | vim.cmd("TSToolsAddMissingImports") 17 | end, { desc = "Add missing imports" }) 18 | end, 19 | }) 20 | 21 | return { 22 | "pmizio/typescript-tools.nvim", 23 | event = { "BufReadPre", "BufNewFile" }, 24 | dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" }, 25 | opts = {}, 26 | } 27 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/whichkey.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/which-key.nvim", 3 | event = "VeryLazy", 4 | init = function() 5 | require("which-key").add({ 6 | { "ma", mode = "n", desc = "Harpoon add" }, 7 | { "M", mode = "n", desc = "Harpoon menu" }, 8 | { "S", mode = "v", desc = "Add surround visual" }, 9 | { "c", group = "Column" }, 10 | { "l", group = "LSP" }, 11 | { "n", group = "Notifications" }, 12 | { "f", group = "Filetree" }, 13 | { "m", group = "Format or Linting" }, 14 | { "r", group = "Rename" }, 15 | { "s", group = "Search" }, 16 | { "t", group = "Tabs" }, 17 | { "u", group = "Buffers" }, 18 | { "w", group = "Wins" }, 19 | { "g", group = "Git Diff" }, 20 | }) 21 | end, 22 | opts = { 23 | preset = "helix", 24 | plugins = { 25 | presets = { 26 | windows = false, 27 | }, 28 | }, 29 | win = { 30 | height = { max = 20 }, 31 | border = "single", 32 | padding = { 0, 1 }, 33 | }, 34 | keys = { 35 | scroll_down = "", 36 | scroll_up = "", 37 | }, 38 | replace = { 39 | key = { 40 | { "", "ret" }, 41 | { "", "spc" }, 42 | { "", "stab" }, 43 | }, 44 | }, 45 | icons = { 46 | rules = false, 47 | separator = "→", 48 | }, 49 | show_help = false, 50 | }, 51 | } 52 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/wrapper.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "andrewferrier/wrapping.nvim", 3 | config = function() 4 | require("wrapping").setup({ 5 | set_nvim_opt_defaults = false, 6 | }) 7 | end, 8 | } 9 | -------------------------------------------------------------------------------- /.config/nvim/snippets/lua.json: -------------------------------------------------------------------------------- 1 | {"autocmd":{"body":["vim.api.nvim_create_autocmd(\"${1:BufRead}\", {"," callback = function()"," ${2:do something}"," end,"," group = ${3:group},"," pattern = \"*\",","})"],"prefix":"autocmd"},"hlss":{"prefix":"hlss","body":"set_hl(0, \"${1:hls}\", { fg = colors.highlight(\"${2:hls2}\", \"fg\"), bg = column_background })"}} -------------------------------------------------------------------------------- /.config/nvim/snippets/package.json: -------------------------------------------------------------------------------- 1 | {"name":"my-snippets","contributes":{"snippets":[{"path":".\/lua.json","language":["lua"]},{"path":".\/typescriptreact.json","language":["typescriptreact"]}]},"description":"This package.json has been generated by nvim-scissors."} -------------------------------------------------------------------------------- /.config/nvim/snippets/typescriptreact.json: -------------------------------------------------------------------------------- 1 | {"iconcmp":{"body":["export default function ${1:Icon}() {"," return (","
"," ${2:svg}","
"," );","}"],"prefix":"iconcmp"},"component":{"body":["${1:export default }function ${2:Component}() {"," return ("," <>"," ${3:Hello World}"," "," );","}"],"prefix":"component"}} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | tags 3 | test.sh 4 | .luarc.json 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Neovim Config 2 | 3 | - This neovim config never stops changing but I enjoy that. 4 | - I use it on osx and nixos because I manage my tooling with nix. 5 | - My remaps are not very conventional, but they are documented in whichkey. 6 | 7 | ![image](https://github.com/user-attachments/assets/a2f7e8bd-8c7f-4e40-bbdd-0f509dce3934) 8 | ![image](https://github.com/user-attachments/assets/400f8bb1-8f8b-4a26-b944-bbd489419407) 9 | ![image](https://github.com/user-attachments/assets/3bc2077a-95c2-438d-aa74-a4d98813bb89) 10 | ![image](https://github.com/user-attachments/assets/528b07ae-fd91-457a-8959-d419d01a7822) 11 | ![image](https://github.com/user-attachments/assets/20a00117-7f91-4b0d-a10d-eece82f0e29a) 12 | 13 | --------------------------------------------------------------------------------