From f7158f54946712c6dc03e4bfbfaaccaab5fba387 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 5 Apr 2023 14:10:50 -0400 Subject: [PATCH 01/39] Update README.md --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index aa3823b8..93e3507b 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,18 @@ ### ThePrimeagen's init.lua Prerequisite: install [ripgrep](https://github.com/BurntSushi/ripgrep). -[The full video of me setting up this repo](https://www.youtube.com/watch?v=w7i4amO_zaE) +Video walkthrough of how to config your NeoVim like ThePrimeagen: https://youtu.be/w7i4amO_zaE -For anyone that is interested in my vimrc, i will have a commit log below -documenting each one of my commits (easy to C-f the change you want to know +- What the file structure looks like: + +![init lua](https://user-images.githubusercontent.com/46334926/230166494-c42825b4-7a2e-4d62-b89a-b7bde9c62326.png) + +--- +For anyone that is interested in Prime's vimrc, he will have a commit log below +documenting each commits (easy to C-f the change you want to know about though i would just suggest `git log -S`). -### Change Log +### Change Log (as of the date of me forking this repo: 04/05/2023 * [33eee9ad](https://github.com/ThePrimeagen/init.lua/commit/33eee9ad0c035a92137d99dae06a2396be4c892e) initial commits * [cb210006](https://github.com/ThePrimeagen/init.lua/commit/cb210006356b4b613b71c345cb2b02eefa961fc0) netrw, autogroups for yank highlighting, and auto remove whitespace * [c8c0bf4a](https://github.com/ThePrimeagen/init.lua/commit/c8c0bf4aeacd0bd77136d9c5ee490680515a106b) zenmode. i really like this plugin From f532abaa2ecf087453113208dcddd42e0b3f18db Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 5 Apr 2023 15:46:31 -0400 Subject: [PATCH 02/39] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 93e3507b..47626378 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,12 @@ Video walkthrough of how to config your NeoVim like ThePrimeagen: https://youtu. - What the file structure looks like: ![init lua](https://user-images.githubusercontent.com/46334926/230166494-c42825b4-7a2e-4d62-b89a-b7bde9c62326.png) +--- + +### Navigating netrw. +- Close a file `leader pv` *the leader key is the spacebar* +- Open the fuzzy finder from within a neovim file (accessed via netrw): `Ctrl + p` +- Scroll up and down within the fuzzy finder using `up and down arrow keys` and typing the file name --- For anyone that is interested in Prime's vimrc, he will have a commit log below From 3b4fa9a7b588550e7de55b6b7b76a29fd2ba820d Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 5 Apr 2023 16:12:18 -0400 Subject: [PATCH 03/39] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 47626378..4ce8b0af 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Video walkthrough of how to config your NeoVim like ThePrimeagen: https://youtu. ### Navigating netrw. - Close a file `leader pv` *the leader key is the spacebar* +- Fuzzy find while in netrw `leader pf` - Open the fuzzy finder from within a neovim file (accessed via netrw): `Ctrl + p` - Scroll up and down within the fuzzy finder using `up and down arrow keys` and typing the file name From 0ff1458d8c0c9be73d875b615ac07049be2f50a8 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 5 Apr 2023 16:14:46 -0400 Subject: [PATCH 04/39] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4ce8b0af..921fc122 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Video walkthrough of how to config your NeoVim like ThePrimeagen: https://youtu. --- ### Navigating netrw. +- Enter netrw from the terminal: `nvim . ` - Close a file `leader pv` *the leader key is the spacebar* - Fuzzy find while in netrw `leader pf` - Open the fuzzy finder from within a neovim file (accessed via netrw): `Ctrl + p` From 391537d2a90df0ab7ba090fb00832ed9124ad577 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 5 Apr 2023 16:22:21 -0400 Subject: [PATCH 05/39] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 921fc122..c5dde075 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,12 @@ Video walkthrough of how to config your NeoVim like ThePrimeagen: https://youtu. ![init lua](https://user-images.githubusercontent.com/46334926/230166494-c42825b4-7a2e-4d62-b89a-b7bde9c62326.png) --- +[Click here for NeoVim documentation on netrw:](https://neovim.io/doc/user/pi_netrw.html#:~:text=Netrw%20makes%20reading%20files%2C%20writing,plugin%20on%20%22%20plugins%20are%20enabled) + ### Navigating netrw. - Enter netrw from the terminal: `nvim . ` +- Scroll using `j and k`, (up and down) +- Select / open a file or dir with `Enter` - Close a file `leader pv` *the leader key is the spacebar* - Fuzzy find while in netrw `leader pf` - Open the fuzzy finder from within a neovim file (accessed via netrw): `Ctrl + p` From fa366f8b4a88f9c70b61fe08dc1f9bbfc55980d9 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 5 Apr 2023 16:35:10 -0400 Subject: [PATCH 06/39] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c5dde075..dd35aa97 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ Video walkthrough of how to config your NeoVim like ThePrimeagen: https://youtu. - Fuzzy find while in netrw `leader pf` - Open the fuzzy finder from within a neovim file (accessed via netrw): `Ctrl + p` - Scroll up and down within the fuzzy finder using `up and down arrow keys` and typing the file name +- Open up the file tree without closing the file you are in. use the cmd `:Vex` vertical explore. (split window). +- Hop left-right between windows: enter *window mode* `ctrl + w` then `ctrl + l` to go right & `ctrl + h` go left. --- For anyone that is interested in Prime's vimrc, he will have a commit log below From fb94bc6b70d07139e40c4d8641bffb548bd923a6 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 5 Apr 2023 16:38:51 -0400 Subject: [PATCH 07/39] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dd35aa97..67dc6119 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Video walkthrough of how to config your NeoVim like ThePrimeagen: https://youtu. - Open the fuzzy finder from within a neovim file (accessed via netrw): `Ctrl + p` - Scroll up and down within the fuzzy finder using `up and down arrow keys` and typing the file name - Open up the file tree without closing the file you are in. use the cmd `:Vex` vertical explore. (split window). -- Hop left-right between windows: enter *window mode* `ctrl + w` then `ctrl + l` to go right & `ctrl + h` go left. +- Hop left-right between windows: enter *window mode* `ctrl + w` then `l` to go right & `ctrl + w` + `h` go left. --- For anyone that is interested in Prime's vimrc, he will have a commit log below From e8ebf2e77c626683827395cd20472af959db8033 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 5 Apr 2023 16:42:13 -0400 Subject: [PATCH 08/39] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 67dc6119..208e88fc 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Video walkthrough of how to config your NeoVim like ThePrimeagen: https://youtu. - Scroll up and down within the fuzzy finder using `up and down arrow keys` and typing the file name - Open up the file tree without closing the file you are in. use the cmd `:Vex` vertical explore. (split window). - Hop left-right between windows: enter *window mode* `ctrl + w` then `l` to go right & `ctrl + w` + `h` go left. +- Return to the original file, (close all window splits), `ctrl + w` + `o` --- For anyone that is interested in Prime's vimrc, he will have a commit log below From 00d7d7d578a79aa52842af5efd0b8f9d57d3f523 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 5 Apr 2023 16:49:35 -0400 Subject: [PATCH 09/39] Update remap.lua --- lua/theprimeagen/remap.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/theprimeagen/remap.lua b/lua/theprimeagen/remap.lua index e165d1ab..18f071c8 100644 --- a/lua/theprimeagen/remap.lua +++ b/lua/theprimeagen/remap.lua @@ -2,6 +2,10 @@ vim.g.mapleader = " " vim.keymap.set("n", "pv", vim.cmd.Ex) +-- when highlighting a line, press shift + j or k +-- and yoiu can move an entite line or lines up or down. +-- Example: taking some lines of code and moving them into an if statement +-- The lines auto indent when you are done moving them. vim.keymap.set("v", "J", ":m '>+1gv=gv") vim.keymap.set("v", "K", ":m '<-2gv=gv") From a4b8de39ae77257c284c762828938341badc08a1 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 5 Apr 2023 17:04:05 -0400 Subject: [PATCH 10/39] Update remap.lua --- lua/theprimeagen/remap.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lua/theprimeagen/remap.lua b/lua/theprimeagen/remap.lua index 18f071c8..f182d2ac 100644 --- a/lua/theprimeagen/remap.lua +++ b/lua/theprimeagen/remap.lua @@ -1,4 +1,4 @@ - +-- For explinations see https://youtu.be/w7i4amO_zaE and skip to 24:24 The Best remaps vim.g.mapleader = " " vim.keymap.set("n", "pv", vim.cmd.Ex) @@ -7,11 +7,17 @@ vim.keymap.set("n", "pv", vim.cmd.Ex) -- Example: taking some lines of code and moving them into an if statement -- The lines auto indent when you are done moving them. vim.keymap.set("v", "J", ":m '>+1gv=gv") +-- J takes the line below and appends it to your current line with a space +-- And this one keeps your cursor in one place dispite movving other lines vim.keymap.set("v", "K", ":m '<-2gv=gv") vim.keymap.set("n", "J", "mzJ`z") +-- The two below keeps the cursor in the middle when scrolling with ctrl + d & u +-- Makes searching the file less disorienting. vim.keymap.set("n", "", "zz") vim.keymap.set("n", "", "zz") + +-- Make search terms stay in the middle when searching the file for characters, text, etc.. vim.keymap.set("n", "n", "nzzzv") vim.keymap.set("n", "N", "Nzzzv") @@ -23,6 +29,8 @@ vim.keymap.set("n", "svwm", function() end) -- greatest remap ever +-- Pasting highlighted text over a pre-selected highligted text +-- Deletes highlighted word into the 'void' register and then paste it over. vim.keymap.set("x", "p", [["_dP]]) -- next greatest remap ever : asbjornHaland From 297617b80963f18eab2b811af7e9bfdb6670e1b9 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 5 Apr 2023 17:08:50 -0400 Subject: [PATCH 11/39] Update remap.lua --- lua/theprimeagen/remap.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/theprimeagen/remap.lua b/lua/theprimeagen/remap.lua index f182d2ac..e3d3ba65 100644 --- a/lua/theprimeagen/remap.lua +++ b/lua/theprimeagen/remap.lua @@ -34,6 +34,7 @@ end) vim.keymap.set("x", "p", [["_dP]]) -- next greatest remap ever : asbjornHaland +-- leader y yanks text to the system clipboard enabling you to pate elsewhere vim.keymap.set({"n", "v"}, "y", [["+y]]) vim.keymap.set("n", "Y", [["+Y]]) From a2c6bf27b49587b706bf85e59b2485fdd2ca8f48 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 5 Apr 2023 17:21:06 -0400 Subject: [PATCH 12/39] Update remap.lua --- lua/theprimeagen/remap.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/theprimeagen/remap.lua b/lua/theprimeagen/remap.lua index e3d3ba65..4cbc558e 100644 --- a/lua/theprimeagen/remap.lua +++ b/lua/theprimeagen/remap.lua @@ -44,15 +44,20 @@ vim.keymap.set({"n", "v"}, "d", [["_d]]) vim.keymap.set("i", "", "") vim.keymap.set("n", "Q", "") +-- When using Tmux: ctrl + f and now fuzzy find in another terminal session vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") vim.keymap.set("n", "f", vim.lsp.buf.format) +-- Quick-fix navigation list vim.keymap.set("n", "", "cnextzz") vim.keymap.set("n", "", "cprevzz") vim.keymap.set("n", "k", "lnextzz") vim.keymap.set("n", "j", "lprevzz") +-- space + s opens a menu and begin replacing the word on which your cursor lies. vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) + +-- Make the file executable without having to exit and chmoding it manually. vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) vim.keymap.set("n", "vpp", "e ~/.dotfiles/nvim/.config/nvim/lua/theprimeagen/packer.lua"); From c4fbd71d32ad1cce2bf94bb56cd05b50d4db0720 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 5 Apr 2023 17:36:36 -0400 Subject: [PATCH 13/39] Update remap.lua --- lua/theprimeagen/remap.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/theprimeagen/remap.lua b/lua/theprimeagen/remap.lua index 4cbc558e..cc39b006 100644 --- a/lua/theprimeagen/remap.lua +++ b/lua/theprimeagen/remap.lua @@ -1,6 +1,10 @@ -- For explinations see https://youtu.be/w7i4amO_zaE and skip to 24:24 The Best remaps vim.g.mapleader = " " + +-- Project view vim.keymap.set("n", "pv", vim.cmd.Ex) +-- split window vertically : Vex +vim.keymap.set("n", "ve", vim.cmd.Vex) -- when highlighting a line, press shift + j or k -- and yoiu can move an entite line or lines up or down. From 9f873516c3204d8295e58bd3dd58fcb8fb88af32 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 6 Apr 2023 01:16:48 -0400 Subject: [PATCH 14/39] Update packer.lua --- lua/theprimeagen/packer.lua | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lua/theprimeagen/packer.lua b/lua/theprimeagen/packer.lua index cd886f38..e74a9104 100644 --- a/lua/theprimeagen/packer.lua +++ b/lua/theprimeagen/packer.lua @@ -1,26 +1,24 @@ --- This file can be loaded by calling `lua require('plugins')` from your init.vim +--This file can be loaded by calling `lua require('plugins')` from your init.vim + --use 'folke/tokyonight.nvim' -- Only required if you have packer configured as `opt` -vim.cmd.packadd('packer.nvim') +vim.cmd [[packadd packer.nvim]] return require('packer').startup(function(use) -- Packer can manage itself use 'wbthomason/packer.nvim' + use { - 'nvim-telescope/telescope.nvim', tag = '0.1.0', - -- or , branch = '0.1.x', - requires = { {'nvim-lua/plenary.nvim'} } + 'nvim-telescope/telescope.nvim', tag = '0.1.1', + -- or , branch = '0.1.x', + requires = { {'nvim-lua/plenary.nvim'} } } - use({ - 'rose-pine/neovim', - as = 'rose-pine', - config = function() - vim.cmd('colorscheme rose-pine') - end - }) + use 'folke/tokyonight.nvim' + + -- All other plugins use({ "folke/trouble.nvim", config = function() @@ -39,6 +37,8 @@ return require('packer').startup(function(use) use("theprimeagen/harpoon") use("theprimeagen/refactoring.nvim") use("mbbill/undotree") + -- TabNine + use('codota/tabnine-nvim') use("tpope/vim-fugitive") use("nvim-treesitter/nvim-treesitter-context"); @@ -57,7 +57,7 @@ return require('packer').startup(function(use) {'hrsh7th/cmp-path'}, {'saadparwaiz1/cmp_luasnip'}, {'hrsh7th/cmp-nvim-lsp'}, - {'hrsh7th/cmp-nvim-lua'}, + {'codota/tabnine-nvim'}, -- Snippets {'L3MON4D3/LuaSnip'}, @@ -66,9 +66,9 @@ return require('packer').startup(function(use) } use("folke/zen-mode.nvim") - use("github/copilot.vim") + --use("github/copilot.vim") use("eandrju/cellular-automaton.nvim") use("laytan/cloak.nvim") -end) +end) From 091c124038e7b986cca545f2eddd083f31a2669e Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 6 Apr 2023 01:18:10 -0400 Subject: [PATCH 15/39] Update init.lua --- init.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/init.lua b/init.lua index a39d9f18..536d1de2 100644 --- a/init.lua +++ b/init.lua @@ -1,2 +1,13 @@ require("theprimeagen") + +require('tabnine').setup({ + disable_auto_comment=true, + accept_keymap="", + dismiss_keymap = "", + debounce_ms = 800, + suggestion_color = {gui = "#808080", cterm = 244}, + exclude_filetypes = {"TelescopePrompt"} +}) + + From 55111c8d6500331e44ecceaee832410af188cd05 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 6 Apr 2023 01:19:22 -0400 Subject: [PATCH 16/39] Create tabnine.lua --- after/plugin/tabnine.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 after/plugin/tabnine.lua diff --git a/after/plugin/tabnine.lua b/after/plugin/tabnine.lua new file mode 100644 index 00000000..a90f0af9 --- /dev/null +++ b/after/plugin/tabnine.lua @@ -0,0 +1,18 @@ +local config = require("tabnine.config") +local auto_commands = require("tabnine.auto_commands") +local user_commands = require("tabnine.user_commands") +local keymaps = require("tabnine.keymaps") + +local M = {} + +function M.setup(o) + config.set_config(o) + + keymaps.setup() + + user_commands.setup() + + auto_commands.setup() +end + +return M From 45ec491de2303796154c1681837442d9de98db76 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 6 Apr 2023 01:21:08 -0400 Subject: [PATCH 17/39] Update init.lua --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 536d1de2..113fafaa 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,6 @@ require("theprimeagen") +-- run the comannd :TabnineHub after all tabnine code has been saved and sourced require('tabnine').setup({ disable_auto_comment=true, From afdf2aa5474cb410652607a85d2fe37df8cdc1d4 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 6 Apr 2023 01:21:55 -0400 Subject: [PATCH 18/39] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 208e88fc..e2e205f9 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ Prerequisite: install [ripgrep](https://github.com/BurntSushi/ripgrep). Video walkthrough of how to config your NeoVim like ThePrimeagen: https://youtu.be/w7i4amO_zaE - What the file structure looks like: +- I have since installed Tabnine ![init lua](https://user-images.githubusercontent.com/46334926/230166494-c42825b4-7a2e-4d62-b89a-b7bde9c62326.png) --- From 666eb0024721737652620b077f27257f031b7a2d Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 6 Apr 2023 01:37:45 -0400 Subject: [PATCH 19/39] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e2e205f9..599376c9 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Video walkthrough of how to config your NeoVim like ThePrimeagen: https://youtu. - What the file structure looks like: - I have since installed Tabnine - +- https://github.com/LinuxUser255/BashAndLinux/blob/main/Tabnine_Install.md ![init lua](https://user-images.githubusercontent.com/46334926/230166494-c42825b4-7a2e-4d62-b89a-b7bde9c62326.png) --- From 45313dcbffb21f1ecb0f6c6935a9df06044a93b4 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 6 Apr 2023 09:01:07 -0400 Subject: [PATCH 20/39] Update colors.lua --- after/plugin/colors.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/after/plugin/colors.lua b/after/plugin/colors.lua index fe97b1bb..16acd5a1 100644 --- a/after/plugin/colors.lua +++ b/after/plugin/colors.lua @@ -1,14 +1,17 @@ -require('rose-pine').setup({ - disable_background = true -}) +-- color scheme and transparent background + --require("tokyonight.colors").setup({ +-- disable_background = false + --}) -function ColorMyPencils(color) - color = color or "rose-pine" + function ColorMyPencils(color) + color = color or "tokyonight" vim.cmd.colorscheme(color) - vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) - vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) + -- uncomment the following lines to enable transparent background. + --vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) + --vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) end ColorMyPencils() + From a1cf2fb1e4cad66758a7ee9ac1ce821aeed2ce56 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 29 Jun 2023 10:36:06 -0400 Subject: [PATCH 21/39] Update README.md --- README.md | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 599376c9..319a44f2 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,32 @@ -### ThePrimeagen's init.lua -Prerequisite: install [ripgrep](https://github.com/BurntSushi/ripgrep). +# ThePrimeagen's init.lua + + +## Getting Started +### Install the following: +* **[ripgrep](https://github.com/BurntSushi/ripgrep)** + ```sh + sudo apt install rg + ``` +* **[Use the latest version of Zsh](https://zsh.sourceforge.io/Arc/source.html)** <-- Link +* You will need a recent version of NeoVim too, the ones in the apt repos are too old. +* Download the most recent **[nvim-linux64.tar.gz](https://github.com/neovim/neovim/releases/)** <-- Link, then follow the install instructions. + +

