@@ -91,7 +91,7 @@ vim.g.mapleader = ' '
9191vim .g .maplocalleader = ' '
9292
9393-- Set to true if you have a Nerd Font installed and selected in the terminal
94- vim .g .have_nerd_font = false
94+ vim .g .have_nerd_font = true
9595
9696-- [[ Setting options ]]
9797-- See `:help vim.o`
@@ -105,7 +105,7 @@ vim.o.number = true
105105-- vim.o.relativenumber = true
106106
107107-- Enable mouse mode, can be useful for resizing splits for example!
108- vim .o .mouse = ' a '
108+ vim .o .mouse = ' '
109109
110110-- Don't show the mode, since it's already in the status line
111111vim .o .showmode = false
@@ -124,9 +124,9 @@ vim.o.breakindent = true
124124-- Save undo history
125125vim .o .undofile = true
126126
127- -- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
128- vim .o .ignorecase = true
129- vim .o .smartcase = true
127+ -- Case-sensitive searching
128+ vim .o .ignorecase = false
129+ vim .o .smartcase = false
130130
131131-- Keep signcolumn on by default
132132vim .o .signcolumn = ' yes'
@@ -138,8 +138,8 @@ vim.o.updatetime = 250
138138vim .o .timeoutlen = 300
139139
140140-- Configure how new splits should be opened
141- vim .o .splitright = true
142- vim .o .splitbelow = true
141+ vim .o .splitright = false
142+ vim .o .splitbelow = false
143143
144144-- Sets how neovim will display certain whitespace characters in the editor.
145145-- See `:help 'list'`
@@ -166,12 +166,18 @@ vim.o.scrolloff = 10
166166-- See `:help 'confirm'`
167167vim .o .confirm = true
168168
169+ -- No wrap.
170+ vim .o .wrap = false
171+
169172-- [[ Basic Keymaps ]]
170173-- See `:help vim.keymap.set()`
171174
172- -- Clear highlights on search when pressing <Esc> in normal mode
175+ -- Exit to normal mode.
176+ vim .keymap .set (' i' , ' jk' , ' <Esc>' )
177+
178+ -- Clear highlights on search when pressing `\` in normal mode
173179-- See `:help hlsearch`
174- vim .keymap .set (' n' , ' <Esc> ' , ' <cmd>nohlsearch<CR>' )
180+ vim .keymap .set (' n' , ' \\ ' , ' <cmd>nohlsearch<CR>' )
175181
176182-- Diagnostic keymaps
177183vim .keymap .set (' n' , ' <leader>q' , vim .diagnostic .setloclist , { desc = ' Open diagnostic [Q]uickfix list' })
@@ -184,6 +190,13 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
184190-- or just use <C-\><C-n> to exit terminal mode
185191vim .keymap .set (' t' , ' <Esc><Esc>' , ' <C-\\ ><C-n>' , { desc = ' Exit terminal mode' })
186192
193+ -- RustFmt key mapping.
194+ -- Normal-mode: whole file
195+ vim .keymap .set (' n' , ' <C-k>' , ' :RustFmt<CR>' , { noremap = true , silent = true })
196+
197+ -- Visual-mode: selection only
198+ vim .keymap .set (' v' , ' <C-k>' , ' :RustFmt<CR>' , { noremap = true , silent = true })
199+
187200-- TIP: Disable arrow keys in normal mode
188201-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
189202-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
@@ -194,10 +207,10 @@ vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' }
194207-- Use CTRL+<hjkl> to switch between windows
195208--
196209-- See `:help wincmd` for a list of all window commands
197- vim .keymap .set (' n' , ' <C-h>' , ' <C-w><C-h>' , { desc = ' Move focus to the left window' })
198- vim .keymap .set (' n' , ' <C-l>' , ' <C-w><C-l>' , { desc = ' Move focus to the right window' })
199- vim .keymap .set (' n' , ' <C-j>' , ' <C-w><C-j>' , { desc = ' Move focus to the lower window' })
200- vim .keymap .set (' n' , ' <C-k>' , ' <C-w><C-k>' , { desc = ' Move focus to the upper window' })
210+ -- vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
211+ -- vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
212+ -- vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
213+ -- vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
201214
202215-- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes
203216-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
@@ -248,13 +261,18 @@ rtp:prepend(lazypath)
248261require (' lazy' ).setup ({
249262 -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
250263 ' NMAC427/guess-indent.nvim' , -- Detect tabstop and shiftwidth automatically
264+ ' farmergreg/vim-lastplace' , -- Reopens files at your last edit position
251265
252266 -- NOTE: Plugins can also be added by using a table,
253267 -- with the first argument being the link and the following
254268 -- keys can be used to configure plugin behavior/loading/etc.
255269 --
256270 -- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded.
257- --
271+ {
272+ ' mrcjkb/rustaceanvim' ,
273+ version = ' ^6' , -- Recommended
274+ lazy = false , -- This plugin is already lazy
275+ },
258276
259277 -- Alternatively, use `config = function() ... end` for full control over the configuration.
260278 -- If you prefer to call `setup` explicitly, use:
@@ -304,7 +322,7 @@ require('lazy').setup({
304322 opts = {
305323 -- delay between pressing a key and opening which-key (milliseconds)
306324 -- this setting is independent of vim.o.timeoutlen
307- delay = 0 ,
325+ delay = 500 ,
308326 icons = {
309327 -- set icon mappings to true if you have a Nerd Font
310328 mappings = vim .g .have_nerd_font ,
0 commit comments