From 8e0048f55eefb1d4e6234984ebca5d2aeffa87e7 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Mon, 14 Oct 2024 10:33:11 -0400 Subject: [PATCH] customer scrolling options and such --- lua/mappings.lua | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/lua/mappings.lua b/lua/mappings.lua index ddfc780..ba5d6b6 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -9,8 +9,42 @@ map("i", "jk", "") -- map({ "n", "i", "v" }, "", " w ") -local custom_telescope = require('custom_telescope') +-- local custom_telescope = require('custom_telescope') -- Add a keybinding for searching Markdown tasks vim.api.nvim_set_keymap('n', 'mt', ':lua require("custom_telescope").search_markdown_tasks()', { noremap = true, silent = true }) +-- Configure Telescope to scroll files with ctrl+j/k +local actions = require('telescope.actions') +-- local sorters = require('telescope.sorters') + +require('telescope').setup { + defaults = { + mappings = { + i = { + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + }, + }, + }, +} + +-- make leader-e toggle the tree view as opposed to just setting focus +vim.api.nvim_set_keymap('n', 'e', ':NvimTreeToggle', {noremap = true, silent = true}) + +-- move the whole page without moving the cursor +vim.api.nvim_set_keymap('n', 'J', '', { noremap = true }) +vim.api.nvim_set_keymap('n', 'K', '', { noremap = true }) + +-- Resize windows +vim.api.nvim_set_keymap('n', '', '5+', { silent = true }) +vim.api.nvim_set_keymap('n', '', '5-', { silent = true }) +vim.api.nvim_set_keymap('n', '', '10>', { silent = true }) +vim.api.nvim_set_keymap('n', '', '10<', { silent = true }) + +-- Set the tab width to 4 spaces +vim.cmd('set tabstop=4') +vim.cmd('set shiftwidth=4') +vim.cmd('set expandtab') + +vim.o.hidden = true