From 916560e22c71919c405bcc7c305233c53faca23a Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Wed, 4 Dec 2024 15:22:00 -0500 Subject: [PATCH] day 4 --- 04 - Package Manager/Package Manager.md | 43 +++++++++++++++++++++++++ 04 - Package Manager/init.lua | 18 +++++++++++ README.md | 8 ++--- init.lua | 18 +++++++++++ 4 files changed, 83 insertions(+), 4 deletions(-) create mode 100644 04 - Package Manager/Package Manager.md create mode 100644 04 - Package Manager/init.lua create mode 100644 init.lua diff --git a/04 - Package Manager/Package Manager.md b/04 - Package Manager/Package Manager.md new file mode 100644 index 0000000..8d10a3c --- /dev/null +++ b/04 - Package Manager/Package Manager.md @@ -0,0 +1,43 @@ +# Package Manager + +## Package Manager + +Going to use `lazy.nvim` +- https://lazy.folke.io/installation + +NOTE: which is different from LazyVim + +## Install + +(follow instructions) + +`:checkhealth lazy` + +## Install a colorscheme + +- Tokyo Night Color Scheme + - https://github.com/folke/tokyonight.nvim + +```lua +{ "folke/tokyonight.nvim", config = function() vim.cmd.colorscheme "tokyonight" end } +``` + +## Install `mini` + +- Mini.nvim + - https://github.com/echasnovski/mini.nvim + +- Setup statusline + +```lua +-- lua/custom/plugins/mini.lua +return { + { + 'echasnovski/mini.nvim', + config = function() + local statusline = require 'mini.statusline' + statusline.setup { use_icons = true } + end + } +} +``` diff --git a/04 - Package Manager/init.lua b/04 - Package Manager/init.lua new file mode 100644 index 0000000..344bb14 --- /dev/null +++ b/04 - Package Manager/init.lua @@ -0,0 +1,18 @@ +print("advent of neovim") +print("advent of neovim") + + +vim.keymap.set("n", "x", "source %") +vim.keymap.set("n", "x", ":.lua") +vim.keymap.set("v", "x", ":lua") + +-- Highlight when yanking (copying) text +-- Try it with `yap` in normal mode +-- See `:help vim.highlight.on_yank()` +vim.api.nvim_create_autocmd('TextYankPost', { + desc = 'Highlight when yanking (copying) text', + group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), + callback = function() + vim.highlight.on_yank() + end, +}) diff --git a/README.md b/README.md index cc81328..29d6cc1 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,10 @@ 25 Mini Lessons to get started with Neovim. - We'll build a working configuration that resembles kickstart.nvim, but we'll do it completely from scratch. -- Install Neovim and Open (with some reasons why) -- Tutor / Modal Editing -- Lua Configuration (Options / Keymaps) -- Plugin Manager +- [x] Install Neovim and Open (with some reasons why) +- [x] Tutor / Modal Editing +- [x] Lua Configuration (Options / Keymaps) +- [x] Plugin Manager - `tree-sitter`, Colorschemes, and `statusline` - LSP (Keymaps and Settings) - LSP Installation / Management diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..a4ec771 --- /dev/null +++ b/init.lua @@ -0,0 +1,18 @@ +print("advent of neovim") + +require("config.lazy") + +vim.keymap.set("n", "x", "source %") +vim.keymap.set("n", "x", ":.lua") +vim.keymap.set("v", "x", ":lua") + +-- Highlight when yanking (copying) text +-- Try it with `yap` in normal mode +-- See `:help vim.highlight.on_yank()` +vim.api.nvim_create_autocmd('TextYankPost', { + desc = 'Highlight when yanking (copying) text', + group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), + callback = function() + vim.highlight.on_yank() + end, +})