From 1e5b6df23f9610786ffc0c04ac9bfd1c0b778352 Mon Sep 17 00:00:00 2001 From: adam <56338480+adastx@users.noreply.github.com> Date: Sun, 9 Oct 2022 21:48:44 +0200 Subject: nvim: cleaner git support for dotfiles --- .config/nvim/lua/mappings.lua | 2 +- .config/nvim/lua/plugins.lua | 8 +++++++- .config/nvim/lua/setup/gitsigns.lua | 8 ++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .config/nvim/lua/setup/gitsigns.lua (limited to '.config/nvim/lua') diff --git a/.config/nvim/lua/mappings.lua b/.config/nvim/lua/mappings.lua index 69e21a6..2d1222c 100644 --- a/.config/nvim/lua/mappings.lua +++ b/.config/nvim/lua/mappings.lua @@ -48,7 +48,7 @@ map('n', 'xN', 'lua vim.diagnostic.goto_prev()', opts) map('n', 'xx', 'Telescope lsp_code_actions', opts) map('n', 'xX', 'Telescope lsp_range_code_actions', opts) -map('n', 'co', ':copen', opts) +map('n', 'co', ':cwindow', opts) map('n', ']q', ':cnext', opts) map('n', '[q', ':cprevious', opts) map('n', '[Q', ':cfirst', opts) diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 2e6b3ff..cf27f1f 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -65,7 +65,7 @@ return require('packer').startup(function(use) event = { "BufRead", "BufNewFile" }, wants = "plenary.nvim", config = function() - require('gitsigns').setup() + require 'setup.gitsigns' end, } @@ -135,6 +135,12 @@ return require('packer').startup(function(use) event = { "BufRead", "BufNewFile" }, } + use { + "tpope/vim-fugitive", + config = "vim.cmd [[call FugitiveDetect('~/.cfg')]]", + cmd = { 'G', 'Ggrep' }, + } + use { "b3nj5m1n/kommentary", event = { "BufRead", "BufNewFile" }, diff --git a/.config/nvim/lua/setup/gitsigns.lua b/.config/nvim/lua/setup/gitsigns.lua new file mode 100644 index 0000000..7894125 --- /dev/null +++ b/.config/nvim/lua/setup/gitsigns.lua @@ -0,0 +1,8 @@ +require('gitsigns').setup { + worktrees = { + { + toplevel = vim.env.HOME, + gitdir = vim.env.HOME .. '/.cfg' + } + } +} -- cgit v1.2.3-70-g09d2