diff --git a/README.md b/README.md index 2b9e52dad85..3a4f4ffb40b 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,7 @@ ## Introduction -A starting point for Neovim that is: - -* Small -* Single-file -* Completely Documented - -**NOT** a Neovim distribution, but instead a starting point for your configuration. +Personal neovim configuration from Rue, forked from Kickstart.nvim. Be safe to fork and change how you want! ## Installation @@ -81,7 +75,10 @@ too - it's ignored in the kickstart repo to make maintenance easier, but it's
Linux and Mac ```sh -git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim +git clone https://github.com/Rue0612/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim +``` +```fish +git clone https://github.com/Rue0612/kickstart.nvim.git (if set -q XDG_CONFIG_HOME; echo "$XDG_CONFIG_HOME"; else; echo "$HOME/.config"; end)/nvim ```
@@ -91,13 +88,13 @@ git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HO If you're using `cmd.exe`: ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git "%localappdata%\nvim" +git clone https://github.com/Rue0612/kickstart.nvim.git "%localappdata%\nvim" ``` If you're using `powershell.exe` ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim" +git clone https://github.com/Rue0612/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim" ``` @@ -242,7 +239,7 @@ sudo dnf install -y gcc make git ripgrep fd-find unzip neovim
Arch Install Steps ``` -sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim +sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip wl-clipboard neovim ```
diff --git a/init.lua b/init.lua index d5ae6dc9b2a..812df2e00d1 100644 --- a/init.lua +++ b/init.lua @@ -1,87 +1,26 @@ --[[ + This is my personal nvim config, forked from "kickstarter.nvim" -===================================================================== -==================== 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. + Now some personal notes in case I need it. + + In case I forgot something about lua: + - https://learnxinyminutes.com/docs/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. + - Also don't forget about :Tutor rue u dumb + *sorry I like to blame myself + - :help, can someone :help me, :heeeeellllp + - u can, with some [space], [s]earch the [h]elp too. I think u need it - 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. + `:checkhealth` if the world is on fire +<<< master + Thanks TJ. - 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! :) + NOTE: vugnaes sreo +- Rue --]] -- Set as the leader key @@ -90,21 +29,19 @@ P.S. You can delete this when you're done too. It's your config now! :) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' --- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +-- I am nerd. +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.o` --- NOTE: You can change these options as you wish! -- For more options, you can see `:help option-list` --- Make line numbers default vim.o.number = true -- You can also add relative line numbers, to help with jumping. --- Experiment for yourself to see if you like it! +-- Okay. What you're doing there is jumping. You just... you just jumped. But nevermind. -- vim.o.relativenumber = true --- Enable mouse mode, can be useful for resizing splits for example! +-- Enable mouse mode, even tho I hate disney vim.o.mouse = 'a' -- Don't show the mode, since it's already in the status line @@ -112,7 +49,6 @@ vim.o.showmode = false -- Sync clipboard between OS and Neovim. -- Schedule the setting after `UiEnter` because it can increase startup-time. --- Remove this option if you want your OS clipboard to remain independent. -- See `:help 'clipboard'` vim.schedule(function() vim.o.clipboard = 'unnamedplus' end) @@ -157,14 +93,14 @@ vim.o.inccommand = 'split' vim.o.cursorline = true -- Minimal number of screen lines to keep above and below the cursor. -vim.o.scrolloff = 10 +vim.o.scrolloff = 15 -- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`), -- instead raise a dialog asking if you wish to save the current file(s) -- See `:help 'confirm'` vim.o.confirm = true --- [[ Basic Keymaps ]] +-- NOTE: [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` -- Clear highlights on search when pressing in normal mode @@ -192,31 +128,24 @@ vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagn -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier -- for people to discover. Otherwise, you normally need to press , which -- is not what someone will guess without a bit more experience. --- -- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping -- or just use to exit terminal mode vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) --- TIP: Disable arrow keys in normal mode --- vim.keymap.set('n', '', 'echo "Use h to move!!"') --- vim.keymap.set('n', '', 'echo "Use l to move!!"') --- vim.keymap.set('n', '', 'echo "Use k to move!!"') --- vim.keymap.set('n', '', 'echo "Use j to move!!"') - -- Keybinds to make split navigation easier. --- Use CTRL+ to switch between windows --- +-- As I use a colemack keyboard, is easier to me to move focus using the arrow keys +-- Also Ctrl+neio is aready what I use for moving around so it would be more ackward Cmd+Ctrl+something.... -- See `:help wincmd` for a list of all window commands -vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) --- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes --- vim.keymap.set("n", "", "H", { desc = "Move window to the left" }) --- vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) --- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) --- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) +-- Terminal keymaps to make it<<< master easyer to open a terminal in the directory that I am working +-- (thanks alacritty for not having tabs *ironically*) +vim.keymap.set('n', 'tt', ':!alacritty --working-directory=%:p:h &', { desc = 'Open external terminal in current file directory' }) +vim.keymap.set('n', 't.', ':lcd %:p:h | terminal', { desc = 'Open integrated terminal in current file directory' }) +vim.keymap.set('n', 'ts', ':vsplit | lcd %:p:h | terminal', { desc = 'Open terminal split in current file directory' }) -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -243,8 +172,7 @@ end local rtp = vim.opt.rtp rtp:prepend(lazypath) --- [[ Configure and install plugins ]] --- +-- NOTE: [[ Configure and install plugins ]] -- To check the current status of your plugins, run -- :Lazy -- @@ -253,10 +181,10 @@ rtp:prepend(lazypath) -- To update plugins you can run -- :Lazy update -- --- NOTE: Here is where you install your plugins. require('lazy').setup({ - -- NOTE: Plugins can be added via a link or github org/name. To run setup automatically, use `opts = {}` - { 'NMAC427/guess-indent.nvim', opts = {} }, + 'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically +<<< master + -- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded. -- Alternatively, use `config = function() ... end` for full control over the configuration. -- If you prefer to call `setup` explicitly, use: @@ -269,9 +197,6 @@ require('lazy').setup({ -- end, -- } -- - -- Here is a more advanced example where we pass configuration - -- options to `gitsigns.nvim`. - -- -- See `:help gitsigns` to understand what the configuration keys do { -- Adds git related signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', @@ -285,19 +210,14 @@ require('lazy').setup({ }, }, }, - - -- NOTE: Plugins can also be configured to run Lua code when they are loaded. - -- - -- This is often very useful to both group configuration, as well as handle - -- lazy loading plugins that don't need to be loaded immediately at startup. - -- + { 'tpope/vim-fugitive' }, -- For example, in the following configuration, we use: -- event = 'VimEnter' -- -- which loads which-key before all the UI elements are loaded. Events can be -- normal autocommands events (`:help autocmd-events`). -- - -- Then, because we use the `opts` key (recommended), the configuration runs + -- Then, because we useOkay. What you're doing there is jumping. You just... you just jumped. But nevermind. Say 'Apple'. 'Aaaapple. the `opts` key (recommended), the configuration runs -- after the plugin has been loaded as `require(MODULE).setup(opts)`. { -- Useful plugin to show you pending keybinds. @@ -310,7 +230,7 @@ require('lazy').setup({ -- Document existing key chains spec = { - { 's', group = '[S]earch', mode = { 'n', 'v' } }, + { 's', group =<<< master '[S]earch', mode = { 'n', 'v' } }, { 't', group = '[T]oggle' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, }, @@ -499,9 +419,9 @@ require('lazy').setup({ -- -- In general, you have a "server" which is some tool built to understand a particular -- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers - -- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone + -- (sometimes called LSP servers, but t<<< masterhat's kind of like ATM Machine) are standalone -- processes that communicate with some "client" - in this case, Neovim! - -- + --" -- LSP provides Neovim with features like: -- - Go to definition -- - Find references @@ -583,6 +503,36 @@ require('lazy').setup({ end, }) + -- Diagnostic Config + -- See :help vim.diagnostic.Opts + vim.diagnostic.config { + severity_sort = true, + float = { border = 'rounded', source = 'if_many' }, + underline = { severity = vim.diagnostic.severity.ERROR }, + signs = vim.g.have_nerd_font and { + text = { + [vim.diagnostic.severity.ERROR] = '󰅚 ', + [vim.diagnostic.severity.WARN] = '󰀪 ', + [vim.diagnostic.severity.INFO] = '󰋽 ', + [vim.diagnostic.severity.HINT] = '󰌶 ', + }, + } or {}, + virtual_text = { + source = 'if_many', + spacing = 2, + format = function(diagnostic) + local diagnostic_message = { + [vim.diagnostic.severity.ERROR] = diagnostic.message, + [vim.diagnostic.severity.WARN] = diagnostic.message, + [vim.diagnostic.severity.INFO] = diagnostic.message, + [vim.diagnostic.severity.HINT] = diagnostic.message, + } + return diagnostic_message[diagnostic.severity] + end, + }, + update_in_insert = true, + } + -- LSP servers and clients are able to communicate to each other what features they support. -- By default, Neovim doesn't support everything that is in the LSP specification. -- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities. @@ -593,10 +543,12 @@ require('lazy').setup({ -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. -- See `:help lsp-config` for information about keys and how to configure local servers = { - -- clangd = {}, + clangd = {}, -- gopls = {}, -- pyright = {}, - -- rust_analyzer = {}, + rust_analyzer = {}, + sourcekit = {}, + -- ... 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: -- https://github.com/pmizio/typescript-tools.nvim @@ -619,6 +571,9 @@ require('lazy').setup({ -- You can add other tools here that you want Mason to install }) + ensure_installed = vim.tbl_filter(function(server_name) + return server_name ~= 'sourcekit' + end, ensure_installed) require('mason-tool-installer').setup { ensure_installed = ensure_installed } for name, server in pairs(servers) do @@ -697,7 +652,7 @@ require('lazy').setup({ { -- Autocompletion 'saghen/blink.cmp', - event = 'VimEnter', + event = 'VimEnter',<<< master version = '1.*', dependencies = { -- Snippet Engine @@ -729,28 +684,13 @@ require('lazy').setup({ --- @type blink.cmp.Config opts = { keymap = { - -- 'default' (recommended) for mappings similar to built-in completions - -- to accept ([y]es) the completion. - -- This will auto-import if your LSP supports it. - -- This will expand snippets if the LSP sent a snippet. - -- 'super-tab' for tab to accept - -- 'enter' for enter to accept - -- 'none' for no mappings - -- - -- For an understanding of why the 'default' preset is recommended, - -- you will need to read `:help ins-completion` - -- - -- No, but seriously. Please read `:help ins-completion`, it is really good! - -- - -- All presets have the following mappings: - -- /: move to right/left of your snippet expansion - -- : Open menu or open docs if already open - -- / or /: Select next/previous item - -- : Hide menu - -- : Toggle signature help - -- - -- See :h blink-cmp-config-keymap for defining your own keymap - preset = 'default', + -- I don't know why default is recomended Tj + -- I don't want to know why + -- I don't need to know why + -- I just wanna autocomplete with tab and be happy with it + -- sorry + -- even tho I am on neovim I prefer simplicity + preset = 'super-tab', -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps @@ -793,20 +733,23 @@ require('lazy').setup({ -- change the command in the config to whatever the name of that colorscheme is. -- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - 'folke/tokyonight.nvim', + 'catppuccin/nvim', + name = 'catppuccin', priority = 1000, -- Make sure to load this before all the other start plugins. config = function() ---@diagnostic disable-next-line: missing-fields - require('tokyonight').setup { - styles = { - comments = { italic = false }, -- Disable italics in comments + require('catppuccin').setup { + flavour = 'mocha', + transparent_background = true, + integrations = { + treesitter = true, }, } -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' + vim.cmd.colorscheme 'catppuccin' end, }, @@ -870,11 +813,11 @@ 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.debug', + require 'kickstart.plugins.indent_line', + require 'kickstart.plugins.lint', + require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.neo-tree',<<< master -- 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` diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index c7067891df0..d3dc9acc77a 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -16,10 +16,12 @@ return { opts = { filesystem = { window = { + position = 'float', mappings = { ['\\'] = 'close_window', }, }, }, + popup_border_syle = 'rounded', }, }