├── README.md ├── init.lua └── lua ├── plugins ├── init.lua └── telescope.lua └── user ├── lazy_bootstrap.lua ├── maps.lua └── options.lua /README.md: -------------------------------------------------------------------------------- 1 | # Neovim Lazy Starter 2 | 3 | A lazy starter kit if you're not sure how to start using [folke/lazy](https://github.com/folke/lazy.nvim). 4 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | 2 | -- . 3 | -- ├── init.lua 4 | -- ├── ... 5 | -- └── lua 6 | -- ├── plugins 7 | -- │   ├── init.lua -- Loads simple plugins 8 | -- │   └── telescope.lua -- Larger plugins have separate files 9 | -- └── user 10 | -- ├── lazy_bootstrap.lua 11 | -- ├── maps.lua 12 | -- └── options.lua 13 | 14 | -- NOTE: ensure that you map before loading Lazy 15 | 16 | require("user/lazy_bootstrap") -- bootstraps folke/lazy 17 | require("user/options") -- loads options, colors, etc. 18 | require("user/maps") -- loads non-plugin maps 19 | require("lazy").setup("plugins") -- loads each lua/plugin/* 20 | -------------------------------------------------------------------------------- /lua/plugins/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { "tpope/vim-fugitive" }, 3 | { "tpope/vim-surround" }, 4 | { "norcalli/nvim-colorizer.lua" }, 5 | { "windwp/nvim-autopairs", config = true }, -- See `config` under https://github.com/folke/lazy.nvim#-plugin-spec 6 | { "numToStr/Comment.nvim", config = true }, 7 | } 8 | -------------------------------------------------------------------------------- /lua/plugins/telescope.lua: -------------------------------------------------------------------------------- 1 | ----------------------------------------------[[ Example Spec ]] 2 | -- This file shows how to organize a more involved plugin 3 | -- Plugins requiring fewer options can be put into lua/plugins/init.lua 4 | 5 | local M = { 6 | -- See https://github.com/folke/lazy.nvim#-plugin-spec 7 | "nvim-telescope/telescope.nvim", branch = "0.1.x", -- optional branch lock 8 | dependencies = { 9 | { "nvim-lua/plenary.nvim" } -- these can also have their own plugin file 10 | }, 11 | cmd = { "Telescope" }, -- lazy loads on these commands 12 | } 13 | 14 | function M.config() 15 | local telescope = require("telescope") 16 | telescope.setup({}) 17 | end 18 | 19 | -- Lazy loads on these mappings 20 | M.keys = { 21 | ---MAPPING------COMMAND---------------------------MODE-----DESCRIPTION----------------- 22 | { "ff", ":Telescope find_files", { "n" }, desc = "Telescope files" }, 23 | { "fg", ":Telescope live_grep" , { "n" }, desc = "Telescope grep" }, 24 | { "fb", ":Telescope buffers" , { "n" }, desc = "Telescope buffers" }, 25 | { "fh", ":Telescope help_tags" , { "n" }, desc = "Telescope help" }, 26 | } 27 | 28 | return M 29 | -------------------------------------------------------------------------------- /lua/user/lazy_bootstrap.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 2 | if not vim.loop.fs_stat(lazypath) then 3 | vim.fn.system({ 4 | "git", 5 | "clone", 6 | "--filter=blob:none", 7 | "--single-branch", 8 | "https://github.com/folke/lazy.nvim.git", 9 | lazypath, 10 | }) 11 | end 12 | vim.opt.runtimepath:prepend(lazypath) 13 | -------------------------------------------------------------------------------- /lua/user/maps.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------------[[ Non-plugin maps ]] 2 | -- Plugin maps go into `plugins/*` files 3 | -- (see lua/plugins/telescope.lua as an example) 4 | 5 | local opts = { silent = true } 6 | local expr_opts = { silent = true, expr = true } 7 | 8 | vim.g.mapleader = " " 9 | 10 | vim.keymap.set({ "n" }, "x" , '"_x') -- use the blackhole register for deletions 11 | vim.keymap.set({ "n" }, "" , ":noh", opts) -- turn off search highlight! 12 | vim.keymap.set({ "n", "v" }, "p", '"0p', opts, { desc = "Paste from yank register" }) 13 | vim.keymap.set({ "v" }, "<" , "" , ">gv", opts, { desc = "Indent lines in" }) 15 | -------------------------------------------------------------------------------- /lua/user/options.lua: -------------------------------------------------------------------------------- 1 | local fn = vim.fn 2 | local o = vim.opt 3 | 4 | vim.cmd([[colo habamax]]) 5 | 6 | o.completeopt = { "menu", "menuone", "noselect", "noinsert" } -- A comma separated list of options for Insert mode completion 7 | o.number = true -- show line numbers (or only the current one) 8 | o.relativenumber = true -- line numbers 9 | o.shiftwidth = 4 10 | o.smartcase = true -- smart case 11 | o.smartindent = true -- make indenting smarter again 12 | o.swapfile = false -- enable/disable swap file creation 13 | o.tabstop = 4 -- how many columns a tab counts for 14 | o.termguicolors = true -- set term gui colors (most terminals support this) 15 | o.undodir = fn.stdpath("data") .. "/undodir" -- set undo directory 16 | o.undofile = true -- enable/disable undo file creation 17 | o.wildignorecase = true -- When set case is ignored when completing file names and directories 18 | o.wildmode = "full" 19 | --------------------------------------------------------------------------------