From 4ba4dacd7115126c9b9a0174e2b897ee6d0134c2 Mon Sep 17 00:00:00 2001 From: wqfish <1171005+wqfish@users.noreply.github.com> Date: Wed, 18 Jun 2025 11:51:04 -0700 Subject: [PATCH] Local config changes. --- init.lua | 48 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/init.lua b/init.lua index b98ffc61..be00d940 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.o` @@ -105,7 +105,7 @@ vim.o.number = true -- vim.o.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! -vim.o.mouse = 'a' +vim.o.mouse = '' -- Don't show the mode, since it's already in the status line vim.o.showmode = false @@ -124,9 +124,9 @@ vim.o.breakindent = true -- Save undo history vim.o.undofile = true --- Case-insensitive searching UNLESS \C or one or more capital letters in the search term -vim.o.ignorecase = true -vim.o.smartcase = true +-- Case-sensitive searching +vim.o.ignorecase = false +vim.o.smartcase = false -- Keep signcolumn on by default vim.o.signcolumn = 'yes' @@ -138,8 +138,8 @@ vim.o.updatetime = 250 vim.o.timeoutlen = 300 -- Configure how new splits should be opened -vim.o.splitright = true -vim.o.splitbelow = true +vim.o.splitright = false +vim.o.splitbelow = false -- Sets how neovim will display certain whitespace characters in the editor. -- See `:help 'list'` @@ -166,12 +166,18 @@ vim.o.scrolloff = 10 -- See `:help 'confirm'` vim.o.confirm = true +-- No wrap. +vim.o.wrap = false + -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` --- Clear highlights on search when pressing in normal mode +-- Exit to normal mode. +vim.keymap.set('i', 'jk', '') + +-- Clear highlights on search when pressing `\` in normal mode -- See `:help hlsearch` -vim.keymap.set('n', '', 'nohlsearch') +vim.keymap.set('n', '\\', 'nohlsearch') -- Diagnostic keymaps vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) @@ -184,6 +190,13 @@ vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagn -- or just use to exit terminal mode vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) +-- RustFmt key mapping. +-- Normal-mode: whole file +vim.keymap.set('n', '', ':RustFmt', { noremap = true, silent = true }) + +-- Visual-mode: selection only +vim.keymap.set('v', '', ':RustFmt', { noremap = true, silent = true }) + -- 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!!"') @@ -194,10 +207,10 @@ vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' } -- 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' }) +-- 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' }) -- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes -- vim.keymap.set("n", "", "H", { desc = "Move window to the left" }) @@ -248,13 +261,18 @@ rtp:prepend(lazypath) require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically + 'farmergreg/vim-lastplace', -- Reopens files at your last edit position -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following -- keys can be used to configure plugin behavior/loading/etc. -- -- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded. - -- + { + 'mrcjkb/rustaceanvim', + version = '^6', -- Recommended + lazy = false, -- This plugin is already lazy + }, -- Alternatively, use `config = function() ... end` for full control over the configuration. -- If you prefer to call `setup` explicitly, use: @@ -304,7 +322,7 @@ require('lazy').setup({ opts = { -- delay between pressing a key and opening which-key (milliseconds) -- this setting is independent of vim.o.timeoutlen - delay = 0, + delay = 500, icons = { -- set icon mappings to true if you have a Nerd Font mappings = vim.g.have_nerd_font,