From 0693fcf41d7f43a465b5bab557add09e14395cdc Mon Sep 17 00:00:00 2001 From: arnold-lei Date: Sun, 24 Sep 2023 23:14:26 -0600 Subject: [PATCH 1/6] configuring my own kickstart --- init.lua | 63 +++++++++-------------------------------- lua/arnoldlei/remap.lua | 49 ++++++++++++++++++++++++++++++++ lua/arnoldlei/set.lua | 27 ++++++++++++++++++ lua/plugins/harpoon.lua | 15 ++++++++++ 4 files changed, 104 insertions(+), 50 deletions(-) create mode 100644 lua/arnoldlei/remap.lua create mode 100644 lua/arnoldlei/set.lua create mode 100644 lua/plugins/harpoon.lua diff --git a/init.lua b/init.lua index 2d31b44b..03e1b9cf 100644 --- a/init.lua +++ b/init.lua @@ -1,48 +1,9 @@ ---[[ - -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== - -Kickstart.nvim is *not* a distribution. - -Kickstart.nvim is a template for your own configuration. - The goal is that you can read every line of code, top-to-bottom, understand - what your configuration is doing, and modify it to suit your needs. - - Once you've done that, you should start exploring, configuring and tinkering to - explore Neovim! - - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example: - - https://learnxinyminutes.com/docs/lua/ - - - And then you can explore or search through `:help lua-guide` - - https://neovim.io/doc/user/lua-guide.html - - -Kickstart Guide: - -I have left several `:help X` comments throughout the init.lua -You should run that command and read that help section for more information. - -In addition, I have some `NOTE:` items throughout the file. -These are for you, the reader to help understand what is happening. Feel free to delete -them once you know what you're doing, but they should serve as a guide for when you -are first encountering a few different constructs in your nvim config. - -I hope you enjoy your Neovim journey, -- TJ - -P.S. You can delete this when you're done too. It's your config now :) ---]] -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' - +vim.keymap.set("n", "gs", vim.cmd.Git) -- Install package manager -- https://github.com/folke/lazy.nvim -- `:help lazy.nvim.txt` for more info @@ -66,9 +27,9 @@ vim.opt.rtp:prepend(lazypath) -- as they will be available in your neovim runtime. require('lazy').setup({ -- NOTE: First, some plugins that don't require any configuration - + {import = "plugins"}, -- Git related plugins - 'tpope/vim-fugitive', + "tpope/vim-fugitive", 'tpope/vim-rhubarb', -- Detect tabstop and shiftwidth automatically @@ -143,14 +104,14 @@ require('lazy').setup({ }, { - -- Theme inspired by Atom - 'navarasu/onedark.nvim', - priority = 1000, + "folke/tokyonight.nvim", + lazy = false, -- make sure we load this during startup if it is your main colorscheme + priority = 1000, -- make sure to load this before all the other start plugins config = function() - vim.cmd.colorscheme 'onedark' + -- load the colorscheme here + vim.cmd([[colorscheme tokyonight]]) end, }, - { -- Set lualine as statusline 'nvim-lualine/lualine.nvim', @@ -313,10 +274,10 @@ vim.keymap.set('n', '/', function() }) end, { desc = '[/] Fuzzily search in current buffer' }) -vim.keymap.set('n', 'gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) -vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) +vim.keymap.set('n', '', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) +vim.keymap.set('n', '', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) -vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) +vim.keymap.set('n', '', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]resume' }) @@ -537,3 +498,5 @@ cmp.setup { -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et +require('arnoldlei.set') +require('arnoldlei.remap') diff --git a/lua/arnoldlei/remap.lua b/lua/arnoldlei/remap.lua new file mode 100644 index 00000000..753b7481 --- /dev/null +++ b/lua/arnoldlei/remap.lua @@ -0,0 +1,49 @@ +vim.g.mapleader = " " +vim.keymap.set("n", "pv", vim.cmd.Ex) + +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") + +vim.keymap.set("n", "J", "mzJ`z") +vim.keymap.set("n", "", "zz") +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) + +-- greatest remap ever +vim.keymap.set("x", "p", [["_dP]]) + +-- next greatest remap ever : asbjornHaland +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", "") +vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") +vim.keymap.set("n", "f", vim.lsp.buf.format) + +vim.keymap.set("n", "", "cnextzz") +vim.keymap.set("n", "", "cprevzz") +vim.keymap.set("n", "k", "lnextzz") +vim.keymap.set("n", "j", "lprevzz") + +vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) +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) diff --git a/lua/arnoldlei/set.lua b/lua/arnoldlei/set.lua new file mode 100644 index 00000000..45aa63b6 --- /dev/null +++ b/lua/arnoldlei/set.lua @@ -0,0 +1,27 @@ +vim.opt.nu = true +vim.opt.relativenumber = true + +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.expandtab = true + +vim.opt.smartindent = true + +vim.opt.wrap = false + +vim.opt.swapfile = false +vim.opt.backup = false +vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" +vim.opt.undofile = true + +-- vim.opt.hlsearch = false +-- vim.opt.incsearch = true + +vim.opt.termguicolors = true + +vim.opt.scrolloff = 8 +vim.opt.signcolumn = "yes" +vim.opt.isfname:append("@-@") + +vim.opt.colorcolumn = "80" diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua new file mode 100644 index 00000000..8590d617 --- /dev/null +++ b/lua/plugins/harpoon.lua @@ -0,0 +1,15 @@ +return { + "ThePrimeagen/harpoon", + lazy = false, + dependencies = { + "nvim-lua/plenary.nvim", + }, + config = true, + keys = { + { "a", "lua require('harpoon.mark').add_file()", desc = "Mark file with harpoon" }, + { "hn", "lua require('harpoon.ui').nav_next()", desc = "Go to next harpoon mark" }, + { "hp", "lua require('harpoon.ui').nav_prev()", desc = "Go to previous harpoon mark" }, + { "", "lua require('harpoon.ui').toggle_quick_menu()", desc = "Show harpoon marks" }, + }, +} + From c74e696c0f4d96a37210b4ae29a5eeb815d1d5f4 Mon Sep 17 00:00:00 2001 From: arnold-lei Date: Mon, 25 Sep 2023 08:13:50 -0600 Subject: [PATCH 2/6] removed some overlapping keymaps --- init.lua | 9 --------- 1 file changed, 9 deletions(-) diff --git a/init.lua b/init.lua index 03e1b9cf..5a716928 100644 --- a/init.lua +++ b/init.lua @@ -336,15 +336,6 @@ require('nvim-treesitter.configs').setup { ['[]'] = '@class.outer', }, }, - swap = { - enable = true, - swap_next = { - ['a'] = '@parameter.inner', - }, - swap_previous = { - ['A'] = '@parameter.inner', - }, - }, }, } From dd35967f311caeb013d46ba4f8f2370ddcb9b62e Mon Sep 17 00:00:00 2001 From: arnold-lei Date: Mon, 25 Sep 2023 22:14:48 -0600 Subject: [PATCH 3/6] added carbon theme --- init.lua | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/init.lua b/init.lua index 5a716928..47122640 100644 --- a/init.lua +++ b/init.lua @@ -103,15 +103,26 @@ require('lazy').setup({ }, }, - { - "folke/tokyonight.nvim", - lazy = false, -- make sure we load this during startup if it is your main colorscheme - priority = 1000, -- make sure to load this before all the other start plugins + { + "nyoom-engineering/oxocarbon.nvim", config = function() - -- load the colorscheme here - vim.cmd([[colorscheme tokyonight]]) + vim.cmd([[colorscheme oxocarbon]]) end, + + -- Add in any other configuration; + -- event = foo, + -- config = bar + -- end, }, + -- { + -- "folke/tokyonight.nvim", + -- lazy = false, -- make sure we load this during startup if it is your main colorscheme + -- priority = 1000, -- make sure to load this before all the other start plugins + -- config = function() + -- -- load the colorscheme here + -- vim.cmd([[colorscheme tokyonight]]) + -- end, + -- }, { -- Set lualine as statusline 'nvim-lualine/lualine.nvim', @@ -119,9 +130,9 @@ require('lazy').setup({ opts = { options = { icons_enabled = false, - theme = 'onedark', - -- component_separators = '|', - -- section_separators = '', + theme = 'auto', + component_separators = '|', + section_separators = '', }, }, }, From f7565c3e450c7c0c56d5df0d784455d4161b270b Mon Sep 17 00:00:00 2001 From: arnold-lei Date: Tue, 26 Sep 2023 19:27:51 -0600 Subject: [PATCH 4/6] wip --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index ea93edad..d699e1d6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ tags test.sh .luarc.json nvim -lazy-lock.json From c77521f028c27d02ff1e08820bec087eb72c5c2d Mon Sep 17 00:00:00 2001 From: arnold-lei Date: Wed, 27 Sep 2023 21:20:38 -0600 Subject: [PATCH 5/6] wip --- init.lua | 7 +++++++ lua/arnoldlei/set.lua | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 47122640..c6b4b8b8 100644 --- a/init.lua +++ b/init.lua @@ -133,6 +133,8 @@ require('lazy').setup({ theme = 'auto', component_separators = '|', section_separators = '', + 'filename', + path=1, }, }, }, @@ -298,6 +300,10 @@ vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim' }, + modules = {}, + sync_install = false, + ignore_install = {}, + parser_install_dir = nil, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) auto_install = false, @@ -463,6 +469,7 @@ cmp.setup { luasnip.lsp_expand(args.body) end, }, + revision=1, mapping = cmp.mapping.preset.insert { [''] = cmp.mapping.select_next_item(), [''] = cmp.mapping.select_prev_item(), diff --git a/lua/arnoldlei/set.lua b/lua/arnoldlei/set.lua index 45aa63b6..2da762e4 100644 --- a/lua/arnoldlei/set.lua +++ b/lua/arnoldlei/set.lua @@ -1,9 +1,9 @@ vim.opt.nu = true vim.opt.relativenumber = true -vim.opt.tabstop = 2 -vim.opt.softtabstop = 2 -vim.opt.shiftwidth = 2 +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 vim.opt.expandtab = true vim.opt.smartindent = true From a0ecdb6263f5faaf99539b87d4a3401ed4bd5e21 Mon Sep 17 00:00:00 2001 From: arnold-lei Date: Wed, 27 Sep 2023 21:23:07 -0600 Subject: [PATCH 6/6] Tracking lazy lock --- lazy-lock.json | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lazy-lock.json diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 00000000..b42f8402 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,28 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "LuaSnip": { "branch": "master", "commit": "1fd22fa96c11573248f9fdd09f25e724c7bb3dd4" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, + "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, + "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, + "friendly-snippets": { "branch": "main", "commit": "ebf6d6e83494cdd88a54a429340256f4dbb6a052" }, + "gitsigns.nvim": { "branch": "main", "commit": "bdeba1cec3faddd89146690c10b9a87949c0ee66" }, + "harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" }, + "indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" }, + "lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" }, + "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "2451adb9bdb0fd32140bf3aa8dbc17ff60050db3" }, + "mason.nvim": { "branch": "main", "commit": "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" }, + "neodev.nvim": { "branch": "main", "commit": "ddf29935af5a510307850919d6772ea6a4e2c008" }, + "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, + "nvim-lspconfig": { "branch": "master", "commit": "ede4114e1fd41acb121c70a27e1b026ac68c42d6" }, + "nvim-treesitter": { "branch": "master", "commit": "0960322686bfa38afd4f1e0b9660473cf77e24b6" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "bd103502252027434ec42f628d2dbf54821d4ce6" }, + "oxocarbon.nvim": { "branch": "main", "commit": "b47c0ecab3a4270815afb3b05e03423b04cca8f2" }, + "plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "54930e1abfc94409e1bb9266e752ef8379008592" }, + "vim-fugitive": { "branch": "master", "commit": "99db68d9b3304580bd383da7aaee05c7a954a344" }, + "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, + "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, + "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" } +} \ No newline at end of file