diff --git a/init.lua b/init.lua index 0dfceab..fbeb896 100644 --- a/init.lua +++ b/init.lua @@ -14,3 +14,29 @@ vim.opt.relativenumber=true vim.opt.clipboard=unnamedplus vim.opt.ttyfast=true vim.cmd("filetype plugin on") + +-- quick exit all +vim.api.nvim_set_keymap("n", ":Q", ":qall", { noremap = true, silent = true }) + + + +-- Plugins +require("config.lazy") + +-- catpucchin +require("catppuccin").setup() +vim.cmd("colorscheme catppuccin-mocha") + +-- using lua API +vim.keymap.set("n", "fb", function() + require("telescope").extensions.file_browser.file_browser() + +end) + +-- nvim-tree +local api = require("nvim-tree.api") +api.tree.open() -- Open the tree + +vim.schedule(function() + vim.cmd("wincmd p") -- Go back to the previous window (the editor) +end) diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..6fe5404 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,9 @@ +{ + "catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "nvim-tree.lua": { "branch": "master", "commit": "6709463b2d18e77f7a946027917aa00d4aaed6f4" }, + "nvim-web-devicons": { "branch": "master", "commit": "4c3a5848ee0b09ecdea73adcd2a689190aeb728c" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" }, + "telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" } +} diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua new file mode 100644 index 0000000..8aa3cd8 --- /dev/null +++ b/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/lua/plugins/catppuccin.lua b/lua/plugins/catppuccin.lua new file mode 100644 index 0000000..8261c54 --- /dev/null +++ b/lua/plugins/catppuccin.lua @@ -0,0 +1,3 @@ +return { +{ "catppuccin/nvim", name = "catppuccin", priority = 1000 } +} diff --git a/lua/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua new file mode 100644 index 0000000..93604bb --- /dev/null +++ b/lua/plugins/nvim-tree.lua @@ -0,0 +1,11 @@ +return { + "nvim-tree/nvim-tree.lua", + version = "*", + lazy = false, + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + config = function() + require("nvim-tree").setup {} + end, +} diff --git a/lua/plugins/nvim-web-devicons.lua b/lua/plugins/nvim-web-devicons.lua new file mode 100644 index 0000000..f15b641 --- /dev/null +++ b/lua/plugins/nvim-web-devicons.lua @@ -0,0 +1,3 @@ +return { + { "nvim-tree/nvim-web-devicons", opts = {} }, +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..58e8aa6 --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,6 @@ +return { + { + "nvim-telescope/telescope-file-browser.nvim", + dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" } + } +}