diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..611e830 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,35 @@ +name: stylua + +on: + push: + branches: ["main"] + tags: ["v*.*.*"] + pull_request: + types: [opened, reopened, synchronize] + branches: ["*"] + workflow_dispatch: + +jobs: + format: + runs-on: [self-hosted] + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + - name: Activate nix-shell + uses: nicknovitski/nix-develop@v1.2.0 + with: + arguments: "github:C4theBomb/nixos-config#lua-dev" + - name: Format all files + run: stylua . + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v5.0.1 + with: + commit_message: | + Autoformatting with stylua + + [skip ci] + diff --git a/lua/autocmds.lua b/lua/autocmds.lua index b573b61..fb3eb58 100644 --- a/lua/autocmds.lua +++ b/lua/autocmds.lua @@ -1,33 +1,35 @@ -require "nvchad.autocmds" +require("nvchad.autocmds") local autocmd = vim.api.nvim_create_autocmd autocmd({ "TextYankPost" }, { - group = vim.api.nvim_create_augroup("HighlightYank", { clear = true }), - callback = function() - vim.highlight.on_yank({ - higroup = "IncSearch", - timeout = 40, - }) - end + group = vim.api.nvim_create_augroup("HighlightYank", { clear = true }), + callback = function() + vim.highlight.on_yank({ + higroup = "IncSearch", + timeout = 40, + }) + end, }) autocmd({ "BufWinEnter" }, { - group = vim.api.nvim_create_augroup("Fugitive", {}), - callback = function() - if vim.bo.ft ~= 'fugitive' then - return - end + group = vim.api.nvim_create_augroup("Fugitive", {}), + callback = function() + if vim.bo.ft ~= "fugitive" then + return + end - vim.keymap.set('n', 'p', 'Git pull', { desc = "Fugitive Git pull" }) - vim.keymap.set('n', 'P', 'Git push', { desc = "Fugitive Git push" }) - end + vim.keymap.set("n", "p", "Git pull", { desc = "Fugitive Git pull" }) + vim.keymap.set("n", "P", "Git push", { desc = "Fugitive Git push" }) + end, }) autocmd({ "LspAttach" }, { - group = vim.api.nvim_create_augroup("Lsp", {}), - callback = function(e) - local opts = { buffer = e.buf, } - vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) - end + group = vim.api.nvim_create_augroup("Lsp", {}), + callback = function(e) + local opts = { buffer = e.buf } + vim.keymap.set("n", "K", function() + vim.lsp.buf.hover() + end, opts) + end, }) diff --git a/lua/chadrc.lua b/lua/chadrc.lua index 0d6f1f5..779d859 100644 --- a/lua/chadrc.lua +++ b/lua/chadrc.lua @@ -2,22 +2,22 @@ local M = {} M.ui = { - theme = "tokyonight", - tabufline = { - enabled = false, - }, + theme = "tokyonight", + tabufline = { + enabled = false, + }, } M.copilot = { - i = { - [""] = { - function() - vim.fn.feedkeys(vim.fn['copilot#Accept'](), '') - end, - "Copilot Accept", - { replace_keycodes = true, nowait = true, silent = true, expr = true, noremap = true } - } - } + i = { + [""] = { + function() + vim.fn.feedkeys(vim.fn["copilot#Accept"](), "") + end, + "Copilot Accept", + { replace_keycodes = true, nowait = true, silent = true, expr = true, noremap = true }, + }, + }, } return M diff --git a/lua/configs/conform.lua b/lua/configs/conform.lua index 97b497b..e7ce5cc 100644 --- a/lua/configs/conform.lua +++ b/lua/configs/conform.lua @@ -1,15 +1,15 @@ local options = { - formatters_by_ft = { - lua = { "stylua" }, - -- css = { "prettier" }, - -- html = { "prettier" }, - }, + formatters_by_ft = { + lua = { "stylua" }, + -- css = { "prettier" }, + -- html = { "prettier" }, + }, - -- format_on_save = { - -- -- These options will be passed to conform.format() - -- timeout_ms = 500, - -- lsp_fallback = true, - -- }, + -- format_on_save = { + -- -- These options will be passed to conform.format() + -- timeout_ms = 500, + -- lsp_fallback = true, + -- }, } require("conform").setup(options) diff --git a/lua/configs/copilot.lua b/lua/configs/copilot.lua index 58386e2..ecc9643 100644 --- a/lua/configs/copilot.lua +++ b/lua/configs/copilot.lua @@ -1,10 +1,10 @@ local options = { - suggestion = { - enable = false, - }, - panel = { - enable = false, - }, + suggestion = { + enable = false, + }, + panel = { + enable = false, + }, } -require('copilot').setup(options) +require("copilot").setup(options) diff --git a/lua/configs/harpoon.lua b/lua/configs/harpoon.lua index e68ea95..9e5f9c7 100644 --- a/lua/configs/harpoon.lua +++ b/lua/configs/harpoon.lua @@ -3,13 +3,33 @@ local set = vim.keymap.set harpoon:setup() -set("n", "a", function() harpoon:list():add() end, { desc = "Harpoon Add new entry" }) -set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, { desc = "Harpoon Open quick menu" }) -set("n", "", function() harpoon:list():select(1) end, { desc = "Harpoon Select entry 1" }) -set("n", "", function() harpoon:list():select(2) end, { desc = "Harpoon Select entry 2" }) -set("n", "", function() harpoon:list():select(3) end, { desc = "Harpoon Select entry 3" }) -set("n", "", function() harpoon:list():select(4) end, { desc = "Harpoon Select entry 4" }) -set("n", "", function() harpoon:list():replace_at(1) end, { desc = "Harpoon Replace entry 1" }) -set("n", "", function() harpoon:list():replace_at(2) end, { desc = "Harpoon Replace entry 2" }) -set("n", "", function() harpoon:list():replace_at(3) end, { desc = "Harpoon Replace entry 3" }) -set("n", "", function() harpoon:list():replace_at(4) end, { desc = "Harpoon Replace entry 4" }) +set("n", "a", function() + harpoon:list():add() +end, { desc = "Harpoon Add new entry" }) +set("n", "", function() + harpoon.ui:toggle_quick_menu(harpoon:list()) +end, { desc = "Harpoon Open quick menu" }) +set("n", "", function() + harpoon:list():select(1) +end, { desc = "Harpoon Select entry 1" }) +set("n", "", function() + harpoon:list():select(2) +end, { desc = "Harpoon Select entry 2" }) +set("n", "", function() + harpoon:list():select(3) +end, { desc = "Harpoon Select entry 3" }) +set("n", "", function() + harpoon:list():select(4) +end, { desc = "Harpoon Select entry 4" }) +set("n", "", function() + harpoon:list():replace_at(1) +end, { desc = "Harpoon Replace entry 1" }) +set("n", "", function() + harpoon:list():replace_at(2) +end, { desc = "Harpoon Replace entry 2" }) +set("n", "", function() + harpoon:list():replace_at(3) +end, { desc = "Harpoon Replace entry 3" }) +set("n", "", function() + harpoon:list():replace_at(4) +end, { desc = "Harpoon Replace entry 4" }) diff --git a/lua/configs/lazy.lua b/lua/configs/lazy.lua index fbb19a9..b15158d 100644 --- a/lua/configs/lazy.lua +++ b/lua/configs/lazy.lua @@ -1,47 +1,47 @@ return { - defaults = { lazy = true }, - install = { colorscheme = { "nvchad" } }, + defaults = { lazy = true }, + install = { colorscheme = { "nvchad" } }, - ui = { - icons = { - ft = "", - lazy = "󰂠 ", - loaded = "", - not_loaded = "", - }, - }, + ui = { + icons = { + ft = "", + lazy = "󰂠 ", + loaded = "", + not_loaded = "", + }, + }, - performance = { - rtp = { - disabled_plugins = { - "2html_plugin", - "tohtml", - "getscript", - "getscriptPlugin", - "gzip", - "logipat", - "netrw", - "netrwPlugin", - "netrwSettings", - "netrwFileHandlers", - "matchit", - "tar", - "tarPlugin", - "rrhelper", - "spellfile_plugin", - "vimball", - "vimballPlugin", - "zip", - "zipPlugin", - "tutor", - "rplugin", - "syntax", - "synmenu", - "optwin", - "compiler", - "bugreport", - "ftplugin", - }, - }, - }, + performance = { + rtp = { + disabled_plugins = { + "2html_plugin", + "tohtml", + "getscript", + "getscriptPlugin", + "gzip", + "logipat", + "netrw", + "netrwPlugin", + "netrwSettings", + "netrwFileHandlers", + "matchit", + "tar", + "tarPlugin", + "rrhelper", + "spellfile_plugin", + "vimball", + "vimballPlugin", + "zip", + "zipPlugin", + "tutor", + "rplugin", + "syntax", + "synmenu", + "optwin", + "compiler", + "bugreport", + "ftplugin", + }, + }, + }, } diff --git a/lua/configs/lspconfig.lua b/lua/configs/lspconfig.lua index df8439f..4c7343f 100644 --- a/lua/configs/lspconfig.lua +++ b/lua/configs/lspconfig.lua @@ -3,47 +3,47 @@ local on_init = require("nvchad.configs.lspconfig").on_init local capabilities = require("nvchad.configs.lspconfig").capabilities require("mason-lspconfig").setup({ - ensure_installed = { "lua_ls", "html", "cssls" }, - handlers = { - function(server_name) -- default handler (optional) - require("lspconfig")[server_name].setup { - capabilities = capabilities, - on_attach = on_attach, - on_init = on_init, - } - end, - zls = function() - local lspconfig = require("lspconfig") - lspconfig.zls.setup({ - root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"), - settings = { - zls = { - enable_inlay_hints = true, - enable_snippets = true, - warn_style = true, - }, - }, - }) - vim.g.zig_fmt_parse_errors = 0 - vim.g.zig_fmt_autosave = 0 - end, - ["lua_ls"] = function() - local lspconfig = require("lspconfig") - lspconfig.lua_ls.setup { - capabilities = capabilities, - settings = { - Lua = { - runtime = { version = "Lua 5.1" }, - diagnostics = { - globals = { "bit", "vim", "it", "describe", "before_each", "after_each" }, - } - } - } - } - end, - } + ensure_installed = { "lua_ls", "html", "cssls" }, + handlers = { + function(server_name) -- default handler (optional) + require("lspconfig")[server_name].setup({ + capabilities = capabilities, + on_attach = on_attach, + on_init = on_init, + }) + end, + zls = function() + local lspconfig = require("lspconfig") + lspconfig.zls.setup({ + root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"), + settings = { + zls = { + enable_inlay_hints = true, + enable_snippets = true, + warn_style = true, + }, + }, + }) + vim.g.zig_fmt_parse_errors = 0 + vim.g.zig_fmt_autosave = 0 + end, + ["lua_ls"] = function() + local lspconfig = require("lspconfig") + lspconfig.lua_ls.setup({ + capabilities = capabilities, + settings = { + Lua = { + runtime = { version = "Lua 5.1" }, + diagnostics = { + globals = { "bit", "vim", "it", "describe", "before_each", "after_each" }, + }, + }, + }, + }) + end, + }, }) -require('lspconfig').clangd.setup({ - capabilities = capabilities, +require("lspconfig").clangd.setup({ + capabilities = capabilities, }) diff --git a/lua/configs/nvim-dap.lua b/lua/configs/nvim-dap.lua index 2985b87..7d0286b 100644 --- a/lua/configs/nvim-dap.lua +++ b/lua/configs/nvim-dap.lua @@ -1,67 +1,77 @@ local dap, dapui = require("dap"), require("dapui") dap.listeners.before.attach.dapui_config = function() - dapui.open() + dapui.open() end dap.listeners.before.launch.dapui_config = function() - dapui.open() + dapui.open() end dap.listeners.before.event_terminated.dapui_config = function() - dapui.close() + dapui.close() end dap.listeners.before.event_exited.dapui_config = function() - dapui.close() + dapui.close() end local set = vim.keymap.set -set('n', 'db', function() dap.toggle_breakpoint() end, { desc = 'Debug Toggle breakpoint' }); -set('n', 'dc', function() dap.continue() end, { desc = 'Debug Continue' }); -set('n', 'do', function() dap.step_over() end, { desc = 'Debug Step over' }); -set('n', 'di', function() dap.step_out() end, { desc = 'Debug Step into' }); -set('n', 'dr', function() dap.repl.open() end, { desc = 'Debug Toggle repl' }); +set("n", "db", function() + dap.toggle_breakpoint() +end, { desc = "Debug Toggle breakpoint" }) +set("n", "dc", function() + dap.continue() +end, { desc = "Debug Continue" }) +set("n", "do", function() + dap.step_over() +end, { desc = "Debug Step over" }) +set("n", "di", function() + dap.step_out() +end, { desc = "Debug Step into" }) +set("n", "dr", function() + dap.repl.open() +end, { desc = "Debug Toggle repl" }) dap.adapters.gdb = { - type = "executable", - command = "gdb", - args = { "--interpreter=dap", "--eval-command", "set print pretty on" } + type = "executable", + command = "gdb", + args = { "--interpreter=dap", "--eval-command", "set print pretty on" }, } dap.configurations.c = { - { - name = "Launch", - type = "gdb", - request = "launch", - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') - end, - cwd = "${workspaceFolder}", - stopAtBeginningOfMainSubprogram = false, - }, - { - name = "Select and attach to process", - type = "gdb", - request = "attach", - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') - end, - pid = function() - local name = vim.fn.input('Executable name (filter): ') - return require("dap.utils").pick_process({ filter = name }) - end, - cwd = '${workspaceFolder}' - }, - { - name = 'Attach to gdbserver :1234', - type = 'gdb', - request = 'attach', - target = 'localhost:1234', - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') - end, - cwd = '${workspaceFolder}' - }, + { + name = "Launch", + type = "gdb", + request = "launch", + program = function() + return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") + end, + cwd = "${workspaceFolder}", + stopAtBeginningOfMainSubprogram = false, + }, + { + name = "Select and attach to process", + type = "gdb", + request = "attach", + program = function() + return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") + end, + pid = function() + local name = vim.fn.input("Executable name (filter): ") + return require("dap.utils").pick_process({ filter = name }) + end, + cwd = "${workspaceFolder}", + }, + { + name = "Attach to gdbserver :1234", + type = "gdb", + request = "attach", + target = "localhost:1234", + program = function() + return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") + end, + cwd = "${workspaceFolder}", + }, } diff --git a/lua/configs/nvimtree.lua b/lua/configs/nvimtree.lua index e5207a1..e53f29e 100644 --- a/lua/configs/nvimtree.lua +++ b/lua/configs/nvimtree.lua @@ -1,83 +1,83 @@ local options = { - filters = { - dotfiles = false, - git_ignored = true, - custom = { ".git", "__pycache__" }, - exclude = { ".gitignore", ".gitattributes", ".gitmodules", ".github" }, - }, - disable_netrw = true, - hijack_netrw = true, - hijack_cursor = true, - hijack_unnamed_buffer_when_opening = false, - sync_root_with_cwd = true, - update_focused_file = { - enable = true, - update_root = false, - }, - view = { - side = "right", - width = 60, - number = true, - adaptive_size = false, - preserve_window_proportions = true, - }, - git = { - enable = true, - ignore = true, - }, - sort = { - sorter = "case_sensitive", - }, - filesystem_watchers = { - enable = true, - }, - actions = { - open_file = { - resize_window = true, - }, - }, - renderer = { - root_folder_label = false, - group_empty = true, - indent_width = 2, - highlight_git = true, - highlight_opened_files = "none", - indent_markers = { - enable = true, - }, - icons = { - show = { - file = true, - folder = true, - folder_arrow = true, - git = true, - }, + filters = { + dotfiles = false, + git_ignored = true, + custom = { ".git", "__pycache__" }, + exclude = { ".gitignore", ".gitattributes", ".gitmodules", ".github" }, + }, + disable_netrw = true, + hijack_netrw = true, + hijack_cursor = true, + hijack_unnamed_buffer_when_opening = false, + sync_root_with_cwd = true, + update_focused_file = { + enable = true, + update_root = false, + }, + view = { + side = "right", + width = 60, + number = true, + adaptive_size = false, + preserve_window_proportions = true, + }, + git = { + enable = true, + ignore = true, + }, + sort = { + sorter = "case_sensitive", + }, + filesystem_watchers = { + enable = true, + }, + actions = { + open_file = { + resize_window = true, + }, + }, + renderer = { + root_folder_label = false, + group_empty = true, + indent_width = 2, + highlight_git = true, + highlight_opened_files = "none", + indent_markers = { + enable = true, + }, + icons = { + show = { + file = true, + folder = true, + folder_arrow = true, + git = true, + }, - glyphs = { - default = "󰈚", - symlink = "", - folder = { - default = "", - empty = "", - empty_open = "", - open = "", - symlink = "", - symlink_open = "", - arrow_open = "", - arrow_closed = "", - }, - git = { - unstaged = "✗", - staged = "✓", - unmerged = "", - renamed = "➜", - untracked = "★", - deleted = "", - ignored = "◌", - }, - }, - }, - }, + glyphs = { + default = "󰈚", + symlink = "", + folder = { + default = "", + empty = "", + empty_open = "", + open = "", + symlink = "", + symlink_open = "", + arrow_open = "", + arrow_closed = "", + }, + git = { + unstaged = "✗", + staged = "✓", + unmerged = "", + renamed = "➜", + untracked = "★", + deleted = "", + ignored = "◌", + }, + }, + }, + }, } require("nvim-tree").setup(options) diff --git a/lua/configs/ufo.lua b/lua/configs/ufo.lua index 54aa9e0..97de380 100644 --- a/lua/configs/ufo.lua +++ b/lua/configs/ufo.lua @@ -1,7 +1,7 @@ require("ufo").setup({ - provider_selector = function(bufnr, filetype, buftype) - return { 'treesitter', 'indent' } - end + provider_selector = function(bufnr, filetype, buftype) + return { "treesitter", "indent" } + end, }) local set = vim.keymap.set diff --git a/lua/configs/zenmode.lua b/lua/configs/zenmode.lua index 9578996..19358ee 100644 --- a/lua/configs/zenmode.lua +++ b/lua/configs/zenmode.lua @@ -1,15 +1,15 @@ local set = vim.keymap.set set("n", "zz", function() - require("zen-mode").setup({ - window = { - width = 150, - options = {} - }, - }) - require("zen-mode").toggle() + require("zen-mode").setup({ + window = { + width = 150, + options = {}, + }, + }) + require("zen-mode").toggle() - vim.wo.wrap = false - vim.wo.number = true - vim.wo.rnu = true + vim.wo.wrap = false + vim.wo.number = true + vim.wo.rnu = true end) diff --git a/lua/mappings.lua b/lua/mappings.lua index f5f9048..fdbbb45 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -7,24 +7,36 @@ map("n", "ch", "NvCheatsheet", { desc = "General Toggle nvcheat -- File map("n", "", "w", { desc = "File Save" }) -map("n", "f", function() require("conform").format({ lsp_fallback = true }) end, { desc = "File Format" }) +map("n", "f", function() + require("conform").format({ lsp_fallback = true }) +end, { desc = "File Format" }) -- Buffer map("n", "b", "enew", { desc = "Buffer new" }) -map("n", "", function() require("nvchad.tabufline").next() end, { desc = "Buffer goto next" }) -map("n", "", function() require("nvchad.tabufline").prev() end, { desc = "Buffer goto prev" }) -map("n", "x", function() require("nvchad.tabufline").close_buffer() end, { desc = "Buffer Close" }) +map("n", "", function() + require("nvchad.tabufline").next() +end, { desc = "Buffer goto next" }) +map("n", "", function() + require("nvchad.tabufline").prev() +end, { desc = "Buffer goto prev" }) +map("n", "x", function() + require("nvchad.tabufline").close_buffer() +end, { desc = "Buffer Close" }) -- nvimtree map("n", "pv", "NvimTreeToggle", { desc = "nvimtree toggle window" }) -- Terminal map("t", "", "", { desc = "Terminal Escape terminal mode" }) -map("n", "h", function() require("nvchad.term").new { pos = "sp" } end, { desc = "Terminal New horizontal term" }) -map({ "n", "t" }, "", function() require("nvchad.term").toggle { pos = "sp", id = "htoggleTerm" } end, - { desc = "Terminal New horizontal term" }) -map({ "n", "t" }, "", function() require("nvchad.term").toggle { pos = "float", id = "floatTerm" } end, - { desc = "Terminal Toggle floating term" }) +map("n", "h", function() + require("nvchad.term").new({ pos = "sp" }) +end, { desc = "Terminal New horizontal term" }) +map({ "n", "t" }, "", function() + require("nvchad.term").toggle({ pos = "sp", id = "htoggleTerm" }) +end, { desc = "Terminal New horizontal term" }) +map({ "n", "t" }, "", function() + require("nvchad.term").toggle({ pos = "float", id = "floatTerm" }) +end, { desc = "Terminal Toggle floating term" }) -- Vertical map("n", "", "zz", { desc = "Vertical Scroll down and keep cursor in same position" }) @@ -33,8 +45,12 @@ map("n", "", "zz", { desc = "Vertical Scroll up and keep cursor in sam -- Find/Replace map("n", "n", "nzzzv", { desc = "Find/Replace Move to next match" }) map("n", "N", "Nzzzv", { desc = "Find/Replace Move to previous match" }) -map("n", "s", [[:%s/\<\>//gI]], - { desc = "Find/Replace Replace current word" }) +map( + "n", + "s", + [[:%s/\<\>//gI]], + { desc = "Find/Replace Replace current word" } +) -- Editing map("v", "J", ":m '>+1gv=gv", { desc = "Editing Move line down" }) @@ -52,20 +68,24 @@ map("n", "j", "lprevzz", { desc = "Navigation Move to previous -- Telescope map("n", "pf", "Telescope find_files", { desc = "Telescope Find files" }) -map("n", "pa", "Telescope find_files follow=true no_ignore=true hidden=true", - { desc = "Telescope Find all files" }) +map( + "n", + "pa", + "Telescope find_files follow=true no_ignore=true hidden=true", + { desc = "Telescope Find all files" } +) map("n", "ps", "Telescope live_grep", { desc = "Telescope Live grep" }) map("n", "pz", "Telescope current_buffer_fuzzy_find", { desc = "Telescope Find in current buffer" }) map("n", "pws", function() - local word = vim.fn.expand("") - require('telescope.builtin').grep_string({ search = word }) + local word = vim.fn.expand("") + require("telescope.builtin").grep_string({ search = word }) end, { desc = "Telescope Search for current word" }) map("n", "pWs", function() - local word = vim.fn.expand("") - require('telescope.builtin').grep_string({ search = word }) + local word = vim.fn.expand("") + require("telescope.builtin").grep_string({ search = word }) end, { desc = "Telescope Search for current WORD" }) map("n", "ws", function() - require('telescope.builtin').lsp_document_symbols({ ignore_symbols = 'variable' }) + require("telescope.builtin").lsp_document_symbols({ ignore_symbols = "variable" }) end, { desc = "Telescope View workspace symbols" }) -- Undotree diff --git a/lua/options.lua b/lua/options.lua index f8f2162..f30ab12 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -1,11 +1,11 @@ -require "nvchad.options" +require("nvchad.options") local o = vim.o local opt = vim.opt local g = vim.g -g.mapleader = ' ' -g.maplocalleader = ' ' +g.mapleader = " " +g.maplocalleader = " " opt.nu = true opt.relativenumber = true @@ -29,7 +29,7 @@ opt.termguicolors = true opt.scrolloff = 8 opt.isfname:append("@-@") -o.foldcolumn = '0' +o.foldcolumn = "0" o.foldlevel = 99 o.foldlevelstart = 99 o.foldenable = true diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 262fb4b..7abc60b 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,63 +1,115 @@ return { - { "sitiom/nvim-numbertoggle", lazy = false, }, - { "junegunn/gv.vim", cmd = { "GV" } }, - { "mbbill/undotree", cmd = { "UndotreeToggle" } }, - { "folke/trouble.nvim", cmd = { "Trouble" }, opts = {} }, - { "zbirenbaum/copilot.lua", event = "InsertEnter", config = function() require("configs.copilot") end }, - { "nvim-tree/nvim-tree.lua", cmd = { "NvimTreeToggle", "NvimTreeFocus" }, config = function() require("configs.nvimtree") end }, - { "folke/zen-mode.nvim", keys = { "zz" }, config = function() require("configs.zenmode") end }, - { "stevearc/conform.nvim", config = function() require("configs.conform") end }, - { "mfussenegger/nvim-dap", lazy = false, }, - { "rcarriga/nvim-dap-ui", dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" }, config = function() require("configs.nvim-dap") end, lazy = false }, - { - "hrsh7th/nvim-cmp", - dependencies = { { "zbirenbaum/copilot-cmp", config = function() require("copilot_cmp").setup() end, }, }, - opts = { - sources = { - { name = "nvim_lsp", group_index = 2 }, - { name = "copilot", group_index = 2 }, - { name = "luasnip", group_index = 2 }, - { name = "buffer", group_index = 2 }, - { name = "nvim_lua", group_index = 2 }, - { name = "path", group_index = 2 }, - }, - }, - }, - { "kylechui/nvim-surround", event = "VeryLazy", opts = {} }, - { - "tpope/vim-fugitive", - keys = { - { "gs", "Git", desc = "Git Toggle window" }, - { "gu", "diffget //2", desc = "Git Diff right side" }, - { "gh", "diffget //3", desc = "Git Diff left side" }, - }, - }, - { - "iamcco/markdown-preview.nvim", - cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, - build = "cd app && yarn install", - init = function() vim.g.mkdp_filetypes = { "markdown" } end, - ft = { "markdown" }, - }, - { - "neovim/nvim-lspconfig", - dependencies = { "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim" }, - config = function() - require("nvchad.configs.lspconfig").defaults() - require("configs.lspconfig") - end, - }, - { - "ThePrimeagen/harpoon", - branch = "harpoon2", - dependencies = { "nvim-lua/plenary.nvim" }, - keys = { "a", "", "", "", "", "", "", "", "", "" }, - config = function() require("configs.harpoon") end, - }, - { - "kevinhwang91/nvim-ufo", - lazy = false, - dependencies = { "kevinhwang91/promise-async" }, - config = function() require("configs.ufo") end, - }, + { "sitiom/nvim-numbertoggle", lazy = false }, + { "junegunn/gv.vim", cmd = { "GV" } }, + { "mbbill/undotree", cmd = { "UndotreeToggle" } }, + { "folke/trouble.nvim", cmd = { "Trouble" }, opts = {} }, + { + "zbirenbaum/copilot.lua", + event = "InsertEnter", + config = function() + require("configs.copilot") + end, + }, + { + "nvim-tree/nvim-tree.lua", + cmd = { "NvimTreeToggle", "NvimTreeFocus" }, + config = function() + require("configs.nvimtree") + end, + }, + { + "folke/zen-mode.nvim", + keys = { "zz" }, + config = function() + require("configs.zenmode") + end, + }, + { + "stevearc/conform.nvim", + config = function() + require("configs.conform") + end, + }, + { "mfussenegger/nvim-dap", lazy = false }, + { + "rcarriga/nvim-dap-ui", + dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" }, + config = function() + require("configs.nvim-dap") + end, + lazy = false, + }, + { + "hrsh7th/nvim-cmp", + dependencies = { { + "zbirenbaum/copilot-cmp", + config = function() + require("copilot_cmp").setup() + end, + } }, + opts = { + sources = { + { name = "nvim_lsp", group_index = 2 }, + { name = "copilot", group_index = 2 }, + { name = "luasnip", group_index = 2 }, + { name = "buffer", group_index = 2 }, + { name = "nvim_lua", group_index = 2 }, + { name = "path", group_index = 2 }, + }, + }, + }, + { "kylechui/nvim-surround", event = "VeryLazy", opts = {} }, + { + "tpope/vim-fugitive", + keys = { + { "gs", "Git", desc = "Git Toggle window" }, + { "gu", "diffget //2", desc = "Git Diff right side" }, + { "gh", "diffget //3", desc = "Git Diff left side" }, + }, + }, + { + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + build = "cd app && yarn install", + init = function() + vim.g.mkdp_filetypes = { "markdown" } + end, + ft = { "markdown" }, + }, + { + "neovim/nvim-lspconfig", + dependencies = { "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim" }, + config = function() + require("nvchad.configs.lspconfig").defaults() + require("configs.lspconfig") + end, + }, + { + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, + keys = { + "a", + "", + "", + "", + "", + "", + "", + "", + "", + "", + }, + config = function() + require("configs.harpoon") + end, + }, + { + "kevinhwang91/nvim-ufo", + lazy = false, + dependencies = { "kevinhwang91/promise-async" }, + config = function() + require("configs.ufo") + end, + }, }