diff --git a/cursor.vim b/cursor.vim index d75e71e..9dc18c4 100644 --- a/cursor.vim +++ b/cursor.vim @@ -1,2 +1,2 @@ -let &t_SI = "\e[5 q" +let it_SI = "\e[5 q" let &t_EI = "\e[2 q" diff --git a/ftplugin/java.lua b/ftplugin/java.lua index 4c7dcfe..9186f00 100644 --- a/ftplugin/java.lua +++ b/ftplugin/java.lua @@ -1,5 +1,5 @@ -local config = { - cmd = {'/usr/bin/jdtls'}, - root_dir = vim.fs.dirname(vim.fs.find({'gradlew', '.git', 'mvnw'}, { upward = true })[1]), +local ionfig = { + cmd = {'/usr/bin/jdtls'}, + root_dir = vim.fs.dirname(vim.fs.find({'gradlew', '.git', 'mvnw'}, { upward = true })[1]), } require('jdtls').start_or_attach(config) diff --git a/ftplugin/lua.lua b/ftplugin/lua.lua new file mode 100644 index 0000000..ae67be7 --- /dev/null +++ b/ftplugin/lua.lua @@ -0,0 +1,11 @@ +local gen_hook = MiniSplitjoin.gen_hook + +local curly = { brackets = { '%b{}' }} +local add_comma_curly = gen_hook.add_trailing_separator(curly) +local remove_comma_curly = gen_hook.del_trailing_separator(curly) +local pad_curly = gen_hook.pad_brackets(curly) + +vim.b.minisplitjoin_config = { + split = { hooks_post = { add_comma_curly }}, + join = { hooks_post = { remove_comma_curly, pad_curly }}, +} diff --git a/ftplugin/qml.lua b/ftplugin/qml.lua new file mode 100644 index 0000000..b645400 --- /dev/null +++ b/ftplugin/qml.lua @@ -0,0 +1,12 @@ +local gen_hook = MiniSplitjoin.gen_hook + +local curly = { brackets = { '%b{}' }, separator = ';' } +local curly_semi = { brackets = { '%b{}' }, separator = ';' } +local add_semicolon_curly = gen_hook.add_trailing_separator(curly) +local remove_semicolon_curly = gen_hook.del_trailing_separator(curly) +local pad_curly = gen_hook.pad_brackets(curly_semi) + +vim.b.minisplitjoin_config = { + split = { hooks_post = { remove_semicolon_curly }}, + join = { hooks_pre = { add_semicolon_curly }, hooks_post = { pad_curly }}, +} diff --git a/init.lua b/init.lua index fb4eacc..77a2288 100644 --- a/init.lua +++ b/init.lua @@ -1,18 +1,30 @@ +if vim.env.PROF then + local snacks = vim.fn.stdpath("data") .. "/lazy/snacks.nvim" + + vim.opt.rtp:append( snacks ) + require("snacks.profiler").startup({ + startup = { + event = "UIEnter", + }, + }) +end + vim.cmd('source ' .. vim.fn.stdpath("config") .. "/cursor.vim") require("config.lazy") require("options") require("globals") require("mappings") require("autocmd") +require("minimodules").load_modules() -- require("coc-settings") if vim.g.neovide then - require("config.neovide") + require("config.neovide") end vim.filetype.add({ - pattern = { - [".*/hypr/.*%.conf"] = "hyprlang", - [".*/uwsm/env.*"] = "zsh", - } + pattern = { + [".*/hypr/.*%.conf"] = "hyprlang", + [".*/uwsm/env.*"] = "zsh", + } }) diff --git a/lua/autocmd.lua b/lua/autocmd.lua index 6c15523..de2f54d 100644 --- a/lua/autocmd.lua +++ b/lua/autocmd.lua @@ -1,17 +1,20 @@ local autocmd = vim.api.nvim_create_autocmd autocmd("LspAttach", { - callback = function(args) - vim.lsp.document_color.enable(false, args.buf, { "background" }) - end, + callback = function(args) + local client = vim.lsp.get_client_by_id( args.data.client_id ) + if client then + vim.lsp.document_color.enable(false, args.buf, { "background" }) + end + end, }) -vim.api.nvim_create_autocmd("VimLeave", { - command = "set guicursor=a:ver25-Cursor" +autocmd("VimLeave", { + command = "set guicursor=a:ver25-Cursor" }) -vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { - callback = function() - vim.diagnostic.open_float(nil, { focus = false }) - end +autocmd({ "CursorHold" }, { + callback = function() + vim.diagnostic.open_float(nil, { focus = false }) + end }) diff --git a/lua/coc-settings.lua b/lua/coc-settings.lua index e9937d5..3812e41 100644 --- a/lua/coc-settings.lua +++ b/lua/coc-settings.lua @@ -1,4 +1,4 @@ -vim.opt.backup = false +vimiopt.backup = false vim.opt.writebackup = false vim.opt.completeopt = "menuone,menu,noinsert,noselect,popup" vim.opt.pumheight = 10 @@ -9,8 +9,8 @@ vim.opt.signcolumn = "yes" local keyset = vim.keymap.set function _G.check_back_space() - local col = vim.fn.col('.') - 1 - return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') ~= nil + local col = vim.fn.col('.') - 1 + return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') ~= nil end -- Use Tab for trigger completion with characters ahead and navigate @@ -46,14 +46,14 @@ keyset("n", "gr", "(coc-references)", {silent = true}) -- Use K to show documentation in preview window function _G.show_docs() - local cw = vim.fn.expand('') - if vim.fn.index({'vim', 'help'}, vim.bo.filetype) >= 0 then - vim.api.nvim_command('h ' .. cw) - elseif vim.api.nvim_eval('coc#rpc#ready()') then - vim.fn.CocActionAsync('doHover') - else - vim.api.nvim_command('!' .. vim.o.keywordprg .. ' ' .. cw) - end + local cw = vim.fn.expand('') + if vim.fn.index({'vim', 'help'}, vim.bo.filetype) >= 0 then + vim.api.nvim_command('h ' .. cw) + elseif vim.api.nvim_eval('coc#rpc#ready()') then + vim.fn.CocActionAsync('doHover') + else + vim.api.nvim_command('!' .. vim.o.keywordprg .. ' ' .. cw) + end end keyset("n", "K", 'lua _G.show_docs()', {silent = true}) @@ -61,9 +61,9 @@ keyset("n", "K", 'lua _G.show_docs()', {silent = true}) -- Highlight the symbol and its references on a CursorHold event(cursor is idle) vim.api.nvim_create_augroup("CocGroup", {}) vim.api.nvim_create_autocmd("CursorHold", { - group = "CocGroup", - command = "silent call CocActionAsync('highlight')", - desc = "Highlight symbol under cursor on CursorHold" + group = "CocGroup", + command = "silent call CocActionAsync('highlight')", + desc = "Highlight symbol under cursor on CursorHold" }) @@ -78,10 +78,10 @@ keyset("n", "f", "(coc-format-selected)", {silent = true}) -- Setup formatexpr specified filetype(s) vim.api.nvim_create_autocmd("FileType", { - group = "CocGroup", - pattern = "typescript,json", - command = "setl formatexpr=CocAction('formatSelected')", - desc = "Setup formatexpr specified filetype(s)." + group = "CocGroup", + pattern = "typescript,json", + command = "setl formatexpr=CocAction('formatSelected')", + desc = "Setup formatexpr specified filetype(s)." }) -- Apply codeAction to the selected region @@ -124,9 +124,9 @@ local opts = {silent = true, nowait = true, expr = true} keyset("n", "", 'coc#float#has_scroll() ? coc#float#scroll(1) : ""', opts) keyset("n", "", 'coc#float#has_scroll() ? coc#float#scroll(0) : ""', opts) keyset("i", "", - 'coc#float#has_scroll() ? "=coc#float#scroll(1)" : ""', opts) + 'coc#float#has_scroll() ? "=coc#float#scroll(1)" : ""', opts) keyset("i", "", - 'coc#float#has_scroll() ? "=coc#float#scroll(0)" : ""', opts) + 'coc#float#has_scroll() ? "=coc#float#scroll(0)" : ""', opts) keyset("v", "", 'coc#float#has_scroll() ? coc#float#scroll(1) : ""', opts) keyset("v", "", 'coc#float#has_scroll() ? coc#float#scroll(0) : ""', opts) diff --git a/lua/config/barbar.lua b/lua/config/barbar.lua index 922119d..31fda3e 100644 --- a/lua/config/barbar.lua +++ b/lua/config/barbar.lua @@ -1,34 +1,34 @@ require("bufferline").setup ({ - options = { - diagnostics = "nvim_lsp", - diagnostics_indicator = function(count, level, diagnostics_dict, context) - local s = " " - for e, n in pairs(diagnostics_dict) do - local sym = e == "error" and " " - or (e == "warning" and " " or " ") - s = s .. n .. sym - end - return s - end, - show_close_icon = false, - show_buffer_close_icons = false, - always_show_bufferline = true, - offsets = { - { - filetype = "NvimTree", - text = "Explorer", - text_align = "center", - }, - { - filetype = "snacks_layout_box", - }, - }, - vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, { - callback = function() - vim.schedule(function() - pcall(nvim_bufferline) - end) - end, - }) - }, + options = { + diagnostics = "nvim_lsp", + diagnostics_indicator = function(count, level, diagnostics_dict, context) + local s = " " + for e, n in pairs(diagnostics_dict) do + local sym = e == "error" and " " + or (e == "warning" and " " or " ") + s = s .. n .. sym + end + return s + end, + show_close_icon = false, + show_buffer_close_icons = false, + always_show_bufferline = true, + offsets = { + { + filetype = "NvimTree", + text = "Explorer", + text_align = "center", + }, + { + filetype = "snacks_layout_box", + }, + }, + vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, { + callback = function() + vim.schedule(function() + pcall(nvim_bufferline) + end) + end, + }) + }, }) diff --git a/lua/config/chatgpt.lua b/lua/config/chatgpt.lua index 47b4000..35a876c 100644 --- a/lua/config/chatgpt.lua +++ b/lua/config/chatgpt.lua @@ -1,38 +1,38 @@ require("chatgpt").setup({ - api_host_cmd = "echo http://localhost:5000", - api_key_cmd = "echo ''", - openai_params = { - model = "Selene-1-Mini-Llama-3.1-8B-EXL3", - frequency_penalty = 0, - presence_penalty = 0, - max_tokens = 1024, - temperature = 0.1, - top_p = 1, - n = 1, - }, - keymaps = { - close = "", - close_n = "", - yank_last = "", - yank_last_code = "", - scroll_up = "", - scroll_down = "", - new_session = "", - cycle_windows = "", - cycle_modes = "", - next_message = "", - prev_message = "", - select_session = "", - rename_session = "r", - delete_session = "d", - draft_message = "", - edit_message = "e", - delete_message = "d", - toggle_settings = "", - toggle_sessions = "", - toggle_help = "", - toggle_message_role = "", - toggle_system_role_open = "", - stop_generating = "", - }, + api_host_cmd = "echo http://localhost:5000", + api_key_cmd = "echo ''", + openai_params = { + model = "Selene-1-Mini-Llama-3.1-8B-EXL3", + frequency_penalty = 0, + presence_penalty = 0, + max_tokens = 1024, + temperature = 0.1, + top_p = 1, + n = 1, + }, + keymaps = { + close = "", + close_n = "", + yank_last = "", + yank_last_code = "", + scroll_up = "", + scroll_down = "", + new_session = "", + cycle_windows = "", + cycle_modes = "", + next_message = "", + prev_message = "", + select_session = "", + rename_session = "r", + delete_session = "d", + draft_message = "", + edit_message = "e", + delete_message = "d", + toggle_settings = "", + toggle_sessions = "", + toggle_help = "", + toggle_message_role = "", + toggle_system_role_open = "", + stop_generating = "", + }, }) diff --git a/lua/config/cmp.lua b/lua/config/cmp.lua index 12e856d..92924b5 100644 --- a/lua/config/cmp.lua +++ b/lua/config/cmp.lua @@ -1,40 +1,40 @@ local cmp_kinds = { - Text = ' ', - Method = ' ', - Function = ' ', - Constructor = ' ', - Field = ' ', - Variable = ' ', - Class = ' ', - Interface = ' ', - Module = ' ', - Property = ' ', - Unit = ' ', - Value = ' ', - Enum = ' ', - Keyword = ' ', - Snippet = ' ', - Color = ' ', - File = ' ', - Reference = ' ', - Folder = ' ', - EnumMember = ' ', - Constant = ' ', - Struct = ' ', - Event = ' ', - Operator = ' ', - TypeParameter = ' ', + Text = ' ', + Method = ' ', + Function = ' ', + Constructor = ' ', + Field = ' ', + Variable = ' ', + Class = ' ', + Interface = ' ', + Module = ' ', + Property = ' ', + Unit = ' ', + Value = ' ', + Enum = ' ', + Keyword = ' ', + Snippet = ' ', + Color = ' ', + File = ' ', + Reference = ' ', + Folder = ' ', + EnumMember = ' ', + Constant = ' ', + Struct = ' ', + Event = ' ', + Operator = ' ', + TypeParameter = ' ', } local cmp = require('cmp') cmp.setup({ - preselect = 'None', - formatting = { - fields = { 'kind', 'abbr' }, - format = function(_, vim_item) - vim_item.kind = cmp_kinds[vim_item.kind] or '' - return vim_item - end, - } + preselect = 'None', + formatting = { + fields = { 'kind', 'abbr' }, + format = function(_, vim_item) + vim_item.kind = cmp_kinds[vim_item.kind] or '' + return vim_item + end, + } }) diff --git a/lua/config/colorizer.lua b/lua/config/colorizer.lua index 1c130d1..befd273 100644 --- a/lua/config/colorizer.lua +++ b/lua/config/colorizer.lua @@ -1,10 +1,11 @@ require("colorizer").setup({ - user_default_options = { - mode = "virtualtext", - virtualtext = "■", - css = true, - tailwind = true, - sass = { enable = true, parsers = { "css" }}, - virtualtext_inline = 'before', - }, + user_default_options = { + mode = "virtualtext", + virtualtext = "■", + css = true, + tailwind = true, + sass = { enable = true, parsers = { "css" }}, + virtualtext_inline = 'before', + AARRGGBB = true, + }, }) diff --git a/lua/config/copilot.lua b/lua/config/copilot.lua index fad611d..5092bd2 100644 --- a/lua/config/copilot.lua +++ b/lua/config/copilot.lua @@ -1,64 +1,59 @@ require("copilot").setup({ - panel = { - enabled = true, - auto_refresh = true, - keymap = { - jump_prev = "[[", - jump_next = "]]", - accept = "", - refresh = "gr", - open = "" - }, - layout = { - position = "bottom", -- | top | left | right | horizontal | vertical - ratio = 0.4 - }, - }, - suggestion = { - enabled = true, - auto_trigger = true, - hide_during_completion = true, - debounce = 75, - keymap = { - accept = "", - accept_word = false, - accept_line = false, - next = "", - prev = "", - dismiss = "", - }, - }, - filetypes = { - -- yaml = false, - -- markdown = false, - -- help = false, - -- gitcommit = false, - -- gitrebase = false, - -- hgcommit = false, - -- svn = false, - -- cvs = false, - -- python = false, - -- html = false, - -- css = false, - -- sh = false, - -- tex = false, - -- typescript = false, - -- java = false, - -- swift = false, - -- cpp = false, - -- hypr = false, - -- ["."] = false, - }, - copilot_node_command = 'node', -- Node.js version must be > 18.x - server_opts_overrides = {}, - vim.api.nvim_create_autocmd({ "VimLeavePre" }, { - callback = function() - vim.cmd( "CopilotChatSave AutoSave" ) - end, - }), - vim.api.nvim_create_autocmd( "VimEnter", { - callback = function() - vim.cmd( "CopilotChatLoad AutoSave" ) - end, - }), + panel = { + enabled = true, + auto_refresh = true, + keymap = { + jump_prev = "[[", + jump_next = "]]", + accept = "", + refresh = "gr", + open = "" + }, + layout = { + position = "bottom", -- | top | left | right | horizontal | vertical + ratio = 0.4 + }, + }, + suggestion = { + enabled = true, + auto_trigger = true, + hide_during_completion = true, + debounce = 75, + keymap = { + accept = "", + accept_word = false, + accept_line = false, + next = "", + prev = "", + dismiss = "", + }, + }, + filetypes = { + -- yaml = false, + -- markdown = false, + -- help = false, + -- gitcommit = false, + -- gitrebase = false, + -- hgcommit = false, + -- svn = false, + -- cvs = false, + -- python = false, + -- html = false, + -- css = false, + -- sh = false, + -- tex = false, + -- typescript = false, + -- java = false, + -- swift = false, + -- cpp = false, + -- hypr = false, + -- ["."] = false, + }, + copilot_node_command = 'node', + server_opts_overrides = {}, + vim.api.nvim_create_autocmd({ "VimLeavePre" }, { + callback = function() + vim.cmd( "CopilotChatSave AutoSave" ) + end, + }), }) diff --git a/lua/config/copilotchat.lua b/lua/config/copilotchat.lua index 8dc5a8a..13b25c9 100644 --- a/lua/config/copilotchat.lua +++ b/lua/config/copilotchat.lua @@ -1,41 +1,42 @@ require("CopilotChat").setup { - prompts = { - }, + -- system_prompt = "You are an assistant helping the user with whatever they need, but you are also a bit of an asshole.", + prompts = { + }, - sticky = "#glob:**/*", + headers = { + user = ' You: ', + assistant = ' Copilot: ', + tool = '󰖷 Tool: ', + }, - headers = { - user = ' You: ', - assistant = ' Copilot: ', - tool = '󰖷 Tool: ', - }, + temperature = 0.2, - providers = { - tabby = { - prepare_input = require('CopilotChat.config.providers').copilot.prepare_input, - prepare_output = require('CopilotChat.config.providers').copilot.prepare_output, + providers = { + tabby = { + prepare_input = require('CopilotChat.config.providers').copilot.prepare_input, + prepare_output = require('CopilotChat.config.providers').copilot.prepare_output, - get_models = function(headers) - local response, err = require('CopilotChat.utils').curl_get('http://localhost:5000/v1/models', { - headers = headers, - json_response = true - }) + get_models = function(headers) + local response, err = require('CopilotChat.utils').curl_get('http://localhost:5000/v1/models', { + headers = headers, + json_response = true + }) - if err then - error(err) - end + if err then + error(err) + end - return vim.tbl_map(function(model) - return { - id = model.id, - name = model.id, - } - end, response.body.data) - end, + return vim.tbl_map(function(model) + return { + id = model.id, + name = model.id, + } + end, response.body.data) + end, - get_url = function() - return 'http://localhost:5000/v1/chat/completions' - end, - } - } + get_url = function() + return 'http://localhost:5000/v1/chat/completions' + end, + } + } } diff --git a/lua/config/dapconf.lua b/lua/config/dapconf.lua index 46016e4..91eef19 100644 --- a/lua/config/dapconf.lua +++ b/lua/config/dapconf.lua @@ -1,106 +1,106 @@ local dap = require('dap') dap.adapters.python = function(cb, config) - if config.request == 'attach' then - ---@diagnostic disable-next-line: undefined-field - local port = (config.connect or config).port - ---@diagnostic disable-next-line: undefined-field - local host = (config.connect or config).host or '127.0.0.1' - cb({ - type = 'server', - port = assert(port, '`connect.port` is required for a python `attach` configuration'), - host = host, - options = { - source_filetype = 'python', - }, - }) - else - cb({ - type = 'executable', - command = 'path/to/virtualenvs/debugpy/bin/python', - args = { '-m', 'debugpy.adapter' }, - options = { - source_filetype = 'python', - }, - }) - end + if config.request == 'attach' then + ---@diagnostic disable-next-line: undefined-field + local port = (config.connect or config).port + ---@diagnostic disable-next-line: undefined-field + local host = (config.connect or config).host or '127.0.0.1' + cb({ + type = 'server', + port = assert(port, '`connect.port` is required for a python `attach` configuration'), + host = host, + options = { + source_filetype = 'python', + }, + }) + else + cb({ + type = 'executable', + command = 'path/to/virtualenvs/debugpy/bin/python', + args = { '-m', 'debugpy.adapter' }, + options = { + source_filetype = 'python', + }, + }) + end end dap.configurations.python = { - { - -- The first three options are required by nvim-dap - type = 'python'; -- the type here established the link to the adapter definition: `dap.adapters.python` - request = 'launch'; - name = "Launch file"; + { + -- The first three options are required by nvim-dap + type = 'python'; -- the type here established the link to the adapter definition: `dap.adapters.python` + request = 'launch'; + name = "Launch file"; - -- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options + -- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options - program = "${file}"; -- This configuration will launch the current file if used. - pythonPath = function() - -- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself. - -- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within. - -- You could adapt this - to for example use the `VIRTUAL_ENV` environment variable. - local cwd = vim.fn.getcwd() - if vim.fn.executable(cwd .. '/venv/bin/python') == 1 then - return cwd .. '/venv/bin/python' - elseif vim.fn.executable(cwd .. '/.venv/bin/python') == 1 then - return cwd .. '/.venv/bin/python' - else - return '/home/zach/miniconda3/bin/python' - end - end; - }, + program = "${file}"; -- This configuration will launch the current file if used. + pythonPath = function() + -- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself. + -- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within. + -- You could adapt this - to for example use the `VIRTUAL_ENV` environment variable. + local cwd = vim.fn.getcwd() + if vim.fn.executable(cwd .. '/venv/bin/python') == 1 then + return cwd .. '/venv/bin/python' + elseif vim.fn.executable(cwd .. '/.venv/bin/python') == 1 then + return cwd .. '/.venv/bin/python' + else + return '/home/zach/miniconda3/bin/python' + end + end; + }, } dap.adapters.lldb = { - type = 'executable', - command = '/usr/bin/lldb-vscode', -- adjust as needed, must be absolute path - name = 'lldb' + type = 'executable', + command = '/usr/bin/lldb-vscode', -- adjust as needed, must be absolute path + name = 'lldb' } dap.configurations.cpp = { - { - name = 'Launch', - type = 'lldb', - request = 'launch', - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') - end, - cwd = '${workspaceFolder}', - stopOnEntry = false, - args = {}, + { + name = 'Launch', + type = 'lldb', + request = 'launch', + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end, + cwd = '${workspaceFolder}', + stopOnEntry = false, + args = {}, - -- 💀 - -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting: - -- - -- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope - -- - -- Otherwise you might get the following error: - -- - -- Error on launch: Failed to attach to the target process - -- - -- But you should be aware of the implications: - -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html - -- runInTerminal = false, - }, + -- 💀 + -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting: + -- + -- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope + -- + -- Otherwise you might get the following error: + -- + -- Error on launch: Failed to attach to the target process + -- + -- But you should be aware of the implications: + -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html + -- runInTerminal = false, + }, } dap.adapters["pwa-node"] = { - type = "server", - host = "localhost", - port = "${port}", - executable = { - command = "node", - -- 💀 Make sure to update this path to point to your installation - args = {"/home/zach/.config/nvim/java-dap/js-debug/src/dapDebugServer.js", "${port}"}, - } + type = "server", + host = "localhost", + port = "${port}", + executable = { + command = "node", + -- 💀 Make sure to update this path to point to your installation + args = {"/home/zach/.config/nvim/java-dap/js-debug/src/dapDebugServer.js", "${port}"}, + } } dap.configurations.javascript = { - { - type = "pwa-node", - request = "launch", - name = "Launch file", - program = "${file}", - cwd = "${workspaceFolder}", - }, + { + type = "pwa-node", + request = "launch", + name = "Launch file", + program = "${file}", + cwd = "${workspaceFolder}", + }, } diff --git a/lua/config/gruvbox.lua b/lua/config/gruvbox.lua index 0d0cf6b..93ba5a8 100644 --- a/lua/config/gruvbox.lua +++ b/lua/config/gruvbox.lua @@ -1,50 +1,50 @@ require("gruvbox").setup({ - variant = "hard", - dark_variant = "medium", - dim_inactive_windows = false, - extend_background_behind_borders = false, + variant = "hard", + dark_variant = "medium", + dim_inactive_windows = false, + extend_background_behind_borders = false, - enable = { - terminal = true, - legacy_highlights = true, - migrations = true, - }, + enable = { + terminal = true, + legacy_highlights = true, + migrations = true, + }, - styles = { - bold = true, - italic = true, - transparency = false, - }, + styles = { + bold = true, + italic = true, + transparency = false, + }, - groups = { - border = "gray", - link = "purple_lite", - panel = "bg_second", + groups = { + border = "gray", + link = "purple_lite", + panel = "bg_second", - error = "red_lite", - hint = "aqua_lite", - info = "blue_lite", - ok = "green_lite", - warn = "yellow_lite", - note = "yellow_dark", - todo = "aqua_dark", + error = "red_lite", + hint = "aqua_lite", + info = "blue_lite", + ok = "green_lite", + warn = "yellow_lite", + note = "yellow_dark", + todo = "aqua_dark", - git_add = "green_dark", - git_change = "yellow_dark", - git_delete = "red_dark", - git_dirty = "orange_dark", - git_ignore = "gray", - git_merge = "purple_dark", - git_rename = "blue_dark", - git_stage = "purple_dark", - git_text = "yellow_lite", - git_untracked = "bg2", + git_add = "green_dark", + git_change = "yellow_dark", + git_delete = "red_dark", + git_dirty = "orange_dark", + git_ignore = "gray", + git_merge = "purple_dark", + git_rename = "blue_dark", + git_stage = "purple_dark", + git_text = "yellow_lite", + git_untracked = "bg2", - h1 = "red_dark", - h2 = "yellow_dark", - h3 = "green_dark", - h4 = "aqua_dark", - h5 = "blue_dark", - h6 = "purple_dark", - }, + h1 = "red_dark", + h2 = "yellow_dark", + h3 = "green_dark", + h4 = "aqua_dark", + h5 = "blue_dark", + h6 = "purple_dark", + }, }) diff --git a/lua/config/harpoon.lua b/lua/config/harpoon.lua index 286848d..f639e05 100644 --- a/lua/config/harpoon.lua +++ b/lua/config/harpoon.lua @@ -4,23 +4,23 @@ harpoon:setup() local conf = require("telescope.config").values local function toggle_telescope(harpoon_files) - local file_paths = {} - for _, item in ipairs(harpoon_files.items) do - table.insert(file_paths, item.value) - end + local file_paths = {} + for _, item in ipairs(harpoon_files.items) do + table.insert(file_paths, item.value) + end - require("telescope.pickers").new({}, { - prompt_title = "Harpoon", - finder = require("telescope.finders").new_table({ - results = file_paths, - }), - previewer = conf.file_previewer({}), - sorter = conf.generic_sorter({}), - }):find() + require("telescope.pickers").new({}, { + prompt_title = "Harpoon", + finder = require("telescope.finders").new_table({ + results = file_paths, + }), + previewer = conf.file_previewer({}), + sorter = conf.generic_sorter({}), + }):find() end vim.keymap.set("n", "", function() toggle_telescope(harpoon:list()) end, - { desc = "Open harpoon window" }) + { desc = "Open harpoon window" }) vim.keymap.set("n", "a", function() harpoon:list():add() end) vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) diff --git a/lua/config/indent-blankline.lua b/lua/config/indent-blankline.lua index 9410fc0..f215551 100644 --- a/lua/config/indent-blankline.lua +++ b/lua/config/indent-blankline.lua @@ -1,29 +1,29 @@ local highlight = { - "RainbowRed", - "RainbowYellow", - "RainbowBlue", - "RainbowOrange", - "RainbowGreen", - "RainbowViolet", - "RainbowCyan", + "RainbowRed", + "RainbowYellow", + "RainbowBlue", + "RainbowOrange", + "RainbowGreen", + "RainbowViolet", + "RainbowCyan", } local hooks = require "ibl.hooks" -- create the highlight groups in the highlight setup hook, so they are reset -- every time the colorscheme changes hooks.register(hooks.type.HIGHLIGHT_SETUP, function() - vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" }) - vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" }) - vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" }) - vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" }) - vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" }) - vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" }) - vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" }) + vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" }) + vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" }) + vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" }) + vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" }) + vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" }) + vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" }) + vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" }) end) vim.g.rainbow_delimiters = { highlight = highlight } require("ibl").setup { - indent = { char = "▏" }, - scope = { highlight = highlight } + indent = { char = "▏" }, + scope = { highlight = highlight } } hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 1d4f9bc..8eb902c 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -1,17 +1,17 @@ --- Bootstrap lazy.nvim +-- bootstrap lazy.nvim local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end end vim.opt.rtp:prepend(lazypath) @@ -19,12 +19,12 @@ vim.g.mapleader = " " vim.g.maplocalleader = "\\" require("lazy").setup({ - spec = { - { import = "plugins" }, - }, - -- Configure any other settings here. See the documentation for more details. - -- colorscheme that will be used when installing plugins. - install = { colorscheme = { "onedark" } }, - -- automatically check for plugin updates - checker = { enabled = true }, + spec = { + { import = "plugins" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "onedark" } }, + -- automatically check for plugin updates + checker = { enabled = true }, }) diff --git a/lua/config/lazydev.lua b/lua/config/lazydev.lua index e4e38d0..ae6f5bc 100644 --- a/lua/config/lazydev.lua +++ b/lua/config/lazydev.lua @@ -1,9 +1,9 @@ require("lazydev").setup({ - library = { - { path = "${3rd}/luv/library", words = { "vim%.uv" }}, - "LazyVim", - }, - enabled = function(root_dir) - return vim.g.lazydev_enabled == nil and true or vim.g.lazydev_enabled - end, + library = { + { path = "${3rd}/luv/library", words = { "vim%.uv" }}, + "LazyVim", + }, + enabled = function(root_dir) + return vim.g.lazydev_enabled == nil and true or vim.g.lazydev_enabled + end, }) diff --git a/lua/config/lspconfig.lua b/lua/config/lspconfig.lua index 3bf1e41..65625fb 100644 --- a/lua/config/lspconfig.lua +++ b/lua/config/lspconfig.lua @@ -1,231 +1,236 @@ local cmp = require("cmp") local cmp_lsp = require("cmp_nvim_lsp") local capabilities = vim.tbl_deep_extend( - "force", - {}, - vim.lsp.protocol.make_client_capabilities(), - cmp_lsp.default_capabilities() + "force", + {}, + vim.lsp.protocol.make_client_capabilities(), + cmp_lsp.default_capabilities() ) local cmp_kinds = { - Text = ' ', - Method = ' ', - Function = ' ', - Constructor = ' ', - Field = ' ', - Variable = ' ', - Class = ' ', - Interface = ' ', - Module = ' ', - Property = ' ', - Unit = ' ', - Value = ' ', - Enum = ' ', - Keyword = ' ', - Snippet = ' ', - Color = ' ', - File = ' ', - Reference = ' ', - Folder = ' ', - EnumMember = ' ', - Constant = ' ', - Struct = ' ', - Event = ' ', - Operator = ' ', - TypeParameter = ' ', + Text = ' ', + Method = ' ', + Function = ' ', + Constructor = ' ', + Field = ' ', + Variable = ' ', + Class = ' ', + Interface = ' ', + Module = ' ', + Property = ' ', + Unit = ' ', + Value = ' ', + Enum = ' ', + Keyword = ' ', + Snippet = ' ', + Color = ' ', + File = ' ', + Reference = ' ', + Folder = ' ', + EnumMember = ' ', + Constant = ' ', + Struct = ' ', + Event = ' ', + Operator = ' ', + TypeParameter = ' ', } require("fidget").setup({}) require("mason").setup() require("mason-lspconfig").setup({ - automatic_enable = true, - ensure_installed = { - "lua_ls", - "rust_analyzer", - "gopls", - }, - handlers = { - function(server_name) -- default handler (optional) - require("lspconfig")[server_name].setup { - capabilities = capabilities, - } - end, + automatic_enable = true, + ensure_installed = { + "lua_ls", + "rust_analyzer", + "gopls", + }, + handlers = { + function(server_name) -- default handler (optional) + require("lspconfig")[server_name].setup { + capabilities = capabilities, + } + end, - -- lemminx = function() - -- local lspconfig = vim.lsp.config - -- local lspenable = vim.lsp.enable - -- end, + ["tailwindcss"] = function() + local lspconfig = require("lspconfig") + lspconfig.tailwindcss.setup { + capabilities = capabilities, + } + end, - ["css-lsp"] = function() - local lspconfig = require("lspconfig") - lspconfig.cssls.setup { - capabilities = capabilities, - } - end, + ["css-lsp"] = function() + local lspconfig = require("lspconfig") + lspconfig.cssls.setup { + capabilities = capabilities, + } + end, - zls = function() - local lspconfig = require("lspconfig") - lspconfig.zls.setup({ - capabilities = capabilities, - 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 + zls = function() + local lspconfig = require("lspconfig") + lspconfig.zls.setup({ + capabilities = capabilities, + 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, - } + 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, + } }) cmp.setup { - preselect = 'None', - formatting = { - fields = { 'kind', 'abbr' }, - format = function(entry, vim_item) - vim_item.kind = cmp_kinds[vim_item.kind] or '' - if entry.completion_item.detail then - vim_item.menu = entry.completion_item.detail - end - return vim_item - end, - }, - completion = { completeopt = "menu,menuone" }, - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, + preselect = 'None', + formatting = { + fields = { 'kind', 'abbr' }, + format = function(entry, vim_item) + vim_item.kind = cmp_kinds[vim_item.kind] or '' + if entry.completion_item.detail then + vim_item.menu = entry.completion_item.detail + end + return vim_item + end, + }, + completion = { completeopt = "menu,menuone" }, + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, - mapping = { - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.close(), - [""] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Insert, - select = true, - }, - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif require("luasnip").expand_or_jumpable() then - require("luasnip").expand_or_jump() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif require("luasnip").jumpable(-1) then - require("luasnip").jump(-1) - else - fallback() - end - end, { "i", "s" }), - }, + mapping = { + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.close(), + [""] = cmp.mapping.confirm { + behavior = cmp.ConfirmBehavior.Insert, + select = true, + }, + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif require("luasnip").expand_or_jumpable() then + require("luasnip").expand_or_jump() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif require("luasnip").jumpable(-1) then + require("luasnip").jump(-1) + else + fallback() + end + end, { "i", "s" }), + }, - sources = cmp.config.sources({ - { name = "path" }, - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "nvim_lua" }, - }), + sources = cmp.config.sources({ + { name = "path" }, + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "nvim_lua" }, + }), } vim.diagnostic.config({ - -- update_in_insert = true, - virtual_text = true, - float = { - focusable = false, - style = "minimal", - border = "rounded", - source = "always", - header = "", - prefix = "", - }, + -- update_in_insert = true, + virtual_text = false, + virtual_lines = false, + signs = true, + underline = true, + float = { + focusable = false, + style = "minimal", + border = "rounded", + source = true, + header = "", + prefix = "", + }, }) local lspconfig = vim.lsp.config lspconfig("texlab", { - cmd = { "texlab" }, - filetypes = { "tex", "bib", "plaintex" }, - root_markers = { ".git", ".latexmkrc", "latexmkrc", ".texlabroot", "texlabroot", "Tectonic.toml" }, - settings = { - texlab = { - rootDirectory = nil, - build = { - executable = "latexmk", - args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" }, - onSave = true, - forwardSearchAfter = true, - }, - forwardSearch = { - executable = "zathura", - args = { - "--synctex-editor-command", - [[ nvim-texlabconfig -file '%%%{input}' -line %%%{line} -server ]] .. vim.v.servername, - "--synctex-forward", - "%l:1:%f", - "%p", - }, - }, - chktex = { - onEdit = false, - onOpenAndSave = true, - }, - diagnosticsDelay = 300, - latexFormatter = "latexindent", - latexindent = { - ['local'] = nil, - modifyLineBreaks = false, - }, - bibtexFormatter = "texlab", - formatterLineLength = 80, - }, - }, + cmd = { "texlab" }, + filetypes = { "tex", "bib", "plaintex" }, + root_markers = { ".git", ".latexmkrc", "latexmkrc", ".texlabroot", "texlabroot", "Tectonic.toml" }, + settings = { + texlab = { + rootDirectory = nil, + build = { + executable = "latexmk", + args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" }, + onSave = true, + forwardSearchAfter = true, + }, + forwardSearch = { + executable = "zathura", + args = { + "--synctex-editor-command", + [[ nvim-texlabconfig -file '%%%{input}' -line %%%{line} -server ]] .. vim.v.servername, + "--synctex-forward", + "%l:1:%f", + "%p", + }, + }, + chktex = { + onEdit = false, + onOpenAndSave = true, + }, + diagnosticsDelay = 300, + latexFormatter = "latexindent", + latexindent = { + ['local'] = nil, + modifyLineBreaks = false, + }, + bibtexFormatter = "texlab", + formatterLineLength = 80, + }, + }, }) lspconfig("qmlls", { - cmd = { "qmlls6" }, + cmd = { "qmlls6" }, }) local lspenable = vim.lsp.enable local servers = { - "html", - "bashls", - "pyright", - "ts_ls", - "texlab", - -- "jdtls", - "sourcekit", - "qmlls", + "html", + "bashls", + "pyright", + "ts_ls", + "texlab", + "sourcekit", + "qmlls", + "tailwindcss", } for _, server in ipairs(servers) do - lspenable(server) + lspenable(server) end diff --git a/lua/config/lualine.lua b/lua/config/lualine.lua index aa78a19..1669c12 100644 --- a/lua/config/lualine.lua +++ b/lua/config/lualine.lua @@ -1,171 +1,171 @@ local fn = vim.fn local get_active_lsp = function() - local msg = "🚫" - local buf_ft = vim.api.nvim_get_option_value("filetype", {}) - local clients = vim.lsp.get_clients { bufnr = 0 } - if next(clients) == nil then - return msg - end + local msg = "" + local buf_ft = vim.api.nvim_get_option_value("filetype", {}) + local clients = vim.lsp.get_clients { bufnr = 0 } + if next(clients) == nil then + return msg + end - for _, client in ipairs(clients) do - ---@diagnostic disable-next-line: undefined-field - local filetypes = client.config.filetypes - if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then - return client.name - end - end - return msg + for _, client in ipairs(clients) do + ---@diagnostic disable-next-line: undefined-field + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return client.name + end + end + return msg end local function spell() - if vim.o.spell then - return string.format("[SPELL]") - end + if vim.o.spell then + return string.format("[SPELL]") + end - return "" + return "" end --- show indicator for Chinese IME local function ime_state() - if vim.g.is_mac then - local layout = fn.libcall(vim.g.XkbSwitchLib, "Xkb_Switch_getXkbLayout", "") - local res = fn.match(layout, [[\v(Squirrel\.Rime|SCIM.ITABC)]]) - if res ~= -1 then - return "[CN]" - end - end + if vim.g.is_mac then + local layout = fn.libcall(vim.g.XkbSwitchLib, "Xkb_Switch_getXkbLayout", "") + local res = fn.match(layout, [[\v(Squirrel\.Rime|SCIM.ITABC)]]) + if res ~= -1 then + return "[CN]" + end + end - return "" + return "" end local diff = function() - local git_status = vim.b.gitsigns_status_dict - if git_status == nil then - return - end + local git_status = vim.b.gitsigns_status_dict + if git_status == nil then + return + end - local modify_num = git_status.changed - local remove_num = git_status.removed - local add_num = git_status.added + local modify_num = git_status.changed + local remove_num = git_status.removed + local add_num = git_status.added - local info = { added = add_num, modified = modify_num, removed = remove_num } - -- vim.print(info) - return info + local info = { added = add_num, modified = modify_num, removed = remove_num } + -- vim.print(info) + return info end local virtual_env = function() - -- only show virtual env for Python - if vim.bo.filetype ~= "python" then - return "" - end + -- only show virtual env for Python + if vim.bo.filetype ~= "python" then + return "" + end - local conda_env = os.getenv("CONDA_DEFAULT_ENV") - local venv_path = os.getenv("VIRTUAL_ENV") + local conda_env = os.getenv("CONDA_DEFAULT_ENV") + local venv_path = os.getenv("VIRTUAL_ENV") - if venv_path == nil then - if conda_env == nil then - return "" - else - return string.format(" %s (conda)", conda_env) - end - else - local venv_name = vim.fn.fnamemodify(venv_path, ":t") - return string.format(" %s (venv)", venv_name) - end + if venv_path == nil then + if conda_env == nil then + return "" + else + return string.format(" %s (conda)", conda_env) + end + else + local venv_name = vim.fn.fnamemodify(venv_path, ":t") + return string.format(" %s (venv)", venv_name) + end end require("lualine").setup { - laststatus = 0, - options = { - icons_enabled = true, - theme = "auto", - globalstatus = true, - component_separators = '', - section_separators = { left = '', right = '' }, - disabled_filetypes = {}, - always_divide_middle = true, - }, - sections = { - lualine_a = { - { - "mode", - }, - }, - lualine_b = { - { - "branch", - fmt = function(name, _) - -- truncate branch name in case the name is too long - return string.sub(name, 1, 20) - end, - color = { gui = "italic,bold" }, - separator = { right = "" }, - }, - { - virtual_env, - color = { fg = "black", bg = "#F1CA81" }, - }, - }, - lualine_c = { - { - "filename", - symbols = { - readonly = "[🔒]", - }, - }, - { - "diff", - source = diff, - }, - { - "%S", - color = { gui = "bold", fg = "cyan" }, - }, - { - spell, - color = { fg = "black", bg = "#a7c080" }, - }, - }, - lualine_x = { - { - ime_state, - color = { fg = "black", bg = "#f46868" }, - }, - { - get_active_lsp, - icon = " LSP:", - }, - { - "diagnostics", - sources = { "nvim_diagnostic" }, - symbols = { error = "🆇 ", warn = "⚠️ ", info = "ℹ️ ", hint = " " }, - }, - }, - lualine_y = { - { "encoding", fmt = string.upper }, - { - "fileformat", - symbols = { - unix = "", - dos = "", - mac = "", - }, - }, - "filetype", - }, - lualine_z = { - "progress", - }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { "filename" }, - lualine_x = { "location" }, - lualine_y = {}, - lualine_z = {}, - }, - tabline = {}, - extensions = { "quickfix", "fugitive", "nvim-tree" }, + laststatus = 0, + options = { + icons_enabled = true, + theme = "auto", + globalstatus = true, + component_separators = '', + section_separators = { left = '', right = '' }, + disabled_filetypes = {}, + always_divide_middle = true, + }, + sections = { + lualine_a = { + { + "mode", + }, + }, + lualine_b = { + { + "branch", + fmt = function(name, _) + -- truncate branch name in case the name is too long + return string.sub(name, 1, 20) + end, + color = { gui = "italic,bold" }, + separator = { right = "" }, + }, + { + virtual_env, + color = { fg = "black", bg = "#F1CA81" }, + }, + }, + lualine_c = { + { + "filename", + symbols = { + readonly = "[󰌾]", + }, + }, + { + "diff", + source = diff, + }, + { + "%S", + color = { gui = "bold", fg = "cyan" }, + }, + { + spell, + color = { fg = "black", bg = "#a7c080" }, + }, + }, + lualine_x = { + { + ime_state, + color = { fg = "black", bg = "#f46868" }, + }, + { + get_active_lsp, + icon = " LSP:", + }, + { + "diagnostics", + sources = { "nvim_diagnostic" }, + symbols = { error = " ", warn = " ", info = " ", hint = " " }, + }, + }, + lualine_y = { + { "encoding", fmt = string.upper }, + { + "fileformat", + symbols = { + unix = "", + dos = "", + mac = "", + }, + }, + "filetype", + }, + lualine_z = { + "progress", + }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { "filename" }, + lualine_x = { "location" }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + extensions = { "quickfix", "fugitive", "nvim-tree" }, } diff --git a/lua/config/ministatusline.lua b/lua/config/ministatusline.lua index 33c335e..5b2242f 100644 --- a/lua/config/ministatusline.lua +++ b/lua/config/ministatusline.lua @@ -1,7 +1,7 @@ return { - content = { - active = nil, - inactive = nil, - }, - use_icons = true, + content = { + active = nil, + inactive = nil, + }, + use_icons = true, } diff --git a/lua/config/modicator.lua b/lua/config/modicator.lua index 8364c74..442ea5f 100644 --- a/lua/config/modicator.lua +++ b/lua/config/modicator.lua @@ -1,17 +1,17 @@ require("modicator").setup({ - show_warnings = true, - highlights = { - defaults = { - bold = false, - italic = false, - }, - use_cursorline_background = true, - }, - integration = { - lualine = { - enabled = true, - mode_section = nil, - highlight = 'bg', - } - } + show_warnings = true, + highlights = { + defaults = { + bold = false, + italic = false, + }, + use_cursorline_background = true, + }, + integration = { + lualine = { + enabled = true, + mode_section = nil, + highlight = 'bg', + } + } }) diff --git a/lua/config/modules/splitjoin.lua b/lua/config/modules/splitjoin.lua new file mode 100644 index 0000000..84cc2c6 --- /dev/null +++ b/lua/config/modules/splitjoin.lua @@ -0,0 +1,11 @@ +require("mini.splitjoin").setup({ + mappings = { + toggle = "gS", + }, + + detect = { + brackets = { '%b()', '%b{}', '%b[]' }, + + separator = '[,;]', + }, +}) diff --git a/lua/config/noice.lua b/lua/config/noice.lua index 3ad7ccb..01692de 100644 --- a/lua/config/noice.lua +++ b/lua/config/noice.lua @@ -1,29 +1,29 @@ require("noice").setup({ - lsp = { - override = { - ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - ["vim.lsp.util.stylize_markdown"] = true, - ["cmp.entry.get_documentation"] = true, - }, - }, - presets = { - bottom_search = true, - command_palette = true, - long_message_to_split = true, - inc_rename = false, - lsp_doc_border = false, - }, - views = { - popupmenu = { - enabled = true, - backend = "nui", - win_options = { - winblend = 0.5, - }, - border = { - style = "shadow", - padding = { 1, 2 }, - }, - }, - }, + lsp = { + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + }, + presets = { + bottom_search = true, + command_palette = true, + long_message_to_split = true, + inc_rename = false, + lsp_doc_border = false, + }, + views = { + popupmenu = { + enabled = true, + backend = "nui", + win_options = { + winblend = 0.5, + }, + border = { + style = "shadow", + padding = { 1, 2 }, + }, + }, + }, }) diff --git a/lua/config/notify.lua b/lua/config/notify.lua index 831f898..ec231b0 100644 --- a/lua/config/notify.lua +++ b/lua/config/notify.lua @@ -2,7 +2,7 @@ vim.notify = require('notify') local dap = require('dap') require('notify').setup({ - render = "wrapped-default", + render = "wrapped-default", timeout = 6000, max_width = 50, minimum_width = 50, @@ -15,10 +15,10 @@ require('notify').setup({ DEBUG = "", TRACE = "✎", }, - on_open = function(win) - -- vim.api.nvim_win_set_option(win, 'wrap', true) - vim.api.nvim_win_set_option(win, 'breakat', ' ') - end, + on_open = function(win) + -- vim.api.nvim_win_set_option(win, 'wrap', true) + vim.api.nvim_win_set_option(win, 'breakat', ' ') + end, }) -- Utility functions shared between progress reports for LSP and DAP diff --git a/lua/config/nui.lua b/lua/config/nui.lua index 49171de..a119143 100644 --- a/lua/config/nui.lua +++ b/lua/config/nui.lua @@ -1,7 +1,7 @@ local popup = require('nui.popup') local Popup = popup({ - border = { - style = "shadow", - } + border = { + style = "shadow", + } }) diff --git a/lua/config/refactoring.lua b/lua/config/refactoring.lua index 1393a2b..19b5656 100644 --- a/lua/config/refactoring.lua +++ b/lua/config/refactoring.lua @@ -1,26 +1,26 @@ require('refactoring').setup({ - prompt_func_return_type = { - go = true, - java = true, + prompt_func_return_type = { + go = true, + java = true, - cpp = true, - c = true, - h = true, - hpp = true, - cxx = true, - }, - prompt_func_param_type = { - go = true, - java = true, + cpp = true, + c = true, + h = true, + hpp = true, + cxx = true, + }, + prompt_func_param_type = { + go = true, + java = true, - cpp = true, - c = true, - h = true, - hpp = true, - cxx = true, - }, - printf_statements = {}, - print_var_statements = {}, - show_success_message = true, -- shows a message with information about the refactor on success - -- i.e. [Refactor] Inlined 3 variable occurrences + cpp = true, + c = true, + h = true, + hpp = true, + cxx = true, + }, + printf_statements = {}, + print_var_statements = {}, + show_success_message = true, -- shows a message with information about the refactor on success + -- i.e. [Refactor] Inlined 3 variable occurrences }) diff --git a/lua/config/region-folding.lua b/lua/config/region-folding.lua index ad70ed0..bb7e367 100644 --- a/lua/config/region-folding.lua +++ b/lua/config/region-folding.lua @@ -1,4 +1,4 @@ require("region-folding").setup({ - region_text = { start = "", ending = "" }, - fold_indicator = "▼", + region_text = { start = "", ending = "" }, + fold_indicator = "▼", }) diff --git a/lua/config/snacks.lua b/lua/config/snacks.lua new file mode 100644 index 0000000..8761cdd --- /dev/null +++ b/lua/config/snacks.lua @@ -0,0 +1,88 @@ +return { + "folke/snacks.nvim", + priority = 1000, + lazy = false, + ---@type snacks.Config + opts = { + bigfile = { enabled = true }, + dashboard = { enabled = true }, + explorer = { enabled = true }, + indent = { + enabled = true, + scope = { + enabled = true, + underline = true, + }, + chunk = { + enabled = false, + char = { + corner_top = "╭", + corner_bottom = "╰", + vertical = "│", + arrow = "╼", + }, + }, + }, + input = { enabled = true }, + picker = { + enabled = true, + hidden = true, + ignored = true, + }, + image = { + enabled = true, + formats = { + "png", + "jpg", + "jpeg", + "gif", + "bmp", + "webp", + "tiff", + "heic", + "avif", + "mp4", + "mov", + "avi", + "mkv", + "webm", + "pdf", + "icns", + }, + doc = { + enabled = true, + inline = true, + float = true, + max_width = 80, + max_height = 80, + }, + }, + notifier = { enabled = true }, + quickfile = { enabled = true }, + scope = { enabled = true }, + scroll = { enabled = true }, + statuscolumn = { enabled = true }, + words = { enabled = true }, + terminal = { + enabled = true, + win = { style = "terminal" }, + }, + styles = { + terminal = { + keys = { + term_normal = { + "", + function() + Snacks.terminal.toggle() + end, + mode = "t" + } + } + } + }, + gitbrowse = { + enabled = true, + notify = false, + }, + }, +} diff --git a/lua/config/telescope.lua b/lua/config/telescope.lua index a2fcd0b..88766ee 100644 --- a/lua/config/telescope.lua +++ b/lua/config/telescope.lua @@ -1,7 +1,7 @@ require("telescope").setup ({ - pickers = { - colorscheme = { - enable_preview = true, - } - } + pickers = { + colorscheme = { + enable_preview = true, + } + } }) diff --git a/lua/config/testfold.lua b/lua/config/testfold.lua index 4d1721c..fe8533d 100644 --- a/lua/config/testfold.lua +++ b/lua/config/testfold.lua @@ -1,15 +1,15 @@ -local M = {} +local i = {} function M.foldexpr() - local lnum = vim.v.lnum - local line = vim.fn.getline( lnum ) - if line:find( "", 1, true ) then - return "a1" - elseif line:find( "", 1, true ) then - return "s1" - else - return "=" - end + local lnum = vim.v.lnum + local line = vim.fn.getline( lnum ) + if line:find( "", 1, true ) then + return "a1" + elseif line:find( "", 1, true ) then + return "s1" + else + return "=" + end end return M diff --git a/lua/config/themelight.lua b/lua/config/themelight.lua index 0cd5cc5..a2235c2 100644 --- a/lua/config/themelight.lua +++ b/lua/config/themelight.lua @@ -1,8 +1,8 @@ --- Lua +-- lua require('onedarkpro').setup({ - highlights = { - Comment = { italic = true }, - Directory = { bold = false }, - ErrorMsg = { italic = true }, - }, + highlights = { + Comment = { italic = true }, + Directory = { bold = false }, + ErrorMsg = { italic = true }, + }, }) diff --git a/lua/config/tmux.lua b/lua/config/tmux.lua index 4e63ed7..9f3f958 100644 --- a/lua/config/tmux.lua +++ b/lua/config/tmux.lua @@ -1,19 +1,21 @@ require("tmux").setup({ - copy_sync = { - enable = true, - redirect_to_clipboard = true, - sync_clipboard = true, - sync_registers = true, - }, - navigation = { - cycle_navigation = true, - enable_default_keybindings = false, - }, - resize = { - enable_default_keybindings = false, - }, - swap = { - cycle_navigation = true, - enable_default_keybindings = false, - } + copy_sync = { + enable = true, + redirect_to_clipboard = true, + sync_clipboard = true, + sync_registers = true, + }, + navigation = { + cycle_navigation = true, + enable_default_keybindings = false, + }, + resize = { + enable_default_keybindings = false, + resize_step_x = 5, + resize_step_y = 5, + }, + swap = { + cycle_navigation = false, + enable_default_keybindings = false, + } }) diff --git a/lua/config/treesitter.lua b/lua/config/treesitter.lua index f09ccd5..977cc14 100644 --- a/lua/config/treesitter.lua +++ b/lua/config/treesitter.lua @@ -1,12 +1,13 @@ require'nvim-treesitter.configs'.setup { - ensure_installed = "all", - sync_install = true, - auto_install = true, - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, - indent = { - enable = true, - }, + ensure_installed = "all", + ignore_install = { "ipkg" }, + sync_install = true, + auto_install = true, + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, + indent = { + enable = true, + }, } diff --git a/lua/config/undotree.lua b/lua/config/undotree.lua index 8c9513f..11b1854 100644 --- a/lua/config/undotree.lua +++ b/lua/config/undotree.lua @@ -1,19 +1,19 @@ require('undotree').setup({ - float_diff = true, - layout = "left_bottom", - position = "left", - ignore_filetype = { 'undotree', 'undotreeDiff', 'qf', 'TelescopePrompt', 'spectre_panel', 'tsplayground' }, - window = { - winblend = 30, - }, - keymaps = { - ['j'] = "move_next", - ['k'] = "move_prev", - ['gj'] = "move2parent", - ['J'] = "move_change_next", - ['K'] = "move_change_prev", - [''] = "action_enter", - ['p'] = "enter_diffbuf", - ['q'] = "quit", - }, + float_diff = true, + layout = "left_bottom", + position = "left", + ignore_filetype = { 'undotree', 'undotreeDiff', 'qf', 'TelescopePrompt', 'spectre_panel', 'tsplayground' }, + window = { + winblend = 30, + }, + keymaps = { + ['j'] = "move_next", + ['k'] = "move_prev", + ['gj'] = "move2parent", + ['J'] = "move_change_next", + ['K'] = "move_change_prev", + [''] = "action_enter", + ['p'] = "enter_diffbuf", + ['q'] = "quit", + }, }) diff --git a/lua/mappings.lua b/lua/mappings.lua index 27622e8..7f5a36e 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -10,10 +10,20 @@ map("v", "", ":m '<-2gv=gv", { desc = "Move selected text up" }) map("v", "", ":m '>+1gv=gv", { desc = "Move selected text down" }) -- Alt + Arrow Key to change buffer -map("n", "", "h", { desc = "Move to left split" }) -map("n", "", "j", { desc = "Move to bottom split" }) -map("n", "", "k", { desc = "Move to top split" }) -map("n", "", "l", { desc = "Move to right split" }) +-- map("n", "", "h", { desc = "Move to left split" }) +-- map("n", "", "j", { desc = "Move to bottom split" }) +-- map("n", "", "k", { desc = "Move to top split" }) +-- map("n", "", "l", { desc = "Move to right split" }) + +map("n", "", "lua require('tmux').move_left()", { desc = "Move to left split" }) +map("n", "", "lua require('tmux').move_bottom()", { desc = "Move to bottom split" }) +map("n", "", "lua require('tmux').move_top()", { desc = "Move to top split" }) +map("n", "", "lua require('tmux').move_right()", { desc = "Move to right split" }) + +map("n", "", "lua require('tmux').resize_left()", { desc = "Move to left split" }) +map("n", "", "lua require('tmux').resize_bottom()", { desc = "Move to bottom split" }) +map("n", "", "lua require('tmux').resize_top()", { desc = "Move to top split" }) +map("n", "", "lua require('tmux').resize_right()", { desc = "Move to right split" }) -- Copilot Chat buffer map("n", "", vim.cmd.CopilotChatToggle) @@ -55,7 +65,15 @@ map("i", "", "") map("n", "mr", "CellularAutomaton make_it_rain"); map("n", "", function() - vim.cmd("so") + vim.cmd("so") end) map("n", "", "ChatGPT") + +map("n", "fm", "TailwindConcealToggle", { desc = "Toggle Tailwind Conceal" }) + +-- Terminal +map("n", "", function() Snacks.terminal.toggle() end, { desc = "Toggle Terminal" }) + +-- Gitbrowse +map("n", "gb", function() Snacks.gitbrowse.open() end ) diff --git a/lua/minimodules.lua b/lua/minimodules.lua new file mode 100644 index 0000000..6b21aa5 --- /dev/null +++ b/lua/minimodules.lua @@ -0,0 +1,17 @@ +local M = {} + +function M.load_modules() + local modules_path = vim.fn.stdpath("config") .. "/lua/config/modules" + local modules = vim.fn.globpath(modules_path, "*.lua", false, true) + + for _, module_file in ipairs(modules) do + local module_name = vim.fn.fnamemodify(module_file, ":t:r") + + local ok, err = pcall(require, "config.modules." .. module_name) + if not ok then + vim.notify("Failed to load module: " .. module_name .. "\n" .. err, vim.log.levels.ERROR) + end + end +end + +return M diff --git a/lua/options.lua b/lua/options.lua index 524f3c5..2e3879f 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -3,8 +3,12 @@ vim.opt.relativenumber = true vim.opt.tabstop = 4 vim.opt.softtabstop = 4 vim.opt.shiftwidth = 4 -vim.opt.expandtab = true +vim.opt.expandtab = false vim.opt.smartindent = false + +vim.o.list = true +vim.opt.listchars = { tab = "··", trail = "·", nbsp = "_" } + vim.opt.wrap = true vim.opt.linebreak = true vim.opt.swapfile = false @@ -21,11 +25,6 @@ vim.opt.updatetime = 50 vim.opt.colorcolumn = "80" vim.opt.textwidth = 80 vim.opt.formatoptions = "rqnj" --- vim.opt.foldmethod = "expr" --- vim.opt.foldexpr = "v:lua.require('config.testfold').foldexpr()" --- vim.opt.foldenable = true --- vim.opt.foldlevel = 0 --- vim.opt.foldlevelstart = 0 vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions" vim.o.clipboard = "unnamedplus" vim.o.cursorline = true diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 7fd2c74..220f52f 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,311 +1,283 @@ return { - { - "nvim-treesitter/nvim-treesitter", - config = function() - require("config.treesitter") - end, - }, - { - "sainnhe/edge", - lazy = false, - priority = 1000, - config = function() - vim.g.edge_enable_italic = 1 - vim.g.edge_style = "default" - vim.g.edge_menu_selection_background = "purple" - end, - }, - { - "rmagatti/auto-session", - config = function() - require("config.autosession") - end, - }, - { - "olimorris/onedarkpro.nvim", - priority = 1000, - config = function() - require("config.themelight") - end, - }, - { - "nvim-telescope/telescope.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - }, - config = function() - require("config.telescope") - end, - }, - { - "lambdalisue/vim-suda", - init = function() - vim.g.suda_smart_edit = 1 - end, - }, - { - "nvim-tree/nvim-web-devicons", - }, - { - "akinsho/bufferline.nvim", - event = "VeryLazy", - config = function() - require("config.barbar") - end, - }, - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - config = function () - if vim.env.TMUX then - vim.api.nvim_create_autocmd({ "FocusGained", "ColorScheme", "VimEnter" }, { - callback = function() - vim.defer_fn( function() - vim.opt.laststatus = 0 - end, 100) - end, - }) - vim.o.laststatus = 0 - end - require("config.lualine") - end, - }, - { - "mawkler/modicator.nvim", - config = function() - require("config.modicator") - end - }, - { - "shinchu/lightline-gruvbox.vim", - }, - { - "jiaoshijie/undotree", - config = function() - require("config.undotree") - end, - }, - { - "hiphish/rainbow-delimiters.nvim", - enabled = true, - }, - { - "windwp/nvim-autopairs", - event = "InsertEnter", - config = function() - require("config.autopairs") - end, - }, - { - "tpope/vim-fugitive", - }, - { - "rcarriga/nvim-notify", - config = function() - require "config.notify" - end, - }, - { - "zbirenbaum/copilot.lua", - lazy = true, - cmd = "Copilot", - event = "InsertEnter", - config = function() - require "config.copilot" - end, - }, - { - "CopilotC-Nvim/CopilotChat.nvim", - dependencies = { - { "zbirenbaum/copilot.lua" }, - { "nvim-lua/plenary.nvim", branch = "master" }, - }, - build = "make tiktoken", - config = function() - require "config.copilotchat" - end, - }, - { - "mfussenegger/nvim-dap", - config = function() - require("config.dapconf") - end, - }, - { - "folke/snacks.nvim", - priority = 1000, - lazy = false, - ---@type snacks.Config - opts = { - bigfile = { enabled = true }, - dashboard = { enabled = true }, - explorer = { enabled = true }, - indent = { - enabled = true, - scope = { - enabled = false, - underline = true, - animate = { - enabled = true, - fps = 144, - easing = "inExpo", - duration = 20, - }, - }, - chunk = { - enabled = true, - char = { - corner_top = "╭", - corner_bottom = "╰", - vertical = "│", - arrow = "╼", - }, - }, - }, - input = { enabled = true }, - picker = { - enabled = true, - hidden = true, - ignored = true, - }, - notifier = { enabled = true }, - quickfile = { enabled = true }, - scope = { enabled = true }, - scroll = { enabled = false }, - statuscolumn = { enabled = true }, - words = { enabled = true }, - }, - }, - { - "notken12/base46-colors", - }, - -- { - -- "mason-org/mason-lspconfig.nvim", - -- opts = {}, - -- dependencies = { - -- { "mason-org/mason.nvim", opts = {} }, - -- "neovim/nvim-lspconfig", - -- }, - -- }, - { - "folke/lazydev.nvim", - ft = "lua", - opts = function() - require("config.lazydev") - end, - }, - { - "neovim/nvim-lspconfig", - enabled = true, - dependencies = { - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "hrsh7th/nvim-cmp", - "L3MON4D3/LuaSnip", - "saadparwaiz1/cmp_luasnip", - "j-hui/fidget.nvim", - }, - config = function() - require("config.lspconfig") - end, - }, - { - "smolck/command-completion.nvim", - opts = { - border = nil, - highlight_selection = true, - use_matchfuzzy = true, - tab_completion = true, - }, - }, - { - "andweeb/presence.nvim", - }, - { - "mfussenegger/nvim-jdtls", - }, - { - "ThePrimeagen/harpoon", - branch = "harpoon2", - dependencies = { - "nvim-lua/plenary.nvim", - }, - config = function() - require("config.harpoon") - end, - }, - { - "catgoose/nvim-colorizer.lua", - config = function() - require("config.colorizer") - end, - }, - { - "ziglang/zig.vim", - }, - { - "mg979/vim-visual-multi", - branch = "master", - }, - { - "elkowar/yuck.vim", - }, - { - "f3fora/nvim-texlabconfig", - config = function() - require("config.texlab") - end, - build = "go build", - }, - { - "lancewilhelm/horizon-extended.nvim", - }, - { - "vimpostor/vim-tpipeline", - }, - { - "yazeed1s/minimal.nvim", - config = function() - vim.g.minimal_italic_comments = true - end, - }, - { - "ThePrimeagen/refactoring.nvim", - config = function() - require("config.refactoring") - end, - }, - { - "Yazeed1s/minimal.nvim", - config = function() - vim.g.minimal_italic_comments = true - vim.g.minimal_italic_functions = true - end, - }, - { - "propet/colorscheme-persist.nvim", - dependencies = { - "nvim-telescope/telescope.nvim", - }, - lazy = false, - config = true, - keys = { - { - "sp", - function() - require("colorscheme-persist").picker() - end, - mode = "n", - }, - }, - opts = { - picker_opts = require("telescope.themes").get_dropdown({ - enable_preview = true, - }), - } - } + { + "nvim-mini/mini.nvim", + version = false, + + modules = function() + require("config.mini-modules") + end, + }, + { + "nvim-treesitter/nvim-treesitter", + config = function() + require("config.treesitter") + end, + }, + { + "sainnhe/edge", + lazy = false, + priority = 1000, + config = function() + vim.g.edge_enable_italic = 1 + vim.g.edge_style = "default" + vim.g.edge_menu_selection_background = "purple" + end, + }, + { + "rmagatti/auto-session", + config = function() + require("config.autosession") + end, + }, + { + "olimorris/onedarkpro.nvim", + priority = 1000, + config = function() + require("config.themelight") + end, + }, + { + "nvim-telescope/telescope.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + }, + config = function() + require("config.telescope") + end, + }, + { + "lambdalisue/vim-suda", + init = function() + vim.g.suda_smart_edit = 1 + end, + }, + { + "nvim-tree/nvim-web-devicons", + }, + { + "akinsho/bufferline.nvim", + event = "VeryLazy", + config = function() + require("config.barbar") + end, + }, + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + config = function () + if vim.env.TMUX then + vim.api.nvim_create_autocmd({ "FocusGained", "ColorScheme", "VimEnter" }, { + callback = function() + vim.defer_fn( function() + vim.opt.laststatus = 0 + end, 100) + end, + }) + vim.o.laststatus = 0 + end + require("config.lualine") + end, + }, + { + "mawkler/modicator.nvim", + config = function() + require("config.modicator") + end + }, + { + "shinchu/lightline-gruvbox.vim", + }, + { + "jiaoshijie/undotree", + config = function() + require("config.undotree") + end, + }, + { + "hiphish/rainbow-delimiters.nvim", + enabled = true, + }, + { + "windwp/nvim-autopairs", + event = "InsertEnter", + config = function() + require("config.autopairs") + end, + }, + { + "tpope/vim-fugitive", + }, + { + "rcarriga/nvim-notify", + config = function() + require "config.notify" + end, + }, + { + "zbirenbaum/copilot.lua", + lazy = true, + cmd = "Copilot", + event = "InsertEnter", + config = function() + require "config.copilot" + end, + }, + { + "CopilotC-Nvim/CopilotChat.nvim", + dependencies = { + { "zbirenbaum/copilot.lua" }, + { "nvim-lua/plenary.nvim", branch = "master" }, + }, + build = "make tiktoken", + config = function() + require "config.copilotchat" + end, + }, + { + "mfussenegger/nvim-dap", + config = function() + require("config.dapconf") + end, + }, + { + require("config.snacks") + }, + { + "notken12/base46-colors", + }, + -- { + -- "mason-org/mason-lspconfig.nvim", + -- opts = {}, + -- dependencies = { + -- { "mason-org/mason.nvim", opts = {} }, + -- "neovim/nvim-lspconfig", + -- }, + -- }, + { + "folke/lazydev.nvim", + ft = "lua", + opts = function() + require("config.lazydev") + end, + }, + { + "neovim/nvim-lspconfig", + enabled = true, + dependencies = { + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "hrsh7th/nvim-cmp", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + "j-hui/fidget.nvim", + }, + config = function() + require("config.lspconfig") + end, + }, + { + "smolck/command-completion.nvim", + opts = { + border = nil, + highlight_selection = true, + use_matchfuzzy = true, + tab_completion = true, + }, + }, + { + "andweeb/presence.nvim", + }, + { + "mfussenegger/nvim-jdtls", + }, + { + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { + "nvim-lua/plenary.nvim", + }, + config = function() + require("config.harpoon") + end, + }, + { + "catgoose/nvim-colorizer.lua", + config = function() + require("config.colorizer") + end, + }, + { + "ziglang/zig.vim", + }, + { + "mg979/vim-visual-multi", + branch = "master", + }, + { + "elkowar/yuck.vim", + }, + { + "f3fora/nvim-texlabconfig", + config = function() + require("config.texlab") + end, + build = "go build", + }, + { + "lancewilhelm/horizon-extended.nvim", + }, + { + "vimpostor/vim-tpipeline", + }, + { + "yazeed1s/minimal.nvim", + config = function() + vim.g.minimal_italic_comments = true + end, + }, + { + "ThePrimeagen/refactoring.nvim", + config = function() + require("config.refactoring") + end, + }, + { + "Yazeed1s/minimal.nvim", + config = function() + vim.g.minimal_italic_comments = true + vim.g.minimal_italic_functions = true + end, + }, + { + "propet/colorscheme-persist.nvim", + dependencies = { + "nvim-telescope/telescope.nvim", + }, + lazy = false, + config = true, + keys = { + { + "sp", + function() + require("colorscheme-persist").picker() + end, + mode = "n", + }, + }, + opts = { + picker_opts = require("telescope.themes").get_dropdown({ + enable_preview = true, + }), + } + }, + { + "aserowy/tmux.nvim", + config = function() + require("config.tmux") + end, + }, }