Changes to be committed:

modified:   init.lua
	new file:   lua/custom/init.lua
	new file:   lua/custom/remap.lua
  Added Personal stuff to updated fork
This commit is contained in:
Tobias Meinert 2024-03-03 14:26:43 +01:00
parent 58b5848862
commit 2ca1f10796
3 changed files with 96 additions and 103 deletions

172
init.lua
View File

@ -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:
- <escape key>
- :
- Tutor
- <enter key>
(If you already know how 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 "<space>sh" to [s]earch the [h]elp documentation,
which is very useful when you're not sure exactly 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 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.
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 <space> as the leader key -- Set <space> as the leader key
-- See `:help mapleader` -- See `:help mapleader`
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
@ -97,6 +11,7 @@ vim.g.maplocalleader = ' '
-- Make line numbers default -- Make line numbers default
vim.opt.number = true vim.opt.number = true
vim.opt.relativenumber = true
-- You can also add relative line numbers, for help with jumping. -- You can also add relative line numbers, for help with jumping.
-- Experiment for yourself to see if you like it! -- Experiment for yourself to see if you like it!
-- vim.opt.relativenumber = true -- vim.opt.relativenumber = true
@ -106,12 +21,6 @@ vim.opt.mouse = 'a'
-- Don't show the mode, since it's already in status line -- Don't show the mode, since it's already in status line
vim.opt.showmode = false 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 -- Enable break indent
vim.opt.breakindent = true vim.opt.breakindent = true
@ -137,7 +46,7 @@ vim.opt.splitbelow = true
-- See :help 'list' -- See :help 'list'
-- and :help 'listchars' -- and :help 'listchars'
vim.opt.list = true vim.opt.list = true
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '' } -- vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
-- Preview substitutions live, as you type! -- Preview substitutions live, as you type!
vim.opt.inccommand = 'split' vim.opt.inccommand = 'split'
@ -146,7 +55,7 @@ vim.opt.inccommand = 'split'
vim.opt.cursorline = true vim.opt.cursorline = true
-- Minimal number of screen lines to keep above and below the cursor. -- Minimal number of screen lines to keep above and below the cursor.
vim.opt.scrolloff = 10 vim.opt.scrolloff = 20
-- [[ Basic Keymaps ]] -- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()` -- See `:help vim.keymap.set()`
@ -170,10 +79,10 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' }) vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
-- TIP: Disable arrow keys in normal mode -- TIP: Disable arrow keys in normal mode
-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>') vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>') vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>') vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>') vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
-- Keybinds to make split navigation easier. -- Keybinds to make split navigation easier.
-- Use CTRL+<hjkl> to switch between windows -- Use CTRL+<hjkl> to switch between windows
@ -233,7 +142,6 @@ require('lazy').setup {
-- --
-- This is equivalent to: -- This is equivalent to:
-- require('Comment').setup({}) -- require('Comment').setup({})
-- "gc" to comment visual regions/lines -- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} }, { 'numToStr/Comment.nvim', opts = {} },
@ -400,7 +308,66 @@ require('lazy').setup {
end, { desc = '[S]earch [N]eovim files' }) end, { desc = '[S]earch [N]eovim files' })
end, end,
}, },
{
'theprimeagen/harpoon',
branch = 'harpoon2',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
require('harpoon'):setup()
end,
keys = {
{
'<leader>A',
function()
require('harpoon'):list():append()
end,
desc = 'harpoon file',
},
{
'<leader>a',
function()
local harpoon = require 'harpoon'
harpoon.ui:toggle_quick_menu(harpoon:list())
end,
desc = 'harpoon quick menu',
},
{
'<leader>1',
function()
require('harpoon'):list():select(1)
end,
desc = 'harpoon to file 1',
},
{
'<leader>2',
function()
require('harpoon'):list():select(2)
end,
desc = 'harpoon to file 2',
},
{
'<leader>3',
function()
require('harpoon'):list():select(3)
end,
desc = 'harpoon to file 3',
},
{
'<leader>4',
function()
require('harpoon'):list():select(4)
end,
desc = 'harpoon to file 4',
},
{
'<leader>5',
function()
require('harpoon'):list():select(5)
end,
desc = 'harpoon to file 5',
},
},
},
{ -- LSP Configuration & Plugins { -- LSP Configuration & Plugins
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
dependencies = { dependencies = {
@ -534,9 +501,10 @@ require('lazy').setup {
-- - settings (table): Override the default settings passed when initializing the server. -- - 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/ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
local servers = { local servers = {
-- clangd = {}, clangd = {},
zls = {},
-- gopls = {}, -- gopls = {},
-- pyright = {}, pyright = {},
-- rust_analyzer = {}, -- rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
-- --

1
lua/custom/init.lua Normal file
View File

@ -0,0 +1 @@
require("custom.remap")

24
lua/custom/remap.lua Normal file
View File

@ -0,0 +1,24 @@
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- Erlubt es markierte Bloecke an code mit ctr j k zu verschieben
vim.keymap.set("v", "J", ":m '>+1<CR>gv+gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
-- Keep cursour in the middle while page jumping
vim.keymap.set("n", "C-d", "<C-d>zz")
vim.keymap.set("n", "C-u", "<C-u>zz")
-- Keep search tearms in the middle
vim.keymap.set("n", "n", "nzzzv")
vim.keymap.set("n", "N", "Nzzzv")
-- Paste over marked Text, keep buffer
vim.keymap.set("x", "<leader>p", "\"_d")
-- Seperate vim and system clipboard
vim.keymap.set("n", "<leader>d", "\"_d")
-- telescope remaps
--
-- quckfixes