From f4295a7ac1c4a167028fde23b902dcca519e05be Mon Sep 17 00:00:00 2001 From: Wesley Irvin Date: Fri, 2 Aug 2024 14:31:14 -0400 Subject: [PATCH] Neovim Addition Added in my custom configuration from Neovim that I started writing from scratch. So far only have implemented tokyonight theme, telescope, treesitter, and neotree. --- .gitignore | 1 + nvim/dot-config/nvim/init.lua | 19 +++++++++++++++++++ nvim/dot-config/nvim/lua/plugins/neotree.lua | 13 +++++++++++++ .../dot-config/nvim/lua/plugins/telescope.lua | 9 +++++++++ .../nvim/lua/plugins/tokyonight.lua | 10 ++++++++++ .../nvim/lua/plugins/treesitter.lua | 12 ++++++++++++ nvim/dot-config/nvim/lua/vim-options.lua | 7 +++++++ 7 files changed, 71 insertions(+) create mode 100644 .gitignore create mode 100644 nvim/dot-config/nvim/init.lua create mode 100644 nvim/dot-config/nvim/lua/plugins/neotree.lua create mode 100644 nvim/dot-config/nvim/lua/plugins/telescope.lua create mode 100644 nvim/dot-config/nvim/lua/plugins/tokyonight.lua create mode 100644 nvim/dot-config/nvim/lua/plugins/treesitter.lua create mode 100644 nvim/dot-config/nvim/lua/vim-options.lua diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9c11390 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +nvim/dot-config/nvim/lazy-lock.json diff --git a/nvim/dot-config/nvim/init.lua b/nvim/dot-config/nvim/init.lua new file mode 100644 index 0000000..98dabae --- /dev/null +++ b/nvim/dot-config/nvim/init.lua @@ -0,0 +1,19 @@ +-- 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) + +require("vim-options") +require("lazy").setup("plugins") diff --git a/nvim/dot-config/nvim/lua/plugins/neotree.lua b/nvim/dot-config/nvim/lua/plugins/neotree.lua new file mode 100644 index 0000000..8f8de9e --- /dev/null +++ b/nvim/dot-config/nvim/lua/plugins/neotree.lua @@ -0,0 +1,13 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + "MunifTanjim/nui.nvim", + -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information + }, + config = function() + vim.keymap.set('n', 'fe', ':Neotree filesystem reveal toggle left', {}) + end +} diff --git a/nvim/dot-config/nvim/lua/plugins/telescope.lua b/nvim/dot-config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..d2dc830 --- /dev/null +++ b/nvim/dot-config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,9 @@ +return { + 'nvim-telescope/telescope.nvim', tag = '0.1.8', + dependencies = { 'nvim-lua/plenary.nvim' }, + config = function() + local builtin = require('telescope.builtin') + vim.keymap.set('n', '', builtin.find_files, {}) + vim.keymap.set('n', 'fg', builtin.live_grep, {}) + end +} diff --git a/nvim/dot-config/nvim/lua/plugins/tokyonight.lua b/nvim/dot-config/nvim/lua/plugins/tokyonight.lua new file mode 100644 index 0000000..a5be3bb --- /dev/null +++ b/nvim/dot-config/nvim/lua/plugins/tokyonight.lua @@ -0,0 +1,10 @@ +return { + "folke/tokyonight.nvim", + lazy = false, + priority = 1000, + opts = {}, + config = function() + vim.cmd.colorscheme "tokyonight-storm" + end +} + diff --git a/nvim/dot-config/nvim/lua/plugins/treesitter.lua b/nvim/dot-config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..1ca5b94 --- /dev/null +++ b/nvim/dot-config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,12 @@ +return{ + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + local configs = require("nvim-treesitter.configs") + configs.setup({ + ensure_installed = { "c", "cmake", "cpp", "lua", "python", "rust", "toml" }, + highlight = { enable = true }, + indent = { enable = true }, + }) + end +} diff --git a/nvim/dot-config/nvim/lua/vim-options.lua b/nvim/dot-config/nvim/lua/vim-options.lua new file mode 100644 index 0000000..b9afb6a --- /dev/null +++ b/nvim/dot-config/nvim/lua/vim-options.lua @@ -0,0 +1,7 @@ +vim.cmd("set shiftwidth=2") +vim.cmd("set tabstop=2") +vim.g.mapleader = " " +vim.wo.relativenumber = true +vim.wo.number = true +vim.cmd("set list") +