this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add the vim plugin and update the readme

+160 -1
+5 -1
README.md
··· 6 6 7 7 # Usage 8 8 9 - Eventually you should download the bin from the releases and copy it to your board and then follow the vim plugin steps i will add below. 9 + So the orginal goal was for keystrokes to make a nice pattern in your status bar as well as on the led matrix of daedalus but I couldn't get the serial to work from vim; not entirely sure why but it really doesn't like this for some reason. 10 + 11 + What I do have instead is firmware for random led blinking when a serial character is detected and a vim plugin that displays random braille characters in the status bar. 12 + 13 + You can read the [plugin](/lua/braille_indicator/README.md) for more information on installation and for the firmware you can use any serial interface set to a `115200` baud rate (screen for example `screen /dev/tty.usbmodem101 115200`). 10 14 11 15 <p align="center"> 12 16 <img src="https://raw.githubusercontent.com/taciturnaxolotl/carriage/main/.github/images/line-break.svg" />
+78
lua/braille_indicator/README.md
··· 1 + # Braille Typing Indicator Plugin for Neovim 2 + 3 + A simple plugin that displays a random Braille character in your statusline that changes every time you type. 4 + 5 + ## Installation 6 + 7 + ### Using a plugin manager (recommended) 8 + 9 + #### [packer.nvim](https://github.com/wbthomason/packer.nvim) 10 + 11 + ```lua 12 + use { 13 + 'taciturnaxolotl/daedalus', 14 + config = function() 15 + require('braille_indicator').setup() 16 + end 17 + } 18 + ``` 19 + 20 + #### [lazy.nvim](https://github.com/folke/lazy.nvim) 21 + 22 + ```lua 23 + { 24 + 'taciturnaxolotl/daedalus', 25 + config = function() 26 + require('braille_indicator').setup() 27 + end 28 + } 29 + ``` 30 + 31 + ### Manual installation 32 + 33 + 1. Clone this repository to your Neovim configuration directory: 34 + 35 + ``` 36 + git clone https://github.com/taciturnaxolotl/daedalus.git ~/.config/nvim/pack/plugins/start/daedalus 37 + ``` 38 + 39 + 2. Add the following to your `init.lua`: 40 + ```lua 41 + require('braille_indicator').setup() 42 + ``` 43 + 44 + ## Configuration 45 + 46 + The plugin works with minimal configuration, but you can customize it: 47 + 48 + ```lua 49 + require('braille_indicator').setup({ 50 + update_statusline = true, -- Automatically update the statusline 51 + verbose = true, -- Show setup messages 52 + }) 53 + ``` 54 + 55 + ### Adding to your statusline 56 + 57 + If you're using a custom statusline setup, add the Braille indicator with: 58 + 59 + ```lua 60 + %{v:lua.getBrailleIndicator()} 61 + ``` 62 + 63 + For example, with lualine: 64 + 65 + ```lua 66 + require('lualine').setup({ 67 + sections = { 68 + lualine_a = { 69 + function() 70 + return getBrailleIndicator() 71 + end, 72 + 'mode' 73 + }, 74 + -- other sections... 75 + } 76 + }) 77 + ``` 78 +
+77
lua/braille_indicator/init.lua
··· 1 + -- Braille Typing Indicator Plugin for Neovim 2 + -- This is a proper plugin structure for installation in your Neovim config 3 + 4 + local M = {} 5 + 6 + -- Braille unicode characters (⠀ to ⣿) 7 + local brailleChars = { 8 + '⠀', '⠁', '⠂', '⠃', '⠄', '⠅', '⠆', '⠇', '⠈', '⠉', '⠊', '⠋', '⠌', '⠍', '⠎', '⠏', 9 + '⠐', '⠑', '⠒', '⠓', '⠔', '⠕', '⠖', '⠗', '⠘', '⠙', '⠚', '⠛', '⠜', '⠝', '⠞', '⠟', 10 + '⠠', '⠡', '⠢', '⠣', '⠤', '⠥', '⠦', '⠧', '⠨', '⠩', '⠪', '⠫', '⠬', '⠭', '⠮', '⠯', 11 + '⠰', '⠱', '⠲', '⠳', '⠴', '⠵', '⠶', '⠷', '⠸', '⠹', '⠺', '⠻', '⠼', '⠽', '⠾', '⠿', 12 + '⡀', '⡁', '⡂', '⡃', '⡄', '⡅', '⡆', '⡇', '⡈', '⡉', '⡊', '⡋', '⡌', '⡍', '⡎', '⡏', 13 + '⡐', '⡑', '⡒', '⡓', '⡔', '⡕', '⡖', '⡗', '⡘', '⡙', '⡚', '⡛', '⡜', '⡝', '⡞', '⡟', 14 + '⡠', '⡡', '⡢', '⡣', '⡤', '⡥', '⡦', '⡧', '⡨', '⡩', '⡪', '⡫', '⡬', '⡭', '⡮', '⡯', 15 + '⡰', '⡱', '⡲', '⡳', '⡴', '⡵', '⡶', '⡷', '⡸', '⡹', '⡺', '⡻', '⡼', '⡽', '⡾', '⡿', 16 + '⢀', '⢁', '⢂', '⢃', '⢄', '⢅', '⢆', '⢇', '⢈', '⢉', '⢊', '⢋', '⢌', '⢍', '⢎', '⢏', 17 + '⢐', '⢑', '⢒', '⢓', '⢔', '⢕', '⢖', '⢗', '⢘', '⢙', '⢚', '⢛', '⢜', '⢝', '⢞', '⢟', 18 + '⢠', '⢡', '⢢', '⢣', '⢤', '⢥', '⢦', '⢧', '⢨', '⢩', '⢪', '⢫', '⢬', '⢭', '⢮', '⢯', 19 + '⢰', '⢱', '⢲', '⢳', '⢴', '⢵', '⢶', '⢷', '⢸', '⢹', '⢺', '⢻', '⢼', '⢽', '⢾', '⢿', 20 + '⣀', '⣁', '⣂', '⣃', '⣄', '⣅', '⣆', '⣇', '⣈', '⣉', '⣊', '⣋', '⣌', '⣍', '⣎', '⣏', 21 + '⣐', '⣑', '⣒', '⣓', '⣔', '⣕', '⣖', '⣗', '⣘', '⣙', '⣚', '⣛', '⣜', '⣝', '⣞', '⣟', 22 + '⣠', '⣡', '⣢', '⣣', '⣤', '⣥', '⣦', '⣧', '⣨', '⣩', '⣪', '⣫', '⣬', '⣭', '⣮', '⣯', 23 + '⣰', '⣱', '⣲', '⣳', '⣴', '⣵', '⣶', '⣷', '⣸', '⣹', '⣺', '⣻', '⣼', '⣽', '⣾', '⣿' 24 + } 25 + 26 + -- Current braille character 27 + local currentBraille = brailleChars[1] 28 + 29 + -- Update braille character randomly 30 + local function updateBrailleChar() 31 + -- Use os.time() for randomness 32 + math.randomseed(os.time() * 1000 + os.clock() * 10000) 33 + local idx = math.random(1, #brailleChars) 34 + currentBraille = brailleChars[idx] 35 + return currentBraille 36 + end 37 + 38 + -- Get current braille character for statusline 39 + function M.getBrailleIndicator() 40 + return currentBraille 41 + end 42 + 43 + -- Setup function with options 44 + function M.setup(opts) 45 + opts = opts or {} 46 + 47 + -- Make sure statusline is visible 48 + vim.o.laststatus = 2 49 + 50 + -- Key press handler 51 + local function onKeyPress() 52 + -- Update braille character 53 + updateBrailleChar() 54 + end 55 + 56 + -- Set up autocommands 57 + vim.api.nvim_create_autocmd({"InsertCharPre", "CursorMovedI"}, { 58 + callback = onKeyPress, 59 + group = vim.api.nvim_create_augroup("BrailleIndicator", { clear = true }) 60 + }) 61 + 62 + -- Make the function available globally for statusline 63 + _G.getBrailleIndicator = M.getBrailleIndicator 64 + 65 + -- Add to statusline if requested 66 + if opts.update_statusline then 67 + vim.o.statusline = "%{v:lua.getBrailleIndicator()} %f %m %r %= %l,%c " 68 + end 69 + 70 + -- Print setup message 71 + if opts.verbose then 72 + print("Braille indicator active. The character will change as you type.") 73 + print("Add %{v:lua.getBrailleIndicator()} to your statusline if not already there.") 74 + end 75 + end 76 + 77 + return M