diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..6bf6932 --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,23 @@ +-- Before configs +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + +-- Plugins +require("config.lazy") +require("lazy").setup("plugins") + +-- require("oil").setup() +require("nvim-tree").setup() +require("nvim-treesitter").setup() + +require("mason").setup() +require("mason-lspconfig").setup() +require("mason-lspconfig").setup_handlers { + function (server_name) + require("lspconfig")[server_name].setup {} + end +} + +-- Options +require("config.option") +require("config.keymap") diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..3cf45d2 --- /dev/null +++ b/.config/nvim/lazy-lock.json @@ -0,0 +1,18 @@ +{ + "blink.cmp": { "branch": "main", "commit": "cb5e346d9e0efa7a3eee7fd4da0b690c48d2a98e" }, + "friendly-snippets": { "branch": "main", "commit": "fc8f183479a472df60aa86f00e295462f2308178" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, + "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, + "nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" }, + "nvim-lspconfig": { "branch": "master", "commit": "32b6a6449aaba11461fffbb596dd6310af79eea4" }, + "nvim-navbuddy": { "branch": "master", "commit": "f22bac988f2dd073601d75ba39ea5636ab6e38cb" }, + "nvim-navic": { "branch": "master", "commit": "39231352aec0d1e09cebbffdd9dc20a5dc691ffe" }, + "nvim-tree.lua": { "branch": "master", "commit": "be5b788f2dc1522c73fb7afad9092331c8aebe80" }, + "nvim-treesitter": { "branch": "master", "commit": "684eeac91ed8e297685a97ef70031d19ac1de25a" }, + "nvim-web-devicons": { "branch": "master", "commit": "855c97005c8eebcdd19846f2e54706bffd40ee96" }, + "oil.nvim": { "branch": "master", "commit": "685cdb4ffa74473d75a1b97451f8654ceeab0f4a" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "sonokai": { "branch": "master", "commit": "f59c796780655c3b9da442d310ad2f2d735f2e56" }, + "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" } +} diff --git a/.config/nvim/lua/config/Mason.lua b/.config/nvim/lua/config/Mason.lua new file mode 100644 index 0000000..f3b7fe2 --- /dev/null +++ b/.config/nvim/lua/config/Mason.lua @@ -0,0 +1,11 @@ +return { + { + "williamboman/mason.nvim", + }, + { + "neovim/nvim-lspconfig", + }, + { + "williamboman/mason-lspconfig.nvim", + }, +} diff --git a/.config/nvim/lua/config/keymap.lua b/.config/nvim/lua/config/keymap.lua new file mode 100644 index 0000000..e69de29 diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..f5ee74c --- /dev/null +++ b/.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/.config/nvim/lua/config/option.lua b/.config/nvim/lua/config/option.lua new file mode 100644 index 0000000..a7df83d --- /dev/null +++ b/.config/nvim/lua/config/option.lua @@ -0,0 +1,9 @@ +-- Line number +vim.opt.number = true +vim.opt.relativenumber = false + +-- Tab + +-- Colors +vim.opt.termguicolors = true +vim.cmd.colorscheme("sonokai") diff --git a/.config/nvim/lua/plugins/blink.lua b/.config/nvim/lua/plugins/blink.lua new file mode 100644 index 0000000..6322fa7 --- /dev/null +++ b/.config/nvim/lua/plugins/blink.lua @@ -0,0 +1,26 @@ +return { + "Saghen/blink.cmp", + dependencies = { "rafamadriz/friendly-snippets" }, + + version = "1.*", + + ---@module "blink.cmp" + ---@type blink.cmp.Config + + opts = { + keymap = { preset = "default" }, + + appearance = { + nerd_font_variant = "mono" + }, + + completion = { documentation = { auto_show = false } }, + + sources = { + default = { "lsp", "path", "snippets", "buffer" }, + }, + + fuzzy = { implementation = "prefer_rust" } + }, + opts_extend = { "sources.default"} +} diff --git a/.config/nvim/lua/plugins/mason.lua b/.config/nvim/lua/plugins/mason.lua new file mode 100644 index 0000000..f313832 --- /dev/null +++ b/.config/nvim/lua/plugins/mason.lua @@ -0,0 +1,11 @@ +return { + { + "williamboman/mason.nvim", + -- lazy = true, + }, + + { + "williamboman/mason-lspconfig.nvim", + -- lazy = true, + } +} diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua new file mode 100644 index 0000000..f76c879 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -0,0 +1,13 @@ +return { + 'neovim/nvim-lspconfig', + dependencies = { + { + "SmiteshP/nvim-navbuddy", + dependencies = { + "SmiteshP/nvim-navic", + "MunifTanjim/nui.nvim" + }, + opts = { lsp = { auto_attach = true } } + } + }, +} diff --git a/.config/nvim/lua/plugins/nvim-tree.lua b/.config/nvim/lua/plugins/nvim-tree.lua new file mode 100644 index 0000000..687a576 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-tree.lua @@ -0,0 +1,19 @@ +return { + "nvim-tree/nvim-tree.lua", + sort = { + sorter = "name", + }, + view = { + width = 30, + }, + renderer = { + group_empty = false, + highlight_git = "all", + }, + filters = { + dotfiles = true, + }, + git = { + enable = true, + } +} diff --git a/.config/nvim/lua/plugins/nvim-treesitter.lua b/.config/nvim/lua/plugins/nvim-treesitter.lua new file mode 100644 index 0000000..fc6d145 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-treesitter.lua @@ -0,0 +1,16 @@ +return { + {"nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function () + local configs = require("nvim-treesitter.configs") + + configs.setup({ + ensure_installed = {"lua"}, + sync_install = false, + highlight = {enable = true}, + indent = {enable = false}, + }) + + end + }, +} diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua new file mode 100644 index 0000000..537ef59 --- /dev/null +++ b/.config/nvim/lua/plugins/oil.lua @@ -0,0 +1,13 @@ +return { + { + 'stevearc/oil.nvim', + ---@module 'oil' + ---@type oil.SetupOpts + opts = {}, + -- Optional dependencies + -- dependencies = { { "echasnovski/mini.icons", opts = {} } }, + dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons + -- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations. + lazy = false, + } +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..03f4051 --- /dev/null +++ b/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,5 @@ +return { + "nvim-telescope/telescope.nvim", + tag = "0.1.8", + dependencies = { "nvim-lua/plenary.nvim" } +} diff --git a/.config/nvim/lua/plugins/themes.lua b/.config/nvim/lua/plugins/themes.lua new file mode 100644 index 0000000..3b92503 --- /dev/null +++ b/.config/nvim/lua/plugins/themes.lua @@ -0,0 +1,3 @@ +return { + "sainnhe/sonokai" +}