Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Clone kickstart.nvim:
<details><summary> Linux and Mac </summary>

```sh
git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
git clone https://github.com/TobiasMeinert/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
```

</details>
Expand Down
174 changes: 71 additions & 103 deletions init.lua
Original file line number Diff line number Diff line change
@@ -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
-- See `:help mapleader`
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
Expand All @@ -97,6 +11,7 @@ vim.g.maplocalleader = ' '

-- Make line numbers default
vim.opt.number = true
vim.opt.relativenumber = true
-- You can also add relative line numbers, for help with jumping.
-- Experiment for yourself to see if you like it!
-- vim.opt.relativenumber = true
Expand All @@ -106,12 +21,6 @@ vim.opt.mouse = 'a'

-- Don't show the mode, since it's already in 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

Expand All @@ -137,7 +46,7 @@ vim.opt.splitbelow = true
-- See :help 'list'
-- and :help 'listchars'
vim.opt.list = true
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
-- vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }

-- Preview substitutions live, as you type!
vim.opt.inccommand = 'split'
Expand All @@ -146,7 +55,7 @@ vim.opt.inccommand = 'split'
vim.opt.cursorline = true

-- Minimal number of screen lines to keep above and below the cursor.
vim.opt.scrolloff = 10
vim.opt.scrolloff = 20

-- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()`
Expand All @@ -161,7 +70,7 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagn
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })

-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
-- Exit terminal mode in the builtin terminal with a shortcutthat is a bit easier
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
-- is not what someone will guess without a bit more experience.
--
Expand All @@ -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' })

-- TIP: Disable arrow keys in normal mode
-- 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', '<up>', '<cmd>echo "Use k to move!!"<CR>')
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j 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', '<up>', '<cmd>echo "Use k to move!!"<CR>')
vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')

-- Keybinds to make split navigation easier.
-- Use CTRL+<hjkl> to switch between windows
Expand Down Expand Up @@ -233,7 +142,6 @@ require('lazy').setup {
--
-- This is equivalent to:
-- require('Comment').setup({})

-- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} },

Expand Down Expand Up @@ -400,7 +308,66 @@ require('lazy').setup {
end, { desc = '[S]earch [N]eovim files' })
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
'neovim/nvim-lspconfig',
dependencies = {
Expand Down Expand Up @@ -534,9 +501,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 = {},
zls = {},
-- gopls = {},
-- pyright = {},
pyright = {},
-- rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
--
Expand Down
1 change: 1 addition & 0 deletions lua/custom/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require("custom.remap")
24 changes: 24 additions & 0 deletions lua/custom/remap.lua
Original file line number Diff line number Diff line change
@@ -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
Loading