From ac9dd894cc17807d6cb3cdc052b4c176340bfbcf Mon Sep 17 00:00:00 2001 From: Maciej Jur Date: Sat, 22 Jul 2023 13:52:10 +0200 Subject: [PATCH] Refactor config --- nvim/lazy-lock.json | 10 ++-- nvim/lua/plugins.lua | 114 ++++++++++++++++++++++++++----------------- 2 files changed, 74 insertions(+), 50 deletions(-) diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 500606b..78b46b4 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -9,12 +9,12 @@ "gitsigns.nvim": { "branch": "main", "commit": "adcf2c7f2f495f5df148683764bf7cba6a70f34c" }, "haskell-tools.nvim": { "branch": "1.x.x", "commit": "43ec3b2f068c8163476dbb0c35bcb8ad7d588fa4" }, "kanagawa.nvim": { "branch": "master", "commit": "1749cea392acb7d1548a946fcee1e6f1304cd3cb" }, - "lazy.nvim": { "branch": "main", "commit": "ed15f6b39422f46412212005f6d12c6f353b0293" }, + "lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" }, "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "828a538ac8419f586c010996aefa5df6eb7c250b" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "e4d56b400e9757b1dc77d620fd3069396e92d5fc" }, - "mason.nvim": { "branch": "main", "commit": "5ad3e113b0c3fde3caba8630599373046f6197e8" }, - "neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" }, + "mason.nvim": { "branch": "main", "commit": "3f6b544c75c01549f7a2a9e395e0f1cea42b25dd" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "981a43adcca25e7ccc3c589902d49f25e4d48ebc" }, "nui.nvim": { "branch": "main", "commit": "9e3916e784660f55f47daa6f26053ad044db5d6a" }, "nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" }, "nvim-dap": { "branch": "master", "commit": "d17d1bba23ec72a157bd183c57840c39e323f515" }, @@ -25,6 +25,6 @@ "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, "rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" }, - "telescope.nvim": { "branch": "master", "commit": "47c755d737702df7a39b640c8d9c473a728be1df" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" }, "typst.vim": { "branch": "main", "commit": "6a99324a138c2da69589a8ab2e49375774e43d77" } } \ No newline at end of file diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index afb4333..5bde932 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -1,53 +1,106 @@ return { + + -- Editor theme + { + "rebelot/kanagawa.nvim", + lazy = false, + priority = 1000, + config = function() + vim.cmd("colorscheme kanagawa") + end, + }, + + -- Status line + { + "nvim-lualine/lualine.nvim", + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + config = function() + local lualine = require("lualine") + lualine.setup() + end, + }, + -- Telescope { "nvim-telescope/telescope.nvim", + branch = "0.1.x", dependencies = { "nvim-lua/plenary.nvim", }, + config = function() + local builtin = require('telescope.builtin') + vim.keymap.set('n', 'ff', builtin.find_files, {}) + vim.keymap.set('n', 'fg', builtin.live_grep, {}) + vim.keymap.set('n', 'fb', builtin.buffers, {}) + vim.keymap.set('n', 'fh', builtin.help_tags, {}) + end, }, + + -- Discord presence + { + "andweeb/presence.nvim", + config = function() + local presence = require("presence") + presence.setup({ + main_image = "file", + buttons = false, + show_time = false, + }) + end, + }, + -- Treesitter { "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", config = function() local configs = require("nvim-treesitter.configs"); configs.setup({ + sync_install = false, ensure_installed = { -- nvim "vim", "vimdoc", "lua", + -- misc + "comment", "gitignore", "diff", "dockerfile", "json", "yaml", "toml", "regex", -- shell - "bash", "fish", -- "nu", - -- rust - "rust", "toml", - -- python - "python", - -- webdev - "html", "css", "scss", "javascript", "jsdoc", "typescript", "tsx", "astro", "svelte", "vue", + "bash", -- "fish", "nu", -- markdown "markdown", "markdown_inline", - -- nix - "nix", + -- python + "python", + -- rust + "rust", "toml", + -- webdev + "html", "css", "scss", "javascript", "jsdoc", "typescript", "tsx", "astro", "svelte", "vue", -- haskell "haskell", + -- nix + "nix", -- literate "latex", "bibtex", -- "typst", - -- misc - "gitignore", "diff", "dockerfile", "json", "yaml", "regex", }, - sync_install = false, - highlight = { enable = true }, - indent = { enable = true }, + highlight = { + enable = true, + }, + indent = { + enable = true, + }, }) end, - build = ":TSUpdate", init = function() vim.treesitter.language.register("markdown", "mdx") end, }, - -- LSP + + -- LS configs { "neovim/nvim-lspconfig", + -- TODO: config here + -- https://github.com/neovim/nvim-lspconfig#suggested-configuration }, + -- Snippet engine { "saadparwaiz1/cmp_luasnip", @@ -194,34 +247,5 @@ return { require("gitsigns").setup() end, }, - -- Discord presence - { - "andweeb/presence.nvim", - config = function() - require("presence").setup({ - main_image = "file", - buttons = false, - show_time = false, - }) - end, - }, - -- Status line - { - "nvim-lualine/lualine.nvim", - config = function() - local config = require("lualine") - config.setup({}) - end, - dependencies = { - "nvim-tree/nvim-web-devicons", - }, - }, - -- Editor theme - { - "rebelot/kanagawa.nvim", - init = function() - vim.cmd("colorscheme kanagawa") - end, - } }