From fa0f5828c3c19e31474015f2db257e88c8880859 Mon Sep 17 00:00:00 2001 From: Lorne Stalker Date: Sun, 13 Aug 2023 12:44:50 +0100 Subject: [PATCH] base setup and fugitive config --- .github/ISSUE_TEMPLATE/bug_report.md | 28 ----------- README.md | 50 ++----------------- doc/kickstart.txt | 24 --------- doc/tags | 3 -- init.lua | 4 +- .../plugins/autoformat.lua | 0 lua/{kickstart => lornest}/plugins/debug.lua | 0 lua/lornest/plugins/fugitive.lua | 34 +++++++++++++ 8 files changed, 42 insertions(+), 101 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 doc/kickstart.txt delete mode 100644 doc/tags rename lua/{kickstart => lornest}/plugins/autoformat.lua (100%) rename lua/{kickstart => lornest}/plugins/debug.lua (100%) create mode 100644 lua/lornest/plugins/fugitive.lua diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 2ad4d31d..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - - - -## Describe the bug - - -## To Reproduce - -1. ... - -## Desktop - -- OS: -- Terminal: - -## Neovim Version - - -``` -``` diff --git a/README.md b/README.md index ef597600..3b8f2eb9 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,12 @@ -# kickstart.nvim +# PDE based on kickstart.nvim +This repo is my (current) PDE and is subject to periodic changes. To start your own PDE from a base configuration, head over to TJ's kickstart.nvim https://github.com/kdheepak/kickstart.nvim/assets/1813121/f3ff9a2b-c31f-44df-a4fa-8a0d7b17cf7b -### Introduction +You can, of course, feel free to use my setup as is, or fork this repo to adapt from here. -A starting point for Neovim that is: - -* Small -* Single-file (with examples of moving to multi-file) -* Documented -* Modular - -This repo is meant to be used by **YOU** to begin your Neovim journey; remove the things you don't use and add what you miss. - -Kickstart.nvim targets *only* the latest ['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest ['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. If you are experiencing issues, please make sure you have the latest versions. - -Distribution Alternatives: -- [LazyVim](https://www.lazyvim.org/): A delightful distribution maintained by @folke (the author of lazy.nvim, the package manager used here) - -### Installation - -* Backup your previous configuration (if any exists) +* Before starting, backup your previous configuration (if any exists) +`mv ~/.config/nvim ~/.config/nvim.backup` ### Archive Installation * On the home/landing page for the project find the blue "<> CODE" button click it and select Local > Download ZIP. @@ -41,10 +27,6 @@ Distribution Alternatives: * Once the setup is complete, restart Neovim. * **You're ready to go!** -* (Recommended/Optional) Fork this repo (so that you have your own copy that you can modify). -* Clone the kickstart repo into `$HOME/.config/nvim/` (Linux/Mac) or `%userprofile%\AppData\Local\nvim\` (Windows) - * If you don't want to include it as a git repo, you can just clone it and then move the files to this location - Additional system requirements: - Make sure to review the readmes of the plugins if you are experiencing errors. In particular: - [ripgrep](https://github.com/BurntSushi/ripgrep#installation) is required for multiple [telescope](https://github.com/nvim-telescope/telescope.nvim#suggested-dependencies) pickers. @@ -53,7 +35,6 @@ Additional system requirements: ### Configuration And Extension * Inside of your copy, feel free to modify any file you like! It's your copy! -* Feel free to change any of the default options in `init.lua` to better suit your needs. * For adding plugins, there are 3 primary options: * Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` (uncomment the line importing the `custom/plugins` directory in the `init.lua` file to enable this) * Modify `init.lua` with additional plugins. @@ -112,27 +93,6 @@ return { This will install the tree plugin and add the command `:Neotree` for you. You can explore the documentation at [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) for more information. -### Contribution - -Pull-requests are welcome. The goal of this repo is not to create a Neovim configuration framework, but to offer a starting template that shows, by example, available features in Neovim. Some things that will not be included: - -* Custom language server configuration (null-ls templates) -* Theming beyond a default colorscheme necessary for LSP highlight groups - -Each PR, especially those which increase the line count, should have a description as to why the PR is necessary. - -### FAQ - -* What should I do if I already have a pre-existing neovim configuration? - * You should back it up, then delete all files associated with it. - * This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/` - * You may also want to look at the [migration guide for lazy.nvim](https://github.com/folke/lazy.nvim#-migration-guide) -* What if I want to "uninstall" this configuration: - * See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information -* Are there any cool videos about this plugin? - * Current iteration of kickstart (coming soon) - * Here is one about the previous iteration of kickstart: [video introduction to Kickstart.nvim](https://youtu.be/stqUbv-5u2s). Note the install via init.lua no longer works as specified. Please follow the install instructions in this file instead as they're up to date. - ### Windows Installation Installation may require installing build tools, and updating the run command for `telescope-fzf-native` diff --git a/doc/kickstart.txt b/doc/kickstart.txt deleted file mode 100644 index cb87ac3f..00000000 --- a/doc/kickstart.txt +++ /dev/null @@ -1,24 +0,0 @@ -================================================================================ -INTRODUCTION *kickstart.nvim* - -Kickstart.nvim is a project to help you get started on your neovim journey. - - *kickstart-is-not* -It is not: -- Complete framework for every plugin under the sun -- Place to add every plugin that could ever be useful - - *kickstart-is* -It is: -- Somewhere that has a good start for the most common "IDE" type features: - - autocompletion - - goto-definition - - find references - - fuzzy finding - - and hinting at what more can be done :) -- A place to _kickstart_ your journey. - - You should fork this project and use/modify it so that it matches your - style and preferences. If you don't want to do that, there are probably - other projects that would fit much better for you (and that's great!)! - - vim:tw=78:ts=8:ft=help:norl: diff --git a/doc/tags b/doc/tags deleted file mode 100644 index 687ae772..00000000 --- a/doc/tags +++ /dev/null @@ -1,3 +0,0 @@ -kickstart-is kickstart.txt /*kickstart-is* -kickstart-is-not kickstart.txt /*kickstart-is-not* -kickstart.nvim kickstart.txt /*kickstart.nvim* diff --git a/init.lua b/init.lua index 1332c3b9..968f9ec8 100644 --- a/init.lua +++ b/init.lua @@ -201,6 +201,7 @@ require('lazy').setup({ -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- These are some example plugins that I've included in the kickstart repository. -- Uncomment any of the lines below to enable them. + require 'lornest.plugins.fugitive', -- require 'kickstart.plugins.autoformat', -- require 'kickstart.plugins.debug', @@ -218,10 +219,11 @@ require('lazy').setup({ -- NOTE: You can change these options as you wish! -- Set highlight on search -vim.o.hlsearch = false +vim.o.hlsearch = true -- Make line numbers default vim.wo.number = true +vim.o.relativenumber = true -- Enable mouse mode vim.o.mouse = 'a' diff --git a/lua/kickstart/plugins/autoformat.lua b/lua/lornest/plugins/autoformat.lua similarity index 100% rename from lua/kickstart/plugins/autoformat.lua rename to lua/lornest/plugins/autoformat.lua diff --git a/lua/kickstart/plugins/debug.lua b/lua/lornest/plugins/debug.lua similarity index 100% rename from lua/kickstart/plugins/debug.lua rename to lua/lornest/plugins/debug.lua diff --git a/lua/lornest/plugins/fugitive.lua b/lua/lornest/plugins/fugitive.lua new file mode 100644 index 00000000..58663808 --- /dev/null +++ b/lua/lornest/plugins/fugitive.lua @@ -0,0 +1,34 @@ +return { + 'tpope/vim-fugitive', + config = function() + vim.keymap.set("n", "gs", vim.cmd.Git) + + local Lornest_Fugitive = vim.api.nvim_create_augroup("Lornest_Fugitive", {}) + + local autocmd = vim.api.nvim_create_autocmd + autocmd("BufWinEnter", { + group = Lornest_Fugitive, + pattern = "*", + callback = function() + if vim.bo.ft ~= "fugitive" then + return + end + + local bufnr = vim.api.nvim_get_current_buf() + local opts = {buffer = bufnr, remap = false} + vim.keymap.set("n", "p", function() + vim.cmd.Git('push') + end, opts) + + -- rebase always + vim.keymap.set("n", "P", function() + vim.cmd.Git({'pull', '--rebase'}) + end, opts) + + -- NOTE: It allows me to easily set the branch i am pushing and any tracking + -- needed if i did not set the branch up correctly + vim.keymap.set("n", "t", ":Git push -u origin ", opts); + end, + }) + end +}