From 16de9cf02736251883f3e64cef535ad557858baf Mon Sep 17 00:00:00 2001 From: Aaron Date: Sun, 6 Apr 2025 09:22:32 +0200 Subject: [PATCH 1/7] docs: Adds a paragraph about lua being a real programming language. --- init.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/init.lua b/init.lua index cbf9ff65..73d97594 100644 --- a/init.lua +++ b/init.lua @@ -83,6 +83,39 @@ I hope you enjoy your Neovim journey, P.S. You can delete this when you're done too. It's your config now! :) --]] +-- +-- +-- One last note before we leave you to play around: Lua is a real programming language. +-- Why is that important? First of all, that you can use all the features of Lua, +-- like variables, conditionals, loops and functions. Secondly, that you can interact with +-- neovim in concise way. The following lines contain two examples that might give you some inspirations. +-- This snippet adds a keymap to open a predefined file in a new tab: +-- local function open_notes() +-- vim.cmd 'tabnew' +-- vim.cmd 'tabnext' +-- local command = 'e' .. '/full_path/to_file' -- '..' is the build in string concatenation +-- vim.cmd(command) +-- end +-- vim.keymap.set('n', 'm', open_notes) +-- +-- This is interesting because there are certainly plugins out there +-- that provide this functionallity in a sophisticated manner. +-- But a plugin might change, might not provide the options you like, +-- or you might not use this feature at all. If you do not use it, +-- simply delete this code and you are done. If you like it, you +-- may expand to what you need and nothing else. And if this is to +-- much work, you might end up using the plugin anyway, but based +-- on valid effidence that you like this feature. +-- +-- The following snippet loads/executes some lua file when a specific file is opened: +-- if vim.fn.expand("%") == "file.txt" then +-- vim.cmd("so ./additional_config.lua") +-- end +-- One use-case could be a journal where the script.lua automatically moves your cursor +-- to the end of file and inserts the curent date when you open it. (This suggestion is certainly not +-- the easiest example, but that it is possible at all should get your mind racing +-- with possibilities.) +-- Good luck tinkering :) -- Set as the leader key -- See `:help mapleader` From 7f662c07bc320818f6dcd3b60d08625185b4a00e Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 10 Apr 2025 08:43:30 +0200 Subject: [PATCH 2/7] Update init.lua Co-authored-by: Chris Patti --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 73d97594..b11765a5 100644 --- a/init.lua +++ b/init.lua @@ -85,7 +85,7 @@ P.S. You can delete this when you're done too. It's your config now! :) --]] -- -- --- One last note before we leave you to play around: Lua is a real programming language. +-- One last note before we leave you to explore: Lua is a real programming language. -- Why is that important? First of all, that you can use all the features of Lua, -- like variables, conditionals, loops and functions. Secondly, that you can interact with -- neovim in concise way. The following lines contain two examples that might give you some inspirations. From 8d76247947dd0f4ea89b62669812ef2ed241afda Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 10 Apr 2025 08:43:43 +0200 Subject: [PATCH 3/7] Update init.lua Co-authored-by: Chris Patti --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index b11765a5..65c0031b 100644 --- a/init.lua +++ b/init.lua @@ -88,7 +88,7 @@ P.S. You can delete this when you're done too. It's your config now! :) -- One last note before we leave you to explore: Lua is a real programming language. -- Why is that important? First of all, that you can use all the features of Lua, -- like variables, conditionals, loops and functions. Secondly, that you can interact with --- neovim in concise way. The following lines contain two examples that might give you some inspirations. +-- neovim in a concise way. The following lines contain two examples that might give you some inspiration. -- This snippet adds a keymap to open a predefined file in a new tab: -- local function open_notes() -- vim.cmd 'tabnew' From 9bdc47b5d32f78aee44fcf062c5400226acd5dbd Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 10 Apr 2025 08:44:03 +0200 Subject: [PATCH 4/7] Update init.lua Co-authored-by: Chris Patti --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 65c0031b..867c1bbb 100644 --- a/init.lua +++ b/init.lua @@ -90,6 +90,7 @@ P.S. You can delete this when you're done too. It's your config now! :) -- like variables, conditionals, loops and functions. Secondly, that you can interact with -- neovim in a concise way. The following lines contain two examples that might give you some inspiration. -- This snippet adds a keymap to open a predefined file in a new tab: +-- -- local function open_notes() -- vim.cmd 'tabnew' -- vim.cmd 'tabnext' From 63a74f8d0b538805662b8581729a7f0826cac558 Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 10 Apr 2025 08:44:14 +0200 Subject: [PATCH 5/7] Update init.lua Co-authored-by: Chris Patti --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 867c1bbb..0e437fc2 100644 --- a/init.lua +++ b/init.lua @@ -116,6 +116,7 @@ P.S. You can delete this when you're done too. It's your config now! :) -- to the end of file and inserts the curent date when you open it. (This suggestion is certainly not -- the easiest example, but that it is possible at all should get your mind racing -- with possibilities.) +-- -- Good luck tinkering :) -- Set as the leader key From fc814a5129037924efe9375ecd89228906390b6a Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 10 Apr 2025 08:44:25 +0200 Subject: [PATCH 6/7] Update init.lua Co-authored-by: Chris Patti --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 0e437fc2..5b2f969a 100644 --- a/init.lua +++ b/init.lua @@ -109,6 +109,7 @@ P.S. You can delete this when you're done too. It's your config now! :) -- on valid effidence that you like this feature. -- -- The following snippet loads/executes some lua file when a specific file is opened: +-- -- if vim.fn.expand("%") == "file.txt" then -- vim.cmd("so ./additional_config.lua") -- end From 0b13cc3ed8bef415ac763b51d0c1cf3713346692 Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 10 Apr 2025 08:44:31 +0200 Subject: [PATCH 7/7] Update init.lua Co-authored-by: Chris Patti --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 5b2f969a..6e044922 100644 --- a/init.lua +++ b/init.lua @@ -113,6 +113,7 @@ P.S. You can delete this when you're done too. It's your config now! :) -- if vim.fn.expand("%") == "file.txt" then -- vim.cmd("so ./additional_config.lua") -- end +-- -- One use-case could be a journal where the script.lua automatically moves your cursor -- to the end of file and inserts the curent date when you open it. (This suggestion is certainly not -- the easiest example, but that it is possible at all should get your mind racing