From b421d0ccaf25e8fbfa0b914db12e395d661d27b5 Mon Sep 17 00:00:00 2001 From: tastypawns Date: Sat, 15 Feb 2025 15:43:42 -0600 Subject: [PATCH] donny-top commits --- init.lua | 43 +++++++------------------------------------ remap.lua | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 36 deletions(-) create mode 100644 remap.lua diff --git a/init.lua b/init.lua index 99c7c9cb..0a479227 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,6 @@ --[[ + ===================================================================== ==================== READ THIS BEFORE CONTINUING ==================== ===================================================================== @@ -102,7 +103,7 @@ vim.g.have_nerd_font = false vim.opt.number = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! --- vim.opt.relativenumber = true +vim.opt.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.opt.mouse = 'a' @@ -156,38 +157,8 @@ vim.opt.cursorline = true -- Minimal number of screen lines to keep above and below the cursor. vim.opt.scrolloff = 10 --- [[ Basic Keymaps ]] --- See `:help vim.keymap.set()` - --- Clear highlights on search when pressing in normal mode --- See `:help hlsearch` -vim.keymap.set('n', '', 'nohlsearch') - --- Diagnostic keymaps -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) - --- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier --- for people to discover. Otherwise, you normally need to press , which --- is not what someone will guess without a bit more experience. --- --- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping --- or just use to exit terminal mode -vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) - --- TIP: Disable arrow keys in normal mode --- vim.keymap.set('n', '', 'echo "Use h to move!!"') --- vim.keymap.set('n', '', 'echo "Use l to move!!"') --- vim.keymap.set('n', '', 'echo "Use k to move!!"') --- vim.keymap.set('n', '', 'echo "Use j to move!!"') - --- Keybinds to make split navigation easier. --- Use CTRL+ to switch between windows --- --- See `:help wincmd` for a list of all window commands -vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +--pull in remaps +require 'remap' -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -328,7 +299,7 @@ require('lazy').setup({ { 'c', group = '[C]ode', mode = { 'n', 'x' } }, { 'd', group = '[D]ocument' }, { 'r', group = '[R]ename' }, - { 's', group = '[S]earch' }, + { 'S', group = '[S]earch' }, { 'w', group = '[W]orkspace' }, { 't', group = '[T]oggle' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, @@ -628,6 +599,7 @@ require('lazy').setup({ local servers = { -- clangd = {}, -- gopls = {}, + pylsp = {}, -- pyright = {}, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs @@ -859,8 +831,7 @@ require('lazy').setup({ -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' - + vim.cmd.colorscheme 'tokyonight-storm' -- You can configure highlights by doing something like: vim.cmd.hi 'Comment gui=none' end, diff --git a/remap.lua b/remap.lua new file mode 100644 index 00000000..dd1d92dd --- /dev/null +++ b/remap.lua @@ -0,0 +1,36 @@ +-- [[ Basic Keymaps ]] +-- See `:help vim.keymap.set()` + +-- Clear highlights on search when pressing in normal mode +-- See `:help hlsearch` +vim.keymap.set('n', '', 'nohlsearch') + +-- Diagnostic keymaps +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) +--navigation keymaps +vim.keymap.set('n', 'pv', vim.cmd.Ex, { desc = 'Exit file and return to navigation' }) +-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier +-- for people to discover. Otherwise, you normally need to press , which +-- is not what someone will guess without a bit more experience. +-- +-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping +-- or just use to exit terminal mode +vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) + +-- TIP: Disable arrow keys in normal mode +-- vim.keymap.set('n', '', 'echo "Use h to move!!"') +-- vim.keymap.set('n', '', 'echo "Use l to move!!"') +-- vim.keymap.set('n', '', 'echo "Use k to move!!"') +-- vim.keymap.set('n', '', 'echo "Use j to move!!"') + +-- Keybinds to make split navigation easier. +-- Use CTRL+ to switch between windows +-- +-- See `:help wincmd` for a list of all window commands +vim.keymap.set('n', 'u', '', { desc = 'Move focus to the left window' }) +vim.keymap.set('n', 'i', '', { desc = 'Move focus to the right window' }) +vim.keymap.set('n', 'l', '', { desc = 'Move focus to the lower window' }) +vim.keymap.set('n', 'o', '', { desc = 'Move focus to the upper window' }) +--split window maps +vim.keymap.set('n', 'xs', ':close', { desc = 'Close current window' }) +vim.keymap.set('n', 's', ':vsplit', { desc = 'Split window vertically' })