(back to top)

+ +## Installation Video walkthrough by ThePrimeagen: +**How to create this init.lua from scratch: https://youtu.be/w7i4amO_zaE** -Video walkthrough of how to config your NeoVim like ThePrimeagen: https://youtu.be/w7i4amO_zaE -- What the file structure looks like: - I have since installed Tabnine -- https://github.com/LinuxUser255/BashAndLinux/blob/main/Tabnine_Install.md +- **[How to install Tabnine in NeoVim: Detailed instructions. Click here.](https://github.com/LinuxUser255/BashAndLinux/blob/main/Tabnine_Install.md)** +- What the file structure looks like: + ![init lua](https://user-images.githubusercontent.com/46334926/230166494-c42825b4-7a2e-4d62-b89a-b7bde9c62326.png) --- -[Click here for NeoVim documentation on netrw:](https://neovim.io/doc/user/pi_netrw.html#:~:text=Netrw%20makes%20reading%20files%2C%20writing,plugin%20on%20%22%20plugins%20are%20enabled) +**[Click here for NeoVim documentation on netrw:](https://neovim.io/doc/user/pi_netrw.html#:~:text=Netrw%20makes%20reading%20files%2C%20writing,plugin%20on%20%22%20plugins%20are%20enabled)** -### Navigating netrw. +### How to use netrw. The basics. - Enter netrw from the terminal: `nvim . ` - Scroll using `j and k`, (up and down) - Select / open a file or dir with `Enter` From 5fb086df295b94d238a346f038f24cb3a2c44c8e Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 29 Jun 2023 10:53:45 -0400 Subject: [PATCH 22/39] Update dev --- dev | 1 + 1 file changed, 1 insertion(+) diff --git a/dev b/dev index 6f51fbc7..1fbc34b4 100755 --- a/dev +++ b/dev @@ -1,5 +1,6 @@ #!/usr/bin/env bash +# To start with a clean slate, you will need to delete and remove your current/previous neovim files and dirs. rm -rf ~/.config/nvim ln -s $(pwd) ~/.config/nvim From 548d62c1244ecfade2c5d020fcf134448dc22bae Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 29 Jun 2023 11:09:46 -0400 Subject: [PATCH 23/39] Update packer.lua --- lua/theprimeagen/packer.lua | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lua/theprimeagen/packer.lua b/lua/theprimeagen/packer.lua index e74a9104..9f08cf30 100644 --- a/lua/theprimeagen/packer.lua +++ b/lua/theprimeagen/packer.lua @@ -15,8 +15,13 @@ return require('packer').startup(function(use) requires = { {'nvim-lua/plenary.nvim'} } } - use 'folke/tokyonight.nvim' - + use({ + 'rose-pine/neovim', + as = 'rose-pine', + config = function() + vim.cmd('colorscheme rose-pine') + end + }) -- All other plugins use({ @@ -31,8 +36,14 @@ return require('packer').startup(function(use) end }) + use { + 'nvim-treesitter/nvim-treesitter', + run = function() + local ts_update = require('nvim-treesitter.install').update({ with_sync = true }) + ts_update() + end,} - use({"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"}) + -- use({"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"}) use("nvim-treesitter/playground") use("theprimeagen/harpoon") use("theprimeagen/refactoring.nvim") From 21fea0cd731ee7a9ba8c92cef8e0a40823703295 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 29 Jun 2023 11:10:10 -0400 Subject: [PATCH 24/39] Update packer.lua --- lua/theprimeagen/packer.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/theprimeagen/packer.lua b/lua/theprimeagen/packer.lua index 9f08cf30..64defcff 100644 --- a/lua/theprimeagen/packer.lua +++ b/lua/theprimeagen/packer.lua @@ -1,6 +1,5 @@ --This file can be loaded by calling `lua require('plugins')` from your init.vim - --use 'folke/tokyonight.nvim' -- Only required if you have packer configured as `opt` vim.cmd [[packadd packer.nvim]] From 467a7ce91773a33b63bf94d8938d3747c9db688f Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 29 Jun 2023 11:16:17 -0400 Subject: [PATCH 25/39] Update lsp.lua --- after/plugin/lsp.lua | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index ca85cbec..346a7ee5 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -8,15 +8,7 @@ lsp.ensure_installed({ }) -- Fix Undefined global 'vim' -lsp.configure('lua-language-server', { - settings = { - Lua = { - diagnostics = { - globals = { 'vim' } - } - } - } -}) +lsp.nvim_workspace() local cmp = require('cmp') From 15cc6568bbdf9d99010efac0832214339902dde6 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 29 Jun 2023 11:33:47 -0400 Subject: [PATCH 26/39] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 319a44f2..be9073fd 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ sudo apt install rg ``` * **[Use the latest version of Zsh](https://zsh.sourceforge.io/Arc/source.html)** <-- Link -* You will need a recent version of NeoVim too, the ones in the apt repos are too old. +* You will need a recent version of **NeoVim** too, the ones in the apt repos are too old. * Download the most recent **[nvim-linux64.tar.gz](https://github.com/neovim/neovim/releases/)** <-- Link, then follow the install instructions.

