diff --git a/init.lua b/init.lua index b98ffc6198a..3d6a8cba971 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.o` @@ -102,7 +102,7 @@ vim.g.have_nerd_font = false vim.o.number = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! --- vim.o.relativenumber = true +vim.o.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.o.mouse = 'a' @@ -205,6 +205,9 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the upper win -- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) -- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) +-- custom keymaps +vim.keymap.set('i', 'jj', '', { desc = 'Escape from Insert mode' }) + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -247,7 +250,20 @@ rtp:prepend(lazypath) -- NOTE: Here is where you install your plugins. require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). - 'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically + { + "NMAC427/guess-indent.nvim", + config = function() + require('guess-indent').setup({ + override_editorconfig = true, + filetype_exclude = {}, + }) + -- Set default indentation + vim.o.tabstop = 2 + vim.o.shiftwidth = 2 + vim.o.softtabstop = 2 + vim.o.expandtab = true + end, + }, -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following @@ -298,7 +314,7 @@ require('lazy').setup({ -- Then, because we use the `opts` key (recommended), the configuration runs -- after the plugin has been loaded as `require(MODULE).setup(opts)`. - { -- Useful plugin to show you pending keybinds. + { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' opts = { @@ -379,7 +395,7 @@ require('lazy').setup({ { 'nvim-telescope/telescope-ui-select.nvim' }, -- Useful for getting pretty icons, but requires a Nerd Font. - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that @@ -487,7 +503,7 @@ require('lazy').setup({ 'WhoIsSethDaniel/mason-tool-installer.nvim', -- Useful status updates for LSP. - { 'j-hui/fidget.nvim', opts = {} }, + { 'j-hui/fidget.nvim', opts = {} }, -- Allows extra capabilities provided by blink.cmp 'saghen/blink.cmp', @@ -673,7 +689,7 @@ require('lazy').setup({ local servers = { -- clangd = {}, -- gopls = {}, - -- pyright = {}, + pyright = {}, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- @@ -835,7 +851,9 @@ require('lazy').setup({ -- : Toggle signature help -- -- See :h blink-cmp-config-keymap for defining your own keymap - preset = 'default', + preset = 'enter', + + [''] = { 'accept', 'fallback' }, -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps @@ -976,15 +994,15 @@ require('lazy').setup({ -- require 'kickstart.plugins.debug', -- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.neo-tree', + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8d7a..19b404f2e41 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,160 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { + { "sindrets/diffview.nvim" }, + { + "rachartier/tiny-inline-diagnostic.nvim", + event = "VeryLazy", + priority = 1000, + config = function() + require('tiny-inline-diagnostic').setup() + vim.diagnostic.config({ virtual_text = false }) -- Disable default virtual text + end + }, + { + "jellydn/hurl.nvim", + dependencies = { + "MunifTanjim/nui.nvim", + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + -- Optional, for markdown rendering with render-markdown.nvim + { + 'MeanderingProgrammer/render-markdown.nvim', + opts = { + file_types = { "markdown" }, + }, + ft = { "markdown" }, + }, + }, + ft = "hurl", + opts = { + -- Show debugging info + debug = false, + -- Show notification on run + show_notification = false, + -- Show response in popup or split + mode = "split", + -- Default formatter + formatters = { + json = { 'jq' }, -- Make sure you have install jq in your system, e.g: brew install jq + html = { + 'prettier', -- Make sure you have install prettier in your system, e.g: npm install -g prettier + '--parser', + 'html', + }, + xml = { + 'tidy', -- Make sure you have installed tidy in your system, e.g: brew install tidy-html5 + '-xml', + '-i', + '-q', + }, + }, + -- Default mappings for the response popup or split views + mappings = { + close = 'q', -- Close the response popup or split view + next_panel = '', -- Move to the next response popup window + prev_panel = '', -- Move to the previous response popup window + }, + }, + keys = { + -- Run API request + { "A", "HurlRunner", desc = "Run All requests" }, + { "a", "HurlRunnerAt", desc = "Run Api request" }, + { "te", "HurlRunnerToEntry", desc = "Run Api request to entry" }, + { "tE", "HurlRunnerToEnd", desc = "Run Api request from current entry to end" }, + { "tm", "HurlToggleMode", desc = "Hurl Toggle Mode" }, + { "tv", "HurlVerbose", desc = "Run Api in verbose mode" }, + { "tV", "HurlVeryVerbose", desc = "Run Api in very verbose mode" }, + -- Run Hurl request in visual mode + { "h", ":HurlRunner", desc = "Hurl Runner", mode = "v" }, + }, + }, + { + 'AndrewRadev/tagalong.vim', + }, + { + 'windwp/nvim-ts-autotag', + config = function() + require('nvim-ts-autotag').setup { + opts = { + -- Defaults + enable_close = true, -- Auto close tags + enable_rename = true, -- Auto rename pairs of tags + enable_close_on_slash = false, -- Auto close on trailing l', function() + conform.format({ + lsp_fallback = true, + async = false, + timeout_ms = 1000, + }) + end, { desc = 'Format file or range (in visual mode)' }) + end, + }, +} diff --git a/lua/custom/plugins/neotree.lua b/lua/custom/plugins/neotree.lua new file mode 100644 index 00000000000..7c6a6a7371d --- /dev/null +++ b/lua/custom/plugins/neotree.lua @@ -0,0 +1,16 @@ +return { + -- { + -- 'nvim-neo-tree/neo-tree.nvim', + -- branch = 'v3.x', + -- dependencies = { + -- 'nvim-lua/plenary.nvim', + -- 'MunifTanjim/nui.nvim', + -- 'nvim-tree/nvim-web-devicons', -- optional, but recommended + -- }, + -- lazy = false, -- neo-tree will lazily load itself + -- keys = { + -- { 'e', ':Neotree toggle', desc = 'Toggle NeoTree', silent = true }, + -- { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, + -- }, + -- }, +} diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index c7067891df0..2b9050eef4f 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -11,15 +11,6 @@ return { }, lazy = false, keys = { - { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, - }, - opts = { - filesystem = { - window = { - mappings = { - ['\\'] = 'close_window', - }, - }, - }, + { 'e', ':Neotree toggle', desc = 'Toggle Neotree', silent = true }, }, }