From ae01124a46b3a12f9d468624f4468ed67932363a Mon Sep 17 00:00:00 2001 From: Selim Mustafaev Date: Mon, 15 Apr 2024 16:58:49 +0300 Subject: [PATCH] Initial commit --- init.lua | 40 ++++++++++++++++++++++++++++++++++++ lazy-lock.json | 13 ++++++++++++ lua/plugins/lualine.lua | 31 ++++++++++++++++++++++++++++ lua/plugins/monokai.lua | 15 ++++++++++++++ lua/plugins/neotree.lua | 26 +++++++++++++++++++++++ lua/plugins/noice.lua | 20 ++++++++++++++++++ lua/plugins/rustaceanvim.lua | 7 +++++++ lua/plugins/treesitter.lua | 25 ++++++++++++++++++++++ 8 files changed, 177 insertions(+) create mode 100644 init.lua create mode 100644 lazy-lock.json create mode 100644 lua/plugins/lualine.lua create mode 100644 lua/plugins/monokai.lua create mode 100644 lua/plugins/neotree.lua create mode 100644 lua/plugins/noice.lua create mode 100644 lua/plugins/rustaceanvim.lua create mode 100644 lua/plugins/treesitter.lua diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..cea15d9 --- /dev/null +++ b/init.lua @@ -0,0 +1,40 @@ +-- tab/indent options + +vim.opt.expandtab = false +vim.opt.smarttab = true +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.smartindent = true + +-- enable line numbers + +vim.opt.nu = true +vim.opt.relativenumber = true + +-- enable 24 bit colors + +vim.opt.termguicolors = true + +-- disable netrw (will use neotree instead) + +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + +-- Lazy.nvim + +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end + +vim.opt.rtp:prepend(lazypath) +require("lazy").setup("plugins") + diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..72c8be2 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,13 @@ +{ + "lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" }, + "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, + "monokai-pro.nvim": { "branch": "master", "commit": "aafde73a622435891d36b411d8623e705ead6293" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "c61074acb19102dfc6f21738dcae4d9a494a8959" }, + "noice.nvim": { "branch": "main", "commit": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12" }, + "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, + "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, + "nvim-treesitter": { "branch": "master", "commit": "ef267f0c285928ea3a0d3362a260a0728fd4a146" }, + "nvim-web-devicons": { "branch": "master", "commit": "6e355632387a085f15a66ad68cf681c1d7374a04" }, + "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, + "rustaceanvim": { "branch": "master", "commit": "555ba5e2f10626d16d07c58bc5953867505b899e" } +} \ No newline at end of file diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..838f053 --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,31 @@ +return { + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + dependencies = { + "nvim-tree/nvim-web-devicons" + }, + init = function() + vim.g.lualine_laststatus = vim.o.laststatus + if vim.fn.argc(-1) > 0 then + -- set an empty statusline till lualine loads + vim.o.statusline = " " + else + -- hide the statusline on the starter page + vim.o.laststatus = 0 + end + end, + config = function() + require("lualine").setup({ + options = { + theme = "monokai-pro", + globalstatus = true + }, + extensions = { + "lazy", + "neo-tree" + }, + }) + end + } +} diff --git a/lua/plugins/monokai.lua b/lua/plugins/monokai.lua new file mode 100644 index 0000000..dc3973c --- /dev/null +++ b/lua/plugins/monokai.lua @@ -0,0 +1,15 @@ +return { + { + "loctvl842/monokai-pro.nvim", + lazy = false, + priority = 1000, + config = function() + require("monokai-pro").setup({ + filter = "pro", + --terminal_colors = true, + --transparent_background = true + }) + vim.cmd([[colorscheme monokai-pro]]) + end + } +} diff --git a/lua/plugins/neotree.lua b/lua/plugins/neotree.lua new file mode 100644 index 0000000..61d279e --- /dev/null +++ b/lua/plugins/neotree.lua @@ -0,0 +1,26 @@ +return { + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim" + }, + keys = { + { "nt", "Neotree toggle", desc = "NeoTree toggle" }, + { "", "Neotree focus", desc = "NeoTree focus" } + }, + config = function(_, opts) + require("neo-tree").setup(opts) + end, + init = function() + if vim.fn.argc(-1) == 1 then + local stat = vim.uv.fs_stat(vim.fn.argv(0)) + if stat and stat.type == "directory" then + require("neo-tree") + end + end + end + } +} diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua new file mode 100644 index 0000000..4a4d2ec --- /dev/null +++ b/lua/plugins/noice.lua @@ -0,0 +1,20 @@ +return { + { + "folke/noice.nvim", + event = "VeryLazy", + dependencies = { + "MunifTanjim/nui.nvim", + "rcarriga/nvim-notify" + }, + config = function() + require("noice").setup({ + lsp = { + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true + } + } + }) + end + } +} diff --git a/lua/plugins/rustaceanvim.lua b/lua/plugins/rustaceanvim.lua new file mode 100644 index 0000000..db12f43 --- /dev/null +++ b/lua/plugins/rustaceanvim.lua @@ -0,0 +1,7 @@ +return { + { + "mrcjkb/rustaceanvim", + version = "^4", + ft = { "rust" } + } +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..830e9cb --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,25 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + require("nvim-treesitter.configs").setup({ + highlight = { enable = true }, + indent = { enable = true }, + ensure_installed = { + "c", + "cpp", + "rust", + "javascript", + "lua", + "vim", + "regex", + "bash", + "markdown", + "markdown_inline" + }, + auto_install = false + }) + end + } +}