From 65a03860fbf2216efd8f24e295c70e8027608d72 Mon Sep 17 00:00:00 2001 From: Squibid Date: Thu, 29 Dec 2022 18:39:01 -0500 Subject: adhere to 80 column limit and add telescope diagnostics keybind --- init.lua | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/init.lua b/init.lua index f469328..f915b6f 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,7 @@ local o = vim.opt local g = vim.g local a = vim.api +local cmd = vim.cmd g.mapleader = " " @@ -33,7 +34,7 @@ o.softtabstop = -1 -- If negative, shiftwidth value is used -- colors o.termguicolors = true -vim.cmd('colorscheme jellybeans-nvim') +cmd('colorscheme jellybeans-nvim') -- diagnostics vim.diagnostic.config({ @@ -190,12 +191,12 @@ local opts = { noremap = true, silent = true } -- greatest remap ever a.nvim_set_keymap("n", "p", "\"_dP", opts) --- esc to go to normal mode in term bufers -a.nvim_set_keymap("t", "", "", opts) - -- open term buffer a.nvim_set_keymap("n", "to", "vw:term", opts) +-- esc to go to normal mode in term bufers +a.nvim_set_keymap("t", "", "", opts) + -- open Trouble buffer a.nvim_set_keymap("n", "tt", ":TroubleToggle", opts) @@ -227,9 +228,7 @@ a.nvim_set_keymap("n", '', "SmartResizeUp", opts) a.nvim_set_keymap("n", '', "SmartResizeRight", opts) -- don't blame me pls -a.nvim_set_keymap("n", "", - ":Gitsigns toggle_current_line_blame", opts -) +a.nvim_set_keymap("n", "", ":Gitsigns toggle_current_line_blame", opts) -- telescope a.nvim_set_keymap('n', 'sf', 'Telescope find_files', opts) @@ -239,6 +238,7 @@ a.nvim_set_keymap('n', 'sb', a.nvim_set_keymap('n', 'so', 'Telescope oldfiles', opts) a.nvim_set_keymap('n', 'sc', 'Telescope neoclip unnamed', opts) a.nvim_set_keymap('n', 'su', 'Telescope undo', opts) +a.nvim_set_keymap('n', 'sd', 'Telescope diagnostics', opts) -- auto comand keybinds -- add some keybinds to the file view @@ -261,7 +261,7 @@ function _G.Toggle_venn() local venn_enabled = vim.inspect(vim.b.venn_enabled) if venn_enabled == "nil" then vim.b.venn_enabled = true - vim.cmd[[setlocal ve=all]] + cmd[[setlocal ve=all]] -- draw a line on HJKL keystokes a.nvim_buf_set_keymap(0, "n", "J", "j:VBox", {noremap = true}) @@ -270,13 +270,13 @@ function _G.Toggle_venn() a.nvim_buf_set_keymap(0, "n", "H", "h:VBox", {noremap = true}) -- draw a box by pressing "f" with visual selection - vim.api.nvim_buf_set_keymap(0, "v", "f", ":VBox", {noremap = true}) + a.nvim_buf_set_keymap(0, "v", "f", ":VBox", {noremap = true}) -- make easier to navigate o.cursorcolumn = true o.colorcolumn = { 0 } else - vim.cmd[[setlocal ve=]] - vim.cmd[[mapclear ]] + cmd[[setlocal ve=]] + cmd[[mapclear ]] vim.b.venn_enabled = nil o.cursorcolumn = false o.colorcolumn = { 80 } @@ -306,7 +306,8 @@ a.nvim_set_hl(0, "CursorLineNr", { fg = colors.white, bold = true }) a.nvim_set_hl(0, "DiagnosticVirtualTextHint", { fg = "#ffffff", bg = "#1E1E1E" }) a.nvim_set_hl(0, "DiagnosticVirtualTextInfo", { fg = "#006fd8", bg = "#152f47" }) a.nvim_set_hl(0, "DiagnosticVirtualTextWarn", { fg = "#E9AD5A", bg = "#533221" }) -a.nvim_set_hl(0, "DiagnosticVirtualTextError", { fg = "#ED3B44", bg = "#4b1313" }) +a.nvim_set_hl(0, "DiagnosticVirtualTextError", + { fg = "#ED3B44", bg = "#4b1313" }) -- cmp/treesitter stuff a.nvim_set_hl(0, "CmpItemMenu", { fg = colors.purple, italic = true }) @@ -629,7 +630,7 @@ local ensure_packer = function() if fn.empty(fn.glob(install_path)) > 0 then fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) - vim.cmd [[packadd packer.nvim]] + cmd [[packadd packer.nvim]] return true end return false -- cgit v1.2.1