diff --git a/init.lua b/init.lua index b6e4124..1995a7d 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,10 @@ +vim.cmd([[ + augroup FileType_http + au! + au BufNewFile,BufRead *.http setfiletype http + augroup END +]]) + return { colorscheme = "material", lsp = { diff --git a/mappings.lua b/mappings.lua index 7806187..f1ddf4c 100644 --- a/mappings.lua +++ b/mappings.lua @@ -37,6 +37,8 @@ return { ":m .-2==g", desc = "Move the line down", }, + ["r"] = { function() require("rest-nvim").run() end, desc = "Send http request" }, + ["Q"] = { ":qa" ,desc = "Quit all"} }, v = { ["gf"] = { ":OpenInGHFile ", desc = "Open in github" }, diff --git a/plugins/auto-save.lua b/plugins/auto-save.lua index bebbafe..1b0e432 100644 --- a/plugins/auto-save.lua +++ b/plugins/auto-save.lua @@ -1,4 +1,4 @@ return { "Pocco81/auto-save.nvim", - event = "BufEnter", + event = "User AstroFile", } diff --git a/plugins/chatgpt.lua b/plugins/chatgpt.lua index 21fc3a7..63b6319 100644 --- a/plugins/chatgpt.lua +++ b/plugins/chatgpt.lua @@ -1,10 +1,10 @@ return { - "jackMort/ChatGPT.nvim", - event = "VeryLazy", - config = function() require("chatgpt").setup() end, - dependencies = { - "MunifTanjim/nui.nvim", - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope.nvim", - }, + -- "jackMort/ChatGPT.nvim", + -- event = "VeryLazy", + -- config = function() require("chatgpt").setup() end, + -- dependencies = { + -- "MunifTanjim/nui.nvim", + -- "nvim-lua/plenary.nvim", + -- "nvim-telescope/telescope.nvim", + -- }, } diff --git a/plugins/cmp.lua b/plugins/cmp.lua index 8f1a099..210353c 100644 --- a/plugins/cmp.lua +++ b/plugins/cmp.lua @@ -1,64 +1,13 @@ return { --- "hrsh7th/cmp-nvim-lsp", --- "hrsh7th/cmp-nvim-lua", --- "hrsh7th/cmp-nvim-lsp-signature-help", --- "hrsh7th/cmp-vsnip", --- "hrsh7th/cmp-path", --- "hrsh7th/cmp-buffer", --- "hrsh7th/vim-vsnip", --- { --- "hrsh7th/nvim-cmp", --- config = function() --- -- Completion Plugin Setup --- local cmp = require "cmp" --- cmp.setup { --- -- Enable LSP snippets --- snippet = { --- expand = function(args) vim.fn["vsnip#anonymous"](args.body) end, --- }, --- mapping = { --- [""] = cmp.mapping.select_prev_item(), --- [""] = cmp.mapping.select_next_item(), --- -- Add tab support --- [""] = 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, --- }, --- }, --- -- Installed sources: --- sources = { --- { name = "path" }, -- file paths --- { name = "nvim_lsp", keyword_length = 3 }, -- from language server --- { name = "nvim_lsp_signature_help" }, -- display function signatures with current parameter emphasized --- { name = "nvim_lua", keyword_length = 2 }, -- complete neovim's Lua runtime API such vim.lsp.* --- { name = "buffer", keyword_length = 2 }, -- source current buffer - -- { name = "vsnip", keyword_length = 2 }, -- nvim-cmp source for vim-vsnip --- { name = "calc" }, -- source for math calculation --- }, --- window = { --- completion = cmp.config.window.bordered(), --- documentation = cmp.config.window.bordered(), --- }, --- formatting = { --- fields = { "menu", "abbr", "kind" }, --- format = function(entry, item) --- local menu_icon = { --- nvim_lsp = "λ", --- vsnip = "⋗", --- buffer = "Ω", --- path = "🖫", --- } --- item.menu = menu_icon[entry.source.name] --- return item --- end, --- }, --- } --- end, --- }, + "nvim-cmp", + dependencies = { + { + "zbirenbaum/copilot-cmp", + opts = {}, + }, + }, + opts = function(_, opts) + local cmp = require "cmp" + opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "copilot" } })) + end, } diff --git a/plugins/copilot.lua b/plugins/copilot.lua new file mode 100644 index 0000000..0db8576 --- /dev/null +++ b/plugins/copilot.lua @@ -0,0 +1,15 @@ +return { + "zbirenbaum/copilot.lua", + cmd = "Copilot", + event = "InsertEnter", + opts = { + filetypes = { + javascript = true, + typescript = true, + rust = true, + css = true, + scss = true, + ["*"] = false, + } + }, +} diff --git a/plugins/opengh.lua b/plugins/opengh.lua index 0226355..0410ba6 100644 --- a/plugins/opengh.lua +++ b/plugins/opengh.lua @@ -1,4 +1,4 @@ return { "Almo7aya/openingh.nvim", - event = "BufEnter", + event = "User AstroFile", } diff --git a/plugins/rest-nvim.lua b/plugins/rest-nvim.lua new file mode 100644 index 0000000..045df3f --- /dev/null +++ b/plugins/rest-nvim.lua @@ -0,0 +1,7 @@ +return { + "rest-nvim/rest.nvim", + event = "User AstroFile", + requires = { "nvim-lua/plenary.nvim" }, + opts = {}, +} + diff --git a/plugins/treesitter.lua b/plugins/treesitter.lua index 22261f0..3f0cc0a 100644 --- a/plugins/treesitter.lua +++ b/plugins/treesitter.lua @@ -1,8 +1,46 @@ return { "nvim-treesitter/nvim-treesitter", opts = { - "all", - -- ensure_installed = "all", + -- "all", + ensure_installed = { + "http", + "json", + "bash", + "css", + "diff", + "dockerfile", + "dot", + "git_rebase", + "gitattributes", + "html", + "java", + "javascript", + "jq", + "jsdoc", + "json5", + "kotlin", + "latex", + "make", + "markdown", + "markdown_inline", + "nix", + "passwd", + "prisma", + "proto", + "python", + "regex", + "rst", + "rust", + "scss", + "sql", + "svelte", + "terraform", + "toml", + "tsx", + "typescript", + "vue", + "yaml", + }, -- auto_install = true, highlight = { enable = true,