From 123b04ba0e56b848f479ec44742ca3d17f658686 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Fri, 9 Aug 2024 18:37:06 +0200 Subject: [PATCH] Add .config/nvim/init.lua Add .config/nvim/lazy-lock.json Add .config/nvim/lua/config/lazy.lua Add .config/nvim/lua/core/autocmds.lua Add .config/nvim/lua/core/options.lua Add .config/nvim/lua/plugins/autopairs.lua Add .config/nvim/lua/plugins/catppuccin.lua Add .config/nvim/lua/plugins/lsp.lua Add .config/nvim/lua/plugins/syntax.lua Add .config/nvim/lua/plugins/telescope.lua Update zed/settings.json --- dot_config/nvim/init.lua | 3 +++ dot_config/nvim/lazy-lock.json | 19 +++++++++++++++ dot_config/nvim/lua/config/lazy.lua | 35 +++++++++++++++++++++++++++ dot_config/nvim/lua/core/autocmds.lua | 8 ++++++ dot_config/nvim/lua/core/options.lua | 2 ++ zed/settings.json | 22 ++++++++++++++++- 6 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 dot_config/nvim/init.lua create mode 100644 dot_config/nvim/lazy-lock.json create mode 100644 dot_config/nvim/lua/config/lazy.lua create mode 100644 dot_config/nvim/lua/core/autocmds.lua create mode 100644 dot_config/nvim/lua/core/options.lua diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua new file mode 100644 index 0000000..d414f08 --- /dev/null +++ b/dot_config/nvim/init.lua @@ -0,0 +1,3 @@ +require("core.autocmds") +require("core.options") +require("config.lazy") diff --git a/dot_config/nvim/lazy-lock.json b/dot_config/nvim/lazy-lock.json new file mode 100644 index 0000000..c8f1d6f --- /dev/null +++ b/dot_config/nvim/lazy-lock.json @@ -0,0 +1,19 @@ +{ + "catppuccin": { "branch": "main", "commit": "f8564054831b45bac52f91bb8d12c68631b13e1a" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" }, + "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "62360f061d45177dda8afc1b0fd1327328540301" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "nvim-autopairs": { "branch": "master", "commit": "4a39f2dcbe1967ddc3a0f76f863540dd3aa7871a" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-lspconfig": { "branch": "master", "commit": "652386deae739e38fa1bcf2f06e3e7de9b3436ba" }, + "nvim-treesitter": { "branch": "master", "commit": "176e4464736c1feca190d77f481ed5972b513516" }, + "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "vim-vsnip": { "branch": "master", "commit": "02a8e79295c9733434aab4e0e2b8c4b7cea9f3a9" } +} diff --git a/dot_config/nvim/lua/config/lazy.lua b/dot_config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..f5ee74c --- /dev/null +++ b/dot_config/nvim/lua/config/lazy.lua @@ -0,0 +1,35 @@ +-- 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 +end +vim.opt.rtp:prepend(lazypath) + +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + -- import your plugins + { import = "plugins" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "habamax" } }, + -- automatically check for plugin updates + checker = { enabled = true }, +}) diff --git a/dot_config/nvim/lua/core/autocmds.lua b/dot_config/nvim/lua/core/autocmds.lua new file mode 100644 index 0000000..2a5bab5 --- /dev/null +++ b/dot_config/nvim/lua/core/autocmds.lua @@ -0,0 +1,8 @@ +local autocmd = vim.api.nvim_create_autocmd -- Create autocommand + +autocmd("BufWritePre", { + buffer = buffer, + callback = function() + vim.lsp.buf.format { async = false } + end +}) diff --git a/dot_config/nvim/lua/core/options.lua b/dot_config/nvim/lua/core/options.lua new file mode 100644 index 0000000..2796c3e --- /dev/null +++ b/dot_config/nvim/lua/core/options.lua @@ -0,0 +1,2 @@ +vim.g.mapleader = " " +vim.wo.relativenumber = true diff --git a/zed/settings.json b/zed/settings.json index c378383..ac636b6 100644 --- a/zed/settings.json +++ b/zed/settings.json @@ -7,6 +7,9 @@ // custom settings, run the `open default settings` command // from the command palette or from `Zed` application menu. { + "terminal": { + "dock": "bottom" + }, "ui_font_size": 17, "buffer_font_size": 16, "theme": { @@ -17,5 +20,22 @@ "vim_mode": true, "relative_line_numbers": true, "soft_wrap": "preferred_line_length", - "preferred_line_length": 160 + "preferred_line_length": 160, + "project_panel": { + "dock": "right" + }, + "outline_panel": { + "dock": "right" + }, + "assistant": { + "version": "2", + "dock": "left" + }, + "chat_panel": { + "button": false + }, + "collaboration_panel": { + "dock": "right", + "button": false + } }