-- vim.keymap.set('n', 'si', ':!feh ', { desc = 'Open file under cursor with feh' }) ------------------------------------------- -- venn.nvim: enable or disable keymappings ------------------------------------------- function _G.Toggle_venn() local venn_enabled = vim.inspect(vim.b.venn_enabled) if venn_enabled == 'nil' then vim.b.venn_enabled = true vim.cmd [[setlocal ve=all]] -- draw a line on HJKL keystokes vim.api.nvim_buf_set_keymap(0, 'n', 'J', 'j:VBox', { noremap = true }) vim.api.nvim_buf_set_keymap(0, 'n', 'K', 'k:VBox', { noremap = true }) vim.api.nvim_buf_set_keymap(0, 'n', 'L', 'l:VBox', { noremap = true }) vim.api.nvim_buf_set_keymap(0, 'n', 'H', 'h:VBox', { noremap = true }) -- draw a box by pressing "f" with visual selection vim.api.nvim_buf_set_keymap(0, 'v', 'f', ':VBox', { noremap = true }) else vim.cmd [[setlocal ve=]] vim.api.nvim_buf_del_keymap(0, 'n', 'J') vim.api.nvim_buf_del_keymap(0, 'n', 'K') vim.api.nvim_buf_del_keymap(0, 'n', 'L') vim.api.nvim_buf_del_keymap(0, 'n', 'H') vim.api.nvim_buf_del_keymap(0, 'v', 'f') vim.b.venn_enabled = nil end end -- toggle keymappings for venn using v vim.api.nvim_set_keymap('n', 'v', ':lua Toggle_venn()', { noremap = true }) -- vim.keymap.set('n', 'ae', ':EnableAutocorrect', { noremap = false, silent = false, desc = 'Auto[c]orrect [e]able]' }) -- vim.keymap.set('n', 'ad', ':DisableAutocorrect', { noremap = false, silent = false, desc = 'Auto[c]orrect [disable]' }) vim.api.nvim_set_keymap('n', 'AE', ':EnableAutocorrect', { noremap = true }) vim.keymap.set('n', 'ae', ':EnableAutocorrect', { noremap = true }) vim.keymap.set('n', 'ad', ':DisableAutocorrect', { noremap = true }) -- Testing out IWE vim.keymap.set('n', 'm', vim.lsp.buf.code_action, { desc = 'something with IWE?' }) vim.keymap.set('n', 'gs', ':lua require("telescope.builtin").lsp_dynamic_workspace_symbols()', { desc = 'something else with IWE I guess??' }) vim.keymap.set('n', 'sz', ':Telescope lsp_workspace_symbols', { desc = 'SOMETHING [z]' }) ---- From https://linkarzu.com/posts/neovim/neovim-tasks/#list-pending-tasks -- Iterate through incomplete tasks in telescope -- You can confirm in your terminal lamw25wmal with: -- rg "^\s*-\s\[ \]" test-markdown.md vim.keymap.set('n', 'tq', function() require('telescope.builtin').grep_string(require('telescope.themes').get_ivy { prompt_title = 'Incomplete Tasks', -- search = "- \\[ \\]", -- Fixed search term for tasks -- search = "^- \\[ \\]", -- Ensure "- [ ]" is at the beginning of the line search = '^\\s*- \\[ \\]', -- also match blank spaces at the beginning search_dirs = { vim.fn.getcwd() }, -- Restrict search to the current working directory use_regex = true, -- Enable regex for the search term initial_mode = 'normal', -- Start in normal mode --layout_config = { -- preview_width = 0.5, -- Adjust preview width --}, additional_args = function() return { '--no-ignore' } -- Include files ignored by .gitignore end, }) end, { desc = '[P]Search for incomplete tasks' }) vim.keymap.set('n', 'qq', function() require('telescope.builtin').grep_string { prompt_title = 'Incomplete Tasks', search = '^\\s*- \\[ \\]', -- also match blank spaces at the beginning search_dirs = { vim.fn.getcwd() }, -- Restrict search to the current working directory -- initial_mode = 'normal', -- Start in normal mode layout_strategy = 'vertical', -- layout_config = { width = 0.5 }, use_regex = true, -- Enable regex for the search term } end)