Comments (10)
Great write‐up, thanks for sharing. This was very helpful in getting my own lua statusline going.
from elianiva.my.id.
@elianiva error 404 for neovim-lua-statusline website
from elianiva.my.id.
https://web.archive.org/web/20210924021734/https://elianiva.my.id/post/neovim-lua-statusline
from elianiva.my.id.
@elianiva error 404 for neovim-lua-statusline website
Thanks for pointing out! Should be fixed now.
from elianiva.my.id.
thz... wanna make my own statusline for so long xD
from elianiva.my.id.
Pretty informative article, great write-up. Coming from someone entirely new to Lua and Neovim as a whole, I have a question that has been lingering on my mind recently: seeing that these functions you defined within M are only used within this Lua file alone, what are the advantages of defining them within a module instead of as "standalone" functions, like so:
function get_git_status()
-- stuff here
end
I'm seeing a lot of people do it this way (i.e. encapsulating these functions within modules), but I have no idea exactly what purpose it serves.
from elianiva.my.id.
I think it's just a personal preference. I prefer to use self
to access related values instead of relying on local variables inside this file. It's kinda like using class.
from elianiva.my.id.
hey @elianiva , can u try changing the highlight group when we select the text in ur post?
from elianiva.my.id.
Hey, here is the code snippet to replace VimL autocmds with Lua-API
local _au = vim.api.nvim_create_augroup('status_line', { clear = true })
vim.api.nvim_create_autocmd({'WinEnter', 'BufEnter'}, {
pattern = "*",
callback = function()
vim.wo.statusline = statusline.active()
end,
group = _au
})
vim.api.nvim_create_autocmd({'WinLeave', 'BufLeave'}, {
pattern = "*",
callback = function()
vim.wo.statusline = statusline.inactive()
end,
group = _au
})
from elianiva.my.id.
closing since I migrated to giscus
from elianiva.my.id.
Related Issues (19)
- test from octo.nvim HOT 1
- improve typography HOT 1
- post/improving-nvim-startup-time HOT 4
- Doubts HOT 2
- post/my-opinion-on-nix HOT 2
- post/prettify-screenshot-using-imagemagick HOT 2
- post/a-year-of-japanese HOT 8
- rewrite HOT 1
- post/combining-adonis-and-svelte-using-inertia HOT 3
- fix "suggest an edit" link
- fixes for some errors
- Can't read `how-i-use-latex-as-a-uni-student`
- add utteranc.es HOT 1
- ability to cycle through tags using tab
- migrate to Svelte-Kit when it's released
- post/comments-widget-using-utterance HOT 5
- use shiki for code highlighting HOT 1
- add proper update component
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elianiva.my.id.