├── .gitignore ├── trash.jpg ├── lua ├── config │ ├── hop.lua │ ├── tmux.lua │ ├── harpoon.lua │ ├── lsp │ │ ├── fidget.lua │ │ ├── trouble.lua │ │ ├── barbecue.lua │ │ ├── inc-rename.lua │ │ ├── lightbulb.lua │ │ ├── settings │ │ │ ├── eslint.lua │ │ │ ├── jsonls.lua │ │ │ └── lua_ls.lua │ │ ├── signature.lua │ │ ├── null-ls.lua │ │ ├── config.lua │ │ ├── on_attach.lua │ │ └── init.lua │ ├── diffview.lua │ ├── surround.lua │ ├── lastplace.lua │ ├── git-conflict.lua │ ├── impatient.lua │ ├── symbols-outline.lua │ ├── tabout.lua │ ├── notify.lua │ ├── better-escape.lua │ ├── indent_blankline.lua │ ├── scrollbar.lua │ ├── copilot.lua │ ├── color-highlight.lua │ ├── dressing.lua │ ├── cursorline.lua │ ├── autopairs.lua │ ├── bufferline.lua │ ├── toggleterm.lua │ ├── neo-tree.lua │ ├── hlslens.lua │ ├── telescope.lua │ ├── gitsigns.lua │ ├── comment.lua │ ├── colorschemes.lua │ ├── options.lua │ ├── lualine.lua │ ├── keymaps.lua │ ├── treesitter.lua │ ├── alpha.lua │ ├── cmp.lua │ ├── plugins.lua │ └── which-key.lua └── .luarc.json ├── screenshot.png ├── .luarc.json ├── init.lua ├── .tmux.conf └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | plugin 2 | .DS_Store 3 | sessions 4 | -------------------------------------------------------------------------------- /trash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ixahmedxi/trashvim/HEAD/trash.jpg -------------------------------------------------------------------------------- /lua/config/hop.lua: -------------------------------------------------------------------------------- 1 | import("hop", function(hop) 2 | hop.setup() 3 | end) 4 | -------------------------------------------------------------------------------- /lua/config/tmux.lua: -------------------------------------------------------------------------------- 1 | import("tmux", function(tmux) 2 | tmux.setup() 3 | end) 4 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ixahmedxi/trashvim/HEAD/screenshot.png -------------------------------------------------------------------------------- /lua/config/harpoon.lua: -------------------------------------------------------------------------------- 1 | import("harpoon", function(harpoon) 2 | harpoon.setup() 3 | end) 4 | -------------------------------------------------------------------------------- /lua/config/lsp/fidget.lua: -------------------------------------------------------------------------------- 1 | import("fidget", function(fidget) 2 | fidget.setup() 3 | end) 4 | -------------------------------------------------------------------------------- /lua/config/diffview.lua: -------------------------------------------------------------------------------- 1 | import("diffview", function(diffview) 2 | diffview.setup() 3 | end) 4 | -------------------------------------------------------------------------------- /lua/config/lsp/trouble.lua: -------------------------------------------------------------------------------- 1 | import("trouble", function(trouble) 2 | trouble.setup() 3 | end) 4 | -------------------------------------------------------------------------------- /lua/config/lsp/barbecue.lua: -------------------------------------------------------------------------------- 1 | import("barbecue", function(barbecue) 2 | barbecue.setup() 3 | end) 4 | -------------------------------------------------------------------------------- /lua/config/lsp/inc-rename.lua: -------------------------------------------------------------------------------- 1 | import("inc_rename", function(rename) 2 | rename.setup() 3 | end) 4 | -------------------------------------------------------------------------------- /lua/config/surround.lua: -------------------------------------------------------------------------------- 1 | import("nvim-surround", function(surround) 2 | surround.setup() 3 | end) 4 | -------------------------------------------------------------------------------- /lua/config/lastplace.lua: -------------------------------------------------------------------------------- 1 | import("nvim-lastplace", function(lastplace) 2 | lastplace.setup() 3 | end) 4 | -------------------------------------------------------------------------------- /lua/config/git-conflict.lua: -------------------------------------------------------------------------------- 1 | import("git-conflict", function(gitConflict) 2 | gitConflict.setup() 3 | end) 4 | -------------------------------------------------------------------------------- /lua/config/impatient.lua: -------------------------------------------------------------------------------- 1 | import("impatient", function(impatient) 2 | impatient.enable_profile() 3 | end) 4 | -------------------------------------------------------------------------------- /lua/config/symbols-outline.lua: -------------------------------------------------------------------------------- 1 | import("symbols-outline", function(symbolsOutline) 2 | symbolsOutline.setup() 3 | end) 4 | -------------------------------------------------------------------------------- /lua/config/tabout.lua: -------------------------------------------------------------------------------- 1 | import("tabout", function(tabout) 2 | tabout.setup({ 3 | tabkey = "", 4 | }) 5 | end) 6 | -------------------------------------------------------------------------------- /lua/config/lsp/lightbulb.lua: -------------------------------------------------------------------------------- 1 | import("nvim-lightbulb", function(lightbulb) 2 | lightbulb.setup({ autocmd = { enabled = true } }) 3 | end) 4 | -------------------------------------------------------------------------------- /lua/config/notify.lua: -------------------------------------------------------------------------------- 1 | import("notify", function(notify) 2 | notify.setup({ 3 | timeout = 2000, 4 | }) 5 | vim.notify = notify 6 | end) 7 | -------------------------------------------------------------------------------- /lua/config/better-escape.lua: -------------------------------------------------------------------------------- 1 | import("better_escape", function(betterEscape) 2 | betterEscape.setup({ 3 | mapping = { "jk", "jj" }, 4 | }) 5 | end) 6 | -------------------------------------------------------------------------------- /lua/config/indent_blankline.lua: -------------------------------------------------------------------------------- 1 | import("indent_blankline", function(indentBlankline) 2 | indentBlankline.setup({ 3 | show_current_context = true, 4 | }) 5 | end) 6 | -------------------------------------------------------------------------------- /lua/config/scrollbar.lua: -------------------------------------------------------------------------------- 1 | import("scrollbar", function(scrollbar) 2 | scrollbar.setup({ 3 | handlers = { 4 | diagnostic = true, 5 | search = true, 6 | }, 7 | }) 8 | end) 9 | -------------------------------------------------------------------------------- /lua/config/copilot.lua: -------------------------------------------------------------------------------- 1 | import({ "copilot", "copilot_cmp" }, function(modules) 2 | local copilot_cmp = modules["copilot_cmp"] 3 | 4 | modules.copilot.setup() 5 | copilot_cmp.setup() 6 | end) 7 | -------------------------------------------------------------------------------- /lua/config/color-highlight.lua: -------------------------------------------------------------------------------- 1 | import("nvim-highlight-colors", function(colorHighlight) 2 | colorHighlight.setup({ 3 | enable_named_colors = true, 4 | enable_tailwind = true, 5 | }) 6 | end) 7 | -------------------------------------------------------------------------------- /lua/config/dressing.lua: -------------------------------------------------------------------------------- 1 | import("dressing", function(dressing) 2 | dressing.setup({ 3 | input = { 4 | enabled = true, 5 | }, 6 | select = { 7 | enabled = true, 8 | }, 9 | }) 10 | end) 11 | -------------------------------------------------------------------------------- /.luarc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", 3 | "Lua.diagnostics.globals": [ 4 | "vim", 5 | "import", 6 | "augroup" 7 | ] 8 | } -------------------------------------------------------------------------------- /lua/config/cursorline.lua: -------------------------------------------------------------------------------- 1 | import("nvim-cursorline", function(cursorLine) 2 | cursorLine.setup({ 3 | cursorline = { 4 | enable = true, 5 | }, 6 | cursorword = { 7 | enable = true, 8 | }, 9 | }) 10 | end) 11 | -------------------------------------------------------------------------------- /lua/.luarc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", 3 | "Lua.diagnostics.globals": [ 4 | "vim", 5 | "import", 6 | "augroup" 7 | ] 8 | } -------------------------------------------------------------------------------- /lua/config/lsp/settings/eslint.lua: -------------------------------------------------------------------------------- 1 | local status, lspconfig_util = pcall(require, "lspconfig.util") 2 | 3 | if not status then 4 | return 5 | end 6 | 7 | return { 8 | root_dir = lspconfig_util.find_git_ancestor, 9 | } 10 | -------------------------------------------------------------------------------- /lua/config/lsp/signature.lua: -------------------------------------------------------------------------------- 1 | import("lsp_signature", function(signature) 2 | signature.setup({ 3 | bind = true, 4 | handler_opts = { 5 | border = "rounded", 6 | }, 7 | toggle_key = "", 8 | floating_window = false, 9 | }) 10 | end) 11 | -------------------------------------------------------------------------------- /lua/config/lsp/settings/jsonls.lua: -------------------------------------------------------------------------------- 1 | local status, schemastore = pcall(require, "schemastore") 2 | 3 | if not status then 4 | return 5 | end 6 | 7 | return { 8 | settings = { 9 | json = { 10 | schemas = schemastore.json.schemas(), 11 | validate = { enable = true }, 12 | }, 13 | }, 14 | } 15 | -------------------------------------------------------------------------------- /lua/config/lsp/settings/lua_ls.lua: -------------------------------------------------------------------------------- 1 | return { 2 | settings = { 3 | Lua = { 4 | diagnostics = { 5 | globals = { "vim", "import" }, 6 | }, 7 | workspace = { 8 | library = { 9 | [vim.fn.expand("$VIMRUNTIME/lua")] = true, 10 | [vim.fn.stdpath("config") .. "/lua"] = true, 11 | }, 12 | }, 13 | }, 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /lua/config/autopairs.lua: -------------------------------------------------------------------------------- 1 | import({ "nvim-autopairs", "nvim-autopairs.completion.cmp", "cmp" }, function(modules) 2 | local cmp = modules.cmp 3 | local autopairs = modules["nvim-autopairs"] 4 | local cmp_autopairs = modules["nvim-autopairs.completion.cmp"] 5 | 6 | autopairs.setup({ 7 | check_ts = true, 8 | }) 9 | 10 | cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } })) 11 | end) 12 | -------------------------------------------------------------------------------- /lua/config/bufferline.lua: -------------------------------------------------------------------------------- 1 | import("bufferline", function(bufferline) 2 | bufferline.setup({ 3 | options = { 4 | buffer_close_icon = "", 5 | diagnostics = "nvim_lsp", 6 | diagnostics_indicator = function(_, level) 7 | local icon = level:match("error") and " " or "" 8 | return " " .. icon 9 | end, 10 | show_buffer_close_icons = false, 11 | show_close_icon = false, 12 | separator_style = "thick", 13 | offsets = { 14 | { 15 | filetype = "neo-tree", 16 | text = "File Explorer", 17 | padding = 2, 18 | }, 19 | }, 20 | }, 21 | }) 22 | end) 23 | -------------------------------------------------------------------------------- /lua/config/toggleterm.lua: -------------------------------------------------------------------------------- 1 | import("toggleterm", function(toggleterm) 2 | toggleterm.setup({ 3 | open_mapping = [[]], 4 | terminal_mappings = true, 5 | insert_mappings = true, 6 | shade_terminals = false, 7 | start_in_insert = true, 8 | direction = "float", 9 | }) 10 | 11 | function _G.set_terminal_keymaps() 12 | local opts = { buffer = 0 } 13 | vim.keymap.set("t", "", [[]], opts) 14 | vim.keymap.set("t", "jk", [[]], opts) 15 | end 16 | 17 | -- if you only want these mappings for toggle term use term://*toggleterm#* instead 18 | vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()") 19 | end) 20 | -------------------------------------------------------------------------------- /lua/config/neo-tree.lua: -------------------------------------------------------------------------------- 1 | vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) 2 | 3 | import("neo-tree", function(neoTree) 4 | neoTree.setup({ 5 | close_if_last_window = true, 6 | hide_root_node = true, 7 | popup_border_style = "rounded", 8 | enable_git_status = true, 9 | enable_diagnostics = true, 10 | window = { 11 | mappings = { 12 | ["l"] = "open", 13 | ["o"] = "open", 14 | }, 15 | }, 16 | filesystem = { 17 | filtered_items = { 18 | never_show = { 19 | ".git", 20 | ".DS_Store", 21 | }, 22 | }, 23 | follow_current_file = true, 24 | use_libuv_file_watcher = true, 25 | }, 26 | source_selector = { 27 | winbar = true, 28 | }, 29 | }) 30 | end) 31 | -------------------------------------------------------------------------------- /lua/config/hlslens.lua: -------------------------------------------------------------------------------- 1 | local kopts = { noremap = true, silent = true } 2 | 3 | vim.api.nvim_set_keymap( 4 | "n", 5 | "n", 6 | [[execute('normal! ' . v:count1 . 'n')lua require('hlslens').start()]], 7 | kopts 8 | ) 9 | vim.api.nvim_set_keymap( 10 | "n", 11 | "N", 12 | [[execute('normal! ' . v:count1 . 'N')lua require('hlslens').start()]], 13 | kopts 14 | ) 15 | vim.api.nvim_set_keymap("n", "*", [[*lua require('hlslens').start()]], kopts) 16 | vim.api.nvim_set_keymap("n", "#", [[#lua require('hlslens').start()]], kopts) 17 | vim.api.nvim_set_keymap("n", "g*", [[g*lua require('hlslens').start()]], kopts) 18 | vim.api.nvim_set_keymap("n", "g#", [[g#lua require('hlslens').start()]], kopts) 19 | -------------------------------------------------------------------------------- /lua/config/telescope.lua: -------------------------------------------------------------------------------- 1 | import({ "telescope", "telescope.actions" }, function(modules) 2 | local telescope = modules.telescope 3 | local actions = modules["telescope.actions"] 4 | 5 | telescope.setup({ 6 | defaults = { 7 | file_ignore_patterns = { 8 | ".git/", 9 | "node_modules/*", 10 | }, 11 | mappings = { 12 | i = { 13 | [""] = actions.move_selection_next, 14 | [""] = actions.move_selection_previous, 15 | [""] = actions.toggle_selection + actions.move_selection_worse, 16 | [""] = actions.toggle_selection + actions.move_selection_better, 17 | }, 18 | n = { 19 | [""] = actions.toggle_selection + actions.move_selection_worse, 20 | [""] = actions.toggle_selection + actions.move_selection_better, 21 | }, 22 | }, 23 | }, 24 | }) 25 | 26 | telescope.load_extension("fzf") 27 | telescope.load_extension("project") 28 | telescope.load_extension("harpoon") 29 | end) 30 | -------------------------------------------------------------------------------- /lua/config/gitsigns.lua: -------------------------------------------------------------------------------- 1 | import("gitsigns", function(gitsigns) 2 | gitsigns.setup({ 3 | signs = { 4 | add = { hl = "GitSignsAdd", text = "▎", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, 5 | change = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, 6 | delete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, 7 | topdelete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, 8 | changedelete = { 9 | hl = "GitSignsChange", 10 | text = "▎", 11 | numhl = "GitSignsChangeNr", 12 | linehl = "GitSignsChangeLn", 13 | }, 14 | }, 15 | current_line_blame = true, 16 | current_line_blame_opts = { 17 | virt_text = true, 18 | virt_text_pos = "eol", 19 | delay = 1000, 20 | ignore_whitespace = false, 21 | }, 22 | current_line_blame_formatter_opts = { 23 | relative_time = true, 24 | }, 25 | }) 26 | end) 27 | -------------------------------------------------------------------------------- /lua/config/comment.lua: -------------------------------------------------------------------------------- 1 | import( 2 | { "Comment", "Comment.utils", "ts_context_commentstring.utils", "ts_context_commentstring.internal" }, 3 | function(modules) 4 | local comment = modules.Comment 5 | local comment_utils = modules["Comment.utils"] 6 | local commentstring_utils = modules["ts_context_commentstring.utils"] 7 | local commentstring_internal = modules["ts_context_commentstring.internal"] 8 | 9 | comment.setup({ 10 | pre_hook = function(ctx) 11 | local U = comment_utils 12 | 13 | local location = nil 14 | if ctx.ctype == U.ctype.block then 15 | location = commentstring_utils.get_cursor_location() 16 | elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then 17 | location = commentstring_utils.get_visual_start_location() 18 | end 19 | 20 | return commentstring_internal.calculate_commentstring({ 21 | key = ctx.ctype == U.ctype.line and "__default" or "__multiline", 22 | location = location, 23 | }) 24 | end, 25 | }) 26 | end 27 | ) 28 | -------------------------------------------------------------------------------- /lua/config/colorschemes.lua: -------------------------------------------------------------------------------- 1 | import("catppuccin", function(catppuccin) 2 | catppuccin.setup({ 3 | flavour = "mocha", -- latte, frappe, macchiato, mocha 4 | term_colors = true, 5 | transparent_background = false, 6 | no_italic = false, 7 | no_bold = false, 8 | styles = { 9 | comments = {}, 10 | conditionals = {}, 11 | loops = {}, 12 | functions = {}, 13 | keywords = {}, 14 | strings = {}, 15 | variables = {}, 16 | numbers = {}, 17 | booleans = {}, 18 | properties = {}, 19 | types = {}, 20 | }, 21 | color_overrides = { 22 | mocha = { 23 | base = "#000000", 24 | }, 25 | }, 26 | highlight_overrides = { 27 | mocha = function(C) 28 | return { 29 | TabLineSel = { bg = C.pink }, 30 | NvimTreeNormal = { bg = C.none }, 31 | CmpBorder = { fg = C.surface2 }, 32 | Pmenu = { bg = C.none }, 33 | NormalFloat = { bg = C.none }, 34 | TelescopeBorder = { link = "FloatBorder" }, 35 | } 36 | end, 37 | }, 38 | }) 39 | vim.cmd.colorscheme("catppuccin") 40 | end) 41 | -------------------------------------------------------------------------------- /lua/config/options.lua: -------------------------------------------------------------------------------- 1 | local options = { 2 | backup = false, 3 | cmdheight = 1, 4 | laststatus = 3, 5 | completeopt = { "menuone", "noselect" }, 6 | conceallevel = 0, 7 | fileencoding = "utf-8", 8 | hlsearch = true, 9 | ignorecase = true, 10 | mouse = "a", 11 | pumheight = 10, 12 | showmode = false, 13 | showtabline = 2, 14 | smartcase = true, 15 | smartindent = true, 16 | splitbelow = true, 17 | splitright = true, 18 | swapfile = false, 19 | termguicolors = true, 20 | undofile = true, 21 | updatetime = 300, 22 | writebackup = false, 23 | expandtab = true, 24 | shiftwidth = 2, 25 | tabstop = 2, 26 | cursorline = true, 27 | number = true, 28 | relativenumber = true, 29 | numberwidth = 4, 30 | signcolumn = "yes", 31 | wrap = false, 32 | scrolloff = 8, 33 | sidescrolloff = 8, 34 | guicursor = "", 35 | } 36 | 37 | for k, v in pairs(options) do 38 | vim.opt[k] = v 39 | end 40 | 41 | vim.cmd("set whichwrap+=<,>,[,],h,l") 42 | vim.cmd([[set iskeyword+=-]]) 43 | vim.cmd([[set t_Co=256]]) 44 | 45 | vim.opt.shortmess:append("c") 46 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | require("config.plugins") 2 | require("import") 3 | require("config.impatient") 4 | require("config.options") 5 | require("config.notify") 6 | require("config.keymaps") 7 | require("config.colorschemes") 8 | require("config.better-escape") 9 | require("config.treesitter") 10 | require("config.autopairs") 11 | require("config.copilot") 12 | require("config.cmp") 13 | require("config.lsp") 14 | require("config.neo-tree") 15 | require("config.which-key") 16 | require("config.gitsigns") 17 | require("config.lualine") 18 | require("config.bufferline") 19 | require("config.harpoon") 20 | require("config.telescope") 21 | require("config.symbols-outline") 22 | require("config.alpha") 23 | require("config.lastplace") 24 | require("config.dressing") 25 | require("config.comment") 26 | require("config.indent_blankline") 27 | require("config.tabout") 28 | require("config.scrollbar") 29 | require("config.hlslens") 30 | require("config.hop") 31 | require("config.surround") 32 | require("config.toggleterm") 33 | require("config.cursorline") 34 | require("config.color-highlight") 35 | require("config.tmux") 36 | require("config.git-conflict") 37 | require("config.diffview") 38 | -------------------------------------------------------------------------------- /lua/config/lsp/null-ls.lua: -------------------------------------------------------------------------------- 1 | import({ "mason-null-ls", "null-ls", "mason-null-ls.automatic_setup" }, function(modules) 2 | local mason_null_ls = modules["mason-null-ls"] 3 | local mason_automatic_setup = modules["mason-null-ls.automatic_setup"] 4 | local null_ls = modules["null-ls"] 5 | 6 | mason_null_ls.setup({ 7 | ensure_installed = { "stylua", "prettier" }, 8 | }) 9 | 10 | mason_null_ls.setup_handlers({ 11 | function(source_name, methods) 12 | -- all sources with no handler get passed here 13 | -- Keep original functionality of `automatic_setup = true` 14 | mason_automatic_setup(source_name, methods) 15 | end, 16 | stylua = function() 17 | null_ls.register(null_ls.builtins.formatting.stylua) 18 | end, 19 | }) 20 | 21 | -- will setup any installed and configured sources above 22 | null_ls.setup({ 23 | on_attach = function(client, bufnr) 24 | if client.supports_method("textDocument/formatting") then 25 | vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) 26 | vim.api.nvim_create_autocmd("BufWritePre", { 27 | group = augroup, 28 | buffer = bufnr, 29 | callback = function() 30 | vim.lsp.buf.format({ bufnr = bufnr }) 31 | end, 32 | }) 33 | end 34 | end, 35 | }) 36 | end) 37 | -------------------------------------------------------------------------------- /lua/config/lualine.lua: -------------------------------------------------------------------------------- 1 | import("lualine", function(lualine) 2 | local function getLsp() 3 | local msg = "No Active Lsp" 4 | local buf_ft = vim.api.nvim_buf_get_option(0, "filetype") 5 | local clients = vim.lsp.get_active_clients() 6 | if next(clients) == nil then 7 | return msg 8 | end 9 | for _, client in ipairs(clients) do 10 | local filetypes = client.config.filetypes 11 | if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then 12 | return client.name 13 | end 14 | end 15 | return msg 16 | end 17 | 18 | lualine.setup({ 19 | options = { 20 | globalstatus = true, 21 | component_separators = { left = "", right = "" }, 22 | section_separators = { left = "", right = "" }, 23 | disabled_filetypes = { "neo-tree-popup", "alpha" }, 24 | }, 25 | sections = { 26 | lualine_a = { "mode" }, 27 | lualine_b = { "branch", "diff" }, 28 | lualine_c = { "filename" }, 29 | lualine_x = { "diagnostics", getLsp, "encoding", "fileformat", "filetype" }, 30 | lualine_y = { "progress" }, 31 | lualine_z = { "location" }, 32 | }, 33 | inactive_sections = { 34 | lualine_a = {}, 35 | lualine_b = {}, 36 | lualine_c = { "filename" }, 37 | lualine_x = { "location" }, 38 | lualine_y = {}, 39 | lualine_z = {}, 40 | }, 41 | inactive_winbar = {}, 42 | extensions = { "neo-tree", "toggleterm" }, 43 | }) 44 | end) 45 | -------------------------------------------------------------------------------- /lua/config/lsp/config.lua: -------------------------------------------------------------------------------- 1 | local signs = { 2 | { name = "DiagnosticSignError", text = "" }, 3 | { name = "DiagnosticSignWarn", text = "" }, 4 | { name = "DiagnosticSignHint", text = "" }, 5 | { name = "DiagnosticSignInfo", text = "" }, 6 | } 7 | 8 | for _, sign in ipairs(signs) do 9 | vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" }) 10 | end 11 | 12 | local config = { 13 | virtual_text = true, 14 | signs = { 15 | active = signs, 16 | }, 17 | update_in_insert = true, 18 | underline = true, 19 | severity_sort = true, 20 | float = { 21 | focusable = false, 22 | style = "minmal", 23 | border = "rounded", 24 | source = "always", 25 | header = "", 26 | prefix = "", 27 | }, 28 | } 29 | 30 | vim.diagnostic.config(config) 31 | 32 | vim.lsp.handlers["textDocument/hover"] = function(_, result, ctx, conf) 33 | if not (result and result.contents) then 34 | return 35 | end 36 | 37 | local content = vim.lsp.util.convert_input_to_markdown_lines(result.contents) 38 | content = vim.lsp.util.trim_empty_lines(content) 39 | 40 | if vim.tbl_isempty(content) then 41 | return 42 | end 43 | 44 | return vim.lsp.with(vim.lsp.handlers.hover, { 45 | border = "rounded", 46 | })(_, result, ctx, conf) 47 | end 48 | 49 | vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { 50 | border = "rounded", 51 | }) 52 | -------------------------------------------------------------------------------- /.tmux.conf: -------------------------------------------------------------------------------- 1 | # This maps tmux navigation and resize keys to the neovim ones so that they are both the same 2 | is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" 3 | 4 | bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' { if -F '#{pane_at_left}' '' 'select-pane -L' } 5 | bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' { if -F '#{pane_at_bottom}' '' 'select-pane -D' } 6 | bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' { if -F '#{pane_at_top}' '' 'select-pane -U' } 7 | bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' { if -F '#{pane_at_right}' '' 'select-pane -R' } 8 | 9 | bind-key -T copy-mode-vi 'C-h' if -F '#{pane_at_left}' '' 'select-pane -L' 10 | bind-key -T copy-mode-vi 'C-j' if -F '#{pane_at_bottom}' '' 'select-pane -D' 11 | bind-key -T copy-mode-vi 'C-k' if -F '#{pane_at_top}' '' 'select-pane -U' 12 | bind-key -T copy-mode-vi 'C-l' if -F '#{pane_at_right}' '' 'select-pane -R' 13 | 14 | bind -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'resize-pane -L 1' 15 | bind -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'resize-pane -D 1' 16 | bind -n 'M-k' if-shell "$is_vim" 'send-keys M-k' 'resize-pane -U 1' 17 | bind -n 'M-l' if-shell "$is_vim" 'send-keys M-l' 'resize-pane -R 1' 18 | 19 | bind-key -T copy-mode-vi M-h resize-pane -L 1 20 | bind-key -T copy-mode-vi M-j resize-pane -D 1 21 | bind-key -T copy-mode-vi M-k resize-pane -U 1 22 | bind-key -T copy-mode-vi M-l resize-pane -R 1 23 | -------------------------------------------------------------------------------- /lua/config/lsp/on_attach.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.on_attach = function(client, bufnr) 4 | local opts = { noremap = true, silent = true } 5 | local keymap = vim.api.nvim_buf_set_keymap 6 | 7 | if client.name == "tsserver" then 8 | client.server_capabilities.document_formatting = false 9 | end 10 | 11 | if client.name == "lua_ls" then 12 | client.server_capabilities.document_formatting = false 13 | end 14 | 15 | if client.name == "tsserver" then 16 | keymap(bufnr, "n", "gd", "TypescriptGoToSourceDefinition", opts) 17 | else 18 | keymap(bufnr, "n", "gd", "Trouble lsp_definitions", opts) 19 | end 20 | 21 | keymap(bufnr, "n", "gD", "lua vim.lsp.buf.declaration()", opts) 22 | keymap(bufnr, "n", "gt", "Trouble lsp_type_definitions", opts) 23 | keymap(bufnr, "n", "gi", "Trouble lsp_implementations", opts) 24 | keymap(bufnr, "n", "gr", "Trouble lsp_references", opts) 25 | keymap(bufnr, "n", "K", "lua vim.lsp.buf.hover()", opts) 26 | keymap(bufnr, "n", "", "lua vim.lsp.buf.signature_help()", opts) 27 | keymap(bufnr, "n", "rn", ":IncRename ", opts) 28 | keymap(bufnr, "n", "ca", "CodeActionMenu", opts) 29 | keymap(bufnr, "n", "gf", "lua vim.lsp.buf.format({ async = true })", opts) 30 | keymap(bufnr, "n", "gl", "lua vim.diagnostic.open_float()", opts) 31 | keymap(bufnr, "n", "[d", "lua vim.diagnostic.goto_prev()", opts) 32 | keymap(bufnr, "n", "d]", "lua vim.diagnostic.goto_next()", opts) 33 | end 34 | 35 | return M 36 | -------------------------------------------------------------------------------- /lua/config/keymaps.lua: -------------------------------------------------------------------------------- 1 | local opts = { noremap = true, silent = true } 2 | local keymap = vim.api.nvim_set_keymap 3 | 4 | -- Leader key 5 | keymap("", "", "", opts) 6 | vim.g.mapleader = " " 7 | vim.g.maplocalleader = " " 8 | 9 | -- Window navigation 10 | keymap("n", "", "h", opts) 11 | keymap("n", "", "j", opts) 12 | keymap("n", "", "k", opts) 13 | keymap("n", "", "l", opts) 14 | keymap("n", "h", "h", opts) 15 | keymap("n", "j", "j", opts) 16 | keymap("n", "k", "k", opts) 17 | keymap("n", "l", "l", opts) 18 | 19 | -- Resize 20 | keymap("n", "", ":resize -2", opts) 21 | keymap("n", "", ":resize +2", opts) 22 | keymap("n", "", ":vertical resize -2", opts) 23 | keymap("n", "", ":vertical resize +2", opts) 24 | 25 | -- Navigate buffers 26 | keymap("n", "", ":BufferLineCycleNext", opts) 27 | keymap("n", "", ":BufferLineCyclePrev", opts) 28 | keymap("n", "", ":BufferLineMovePrev", opts) 29 | keymap("n", "", ":BufferLineMoveNext", opts) 30 | 31 | -- Stay in indent mode 32 | keymap("v", "<", "", ">gv", opts) 34 | 35 | -- Move text up and down 36 | keymap("v", "", ":m .+1==", opts) 37 | keymap("v", "", ":m .-2==", opts) 38 | keymap("v", "p", '"_dP', opts) 39 | keymap("x", "J", ":move '>+1gv-gv", opts) 40 | keymap("x", "K", ":move '<-2gv-gv", opts) 41 | keymap("x", "", ":move '>+1gv-gv", opts) 42 | keymap("x", "", ":move '<-2gv-gv", opts) 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | Trash logo 3 |
4 | 5 | # Trashvim 6 | 7 | > A neovim configuration focusing on TypeScript and web development, utilising LSP and other features to deliver a powerful IDE like editing experience with the performance and productivity of neovim. 8 | 9 | Screenshot tsx file 10 | 11 | ## Features 12 | 13 | * Fully setup LSP configuration using Mason, lspconfig and typescript.nvim. 14 | * Linters and formatters support using null-ls. 15 | * Terminal panes support using toggleterm. 16 | * Winbar support outlining the code scope. 17 | * Buffer organisation using bufferline. 18 | * File explorer and git management using neo-tree. 19 | * Highlight of colors including TailwindCSS. 20 | * Typescript actions such as remove unused, organise imports, adding missing imports...etc 21 | 22 | And many more! 23 | 24 | ## Installation 25 | 26 | **Note: Before starting the installation, make sure that if you have a `~/.config/nvim` folder that you move it somewhere else.** 27 | 28 | ```bash 29 | # Clone the configuration 30 | cd ~/.config 31 | git clone https://github.com/ixahmedxi/trashvim nvim 32 | cd ~/.config/nvim 33 | 34 | # Run PackerSync to get all of the plugins 35 | nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync' 36 | ``` 37 | 38 | To make sure that everything is working fine, try running `nvim init.lua` and seeing if any errors occur, it should start installing treesitter languages and lsp servers on that initial open. If any errors are present, try running `:PackerSync` again. 39 | 40 | -------------------------------------------------------------------------------- /lua/config/lsp/init.lua: -------------------------------------------------------------------------------- 1 | require("config.lsp.config") 2 | require("config.lsp.fidget") 3 | require("config.lsp.signature") 4 | require("config.lsp.inc-rename") 5 | require("config.lsp.lightbulb") 6 | require("config.lsp.trouble") 7 | require("config.lsp.barbecue") 8 | 9 | import({ "mason", "mason-lspconfig", "lspconfig", "cmp_nvim_lsp" }, function(modules) 10 | local mason = modules.mason 11 | local masonLspConfig = modules["mason-lspconfig"] 12 | local cmpLsp = modules["cmp_nvim_lsp"] 13 | 14 | mason.setup({ 15 | ui = { 16 | icons = { 17 | package_installed = "✓", 18 | package_pending = "➜", 19 | package_uninstalled = "✗", 20 | }, 21 | }, 22 | }) 23 | 24 | masonLspConfig.setup({ 25 | ensure_installed = { 26 | "lua_ls", 27 | "jsonls", 28 | "tsserver", 29 | "eslint", 30 | "prismals", 31 | "tailwindcss", 32 | "html", 33 | "cssls", 34 | "astro", 35 | "yamlls", 36 | "taplo", 37 | "marksman", 38 | "dockerls", 39 | "cssmodules_ls", 40 | "volar", 41 | "angularls", 42 | "rust_analyzer", 43 | }, 44 | }) 45 | 46 | local opts = { 47 | capabilities = cmpLsp.default_capabilities(), 48 | on_attach = require("config.lsp.on_attach").on_attach, 49 | } 50 | 51 | masonLspConfig.setup_handlers({ 52 | function(server_name) 53 | local has_custom_opts, custom_opts = pcall(require, "config.lsp.settings." .. server_name) 54 | 55 | local server_opts = opts 56 | 57 | if has_custom_opts then 58 | server_opts = vim.tbl_deep_extend("force", custom_opts, opts) 59 | end 60 | 61 | modules.lspconfig[server_name].setup(server_opts) 62 | end, 63 | ["tsserver"] = function() 64 | import("typescript", function(typescript) 65 | typescript.setup({ 66 | server = opts, 67 | }) 68 | end) 69 | end, 70 | ["rust_analyzer"] = function() 71 | import("rust-tools", function(rustTools) 72 | rustTools.setup({ server = opts }) 73 | end) 74 | end, 75 | }) 76 | 77 | require("config.lsp.null-ls") 78 | end) 79 | -------------------------------------------------------------------------------- /lua/config/treesitter.lua: -------------------------------------------------------------------------------- 1 | import("nvim-treesitter.configs", function(treesitter) 2 | treesitter.setup({ 3 | ensure_installed = { 4 | "lua", 5 | "markdown", 6 | "html", 7 | "css", 8 | "javascript", 9 | "typescript", 10 | "tsx", 11 | "prisma", 12 | "json", 13 | "svelte", 14 | "scss", 15 | "c", 16 | "python", 17 | "pug", 18 | "php", 19 | "java", 20 | "astro", 21 | "vue", 22 | "dockerfile", 23 | "graphql", 24 | "yaml", 25 | "toml", 26 | }, 27 | highlight = { 28 | enable = true, 29 | }, 30 | rainbow = { 31 | enable = true, 32 | extended_mode = true, 33 | }, 34 | autotag = { 35 | enable = true, 36 | }, 37 | indent = { enable = true }, 38 | textobjects = { 39 | select = { 40 | enable = true, 41 | lookahead = true, 42 | keymaps = { 43 | ["af"] = "@function.outer", 44 | ["if"] = "@function.inner", 45 | ["ac"] = "@class.outer", 46 | ["ic"] = { query = "@class.inner", desc = "Select inner part of a class region" }, 47 | }, 48 | selection_modes = { 49 | ["@parameter.outer"] = "v", 50 | ["@function.outer"] = "V", 51 | ["@class.outer"] = "", 52 | }, 53 | include_surrounding_whitespace = true, 54 | }, 55 | swap = { 56 | enable = true, 57 | swap_next = { 58 | ["a"] = "@parameter.inner", 59 | }, 60 | swap_previous = { 61 | ["A"] = "@parameter.inner", 62 | }, 63 | }, 64 | move = { 65 | enable = true, 66 | set_jumps = true, 67 | goto_next_start = { 68 | ["]m"] = "@function.outer", 69 | ["]]"] = "@class.outer", 70 | }, 71 | goto_next_end = { 72 | ["]M"] = "@function.outer", 73 | ["]["] = "@class.outer", 74 | }, 75 | goto_previous_start = { 76 | ["[m"] = "@function.outer", 77 | ["[["] = "@class.outer", 78 | }, 79 | goto_previous_end = { 80 | ["[M"] = "@function.outer", 81 | ["[]"] = "@class.outer", 82 | }, 83 | }, 84 | }, 85 | }) 86 | 87 | vim.cmd([[hi rainbowcol1 guifg=#7f849c]]) 88 | end) 89 | -------------------------------------------------------------------------------- /lua/config/alpha.lua: -------------------------------------------------------------------------------- 1 | import({ "alpha", "alpha.themes.dashboard" }, function(modules) 2 | local alpha = modules.alpha 3 | local dashboard = modules["alpha.themes.dashboard"] 4 | 5 | dashboard.section.header.val = { 6 | [[ .^!777777~ ]], 7 | [[ .^!77~^:......~Y~ ]], 8 | [[ :!?7^.. .5! ]], 9 | [[ :7?!:. .P^ ]], 10 | [[ ~J!. :G ]], 11 | [[ ^Y!. J? ]], 12 | [[ ?Y. .G. ]], 13 | [[ JJ ?Y ]], 14 | [[ ?Y JG ]], 15 | [[ .G. Y! ]], 16 | [[ J? .G ]], 17 | [[ G^ ::.P^ ]], 18 | [[ G: ^^ ^P ]], 19 | [[ P^ ?J ]], 20 | [[ Y! :G ]], 21 | [[ !Y .. .. P^]], 22 | [[ .G. .^ .7J: P~]], 23 | [[ Y7 .~?J~ ?Y ]], 24 | [[ .G. .^!??~. ^Y7 ]], 25 | [[ ?J .:^!7?!:. :!?!. ]], 26 | [[ P~ .^!777?7~:. .^7?!. ]], 27 | [[ .P~ .^~!7?!:... .:~77!^. ]], 28 | [[ ?JJ!^::..:^~!777~. ]], 29 | [[ .~77777!~^:. ]], 30 | } 31 | 32 | dashboard.section.buttons.val = { 33 | dashboard.button("f", " Find file", "lua require('telescope.builtin').find_files()"), 34 | dashboard.button("e", " New file", ":ene startinsert "), 35 | dashboard.button("p", " Find project", ":Telescope project "), 36 | dashboard.button("r", " Recently used files", ":Telescope oldfiles "), 37 | dashboard.button("t", " Find text", ":Telescope live_grep "), 38 | dashboard.button("c", " Configuration", ":e ~/.config/nvim/init.lua "), 39 | dashboard.button("q", " Quit Neovim", ":qa"), 40 | } 41 | 42 | local function footer() 43 | return "“Should've named my kids tech debt, they're never going away.” – Trash" 44 | end 45 | 46 | dashboard.section.footer.val = footer() 47 | 48 | dashboard.section.footer.opts.hl = "Type" 49 | dashboard.section.header.opts.hl = "Include" 50 | dashboard.section.buttons.opts.hl = "Keyword" 51 | 52 | dashboard.opts.opts.noautocmd = true 53 | alpha.setup(dashboard.opts) 54 | end) 55 | -------------------------------------------------------------------------------- /lua/config/cmp.lua: -------------------------------------------------------------------------------- 1 | import({ "cmp", "luasnip", "lspkind", "luasnip/loaders/from_vscode" }, function(modules) 2 | local cmp = modules.cmp 3 | modules["luasnip/loaders/from_vscode"].lazy_load() 4 | 5 | local check_backspace = function() 6 | local col = vim.fn.col(".") - 1 7 | return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") 8 | end 9 | 10 | cmp.setup({ 11 | snippet = { 12 | expand = function(args) 13 | modules.luasnip.lsp_expand(args.body) 14 | end, 15 | }, 16 | mapping = { 17 | [""] = cmp.mapping.select_prev_item(), 18 | [""] = cmp.mapping.select_next_item(), 19 | [""] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), 20 | [""] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), 21 | [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), 22 | [""] = cmp.config.disable, 23 | [""] = cmp.mapping({ 24 | i = cmp.mapping.abort(), 25 | c = cmp.mapping.close(), 26 | }), 27 | [""] = cmp.mapping.confirm({ select = false }), 28 | [""] = cmp.mapping(function(fallback) 29 | if cmp.visible() then 30 | cmp.select_next_item() 31 | elseif modules.luasnip.expandable() then 32 | modules.luasnip.expand() 33 | elseif modules.luasnip.expand_or_jumpable() then 34 | modules.luasnip.expand_or_jump() 35 | elseif check_backspace() then 36 | fallback() 37 | else 38 | fallback() 39 | end 40 | end, { 41 | "i", 42 | "s", 43 | }), 44 | [""] = cmp.mapping(function(fallback) 45 | if cmp.visible() then 46 | cmp.select_prev_item() 47 | elseif modules.luasnip.jumpable(-1) then 48 | modules.luasnip.jump(-1) 49 | else 50 | fallback() 51 | end 52 | end, { 53 | "i", 54 | "s", 55 | }), 56 | }, 57 | formatting = { 58 | fields = { "abbr", "kind", "menu" }, 59 | format = modules.lspkind.cmp_format({ 60 | mode = "symbol_text", 61 | symbol_map = { 62 | Copilot = "", 63 | }, 64 | before = function(entry, vim_item) 65 | vim_item.menu = ({ 66 | nvim_lsp = "[LSP]", 67 | luasnip = "[Snippet]", 68 | buffer = "[Buffer]", 69 | path = "[Path]", 70 | })[entry.source.name] 71 | return vim_item 72 | end, 73 | }), 74 | }, 75 | sources = { 76 | { name = "nvim_lsp" }, 77 | { name = "copilot" }, 78 | { name = "luasnip" }, 79 | { name = "buffer" }, 80 | { name = "path" }, 81 | }, 82 | confirm_opts = { 83 | behavior = cmp.ConfirmBehavior.Replace, 84 | select = false, 85 | }, 86 | window = { 87 | completion = cmp.config.window.bordered(), 88 | documentation = cmp.config.window.bordered(), 89 | }, 90 | experimental = { 91 | ghost_text = false, 92 | native_menu = false, 93 | }, 94 | performance = { 95 | debounce = 150, 96 | }, 97 | }) 98 | 99 | cmp.setup.cmdline({ "/", "?" }, { 100 | mapping = cmp.mapping.preset.cmdline(), 101 | sources = { 102 | { name = "buffer" }, 103 | }, 104 | }) 105 | 106 | cmp.setup.cmdline(":", { 107 | mapping = cmp.mapping.preset.cmdline(), 108 | sources = cmp.config.sources({ 109 | { name = "path" }, 110 | }, { 111 | { name = "cmdline" }, 112 | }), 113 | }) 114 | end) 115 | -------------------------------------------------------------------------------- /lua/config/plugins.lua: -------------------------------------------------------------------------------- 1 | local fn = vim.fn 2 | 3 | -- Automatically install packer 4 | local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" 5 | if fn.empty(fn.glob(install_path)) > 0 then 6 | PACKER_BOOTSTRAP = fn.system({ 7 | "git", 8 | "clone", 9 | "--depth", 10 | "1", 11 | "https://github.com/wbthomason/packer.nvim", 12 | install_path, 13 | }) 14 | print("Installing packer close and reopen Neovim...") 15 | vim.cmd([[packadd packer.nvim]]) 16 | end 17 | 18 | -- Autocommand that reloads neovim whenever you save the plugins.lua file 19 | vim.cmd([[ 20 | augroup packer_user_config 21 | autocmd! 22 | autocmd BufWritePost plugins.lua source | PackerSync 23 | augroup end 24 | ]]) 25 | 26 | local packer = require("packer") 27 | 28 | -- Have packer use a popup window 29 | packer.init({ 30 | display = { 31 | open_fn = function() 32 | return require("packer.util").float({ border = "rounded" }) 33 | end, 34 | }, 35 | }) 36 | 37 | return packer.startup(function(use) 38 | -- Essentials 39 | use("wbthomason/packer.nvim") 40 | use("nvim-lua/plenary.nvim") 41 | use("miversen33/import.nvim") 42 | use("kyazdani42/nvim-web-devicons") 43 | use("MunifTanjim/nui.nvim") 44 | 45 | -- Navigation 46 | use({ 47 | "nvim-neo-tree/neo-tree.nvim", 48 | branch = "v2.x", 49 | }) 50 | use("folke/which-key.nvim") 51 | 52 | -- Buffers & navigation 53 | use("lewis6991/gitsigns.nvim") 54 | use("nvim-lualine/lualine.nvim") 55 | use({ "akinsho/bufferline.nvim", tag = "v3.*" }) 56 | use("famiu/bufdelete.nvim") 57 | use("lukas-reineke/indent-blankline.nvim") 58 | use("kevinhwang91/nvim-hlslens") 59 | use("petertriho/nvim-scrollbar") 60 | use("yamatsum/nvim-cursorline") 61 | use("brenoprata10/nvim-highlight-colors") 62 | use("ThePrimeagen/harpoon") 63 | use("akinsho/git-conflict.nvim") 64 | 65 | -- Colorscheme 66 | use({ "catppuccin/nvim", as = "catppuccin" }) 67 | 68 | -- Treesitter 69 | use("nvim-treesitter/nvim-treesitter") 70 | use("windwp/nvim-ts-autotag") 71 | use("nvim-treesitter/nvim-treesitter-textobjects") 72 | use("p00f/nvim-ts-rainbow") 73 | use("windwp/nvim-autopairs") 74 | 75 | -- Telescope 76 | use("nvim-telescope/telescope.nvim") 77 | use({ 78 | "nvim-telescope/telescope-fzf-native.nvim", 79 | run = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build", 80 | }) 81 | use("nvim-telescope/telescope-project.nvim") 82 | 83 | -- CMP 84 | use("hrsh7th/nvim-cmp") 85 | use("hrsh7th/cmp-buffer") 86 | use("hrsh7th/cmp-path") 87 | use("hrsh7th/cmp-cmdline") 88 | use("saadparwaiz1/cmp_luasnip") 89 | use("hrsh7th/cmp-nvim-lsp") 90 | use("L3MON4D3/LuaSnip") 91 | use("rafamadriz/friendly-snippets") 92 | use("onsails/lspkind.nvim") 93 | use("zbirenbaum/copilot.lua") 94 | use("zbirenbaum/copilot-cmp") 95 | 96 | -- LSP 97 | use("williamboman/mason.nvim") 98 | use("williamboman/mason-lspconfig.nvim") 99 | use("neovim/nvim-lspconfig") 100 | use("b0o/SchemaStore.nvim") 101 | use("jose-elias-alvarez/typescript.nvim") 102 | use("simrat39/symbols-outline.nvim") 103 | use("j-hui/fidget.nvim") 104 | use("ray-x/lsp_signature.nvim") 105 | use("smjonas/inc-rename.nvim") 106 | use({ 107 | "weilbith/nvim-code-action-menu", 108 | cmd = "CodeActionMenu", 109 | }) 110 | use("kosayoda/nvim-lightbulb") 111 | use("jose-elias-alvarez/null-ls.nvim") 112 | use("jayp0521/mason-null-ls.nvim") 113 | use("gpanders/editorconfig.nvim") 114 | use("folke/trouble.nvim") 115 | use("smiteshp/nvim-navic") 116 | use("utilyre/barbecue.nvim") 117 | use("simrat39/rust-tools.nvim") 118 | 119 | -- Editing 120 | use("max397574/better-escape.nvim") 121 | use("ethanholz/nvim-lastplace") 122 | use("numToStr/Comment.nvim") 123 | use("JoosepAlviste/nvim-ts-context-commentstring") 124 | use("abecodes/tabout.nvim") 125 | use("phaazon/hop.nvim") 126 | use("kylechui/nvim-surround") 127 | 128 | -- UI 129 | use("goolord/alpha-nvim") 130 | use("stevearc/dressing.nvim") 131 | 132 | -- Misc 133 | use("lewis6991/impatient.nvim") 134 | use("akinsho/toggleterm.nvim") 135 | use("rcarriga/nvim-notify") 136 | use("ThePrimeagen/vim-be-good") 137 | use("aserowy/tmux.nvim") 138 | use({ 139 | "folke/persistence.nvim", 140 | event = "BufReadPre", 141 | module = "persistence", 142 | config = function() 143 | require("persistence").setup() 144 | end, 145 | }) 146 | use("sindrets/diffview.nvim") 147 | 148 | if PACKER_BOOTSTRAP then 149 | require("packer").sync() 150 | end 151 | end) 152 | -------------------------------------------------------------------------------- /lua/config/which-key.lua: -------------------------------------------------------------------------------- 1 | import("which-key", function(whichKey) 2 | local setup = { 3 | window = { 4 | border = "rounded", 5 | position = "bottom", 6 | margin = { 1, 0, 1, 0 }, 7 | padding = { 2, 2, 2, 2 }, 8 | winblend = 0, 9 | }, 10 | ignore_missing = true, 11 | hidden = { "", "", "", "", "call", "lua", "^:", "^ " }, 12 | show_help = true, 13 | } 14 | 15 | local opts = { 16 | mode = "n", 17 | prefix = "", 18 | silent = true, 19 | noremap = true, 20 | } 21 | 22 | local mappings = { 23 | ["w"] = { "w", "Save" }, 24 | ["q"] = { "q", "Quit" }, 25 | ["e"] = { "Neotree toggle", "Toggle Explorer" }, 26 | ["n"] = { "nohl", "No highlight" }, 27 | ["b"] = { 28 | name = "Buffers", 29 | ["p"] = { "BufferLinePick", "Pick" }, 30 | ["f"] = { "BufferLineTogglePin", "Toggle pin" }, 31 | ["c"] = { "BufferLinePickClose", "Pick close" }, 32 | ["d"] = { "Bdelete", "Close Current" }, 33 | ["m"] = { "BufferLineCloseRightBufferLineCloseLeft", "Close all other" }, 34 | ["l"] = { "BufferLineCloseRight", "Close right" }, 35 | ["h"] = { "BufferLineCloseLeft", "Close left" }, 36 | ["s"] = { 37 | name = "Sort", 38 | ["t"] = { "BufferLineSortByTabs", "By tabs" }, 39 | ["d"] = { "BufferLineSortByDirectory", "By directory" }, 40 | ["e"] = { "BufferLineSortByExtension", "By extension" }, 41 | ["r"] = { "BufferLineSortByRelativeDirectory", "By relative directory" }, 42 | }, 43 | }, 44 | ["p"] = { 45 | name = "Packer", 46 | ["s"] = { "PackerSync", "Sync" }, 47 | ["i"] = { "PackerInstall", "Install" }, 48 | ["u"] = { "PackerUpdate", "Update" }, 49 | ["c"] = { "PackerCompile", "Compile" }, 50 | }, 51 | ["f"] = { 52 | name = "Find", 53 | ["f"] = { "lua require('telescope.builtin').live_grep()", "Text" }, 54 | ["s"] = { "lua require('telescope.builtin').find_files()", "Files" }, 55 | ["h"] = { "lua require('telescope.builtin').help_tags()", "Help tags" }, 56 | ["b"] = { "lua require('telescope.builtin').buffers()", "Buffers" }, 57 | ["m"] = { "lua require('harpoon.ui').toggle_quick_menu()", "Marked files" }, 58 | }, 59 | ["g"] = { 60 | name = "Git", 61 | ["s"] = { "lua require('telescope.builtin').git_status()", "Status" }, 62 | ["c"] = { "lua require('telescope.builtin').git_commits()", "Commits" }, 63 | ["b"] = { "lua require('telescope.builtin').git_branches()", "Branches" }, 64 | ["d"] = { 65 | name = "Diff view", 66 | ["o"] = { "DiffviewOpen", "Open" }, 67 | ["d"] = { "DiffviewClose", "Close" }, 68 | ["l"] = { "DiffviewLog", "Log" }, 69 | ["r"] = { "DiffviewRefresh", "Refresh" }, 70 | ["f"] = { "DiffviewFocusFiles", "Focus files" }, 71 | ["h"] = { "DiffviewFileHistory", "File history" }, 72 | }, 73 | }, 74 | ["l"] = { 75 | name = "LSP", 76 | ["D"] = { "lua vim.lsp.buf.declaration()", "Declaration" }, 77 | ["d"] = { "lua vim.lsp.buf.definition()", "Definition" }, 78 | ["T"] = { "lua vim.lsp.buf.type_definition()", "Type definition" }, 79 | ["i"] = { "lua vim.lsp.buf.implementation()", "Implementation" }, 80 | ["R"] = { "lua vim.lsp.buf.references()", "References" }, 81 | ["K"] = { "lua vim.lsp.buf.hover()", "Hover" }, 82 | ["k"] = { "lua vim.lsp.buf.signature_help()", "Signature help" }, 83 | ["s"] = { "SymbolsOutline", "Toggle symbols outline" }, 84 | ["n"] = { ":IncRename ", "Rename" }, 85 | ["a"] = { "CodeActionMenu", "Code actions" }, 86 | ["f"] = { "lua vim.lsp.buf.format({ async = true })", "Format" }, 87 | ["l"] = { "lua vim.diagnostic.open_float()", "Open float" }, 88 | ["t"] = { 89 | name = "TypeScript", 90 | ["a"] = { "TypescriptAddMissingImports", "Add missing imports" }, 91 | ["o"] = { "TypescriptOrganizeImports", "Organize imports" }, 92 | ["u"] = { "TypescriptRemoveUnused", "Remove unused" }, 93 | ["f"] = { "TypescriptFixAll", "Fix all" }, 94 | ["g"] = { "TypescriptGoToSourceDefinition", "Go to source definition" }, 95 | ["r"] = { "TypescriptRenameFile", "Rename file" }, 96 | }, 97 | ["r"] = { 98 | name = "Rust", 99 | ["r"] = { "RustRun", "Run" }, 100 | ["a"] = { "RustRunnables", "Runnables" }, 101 | }, 102 | ["u"] = { 103 | name = "Trouble", 104 | r = { "TroubleToggle lsp_references", "References" }, 105 | f = { "TroubleToggle lsp_definitions", "Definitions" }, 106 | d = { "TroubleToggle document_diagnostics", "Diagnostics" }, 107 | q = { "TroubleToggle quickfix", "QuickFix" }, 108 | l = { "TroubleToggle loclist", "LocationList" }, 109 | w = { "TroubleToggle workspace_diagnostics", "Workspace Diagnostics" }, 110 | }, 111 | }, 112 | ["h"] = { 113 | name = "Hop", 114 | ["h"] = { "HopChar2", "2 Chars" }, 115 | ["f"] = { "HopChar1", "1 Chars" }, 116 | ["p"] = { "HopPattern", "Pattern" }, 117 | ["l"] = { "HopLineStart", "Line start" }, 118 | ["v"] = { "HopVertical", "Vertical" }, 119 | ["w"] = { "HopWord", "Word" }, 120 | }, 121 | ["m"] = { "lua require('harpoon.mark').add_file()", "Mark file" }, 122 | ["s"] = { 123 | name = "Session", 124 | ["s"] = { "lua require('persistence').load()", "Load current directory" }, 125 | ["l"] = { "lua require('persistence').load({ last = true })", "Load last session" }, 126 | ["d"] = { "lua require('persistence').stop()", "Stop session" }, 127 | }, 128 | } 129 | 130 | whichKey.setup(setup) 131 | whichKey.register(mappings, opts) 132 | end) 133 | --------------------------------------------------------------------------------