From a5272be22949954be638d430700e40b3554a6b57 Mon Sep 17 00:00:00 2001 From: NikitaT Date: Sun, 2 Jun 2024 00:24:32 +0200 Subject: [PATCH] added colorscheme, couple plugins and necessary options --- init.lua | 182 +++---------------------------- lua/custom/plugins/init.lua | 5 - lua/regularnick/init.lua | 2 + lua/regularnick/opts.lua | 78 +++++++++++++ lua/regularnick/plugins/init.lua | 33 ++++++ lua/regularnick/remaps.lua | 21 ++++ 6 files changed, 151 insertions(+), 170 deletions(-) delete mode 100644 lua/custom/plugins/init.lua create mode 100644 lua/regularnick/init.lua create mode 100644 lua/regularnick/opts.lua create mode 100644 lua/regularnick/plugins/init.lua create mode 100644 lua/regularnick/remaps.lua diff --git a/init.lua b/init.lua index 88658ef3..04e3b758 100644 --- a/init.lua +++ b/init.lua @@ -1,165 +1,14 @@ ---[[ - -===================================================================== -==================== 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) -vim.g.mapleader = ' ' -vim.g.maplocalleader = ' ' +require 'regularnick' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false - --- [[ Setting options ]] --- See `:help vim.opt` --- NOTE: You can change these options as you wish! --- For more options, you can see `:help option-list` - --- Make line numbers default -vim.opt.number = true --- You can also add relative line numbers, to help with jumping. --- Experiment for yourself to see if you like it! --- vim.opt.relativenumber = true - --- Enable mouse mode, can be useful for resizing splits for example! -vim.opt.mouse = 'a' - --- Don't show the mode, since it's already in the status line -vim.opt.showmode = false - --- Sync clipboard between OS and Neovim. --- Remove this option if you want your OS clipboard to remain independent. --- See `:help 'clipboard'` -vim.opt.clipboard = 'unnamedplus' - --- Enable break indent -vim.opt.breakindent = true - --- Save undo history -vim.opt.undofile = true - --- Case-insensitive searching UNLESS \C or one or more capital letters in the search term -vim.opt.ignorecase = true -vim.opt.smartcase = true - --- Keep signcolumn on by default -vim.opt.signcolumn = 'yes' - --- Decrease update time -vim.opt.updatetime = 250 - --- Decrease mapped sequence wait time --- Displays which-key popup sooner -vim.opt.timeoutlen = 300 - --- Configure how new splits should be opened -vim.opt.splitright = true -vim.opt.splitbelow = true - --- Sets how neovim will display certain whitespace characters in the editor. --- See `:help 'list'` --- and `:help 'listchars'` -vim.opt.list = true -vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } - --- Preview substitutions live, as you type! -vim.opt.inccommand = 'split' - --- Show which line your cursor is on -vim.opt.cursorline = true - --- Minimal number of screen lines to keep above and below the cursor. -vim.opt.scrolloff = 10 +vim.g.have_nerd_font = true -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` --- Set highlight on search, but clear on pressing in normal mode -vim.opt.hlsearch = true -vim.keymap.set('n', '', 'nohlsearch') +-- Change highlighting search to incremental +vim.opt.hlsearch = false +vim.opt.incsearch = true -- Diagnostic keymaps vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' }) @@ -173,13 +22,14 @@ vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagn -- -- 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' }) +-- vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) +-- NOTE I guess I don't need this since i am using multiplexor and will likely never be in t mode of Neovim -- 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!!"') +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 @@ -874,10 +724,10 @@ require('lazy').setup({ -- 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.indent_line', -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', + 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` @@ -885,7 +735,7 @@ require('lazy').setup({ -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` - -- { import = 'custom.plugins' }, + { import = 'regularnick.plugins' }, }, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the @@ -908,5 +758,7 @@ require('lazy').setup({ }, }) +vim.cmd.colorscheme 'dracula' + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua deleted file mode 100644 index be0eb9d8..00000000 --- a/lua/custom/plugins/init.lua +++ /dev/null @@ -1,5 +0,0 @@ --- You can add your own plugins here or in other files in this directory! --- I promise not to create any merge conflicts in this directory :) --- --- See the kickstart.nvim README for more information -return {} diff --git a/lua/regularnick/init.lua b/lua/regularnick/init.lua new file mode 100644 index 00000000..cd4e59fc --- /dev/null +++ b/lua/regularnick/init.lua @@ -0,0 +1,2 @@ +require 'regularnick.opts' +require 'regularnick.remaps' diff --git a/lua/regularnick/opts.lua b/lua/regularnick/opts.lua new file mode 100644 index 00000000..c9ddeeb8 --- /dev/null +++ b/lua/regularnick/opts.lua @@ -0,0 +1,78 @@ +-- [[ Setting options ]] +-- See `:help vim.opt` +-- NOTE: You can change these options as you wish! +-- For more options, you can see `:help option-list` + +-- Make line numbers default +vim.opt.number = true +-- You can also add relative line numbers, to help with jumping. +-- Experiment for yourself to see if you like it! +vim.opt.relativenumber = true + +-- Enable mouse mode, can be useful for resizing splits for example! +vim.opt.mouse = '' + +-- Don't show the mode, since it's already in the status line +vim.opt.showmode = false + +-- Sync clipboard between OS and Neovim. +-- Remove this option if you want your OS clipboard to remain independent. +-- See `:help 'clipboard'` +-- vim.opt.clipboard = 'unnamedplus' + +-- +vim.opt.guicursor = 'n-v-c-sm:block,i-ci-ve:hor25-Cursor,r-cr-o:hor20' + +-- Tabs are 4 spaces +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true + +-- Enable smartindent +-- vim.opt.breakindent = true +vim.opt.smartindent = true + +vim.opt.wrap = false + +-- Save undo history +vim.opt.undofile = true + +vim.opt.termguicolors = true +-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term +vim.opt.ignorecase = true +vim.opt.smartcase = true + +-- Keep signcolumn on by default +vim.opt.signcolumn = 'yes' + +-- Decrease update time +vim.opt.updatetime = 50 + +-- Decrease mapped sequence wait time +-- Displays which-key popup sooner +vim.opt.timeoutlen = 300 + +-- Configure how new splits should be opened +vim.opt.splitright = true +vim.opt.splitbelow = true + +-- Sets how neovim will display certain whitespace characters in the editor. +-- See `:help 'list'` +-- and `:help 'listchars'` +vim.opt.list = true +vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } + +-- Preview substitutions live, as you type! +vim.opt.inccommand = 'split' + +-- Show which line your cursor is on +vim.opt.cursorline = true + +-- Minimal number of screen lines to keep above and below the cursor. +vim.opt.scrolloff = 8 + +vim.opt.colorcolumn = '80' + +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' diff --git a/lua/regularnick/plugins/init.lua b/lua/regularnick/plugins/init.lua new file mode 100644 index 00000000..4bd33d5b --- /dev/null +++ b/lua/regularnick/plugins/init.lua @@ -0,0 +1,33 @@ +-- You can add your own plugins here or in other files in this directory! +-- I promise not to create any merge conflicts in this directory :) +-- +-- See the kickstart.nvim README for more information +return { + { + 'catppuccin/nvim', + name = 'catppuccin', + priority = 1000, + config = function() + require('catppuccin').setup { transparent_background = true } + vim.cmd.colorscheme 'catppuccin-macchiato' + end, + }, + { + 'Mofiqul/dracula.nvim', + name = 'dracula', + config = function() + require('dracula').setup { transparent_bg = true } + -- vim.cmd.colorscheme 'dracula' + end, + }, + { + 'akinsho/bufferline.nvim', + version = '*', + dependencies = { 'nvim-tree/nvim-web-devicons', 'Mofiqul/dracula.nvim' }, + config = function() + require('bufferline').setup { + highlights = require('catppuccin.groups.integrations.bufferline').get(), + } + end, + }, +} diff --git a/lua/regularnick/remaps.lua b/lua/regularnick/remaps.lua new file mode 100644 index 00000000..05965353 --- /dev/null +++ b/lua/regularnick/remaps.lua @@ -0,0 +1,21 @@ +-- Set as the leader key +-- See `:help mapleader` +-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) + +vim.keymap.set( + 'n', + '', + ':Neotree toggle current reveal_force_cwd', + { desc = 'Open the explorer in the folder the current file is contained and changes the cwd' } +) +-- Recommended keymaps for Neo-tree??? why do they want me to remap fricking / to do some of their command it's literally a search! +-- nnoremap / :Neotree toggle current reveal_force_cwd +-- nnoremap | :Neotree reveal +-- nnoremap gd :Neotree float reveal_file= reveal_force_cwd +-- nnoremap b :Neotree toggle show buffers right +-- nnoremap s :Neotree float git_status + +vim.keymap.set('n', '', ':bn', { desc = 'Go to the next buffer' }) +vim.keymap.set('n', '', ':bp', { desc = 'Go to the previous buffer' }) +vim.keymap.set('n', '', ':enew', { desc = 'Go to the previous buffer' }) +vim.keymap.set('n', '', ':bd', { desc = 'Go to the previous buffer' })