From 3f19ba0936c0a3f30aaeee6c833463967a038923 Mon Sep 17 00:00:00 2001 From: Benjamin Chaussé Date: Mon, 17 Jun 2024 12:10:12 -0400 Subject: auto-cd to git root, dadbod, colorscheme tweaks --- lua/core/init.lua | 2 +- lua/plugins/colorscheme.lua | 20 +++++++++++++++++++- lua/plugins/dadbod.lua | 7 +++++++ lua/plugins/fugitive.lua | 15 +++------------ lua/plugins/harpoon.lua | 19 +++++++++++++++++++ lua/plugins/orgmode.lua | 2 +- 6 files changed, 50 insertions(+), 15 deletions(-) create mode 100644 lua/plugins/dadbod.lua diff --git a/lua/core/init.lua b/lua/core/init.lua index c0ab11d..3e33124 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -52,4 +52,4 @@ vim.keymap.set("n", "S", "") vim.keymap.set("n", "w", "") -- Quickly navigate between Tabs vim.keymap.set("n", "", "tabnext") -vim.keymap.set("n", "", "tabprevious") +vim.keymap.set("n", "", "tabnew") diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index 94d60d4..48f327b 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -1,4 +1,5 @@ -return { -- No nonsense, very stoic +return { + { -- No nonsense, very stoic "aktersnurra/no-clown-fiesta.nvim", dependencies = { { "nvim-treesitter/nvim-treesitter", @@ -50,6 +51,7 @@ return { -- No nonsense, very stoic -- You can set any of the style values specified for `:h nvim_set_hl` type = { bold = true }, lsp = { underline = true }, + keywords = { italic = true }, }, }) local fullbg = "#111a1f" @@ -57,6 +59,7 @@ return { -- No nonsense, very stoic vim.api.nvim_set_hl(0,"LineNr",{fg="#727272"}) -- vim.api.nvim_set_hl(0,"Visual",{bg="#171717"}) -- vim.api.nvim_set_hl(0,"Visual",{bg="#829e9c"}) + vim.api.nvim_set_hl(0,"@markup.strong",{bold=true}) vim.api.nvim_set_hl(0,"Visual",{bg="#84493b"}) vim.api.nvim_set_hl(0,"Folded",{bg="none"}) vim.api.nvim_set_hl(0,"VertSplit",{bg="none",fg="#727272"}) @@ -67,4 +70,19 @@ return { -- No nonsense, very stoic vim.api.nvim_set_hl(0,"NormalFloat",{bg=fullbg}) vim.api.nvim_set_hl(0,"FloatBorder",{bg="none",fg=fullbg}) end, + }, { + "neanias/everforest-nvim", + version = false, + priority = 1000, + config = function() + require("everforest").setup({ + background = "hard", + transparent_background_level=2 + }) + end, + }, { + "ChausseBenjamin/friffle-vim", + version = false, + priority = 1000, + } } diff --git a/lua/plugins/dadbod.lua b/lua/plugins/dadbod.lua new file mode 100644 index 0000000..84526f4 --- /dev/null +++ b/lua/plugins/dadbod.lua @@ -0,0 +1,7 @@ +return { + "tpope/vim-dadbod", + dependencies = { + "kristijanhusak/vim-dadbod-ui", + "kristijanhusak/vim-dadbod-completion", + }, +} diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua index bbb5ef8..6bb5190 100644 --- a/lua/plugins/fugitive.lua +++ b/lua/plugins/fugitive.lua @@ -4,18 +4,6 @@ return { dependencies = "tpope/vim-rhubarb", config = function() - -- The following seems to break harpoon - -- it's supposed to auto-cd to the git root on vim startup - - -- local handle = io.popen('git rev-parse --is-inside-work-tree 2> /dev/null') - -- if handle then - -- local result = handle:read('*a') - -- handle:close() - -- if result and result:match('true') then - -- vim.cmd([[Gcd]]) - -- end - -- end - end, -- Only load when using one of the following commands: keys = { @@ -26,5 +14,8 @@ return { { "gu", "G push" }, -- G.it push U.pstream { "gp", "G pull" }, -- G.it P.ull { "gf", "G fetch" }, -- G.it F.etch + { "ds", "Gvdiffsplit!" }, + { "dh", "diffget //2" }, + { "dl", "diffget //3" }, }, } diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua index 9d061cf..49f49cb 100644 --- a/lua/plugins/harpoon.lua +++ b/lua/plugins/harpoon.lua @@ -6,6 +6,25 @@ return { "nvim-telescope/telescope.nvim" }, config = function() + + -- Cd to git root on startup to retain harpoons wherever vim starts + local function is_git_repo() + local git_dir = vim.fn.systemlist("git rev-parse --show-toplevel") + if vim.v.shell_error ~= 0 then + return false + end + return git_dir[1] + end + + local function cd_to_git_root() + local git_root = is_git_repo() + if git_root then + vim.cmd('tcd ' .. git_root) + end + end + + cd_to_git_root() + local harpoon = require("harpoon") harpoon:setup() diff --git a/lua/plugins/orgmode.lua b/lua/plugins/orgmode.lua index 9711609..8ae5c52 100644 --- a/lua/plugins/orgmode.lua +++ b/lua/plugins/orgmode.lua @@ -15,7 +15,7 @@ return { -- Setup orgmode require('orgmode').setup({ -- win_split_mode = {'float', 0.9}, - win_split_mode = 'float', + -- win_split_mode = 'float', org_agenda_files = '~/Dropbox/org/**/*', org_default_notes_file = '~/Dropbox/org/index.org', calendar_week_start_day = 0, -- cgit v1.2.3 From 3990159461b650064cbb2e385b17a286b657790d Mon Sep 17 00:00:00 2001 From: Benjamin Chaussé Date: Mon, 17 Jun 2024 12:11:42 -0400 Subject: Telescope not needed for harpoon --- lua/plugins/harpoon.lua | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua index 49f49cb..6f15fc4 100644 --- a/lua/plugins/harpoon.lua +++ b/lua/plugins/harpoon.lua @@ -29,24 +29,6 @@ return { harpoon:setup() - -- -- basic telescope config - -- local conf = require("telescope.config").values - -- local function toggle_telescope(harpoon_files) - -- local file_paths = {} - -- for _, item in ipairs(harpoon_files.items) do - -- table.insert(file_paths, item.value) - -- end - - -- require("telescope.pickers").new({}, { - -- prompt_title = "Harpoon", - -- finder = require("telescope.finders").new_table({ - -- results = file_paths, - -- }), - -- previewer = conf.file_previewer({}), - -- sorter = conf.generic_sorter({}), - -- }):find() - -- end - -- harpoon keybindings vim.keymap.set("n", "a", function() harpoon:list():add() end ) -- vim.keymap.set("n", "", function() toggle_telescope(harpoon:list()) end, {desc = "Open harpoon window"} ) -- cgit v1.2.3