Nixfiles! :3
0

Configure Feed

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

separators just got better!


Signed-off-by: MLC Bloeiman <mar@strawmelonjuice.com>

MLC Bloeiman (May 10, 2026, 4:57 PM +0200) f423ca7e 4db3fd2e

+31 -9
+31 -9
configs/nvim/lua/config/keymaps.lua
··· 1 1 local map = vim.keymap.set 2 2 local wk = require("which-key") 3 3 4 - -- Misc. -------------------------------------------------------------------------------------------------------------------------------------------------- 4 + -- Misc. ============================================================================================================================================== 5 5 6 6 -- Visual VCS managers group 7 7 wk.add({ ··· 16 16 map("n", "<space>\\", "<cmd>vsplit<CR>", { desc = "Vertical split" }) 17 17 map("n", "<space>-", "<cmd>split<CR>", { desc = "Horizontal split" }) 18 18 19 - -- Pickers -------------------------------------------------------------------------------------------------------------------------------------------------- 20 - ---@diagnostic disable-next-line: assign-type-mismatch 19 + -- Pickers---@diagnostic disable-next-line: assign-type-mismatch 21 20 map("n", "<space>f", function() 22 21 Snacks.picker.files() 23 22 end, { desc = "Open file picker" }) ··· 66 65 Snacks.picker.resume() 67 66 end, { desc = "Resume last search" }) 68 67 69 - -- LSP -------------------------------------------------------------------------------------------------------------------------------------------------- 68 + -- LSP ================================================================================================================================================ 70 69 -- LSP group 71 70 wk.add({ 72 71 { "<space>c", group = "LSP ->", mode = { "n", "v" } }, ··· 117 116 end, { desc = "[T]oggle [E]rrors" }) 118 117 119 118 vim.keymap.set("n", "<space>cew", vim.diagnostic.open_float, { desc = "Open [E]rror [W]indow" }) 119 + local sep = "~" 120 + -- Adding a group of binds for setting it :3 121 + wk.add({ 122 + { "<space>cS", group = "[S]et [S]eperator ->", mode = { "n", "v" } }, 123 + }) 124 + map("n", "<space>cS-", function() 125 + sep = "-" 126 + end, { desc = "To '---'" }) 127 + map("n", "<space>cS=", function() 128 + sep = "=" 129 + end, { desc = "To '==='" }) 130 + map("n", "<space>cS`", function() 131 + sep = "~" 132 + end, { desc = "To '~~~' (default)" }) 133 + -- ...and using it! 120 134 map("n", "<space>cs", function() 121 135 -- get current line(string) and row(int) in the buffer 122 136 local line = trim(vim.api.nvim_get_current_line()) 123 137 local row, _ = unpack(vim.api.nvim_win_get_cursor(0)) 124 138 125 - -- make "-----------" seperator line at consitent length 126 - local seperator = string.rep("-", 120 - string.len(line)) 139 + -- make "~~~~~~~~~~~~" seperator line at consistent length 140 + local seperator = string.rep(sep, 150 - string.len(line)) 127 141 128 142 -- write line with seperator to current buffer at current cursor position 129 143 vim.api.nvim_buf_set_lines(0, row - 1, row, true, { line .. " " .. seperator }) 130 - end, { desc = "set [S]eperator" }) 144 + end, { desc = "Make [S]eperator" }) 131 145 132 - -- Movement -------------------------------------------------------------------------------------------------------------------------------------------------- 146 + -- Movement =========================================================================================================================================== 147 + -- Move cursor within file 133 148 map("i", "<down>", "<esc>gj", { desc = "Move down and exit insert" }) 134 149 map("i", "<up>", "<esc>gk", { desc = "Move up and exit insert" }) 135 150 136 - -- Selections -------------------------------------------------------------------------------------------------------------------------------------------------- 151 + -- Move current line 152 + map("n", "<A-j>", "<cmd>execute 'move .+' . v:count1<cr>==", { desc = "Move Line Down" }) 153 + map("n", "<A-k>", "<cmd>execute 'move .-' . (v:count1 + 1)<cr>==", { desc = "Move Line Up" }) 154 + -- Move selection 155 + map("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move Selection Down" }) 156 + map("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move Selection Up" }) 157 + 158 + -- Selections ========================================================================================================================================= 137 159 map("n", "x", "V", { desc = "Select line" }) 138 160 map("v", "x", "j", { desc = "Extend selection down" }) 139 161 map("v", "X", "k", { desc = "Extend selection up" })