-
Notifications
You must be signed in to change notification settings - Fork 34.8k
docs: Adds a paragraph about lua being a real programming language. #1446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
16de9cf
7f662c0
8d76247
9bdc47b
63a74f8
fc814a5
0b13cc3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,6 +83,43 @@ 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 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 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' | ||
-- local command = 'e' .. '/full_path/to_file' -- '..' is the build in string concatenation | ||
-- vim.cmd(command) | ||
-- end | ||
-- vim.keymap.set('n', '<leader>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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
is this a normative word? As a non-native speaker, I suspect it's not a standard English word. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Excactly, you spotted a typo. I should have been more thorough on these. |
||
-- | ||
-- The following snippet loads/executes some lua file when a specific file is opened: | ||
Weyaaron marked this conversation as resolved.
Show resolved
Hide resolved
|
||
-- | ||
-- if vim.fn.expand("%") == "file.txt" then | ||
-- vim.cmd("so ./additional_config.lua") | ||
-- end | ||
Weyaaron marked this conversation as resolved.
Show resolved
Hide resolved
|
||
-- | ||
-- 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.) | ||
Weyaaron marked this conversation as resolved.
Show resolved
Hide resolved
|
||
-- | ||
-- Good luck tinkering :) | ||
|
||
-- Set <space> as the leader key | ||
-- See `:help mapleader` | ||
|
Uh oh!
There was an error while loading. Please reload this page.