From a51c789178f1ef6bb6ae57275db12950f30cc333 Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Sat, 4 Nov 2023 00:55:51 -0500 Subject: [PATCH] updated nvim_minimal config. --- neovim/.config/nvim/init.lua | 6 +++--- nvim_minimal/.config/nvim/init.lua | 33 ++++++++++++++++++++---------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/neovim/.config/nvim/init.lua b/neovim/.config/nvim/init.lua index 3802ad8..d72cfd8 100644 --- a/neovim/.config/nvim/init.lua +++ b/neovim/.config/nvim/init.lua @@ -107,6 +107,9 @@ local function optsWithDesc(desc) end --toggle spell check map('n', 'sp', ':setlocal spell!', optsWithDesc("toggle spell check")) +--buffer stuff (gt and gT are prev/next tab in stock vim) +map('n', 'gf', ':bnext', optsWithDesc("next buffer")) +map('n', 'gF', ':bprevious', optsWithDesc("prev buffer")) --use ctrl+direction to move between splits. map('n', '', 'h', optsWithDesc("move to split to the right")) map('n', '', 'j', optsWithDesc("move to split below")) @@ -143,9 +146,6 @@ map('n', 'fto', ':TodoTelescope', optsWithDesc("search todos")) map('n', 'ft', ':Telescope treesitter', optsWithDesc("search treesitter")) --Treesitter context map('n', 'c', ':TSContextToggle', optsWithDesc("toggle ts context")) ---tabline stuff (gt and gT are prev/next tab in stock vim) -map('n', 'gf', ':bnext', optsWithDesc("next buffer")) -map('n', 'gF', ':bprevious', optsWithDesc("prev buffer")) --gitsigns map('n', 'bl', ':Gitsigns toggle_current_line_blame', optsWithDesc("toggle inline git blame")) -- toggle keymappings for venn using v diff --git a/nvim_minimal/.config/nvim/init.lua b/nvim_minimal/.config/nvim/init.lua index 04b7e7d..f06e807 100644 --- a/nvim_minimal/.config/nvim/init.lua +++ b/nvim_minimal/.config/nvim/init.lua @@ -2,11 +2,12 @@ local cmd = vim.cmd local opt = vim.opt local fn = vim.fn -local map = vim.api.nvim_set_keymap +local map = vim.keymap.set --leader key is set through a variable, for some reason. vim.g.mapleader = ';' + --helper functions local function keyCode(string) return vim.api.nvim_replace_termcodes(str, true, true, true, true) @@ -24,11 +25,13 @@ opt.formatoptions = 'rojq' opt.textwidth = 0 opt.wrapmargin = 0 opt.wrap = true -opt.linebreak = true +-- opt.linebreak = true opt.breakindent = true +--highlight after col +opt.colorcolumn = "80,100,120" --add ruler to side of screen. opt.number = true -opt.numberwidth=2 +opt.numberwidth=3 --displays cordinates of your cursor in statusbar opt.ruler = true --always leave 5 cells between cursor and side of window. @@ -62,20 +65,28 @@ cmd([[source ~/.config/nvim/foldtext.vimrc]]) opt.foldmethod = 'indent' opt.foldtext = 'minimal_foldtext()' opt.fillchars = 'stl:=,stlnc: ,vert:|,fold:-' -opt.foldcolumn = '4' +opt.foldcolumn = 'auto:4' opt.foldenable = true opt.foldignore = '' --keyboard mappings +local function optsWithDesc(desc) + return {silent=true, desc=desc} +end local opts = { noremap = true, silent = true } --toggle spell check -map('n', 'sp', ':setlocal spell!', opts) +map('n', 'sp', ':setlocal spell!', optsWithDesc("toggle spell check")) +--buffer stuff (gt and gT are prev/next tab in stock vim) +map('n', 'gf', ':bnext', optsWithDesc("next buffer")) +map('n', 'gF', ':bprevious', optsWithDesc("prev buffer")) --use ctrl+direction to move between splits. -map('n', '', 'h', opts) -map('n', '', 'j', opts) -map('n', '', 'k', opts) -map('n', '', 'l', opts) +map('n', '', 'h', optsWithDesc("move to split to the right")) +map('n', '', 'j', optsWithDesc("move to split below")) +map('n', '', 'k', optsWithDesc("move to split above")) +map('n', '', 'l', optsWithDesc("move to split to the left")) --toggle folds with space. -map('', '', 'za', opts) +map('n', '', 'za', optsWithDesc("toggle fold")) --clear highlighting with leader+h -map('', 'h', ':nohls', opts) +map('', 'h', ':nohls', optsWithDesc("clear highlighting")) +--open file browser with leader+t +map('n', 't', ':Lexplore', optsWithDesc("toggle file browser"))