From bcd5101e36a0b900b802f1ba72f8ee26c1be1e27 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Fri, 23 Aug 2024 01:55:21 -0400 Subject: Update highlighting after diffget (fugitive) --- lua/plugins/fugitive.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua index e52a4c6..4dc31d6 100644 --- a/lua/plugins/fugitive.lua +++ b/lua/plugins/fugitive.lua @@ -13,8 +13,8 @@ return { { "gp", "G pull" }, -- G.it P.ull { "gf", "G fetch" }, -- G.it F.etch { "ds", "Gvdiffsplit!" }, -- G.it D.iff S.plit - { "dh", "diffget //2" }, - { "dl", "diffget //3" }, + { "dh", "diffget //2 | diffupdate" }, + { "dl", "diffget //3 | diffupdate" }, }, }, { -- cgit v1.2.3 From d5c04777b219edd1b37fa27fc130f89ef17d4df5 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Fri, 23 Aug 2024 02:02:16 -0400 Subject: Exit vimdiff easily --- lua/plugins/fugitive.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua index 4dc31d6..56c525a 100644 --- a/lua/plugins/fugitive.lua +++ b/lua/plugins/fugitive.lua @@ -15,6 +15,8 @@ return { { "ds", "Gvdiffsplit!" }, -- G.it D.iff S.plit { "dh", "diffget //2 | diffupdate" }, { "dl", "diffget //3 | diffupdate" }, + { "de", "only" }, -- D.iff E.xit + -- NOTE: dp (no leader) is already set to diffput | diffupdate by default }, }, { -- cgit v1.2.3 From 9973585a15e2769ebc8dfe81e7c35c5965064171 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Fri, 6 Sep 2024 10:19:42 -0400 Subject: Latex Compiler goodies and oil.nvim plugin --- ftplugin/tex.lua | 7 ++++++- lua/core/init.lua | 16 ++++++---------- lua/plugins/oil.lua | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 lua/plugins/oil.lua diff --git a/ftplugin/tex.lua b/ftplugin/tex.lua index b565c48..5df3dd9 100644 --- a/ftplugin/tex.lua +++ b/ftplugin/tex.lua @@ -1,2 +1,7 @@ -- Configure the compiler for latex -vim.opt_local.makeprg = 'pdflatex -interaction=nonstopmode -file-line-error -synctex=1 %' + +local function tex_root() + return vim.fn.system('grep -rl -m 1 --include "*.tex" "documentclass"') +end + +vim.opt_local.makeprg = "pdflatex -interaction=nonstopmode -file-line-error -synctex=1 " .. tex_root() diff --git a/lua/core/init.lua b/lua/core/init.lua index 05a3bb5..3b28e6a 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -23,7 +23,7 @@ vim.api.nvim_set_keymap("t", "", "", {}) -- terminal mode Esc vim.keymap.set("v", "", ":m '>+1gv=gv") vim.keymap.set("v", "", ":m '<-2gv=gv") --- Netrw preferences when not using lf +-- Netrw preferences vim.g.netrw_liststyle = 3 vim.g.netrw_banner = 0 vim.g.netrw_bufsettings = "noma nomod nu nobl nowrap ro" @@ -65,8 +65,11 @@ end cd_to_git_root() -- Quickly compile and preview files -vim.keymap.set("n", "pc", "make") -- P.roject C.ompile -vim.keymap.set("n", "pp", "!opout %") -- P.roject P.review +vim.keymap.set("n", "mm", "make") -- M.ake +vim.keymap.set("n", "ma", "make") -- M.ake A.ll +vim.keymap.set("n", "mc", "make") -- M.ake C.lean +vim.keymap.set("n", "mo", "!opout %") -- M.ake O.pen + -- Make sure I don't accidentally delete with 'S' when not using an LSP: vim.keymap.set("n", "S", "") -- Stop hurting my pinky with : @@ -74,10 +77,3 @@ vim.keymap.set("n", "w", "") -- Quickly navigate between Tabs vim.keymap.set("n", "", "tabnext") vim.keymap.set("n", "", "tabnew") - --- TEST --- vim.api.nvim_create_autocmd("InsertLeave", { --- callback = function() --- print("hello") --- end, --- }) diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua new file mode 100644 index 0000000..0a912b7 --- /dev/null +++ b/lua/plugins/oil.lua @@ -0,0 +1,34 @@ +return { + "stevearc/oil.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require("oil").setup({ + columns = { "icon" }, + keymaps = { + [""] = false, + [""] = "actions.select_split", + }, + view_options = { + show_hidden = true, + }, + }) + end, + keys = { + + { -- Floating Oil window + "-", + function() + require("oil").toggle_float() + end, + mode = "n", + desc = "Toggle floating Oil window", + }, + + { -- Open parent directory + "-", + "Oil", + mode = "n", + desc = "Open parent directory", + }, + }, +} -- cgit v1.2.3