(back to top)

From 2906656f6b7f0cd8e322e2ff20cf733be32b9ae3 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 6 Jul 2023 11:14:35 -0400 Subject: [PATCH 27/39] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index be9073fd..5e67a652 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,11 @@ ## Installation Video walkthrough by ThePrimeagen: **How to create this init.lua from scratch: https://youtu.be/w7i4amO_zaE** +**_Coming soon:_** +``` +I will be adding written directions here shortly, and more netrw navigation cmds. +``` +

(back to top)

- I have since installed Tabnine - **[How to install Tabnine in NeoVim: Detailed instructions. Click here.](https://github.com/LinuxUser255/BashAndLinux/blob/main/Tabnine_Install.md)** From 83c6aa5320fb4168b1d7ad86e604d6132b85a7d0 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 6 Jul 2023 11:27:32 -0400 Subject: [PATCH 28/39] Update README.md --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5e67a652..596494bb 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,11 @@ ## Installation Video walkthrough by ThePrimeagen: **How to create this init.lua from scratch: https://youtu.be/w7i4amO_zaE** -**_Coming soon:_** -``` -I will be adding written directions here shortly, and more netrw navigation cmds. -``` +### _Coming soon:_ + +* There are some repos and files you must git clone before installing this init.lua. +* I will be adding written directions here shortly, and more netrw navigation cmds. +

(back to top)

- I have since installed Tabnine From 3ee98d47c2ad08990590e595c9748fe707be2a78 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 6 Jul 2023 11:30:28 -0400 Subject: [PATCH 29/39] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 596494bb..1ce78f6f 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ ## Getting Started ### Install the following: -* **[ripgrep](https://github.com/BurntSushi/ripgrep)** +* **[ripgrep](https://github.com/BurntSushi/ripgrep)** (It's in the Debian repos) ```sh - sudo apt install rg + sudo apt-get install ripgrep ``` * **[Use the latest version of Zsh](https://zsh.sourceforge.io/Arc/source.html)** <-- Link * You will need a recent version of **NeoVim** too, the ones in the apt repos are too old. From 490de094831b701044eee3cd10e4241a92e82b7b Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 6 Jul 2023 12:13:31 -0400 Subject: [PATCH 30/39] Update packer.lua --- lua/theprimeagen/packer.lua | 102 +++++++++++++++--------------------- 1 file changed, 42 insertions(+), 60 deletions(-) diff --git a/lua/theprimeagen/packer.lua b/lua/theprimeagen/packer.lua index 64defcff..93ddadfa 100644 --- a/lua/theprimeagen/packer.lua +++ b/lua/theprimeagen/packer.lua @@ -14,71 +14,53 @@ return require('packer').startup(function(use) requires = { {'nvim-lua/plenary.nvim'} } } - use({ - 'rose-pine/neovim', - as = 'rose-pine', - config = function() - vim.cmd('colorscheme rose-pine') - end - }) - - -- All other plugins - use({ - "folke/trouble.nvim", - config = function() - require("trouble").setup { - icons = false, - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - } - end - }) - - use { - 'nvim-treesitter/nvim-treesitter', - run = function() - local ts_update = require('nvim-treesitter.install').update({ with_sync = true }) - ts_update() - end,} +use ({ + 'rose-pine/neovim', + as = 'rose-pine', + config = function() + vim.cmd('colorscheme rose-pine') + end +}) + +use('nvim-treesitter/nvim-treesitter', {run: ':TSUpdate'}) +end) - -- use({"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"}) - use("nvim-treesitter/playground") - use("theprimeagen/harpoon") - use("theprimeagen/refactoring.nvim") - use("mbbill/undotree") - -- TabNine - use('codota/tabnine-nvim') - use("tpope/vim-fugitive") - use("nvim-treesitter/nvim-treesitter-context"); - use { - 'VonHeikemen/lsp-zero.nvim', - branch = 'v1.x', - requires = { - -- LSP Support - {'neovim/nvim-lspconfig'}, - {'williamboman/mason.nvim'}, - {'williamboman/mason-lspconfig.nvim'}, +use("nvim-treesitter/playground") +use("theprimeagen/harpoon") +use("theprimeagen/refactoring.nvim") +use("mbbill/undotree") +-- TabNine +use('codota/tabnine-nvim') +use("tpope/vim-fugitive") +use("nvim-treesitter/nvim-treesitter-context"); - -- Autocompletion - {'hrsh7th/nvim-cmp'}, - {'hrsh7th/cmp-buffer'}, - {'hrsh7th/cmp-path'}, - {'saadparwaiz1/cmp_luasnip'}, - {'hrsh7th/cmp-nvim-lsp'}, - {'codota/tabnine-nvim'}, +use { + 'VonHeikemen/lsp-zero.nvim', + branch = 'v1.x', + requires = { + -- LSP Support + {'neovim/nvim-lspconfig'}, + {'williamboman/mason.nvim'}, + {'williamboman/mason-lspconfig.nvim'}, - -- Snippets - {'L3MON4D3/LuaSnip'}, - {'rafamadriz/friendly-snippets'}, - } - } + -- Autocompletion + {'hrsh7th/nvim-cmp'}, + {'hrsh7th/cmp-buffer'}, + {'hrsh7th/cmp-path'}, + {'saadparwaiz1/cmp_luasnip'}, + {'hrsh7th/cmp-nvim-lsp'}, + {'codota/tabnine-nvim'}, - use("folke/zen-mode.nvim") - --use("github/copilot.vim") - use("eandrju/cellular-automaton.nvim") - use("laytan/cloak.nvim") + -- Snippets + {'L3MON4D3/LuaSnip'}, + {'rafamadriz/friendly-snippets'}, + } +} +use("folke/zen-mode.nvim") +--use("github/copilot.vim") +use("eandrju/cellular-automaton.nvim") +use("laytan/cloak.nvim") end) From 57b708c4c9f89706c81aa9566c7d3c67c68bc0d2 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 6 Jul 2023 12:17:21 -0400 Subject: [PATCH 31/39] Update colors.lua --- after/plugin/colors.lua | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/after/plugin/colors.lua b/after/plugin/colors.lua index 16acd5a1..51ba27f6 100644 --- a/after/plugin/colors.lua +++ b/after/plugin/colors.lua @@ -1,16 +1,14 @@ --- color scheme and transparent background - --require("tokyonight.colors").setup({ --- disable_background = false - --}) +require('rose-pine').setup({ + disable_background = true +}) - function ColorMyPencils(color) - color = color or "tokyonight" +function ColorMyPencils(color) + color = color or "rose-pine" vim.cmd.colorscheme(color) + vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) - -- uncomment the following lines to enable transparent background. - --vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) - --vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) end ColorMyPencils() From 32351b7c13ef50ffdac8c9a983f45b9bb40ca264 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 8 Nov 2023 18:37:39 -0500 Subject: [PATCH 32/39] Update README.md --- README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/README.md b/README.md index 1ce78f6f..b376f1dd 100644 --- a/README.md +++ b/README.md @@ -11,17 +11,9 @@ * You will need a recent version of **NeoVim** too, the ones in the apt repos are too old. * Download the most recent **[nvim-linux64.tar.gz](https://github.com/neovim/neovim/releases/)** <-- Link, then follow the install instructions. -

(back to top)

- ## Installation Video walkthrough by ThePrimeagen: **How to create this init.lua from scratch: https://youtu.be/w7i4amO_zaE** -### _Coming soon:_ - -* There are some repos and files you must git clone before installing this init.lua. -* I will be adding written directions here shortly, and more netrw navigation cmds. - -

(back to top)

- I have since installed Tabnine - **[How to install Tabnine in NeoVim: Detailed instructions. Click here.](https://github.com/LinuxUser255/BashAndLinux/blob/main/Tabnine_Install.md)** From 6d167cacbddaf753b97477441aff50db49a1a23b Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 8 Nov 2023 18:38:12 -0500 Subject: [PATCH 33/39] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b376f1dd..8f92c97f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ### Install the following: * **[ripgrep](https://github.com/BurntSushi/ripgrep)** (It's in the Debian repos) ```sh - sudo apt-get install ripgrep + sudo apt install ripgrep ``` * **[Use the latest version of Zsh](https://zsh.sourceforge.io/Arc/source.html)** <-- Link * You will need a recent version of **NeoVim** too, the ones in the apt repos are too old. From 42b535df7983734129a2be9dde4c66a95b0f4884 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 16 Nov 2023 09:51:16 -0500 Subject: [PATCH 34/39] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 8f92c97f..29453182 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,9 @@ ### How to use netrw. The basics. - Enter netrw from the terminal: `nvim . ` +- Runtimepath: `:h rtp` +- Create a new file: enter netrw: `nvim .` press the percent sign `%` then name it. +- Create a directory, enter netrw `nvim .` then press d, then name it. - Scroll using `j and k`, (up and down) - Select / open a file or dir with `Enter` - Close a file `leader pv` *the leader key is the spacebar* From eaddd64fee472a48c6e9b3d47f8ea4b1ca609010 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 16 Nov 2023 10:07:42 -0500 Subject: [PATCH 35/39] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 29453182..d59b8377 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ - Runtimepath: `:h rtp` - Create a new file: enter netrw: `nvim .` press the percent sign `%` then name it. - Create a directory, enter netrw `nvim .` then press d, then name it. +- To source a file use the command `:so` - Scroll using `j and k`, (up and down) - Select / open a file or dir with `Enter` - Close a file `leader pv` *the leader key is the spacebar* From 134a99877680004f036662a47b7523ccd5505fe2 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 16 Nov 2023 15:57:09 -0500 Subject: [PATCH 36/39] Update packer.lua --- lua/theprimeagen/packer.lua | 110 ++++++++++++++++++++---------------- 1 file changed, 62 insertions(+), 48 deletions(-) diff --git a/lua/theprimeagen/packer.lua b/lua/theprimeagen/packer.lua index 93ddadfa..996919b3 100644 --- a/lua/theprimeagen/packer.lua +++ b/lua/theprimeagen/packer.lua @@ -1,66 +1,80 @@ ---This file can be loaded by calling `lua require('plugins')` from your init.vim +-- This file can be loaded by calling `lua require('plugins')` from your init.vim -- Only required if you have packer configured as `opt` -vim.cmd [[packadd packer.nvim]] +vim.cmd.packadd('packer.nvim') return require('packer').startup(function(use) -- Packer can manage itself use 'wbthomason/packer.nvim' - use { - 'nvim-telescope/telescope.nvim', tag = '0.1.1', - -- or , branch = '0.1.x', - requires = { {'nvim-lua/plenary.nvim'} } + 'nvim-telescope/telescope.nvim', tag = '0.1.0', + -- or , branch = '0.1.x', + requires = { {'nvim-lua/plenary.nvim'} } } -use ({ - 'rose-pine/neovim', - as = 'rose-pine', - config = function() - vim.cmd('colorscheme rose-pine') - end -}) - -use('nvim-treesitter/nvim-treesitter', {run: ':TSUpdate'}) -end) + use({ + 'rose-pine/neovim', + as = 'rose-pine', + config = function() + vim.cmd('colorscheme rose-pine') + end + }) + use({ + "folke/trouble.nvim", + config = function() + require("trouble").setup { + icons = false, + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + } + end + }) -use("nvim-treesitter/playground") -use("theprimeagen/harpoon") -use("theprimeagen/refactoring.nvim") -use("mbbill/undotree") --- TabNine -use('codota/tabnine-nvim') -use("tpope/vim-fugitive") -use("nvim-treesitter/nvim-treesitter-context"); + use { + 'nvim-treesitter/nvim-treesitter', + run = function() + local ts_update = require('nvim-treesitter.install').update({ with_sync = true }) + ts_update() + end,} + use("nvim-treesitter/playground") + use("theprimeagen/harpoon") + use("ThePrimeagen/vim-be-good") + use("theprimeagen/refactoring.nvim") + use("mbbill/undotree") + use("tpope/vim-fugitive") + use("nvim-treesitter/nvim-treesitter-context"); -use { - 'VonHeikemen/lsp-zero.nvim', - branch = 'v1.x', - requires = { - -- LSP Support - {'neovim/nvim-lspconfig'}, - {'williamboman/mason.nvim'}, - {'williamboman/mason-lspconfig.nvim'}, + use { + 'VonHeikemen/lsp-zero.nvim', + branch = 'v1.x', + requires = { + -- LSP Support + {'neovim/nvim-lspconfig'}, + {'williamboman/mason.nvim'}, + {'williamboman/mason-lspconfig.nvim'}, - -- Autocompletion - {'hrsh7th/nvim-cmp'}, - {'hrsh7th/cmp-buffer'}, - {'hrsh7th/cmp-path'}, - {'saadparwaiz1/cmp_luasnip'}, - {'hrsh7th/cmp-nvim-lsp'}, - {'codota/tabnine-nvim'}, + -- Autocompletion + {'hrsh7th/nvim-cmp'}, + {'hrsh7th/cmp-buffer'}, + {'hrsh7th/cmp-path'}, + {'saadparwaiz1/cmp_luasnip'}, + {'hrsh7th/cmp-nvim-lsp'}, + {'hrsh7th/cmp-nvim-lua'}, - -- Snippets - {'L3MON4D3/LuaSnip'}, - {'rafamadriz/friendly-snippets'}, - } -} + -- Snippets + {'L3MON4D3/LuaSnip'}, + {'rafamadriz/friendly-snippets'}, + } + } -use("folke/zen-mode.nvim") ---use("github/copilot.vim") -use("eandrju/cellular-automaton.nvim") -use("laytan/cloak.nvim") + use("folke/zen-mode.nvim") + -- use("github/copilot.vim") + -- TabNine + use('codota/tabnine-nvim') + use("eandrju/cellular-automaton.nvim") + use("laytan/cloak.nvim") end) From 31ebc07b330c7ce6b0837103bf0858a86029970e Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 23 Nov 2023 12:24:57 -0500 Subject: [PATCH 37/39] Update README.md --- README.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d59b8377..12b1722c 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,27 @@ ``` * **[Use the latest version of Zsh](https://zsh.sourceforge.io/Arc/source.html)** <-- Link * You will need a recent version of **NeoVim** too, the ones in the apt repos are too old. -* Download the most recent **[nvim-linux64.tar.gz](https://github.com/neovim/neovim/releases/)** <-- Link, then follow the install instructions. +* The most compatable version of NeoVim for this config, is NVIM v0.9.4 +* Use these commands to install it, and u must have Packer installed alongside this `init.lua` repo too + + +**Then you can git clone this repo in your home directory, and run the dev bash script to clean out your current nvim files** +```bash +#!/usr/bin/env bash + +# To start with a clean slate, you will need to delete and remove your current/previous neovim files and dirs. +rm -rf ~/.config/nvim +ln -s $(pwd) ~/.config/nvim +``` +**Then install NVIM v0.9.4, and Packer** +```bash +wget https://github.com/neovim/neovim/releases/download/stable/nvim.appimage +chmod +x nvim.appimage +sudo mv nvim.appimage /usr/local/bin/nvim + +# git clone packer +git clone --depth 1 https://github.com/wbthomason/packer.nvim\\n ~/.local/share/nvim/site/pack/packer/start/packer.nvim +``` ## Installation Video walkthrough by ThePrimeagen: **How to create this init.lua from scratch: https://youtu.be/w7i4amO_zaE** From dc80f0aec27d93669cfc79817cff919516a30521 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 23 Nov 2023 12:29:17 -0500 Subject: [PATCH 38/39] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 12b1722c..10af542f 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,11 @@ ``` * **[Use the latest version of Zsh](https://zsh.sourceforge.io/Arc/source.html)** <-- Link * You will need a recent version of **NeoVim** too, the ones in the apt repos are too old. -* The most compatable version of NeoVim for this config, is NVIM v0.9.4 +* The most compatable version of NeoVim for this config, is **[NVIM v0.9.4](https://github.com/neovim/neovim/releases)** * Use these commands to install it, and u must have Packer installed alongside this `init.lua` repo too -**Then you can git clone this repo in your home directory, and run the dev bash script to clean out your current nvim files** +**- Then you can git clone this repo in your home directory, and run the dev bash script to clean out your current nvim files** ```bash #!/usr/bin/env bash @@ -21,7 +21,7 @@ rm -rf ~/.config/nvim ln -s $(pwd) ~/.config/nvim ``` -**Then install NVIM v0.9.4, and Packer** +**- Then install NVIM v0.9.4, and Packer** ```bash wget https://github.com/neovim/neovim/releases/download/stable/nvim.appimage chmod +x nvim.appimage From c2a6a63f183000e78c0cf82a5485ed9cf569b94f Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 17 Jul 2024 17:23:32 -0400 Subject: [PATCH 39/39] Update remap.lua --- lua/theprimeagen/remap.lua | 78 ++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 29 deletions(-) diff --git a/lua/theprimeagen/remap.lua b/lua/theprimeagen/remap.lua index cc39b006..d9beac31 100644 --- a/lua/theprimeagen/remap.lua +++ b/lua/theprimeagen/remap.lua @@ -1,20 +1,15 @@ --- For explinations see https://youtu.be/w7i4amO_zaE and skip to 24:24 The Best remaps -vim.g.mapleader = " " +-- This keymaps file needs to be "required" in /nvim/config/init.lua --- Project view +-- [[ NetRW cmds Project view & vertical window split ]] vim.keymap.set("n", "pv", vim.cmd.Ex) --- split window vertically : Vex vim.keymap.set("n", "ve", vim.cmd.Vex) --- when highlighting a line, press shift + j or k --- and yoiu can move an entite line or lines up or down. --- Example: taking some lines of code and moving them into an if statement --- The lines auto indent when you are done moving them. +--[ ! Move an entite line or lines up or down. ]] +-- when highlighting a line, press shift + j or k vim.keymap.set("v", "J", ":m '>+1gv=gv") -- J takes the line below and appends it to your current line with a space -- And this one keeps your cursor in one place dispite movving other lines vim.keymap.set("v", "K", ":m '<-2gv=gv") - vim.keymap.set("n", "J", "mzJ`z") -- The two below keeps the cursor in the middle when scrolling with ctrl + d & u -- Makes searching the file less disorienting. @@ -25,29 +20,24 @@ vim.keymap.set("n", "", "zz") vim.keymap.set("n", "n", "nzzzv") vim.keymap.set("n", "N", "Nzzzv") -vim.keymap.set("n", "vwm", function() - require("vim-with-me").StartVimWithMe() -end) -vim.keymap.set("n", "svwm", function() - require("vim-with-me").StopVimWithMe() -end) +-- Pasting highlighted text over a pre-selected highligted text +-- Deletes highlighted word into the 'void' register and then paste it over. +vim.keymap.set("x", "p", [["_dP]]) +-- normal mode, then visual line mode, then spacebar shift -- greatest remap ever -- Pasting highlighted text over a pre-selected highligted text -- Deletes highlighted word into the 'void' register and then paste it over. vim.keymap.set("x", "p", [["_dP]]) --- next greatest remap ever : asbjornHaland --- leader y yanks text to the system clipboard enabling you to pate elsewhere +-- YANK TEXT TO THE SYSTEM CLIPBOARD +-- Normal mode, then leader yy +-- yanks text to the system clipboard enabling you to pate elsewhere vim.keymap.set({"n", "v"}, "y", [["+y]]) vim.keymap.set("n", "Y", [["+Y]]) vim.keymap.set({"n", "v"}, "d", [["_d]]) --- This is going to get me cancelled -vim.keymap.set("i", "", "") - -vim.keymap.set("n", "Q", "") -- When using Tmux: ctrl + f and now fuzzy find in another terminal session vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") vim.keymap.set("n", "f", vim.lsp.buf.format) @@ -58,16 +48,46 @@ vim.keymap.set("n", "", "cprevzz") vim.keymap.set("n", "k", "lnextzz") vim.keymap.set("n", "j", "lprevzz") --- space + s opens a menu and begin replacing the word on which your cursor lies. +-- ! Extremely useful: space + s opens a menu and begin replacing the word on which your cursor lies. vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) -- Make the file executable without having to exit and chmoding it manually. vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) -vim.keymap.set("n", "vpp", "e ~/.dotfiles/nvim/.config/nvim/lua/theprimeagen/packer.lua"); -vim.keymap.set("n", "mr", "CellularAutomaton make_it_rain"); - -vim.keymap.set("n", "", function() - vim.cmd("so") -end) - +-- Diagnostic keymaps +vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) +vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) +vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) + +-- ThePrimeagen's Flashy Highlight on yank +local augroup = vim.api.nvim_create_augroup +local ThePrimeagenGroup = augroup('ThePrimeagen', {}) + +local autocmd = vim.api.nvim_create_autocmd +local yank_group = augroup('HighlightYank', {}) + +function R(name) + require("plenary.reload").reload_module(name) +end + +autocmd('TextYankPost', { + group = yank_group, + pattern = '*', + callback = function() + vim.highlight.on_yank({ + higroup = 'IncSearch', + timeout = 40, + }) + end, +}) + +autocmd({"BufWritePre"}, { + group = ThePrimeagenGroup, + pattern = "*", + command = [[%s/\s\+$//e]], +}) + +-- attempt opaque background: It worked! +vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) +vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })