diff --git a/init.lua b/init.lua index 8fbbb471..7480db4a 100644 --- a/init.lua +++ b/init.lua @@ -845,12 +845,12 @@ require('lazy').setup({ -- `friendly-snippets` contains a variety of premade snippets. -- See the README about individual language/framework/plugin snippets: -- https://github.com/rafamadriz/friendly-snippets - -- { - -- 'rafamadriz/friendly-snippets', - -- config = function() - -- require('luasnip.loaders.from_vscode').lazy_load() - -- end, - -- }, + { + 'rafamadriz/friendly-snippets', + config = function() + require('luasnip.loaders.from_vscode').lazy_load() + end, + }, }, opts = {}, }, @@ -923,7 +923,8 @@ require('lazy').setup({ }, }, - { -- You can easily change to a different colorscheme. + { + -- You can easily change to a different colorscheme. -- Change the name of the colorscheme plugin below, and then -- change the command in the config to whatever the name of that colorscheme is. -- @@ -944,7 +945,8 @@ require('lazy').setup({ -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'retrobox' + -- vim.cmd.colorscheme 'retrobox' + vim.cmd.colorscheme 'jb' end, }, @@ -1045,7 +1047,7 @@ require('lazy').setup({ main = 'nvim-treesitter.configs', -- Sets main module to use for opts -- [[ Configure Treesitter ]] See `:help nvim-treesitter` opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, + ensure_installed = { 'bash', 'c', 'diff', 'html', 'http', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, -- Autoinstall languages that are not installed auto_install = true, highlight = { @@ -1138,3 +1140,5 @@ vim.lsp.config('kotlin_lsp', { root_markers = { "settings.gradle", "settings.gradle.kts", "build.gradle", "build.gradle.kts" }, }) vim.lsp.enable('kotlin_lsp') + +vim.o.wrap=false diff --git a/lazy-lock.json b/lazy-lock.json index a9d05ef5..f60d20cb 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,31 +1,34 @@ { - "LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" }, - "blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" }, - "conform.nvim": { "branch": "master", "commit": "178b8f0d70ee63db616a8b3bda637218eef121dd" }, - "fidget.nvim": { "branch": "main", "commit": "e32b672d8fd343f9d6a76944fedb8c61d7d8111a" }, - "gitsigns.nvim": { "branch": "main", "commit": "cdafc320f03f2572c40ab93a4eecb733d4016d07" }, + "LuaSnip": { "branch": "master", "commit": "642b0c595e11608b4c18219e93b88d7637af27bc" }, + "blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" }, + "conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" }, + "fidget.nvim": { "branch": "main", "commit": "6f793b2bcd2d35e201c09520f698bb763220908a" }, + "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, + "gitsigns.nvim": { "branch": "main", "commit": "2038c666bd9d8a0b7349a0b6ee00dc83104b9ecf" }, "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, - "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, - "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "b1d9a914b02ba5660f1e272a03314b31d4576fe2" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, - "mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" }, - "mini.nvim": { "branch": "main", "commit": "dce9bc4e19d02d5c37fe71c16f40f8a5536b0386" }, - "neo-tree.nvim": { "branch": "main", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" }, + "jb.nvim": { "branch": "main", "commit": "cd3688530993049c72bdb007200b558bf4547b01" }, + "kulala.nvim": { "branch": "main", "commit": "8848e90bf05b8416e02b2561039b70acc271071c" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "50bf3871b539896bd0650b882f6e6b467cc1c1eb" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" }, + "mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" }, + "mini.nvim": { "branch": "main", "commit": "c248713d3530710f67ec804cfbdfcd5b02b19dee" }, + "neo-tree.nvim": { "branch": "main", "commit": "83e7a2982fd12b9c3d35bc39dd5877cd91a02a61" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-lint": { "branch": "master", "commit": "baf7c91c2b868b12446df511d4cdddc98e9bf66e" }, - "nvim-lspconfig": { "branch": "master", "commit": "dc7e7c7699cc01b1b6fefa97f9b496d8f447d7a1" }, + "nvim-lint": { "branch": "master", "commit": "a219b2c9e5b4765e5c845aba119dad55806fcaf1" }, + "nvim-lspconfig": { "branch": "master", "commit": "3371bf298c1f56efc26771ee961f461176958fb5" }, "nvim-navic": { "branch": "master", "commit": "f5eba192f39b453675d115351808bd51276d9de5" }, - "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, - "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" }, + "nvim-web-devicons": { "branch": "master", "commit": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c" }, + "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "master", "commit": "3a12a853ebf21ec1cce9a92290e3013f8ae75f02" }, + "telescope.nvim": { "branch": "master", "commit": "427b576c16792edad01a92b89721d923c19ad60f" }, "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, - "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, - "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, + "tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" }, + "vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" }, "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } } diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index ee7161eb..399aabb3 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -3,6 +3,8 @@ -- -- See the kickstart.nvim README for more information return { + -- Some color schemes + 'nickkadutskyi/jb.nvim', -- Git integration in nvim 'tpope/vim-fugitive', @@ -69,6 +71,242 @@ return { "SmiteshP/nvim-navic", dependencies = 'neovim/nvim-lspconfig', }, + -- Rest api client + { + "mistweaverco/kulala.nvim", + -- Load before session save/restore so VimLeavePre and SessionLoadPost hooks are registered. + event = { "SessionLoadPost", "VimLeavePre" }, + keys = { + { "Rs", mode = { "n", "v" }, desc = "Send request" }, + { "Ra", mode = { "n", "v" }, desc = "Send all requests" }, + { "Rb", desc = "Open scratchpad" }, + }, + -- See opts.lsp.enforce_external_script_naming_convention + -- to restrict LSP capabilities to *.http, *.http.js, *.http.ts and *.http.lua files. + ft = {"http", "rest", "javascript", "lua"}, + opts = { + kulala_core = { + -- Optional path to the kulala-core executable + -- (https://github.com/mistweaverco/kulala-core). + -- When set, this path is used exclusively. + -- When nil (default), auto-download and + -- use kulala-core from GitHub releases based on the user's OS and architecture. + path = nil, + -- Subprocess timeout (ms) for kulala-core. + -- Default is 60000 (1 minute). + -- nil disables the vim.system timeout. + timeout = 60000, + -- Optional override for kulala-core persistence + -- (cookies, OAuth, prompts). + -- Default matches kulala-core CLI: + -- - Linux: ~/.local/share/kulala-core + -- or $XDG_DATA_HOME/kulala-core + -- - macOS: ~/Library/Application + -- or Support/kulala-core + -- - Windows: %APPDATA%\kulala-core + data_dir = nil, + -- Optional override for download url + download_url = "https://github.com/mistweaverco/kulala-core/releases/download/%s/%s", + }, + -- Restore request history and UI after sourcing a vim session. + -- Requires `set sessionoptions+=globals` in your Neovim config. + session = { + restore = true, + }, + -- dev, test, prod, can be anything + -- see: https://learn.microsoft.com/en-us/aspnet/core/test/http-files?view=aspnetcore-8.0#environment-files + default_env = "default", + -- `"b"` = per-buffer env (default), `"g"` = global + environment_scope = "b", + -- enable reading vscode rest client environment variables + vscode_rest_client_environmentvars = false, + + -- Response body pretty-printing + response_format = { + indent = 2, + expand_tabs = true, + sort_keys = false, + }, + ui = { + -- display mode: possible values: "split", "float" + display_mode = "split", + -- split direction: possible values: "above", "right", "below", "left", fun(): "above"|"right"|"below"|"left" + split_direction = "right", + -- window options to override win_config: width/height/split/vertical.., buffer/window options + win_opts = { bo = {}, wo = {} }, ---@type kulala.ui.win_config + -- default view: "body" or "headers" or "headers_body" or "verbose" or fun(response: Response) + default_view = "body", ---@type "body"|"headers"|"headers_body"|"verbose"|fun(response: Response) + -- enable winbar + winbar = true, + -- Specify the panes to be displayed by default + -- Available panes are { "body", "headers", "headers_body", "script_output", "stats", "verbose", "report", "help" }, + default_winbar_panes = { "body", "headers", "verbose", "script_output", "report" }, + -- Winbar labels + winbar_labels = { + body = "Body", + headers = "Headers", + headers_body = "All", + verbose = "Verbose", + script_output = "Script Output", + stats = "Stats", + report = "Report", + help = "Help", + }, + -- show/hide winbar keymaps in labels + winbar_labels_keymaps = true, + -- enable/disable variable info text + -- this will show the variable name and value as float + -- possible values: false, "float" + show_variable_info_text = false, + -- icons position: "signcolumn"|"on_request"|"above_request"|"below_request" or nil to disable + show_icons = "on_request", + -- default icons + icons = { + inlay = { + loading = "⏳", + done = "✔", + error = "✘", + }, + lualine = "🐼", + textHighlight = "WarningMsg", -- highlight group for request elapsed time + loadingHighlight = "Normal", + doneHighlight = "String", + errorHighlight = "ErrorMsg", + }, + + -- enable/disable request summary in the output window + show_request_summary = true, + + -- do not show responses over maximum size, in bytes + max_response_size = 32768, + + -- used by `Copy as Curl` command to determine whether to inline request body + max_request_size = 2048, + + report = { + -- possible values: true | false | "on_error" + show_script_output = true, + -- possible values: true | false | "on_error" | "failed_only" + show_asserts_output = true, + -- possible values: true | false | "on_error" + show_summary = true, + + headersHighlight = "Special", + successHighlight = "String", + errorHighlight = "Error", + }, + + -- scratchpad default contents + scratchpad_default_contents = { + "@MY_TOKEN_NAME=my_token_value", + "", + "# @name scratchpad", + "POST https://echo.kulala.app/post HTTP/1.1", + "accept: application/json", + "content-type: application/json", + "", + "{", + ' "foo": "bar"', + "}", + }, + + -- Settings for pickers used for Environment, Authentication and Requests Managers + pickers = { + snacks = { + layout = function() + local has_snacks, snacks_picker = pcall(require, "snacks.picker") + return not has_snacks and {} + or vim.tbl_deep_extend("force", snacks_picker.config.layout("telescope"), { + reverse = true, + layout = { + { { win = "list" }, { height = 1, win = "input" }, box = "vertical" }, + { win = "preview", width = 0.6 }, + box = "horizontal", + width = 0.8, + }, + }) + end, + }, + }, + }, + + lsp = { + ---enable/disable built-in LSP server + ---@type boolean + enable = true, + + ---filetypes to attach Kulala LSP to + ---@type string[] + filetypes = { + "http", + "rest", + "javascript", + "typescript", + "lua", + }, + + ---Only scripts ending in *.http.js, *.http.ts and *.http.lua will be treated as HTTP scripts and + ---have LSP capabilities, unless `enforce_external_script_naming_convention` is set to false. + ---This allows users to have non-HTTP scripts with the same filetypes without LSP interference. + ---@type boolean + enforce_external_script_naming_convention = true, + + --enable/disable/customize LSP keymaps + ---@type boolean|table + keymaps = false, -- disabled by default, as Kulala relies on default Neovim LSP keymaps + + on_attach = nil, -- function called when Kulala LSP attaches to the buffer + }, + + -- enable/disable debug mode + debug = 3, + -- enable/disable bug reports on all errors + generate_bug_report = false, + + -- set to true to enable default keymaps + -- (see docs or lua/kulala/config/keymaps.lua) + -- or override default keymaps as shown in the example below. + ---@type boolean|table + global_keymaps = true, + --[[ + { + ["Send request"] = { -- sets global mapping + "Rs", + function() require("kulala").run() end, + mode = { "n", "v" }, -- optional mode, default is n + desc = "Send request" -- optional description, otherwise inferred from the key + }, + ["Send all requests"] = { + "Ra", + function() require("kulala").run_all() end, + mode = { "n", "v" }, + ft = "http", -- sets mapping for *.http files only + }, + ["Replay the last request"] = { + "Rr", + function() require("kulala").replay() end, + ft = { "http", "rest" }, -- sets mapping for specified file types + }, + ["Find request"] = false -- set to false to disable + }, + ]] + + -- Prefix for global keymaps + global_keymaps_prefix = "R", + + -- Kulala UI keymaps; override with custom keymaps as required + -- (see docs or lua/kulala/config/keymaps.lua) + ---@type boolean|table + kulala_keymaps = true, + --[[ + { + ["Show headers"] = { "H", function() require("kulala.ui").show_headers() end, }, + } + ]] + + kulala_keymaps_prefix = "", + }, + }, } -- vim: ts=2 sts=2 sw=2 et