From 86d83c8e10ab370a8ae371a2d981e26f266c339b Mon Sep 17 00:00:00 2001 From: T Date: Sat, 5 Apr 2025 16:49:37 -0400 Subject: [PATCH 1/6] enable plugins --- init.lua | 106 ++++++------------------------------------------------- 1 file changed, 11 insertions(+), 95 deletions(-) diff --git a/init.lua b/init.lua index cbf9ff65d67..2175e0adf56 100644 --- a/init.lua +++ b/init.lua @@ -1,89 +1,3 @@ ---[[ - -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== -======== .-----. ======== -======== .----------------------. | === | ======== -======== |.-""""""""""""""""""-.| |-----| ======== -======== || || | === | ======== -======== || KICKSTART.NVIM || |-----| ======== -======== || || | === | ======== -======== || || |-----| ======== -======== ||:Tutor || |:::::| ======== -======== |'-..................-'| |____o| ======== -======== `"")----------------(""` ___________ ======== -======== /::::::::::| |::::::::::\ \ no mouse \ ======== -======== /:::========| |==hjkl==:::\ \ required \ ======== -======== '""""""""""""' '""""""""""""' '""""""""""' ======== -======== ======== -===================================================================== -===================================================================== - -What is Kickstart? - - Kickstart.nvim is *not* a distribution. - - Kickstart.nvim is a starting point 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 can start exploring, configuring and tinkering to - make Neovim your own! That might mean leaving Kickstart just the way it is for a while - or immediately breaking it into modular pieces. It's up to you! - - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example which will only take 10-15 minutes: - - https://learnxinyminutes.com/docs/lua/ - - After understanding a bit more about Lua, you can use `:help lua-guide` as a - reference for how Neovim integrates Lua. - - :help lua-guide - - (or HTML version): https://neovim.io/doc/user/lua-guide.html - -Kickstart Guide: - - TODO: The very first thing you should do is to run the command `:Tutor` in Neovim. - - If you don't know what this means, type the following: - - - - : - - Tutor - - - - (If you already know the Neovim basics, you can skip this step.) - - Once you've completed that, you can continue working through **AND READING** the rest - of the kickstart init.lua. - - Next, run AND READ `:help`. - This will open up a help window with some basic information - about reading, navigating and searching the builtin help documentation. - - This should be the first place you go to look when you're stuck or confused - with something. It's one of my favorite Neovim features. - - MOST IMPORTANTLY, we provide a keymap "sh" to [s]earch the [h]elp documentation, - which is very useful when you're not exactly sure of what you're looking for. - - I have left several `:help X` comments throughout the init.lua - These are hints about where to find more information about the relevant settings, - plugins or Neovim features used in Kickstart. - - NOTE: Look for lines like this - - Throughout the file. These are for you, the reader, to help you 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 Neovim config. - -If you experience any errors while trying to install kickstart, run `:checkhealth` for more info. - -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 loaded (otherwise wrong leader will be used) @@ -240,6 +154,8 @@ vim.opt.rtp:prepend(lazypath) require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically + 'https://github.com/bergercookie/asm-lsp', + -- 'https://github.com/microsoft/pyright', -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following @@ -669,10 +585,10 @@ require('lazy').setup({ -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { - -- clangd = {}, + clangd = {}, -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, + pyright = {}, -- Need to install via npm first + rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- -- Some languages (like typescript) have entire language plugins that can be useful: @@ -990,12 +906,12 @@ require('lazy').setup({ -- Here are some example plugins that I've included in the Kickstart repository. -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- - -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', - -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'kickstart.plugins.debug', + require 'kickstart.plugins.indent_line', + require 'kickstart.plugins.lint', + require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.neo-tree', + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. From 5ffabe5b25cbab0e37d679db93dbec57b950c45d Mon Sep 17 00:00:00 2001 From: tannerlp Date: Sun, 6 Apr 2025 09:21:49 -0400 Subject: [PATCH 2/6] add docstring generator --- init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/init.lua b/init.lua index 2175e0adf56..a1000192b39 100644 --- a/init.lua +++ b/init.lua @@ -164,6 +164,13 @@ require('lazy').setup({ -- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded. -- + { + 'jeangiraldoo/codedocs.nvim', + -- Remove the 'dependencies' section if you don't plan on using nvim-treesitter + dependencies = { + 'nvim-treesitter/nvim-treesitter', + }, + }, -- Alternatively, use `config = function() ... end` for full control over the configuration. -- If you prefer to call `setup` explicitly, use: -- { @@ -359,6 +366,7 @@ require('lazy').setup({ }) end, { desc = '[/] Fuzzily search in current buffer' }) + vim.keymap.set('n', 'k', require('codedocs').insert_docs, { desc = 'Insert docstring' }) -- It's also possible to pass additional configuration options. -- See `:help telescope.builtin.live_grep()` for information about particular keys vim.keymap.set('n', 's/', function() From c5e5964e5622d683f087592adfc8f9d6c49c5f5d Mon Sep 17 00:00:00 2001 From: T Date: Sun, 6 Apr 2025 09:50:24 -0400 Subject: [PATCH 3/6] switch documentation plugin --- init.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index a1000192b39..79ace422881 100644 --- a/init.lua +++ b/init.lua @@ -165,11 +165,10 @@ require('lazy').setup({ -- { - 'jeangiraldoo/codedocs.nvim', - -- Remove the 'dependencies' section if you don't plan on using nvim-treesitter - dependencies = { - 'nvim-treesitter/nvim-treesitter', - }, + 'danymat/neogen', + config = true, + -- Uncomment next line if you want to follow only stable versions + -- version = "*" }, -- Alternatively, use `config = function() ... end` for full control over the configuration. -- If you prefer to call `setup` explicitly, use: @@ -366,7 +365,10 @@ require('lazy').setup({ }) end, { desc = '[/] Fuzzily search in current buffer' }) - vim.keymap.set('n', 'k', require('codedocs').insert_docs, { desc = 'Insert docstring' }) + vim.keymap.set('n', 'k', require('neogen').generate, { + noremap = true, + silent = true, + }) -- It's also possible to pass additional configuration options. -- See `:help telescope.builtin.live_grep()` for information about particular keys vim.keymap.set('n', 's/', function() From 504543e1482bf7564464502ede9b1d266ceb8161 Mon Sep 17 00:00:00 2001 From: T Date: Sun, 6 Apr 2025 13:57:45 -0400 Subject: [PATCH 4/6] add formatters --- init.lua | 14 +++++++++++++- resources/clang-format | 12 ++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 resources/clang-format diff --git a/init.lua b/init.lua index 79ace422881..88843ef1c4a 100644 --- a/init.lua +++ b/init.lua @@ -128,6 +128,8 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) +-- ~/.local/share/nvim +-- This is the location that nvim installs all the plugins -- [[ Install `lazy.nvim` plugin manager ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' @@ -640,6 +642,8 @@ require('lazy').setup({ local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { 'stylua', -- Used to format Lua code + 'clang-format', -- Need to install venv via `sudo apt install python3.12-venv` + 'black', }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } @@ -680,7 +684,8 @@ require('lazy').setup({ -- Disable "format_on_save lsp_fallback" for languages that don't -- have a well standardized coding style. You can add additional -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } + -- local disable_filetypes = { c = true, cpp = true } + local disable_filetypes = {} if disable_filetypes[vim.bo[bufnr].filetype] then return nil else @@ -692,12 +697,19 @@ require('lazy').setup({ end, formatters_by_ft = { lua = { 'stylua' }, + c = { 'clang-format' }, + python = { 'black' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- -- You can use 'stop_after_first' to run the first available formatter from the list -- javascript = { "prettierd", "prettier", stop_after_first = true }, }, + formatters = { + ['clang-format'] = { + prepend_args = { '--style=file', '--fallback-style=LLVM' }, + }, + }, }, }, diff --git a/resources/clang-format b/resources/clang-format new file mode 100644 index 00000000000..b8e705b0349 --- /dev/null +++ b/resources/clang-format @@ -0,0 +1,12 @@ +--- +# We'll use defaults from the LLVM style, but with 4 columns indentation. +BasedOnStyle: LLVM +IndentWidth: 4 +TabWidth: 4 +UseTab: Never +ColumnLimit: 100 +--- +Language: C +PointerAlignment: Left +BreakBeforeBraces: Attach +AlignAfterOpenBracket: BlockIndent From 031ced11bb03777dcfb36cbd2060ae2e9c3a4418 Mon Sep 17 00:00:00 2001 From: tannerlp Date: Sun, 6 Apr 2025 20:07:40 -0400 Subject: [PATCH 5/6] put neogen mappings in a sane place --- init.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index 88843ef1c4a..ee8ba85122f 100644 --- a/init.lua +++ b/init.lua @@ -168,7 +168,14 @@ require('lazy').setup({ { 'danymat/neogen', - config = true, + config = function() + require('neogen').setup {} + + vim.keymap.set('n', 'k', require('neogen').generate, { + noremap = true, + silent = true, + }) + end, -- Uncomment next line if you want to follow only stable versions -- version = "*" }, @@ -367,10 +374,6 @@ require('lazy').setup({ }) end, { desc = '[/] Fuzzily search in current buffer' }) - vim.keymap.set('n', 'k', require('neogen').generate, { - noremap = true, - silent = true, - }) -- It's also possible to pass additional configuration options. -- See `:help telescope.builtin.live_grep()` for information about particular keys vim.keymap.set('n', 's/', function() From 6002925188899484c9e54fe40de86edebb8fcdfa Mon Sep 17 00:00:00 2001 From: tannerlp Date: Sun, 24 Aug 2025 09:35:58 -0400 Subject: [PATCH 6/6] add go lsp back --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index ee8ba85122f..420b47e15f1 100644 --- a/init.lua +++ b/init.lua @@ -601,7 +601,7 @@ require('lazy').setup({ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { clangd = {}, - -- gopls = {}, + gopls = {}, pyright = {}, -- Need to install via npm first rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs