1- --[[
2-
3- =====================================================================
4- ==================== READ THIS BEFORE CONTINUING ====================
5- =====================================================================
6- ======== .-----. ========
7- ======== .----------------------. | === | ========
8- ======== |.-""""""""""""""""""-.| |-----| ========
9- ======== || || | === | ========
10- ======== || KICKSTART.NVIM || |-----| ========
11- ======== || || | === | ========
12- ======== || || |-----| ========
13- ======== ||:Tutor || |:::::| ========
14- ======== |'-..................-'| |____o| ========
15- ======== `"")----------------(""` ___________ ========
16- ======== /::::::::::| |::::::::::\ \ no mouse \ ========
17- ======== /:::========| |==hjkl==:::\ \ required \ ========
18- ======== '""""""""""""' '""""""""""""' '""""""""""' ========
19- ======== ========
20- =====================================================================
21- =====================================================================
22-
23- What is Kickstart?
24-
25- Kickstart.nvim is *not* a distribution.
26-
27- Kickstart.nvim is a starting point for your own configuration.
28- The goal is that you can read every line of code, top-to-bottom, understand
29- what your configuration is doing, and modify it to suit your needs.
30-
31- Once you've done that, you can start exploring, configuring and tinkering to
32- make Neovim your own! That might mean leaving Kickstart just the way it is for a while
33- or immediately breaking it into modular pieces. It's up to you!
34-
35- If you don't know anything about Lua, I recommend taking some time to read through
36- a guide. One possible example which will only take 10-15 minutes:
37- - https://learnxinyminutes.com/docs/lua/
38-
39- After understanding a bit more about Lua, you can use `:help lua-guide` as a
40- reference for how Neovim integrates Lua.
41- - :help lua-guide
42- - (or HTML version): https://neovim.io/doc/user/lua-guide.html
43-
44- Kickstart Guide:
45-
46- TODO: The very first thing you should do is to run the command `:Tutor` in Neovim.
47-
48- If you don't know what this means, type the following:
49- - <escape key>
50- - :
51- - Tutor
52- - <enter key>
53-
54- (If you already know the Neovim basics, you can skip this step.)
55-
56- Once you've completed that, you can continue working through **AND READING** the rest
57- of the kickstart init.lua.
58-
59- Next, run AND READ `:help`.
60- This will open up a help window with some basic information
61- about reading, navigating and searching the builtin help documentation.
62-
63- This should be the first place you go to look when you're stuck or confused
64- with something. It's one of my favorite Neovim features.
65-
66- MOST IMPORTANTLY, we provide a keymap "<space>sh" to [s]earch the [h]elp documentation,
67- which is very useful when you're not exactly sure of what you're looking for.
68-
69- I have left several `:help X` comments throughout the init.lua
70- These are hints about where to find more information about the relevant settings,
71- plugins or Neovim features used in Kickstart.
72-
73- NOTE: Look for lines like this
74-
75- Throughout the file. These are for you, the reader, to help you understand what is happening.
76- Feel free to delete them once you know what you're doing, but they should serve as a guide
77- for when you are first encountering a few different constructs in your Neovim config.
78-
79- If you experience any errors while trying to install kickstart, run `:checkhealth` for more info.
80-
81- I hope you enjoy your Neovim journey,
82- - TJ
83-
84- P.S. You can delete this when you're done too. It's your config now! :)
85- --]]
86-
871-- Set <space> as the leader key
882-- See `:help mapleader`
893-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
@@ -145,7 +59,7 @@ vim.opt.splitbelow = true
14559-- See `:help 'list'`
14660-- and `:help 'listchars'`
14761vim .opt .list = true
148- vim .opt .listchars = { tab = ' » ' , trail = ' ·' , nbsp = ' ␣' }
62+ vim .opt .listchars = { tab = ' ' , trail = ' ·' , nbsp = ' ␣' }
14963
15064-- Preview substitutions live, as you type!
15165vim .opt .inccommand = ' split'
@@ -154,7 +68,7 @@ vim.opt.inccommand = 'split'
15468vim .opt .cursorline = true
15569
15670-- Minimal number of screen lines to keep above and below the cursor.
157- vim .opt .scrolloff = 10
71+ vim .opt .scrolloff = 20
15872
15973-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
16074-- instead raise a dialog asking if you wish to save the current file(s)
@@ -180,17 +94,18 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
18094vim .keymap .set (' t' , ' <Esc><Esc>' , ' <C-\\ ><C-n>' , { desc = ' Exit terminal mode' })
18195
18296-- TIP: Disable arrow keys in normal mode
183- -- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
184- -- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
185- -- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
186- -- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
97+ vim .keymap .set (' n' , ' <left>' , ' <cmd>echo "Use h to move!!"<CR>' )
98+ vim .keymap .set (' n' , ' <right>' , ' <cmd>echo "Use l to move!!"<CR>' )
99+ vim .keymap .set (' n' , ' <up>' , ' <cmd>echo "Use k to move!!"<CR>' )
100+ vim .keymap .set (' n' , ' <down>' , ' <cmd>echo "Use j to move!!"<CR>' )
187101-- Keybinds to make split navigation easier.
188102-- Use CTRL+<hjkl> to switch between windows
189103--
190104-- TODO: EGEN TEXT
191105vim .keymap .set (' n' , ' <leader>ls' , ' :!start cmd.exe /K "live-server"<CR>' , { desc = ' Live server Run' })
192106vim .keymap .set (' n' , ' <leader>e' , ' :Ex<CR>' , { desc = ' Explore working directory' })
193107vim .keymap .set (' n' , ' <leader>lt' , ' O/** @type {} */<Esc>F}i' , { desc = ' Define type for js' })
108+ vim .keymap .set (' i' , ' <CapsLock>' , ' <Esc>' , { silent = true })
194109
195110-- TODO: Bevægelse
196111vim .keymap .set (' n' , ' L' , ' $' )
@@ -200,6 +115,9 @@ vim.keymap.set('v', 'H', '0')
200115vim .keymap .set (' v' , ' J' , " :m '>+1<CR>gv=gv" )
201116vim .keymap .set (' v' , ' K' , " :m '<-2<CR>gv=gv" )
202117
118+ -- TODO: Erstat
119+ vim .keymap .set (' n' , ' <leader>S' , [[ :%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]] , { desc = ' Erstat' })
120+
203121-- See `:help wincmd` for a list of all window commands
204122vim .keymap .set (' n' , ' <C-h>' , ' <C-w><C-h>' , { desc = ' Move focus to the left window' })
205123vim .keymap .set (' n' , ' <C-l>' , ' <C-w><C-l>' , { desc = ' Move focus to the right window' })
0 commit comments