From 3058dbb2fc8913e5a3484b191f076a0df26d235f Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 20 Sep 2023 11:56:03 +0200 Subject: [nvim] use gitsigns in favor of gitgutter --- config/essentials/nvim/after/plugin/gitsigns.lua | 82 ++++++++++++++++++++++++ config/essentials/nvim/lua/user/packer.lua | 3 +- 2 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 config/essentials/nvim/after/plugin/gitsigns.lua (limited to 'config/essentials') diff --git a/config/essentials/nvim/after/plugin/gitsigns.lua b/config/essentials/nvim/after/plugin/gitsigns.lua new file mode 100644 index 0000000..025f70d --- /dev/null +++ b/config/essentials/nvim/after/plugin/gitsigns.lua @@ -0,0 +1,82 @@ +require('gitsigns').setup { + signs = { + add = { text = '│' }, + change = { text = '│' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + untracked = { text = '┆' }, + }, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + watch_gitdir = { + follow_files = true + }, + attach_to_untracked = true, + current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + }, + current_line_blame_formatter = ', - ', + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, -- Disable if file is longer than this (in lines) + preview_config = { + -- Options passed to nvim_open_win + border = 'single', + style = 'minimal', + relative = 'cursor', + row = 0, + col = 1 + }, + yadm = { + enable = false + }, + on_attach = function(bufnr) + local gs = package.loaded.gitsigns + + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end + + -- Navigation + map('n', ']c', function() + if vim.wo.diff then return ']c' end + vim.schedule(function() gs.next_hunk() end) + return '' + end, {expr=true}) + + map('n', '[c', function() + if vim.wo.diff then return '[c' end + vim.schedule(function() gs.prev_hunk() end) + return '' + end, {expr=true}) + + -- Actions + map('n', 'hs', gs.stage_hunk) + map('n', 'hr', gs.reset_hunk) + map('v', 'hs', function() gs.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end) + map('v', 'hr', function() gs.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end) + map('n', 'hS', gs.stage_buffer) + map('n', 'hu', gs.undo_stage_hunk) + map('n', 'hR', gs.reset_buffer) + map('n', 'hp', gs.preview_hunk) + map('n', 'hb', function() gs.blame_line{full=true} end) + map('n', 'tb', gs.toggle_current_line_blame) + map('n', 'hd', gs.diffthis) + map('n', 'hD', function() gs.diffthis('~') end) + map('n', 'td', gs.toggle_deleted) + + -- Text object + map({'o', 'x'}, 'ih', ':Gitsigns select_hunk') + end + +} diff --git a/config/essentials/nvim/lua/user/packer.lua b/config/essentials/nvim/lua/user/packer.lua index 4a174bc..a717e7c 100644 --- a/config/essentials/nvim/lua/user/packer.lua +++ b/config/essentials/nvim/lua/user/packer.lua @@ -18,8 +18,6 @@ return require('packer').startup(function(use) use { 'uZer/pywal16.nvim', as = 'pywal16' } use('norcalli/nvim-colorizer.lua') - use('airblade/vim-gitgutter') - use('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'}) use('nvim-treesitter/playground') use('theRealCarneiro/hyprland-vim-syntax') @@ -30,6 +28,7 @@ return require('packer').startup(function(use) use('tpope/vim-commentary') -- use('tpope/vim-endwise') use('tpope/vim-fugitive') + use('lewis6991/gitsigns.nvim') use('tpope/vim-repeat') use('tpope/vim-surround') use('tpope/vim-vinegar') -- cgit v1.2.3 From e5b735f8a7013fd872cd78e588b9cbe87602ec14 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 20 Sep 2023 12:14:10 +0200 Subject: [aliases] prevent gurk from relink when already running --- config/essentials/zsh/aliases.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config/essentials') diff --git a/config/essentials/zsh/aliases.sh b/config/essentials/zsh/aliases.sh index 9a7b196..67aa74a 100644 --- a/config/essentials/zsh/aliases.sh +++ b/config/essentials/zsh/aliases.sh @@ -51,6 +51,8 @@ alias sr='surfraw' alias ccu='calcurse' alias pf='profanity' +alias gurk='pgrep gurk > /dev/null && printf "Already Running.\n" || gurk' + alias arduino-cli='arduino-cli --config-file $XDG_CONFIG_HOME/arduino15/arduino-cli.yaml' if [ -x /usr/bin/dircolors ] || [ -x $HOME/../usr/bin/dircolors ] -- cgit v1.2.3 From ae7b55ff7650160ed2b0fade12a6e79bc738e5e0 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 20 Sep 2023 12:17:08 +0200 Subject: [nvim (zk)] removed unused vaults --- config/essentials/nvim/lua/user/zk.lua | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'config/essentials') diff --git a/config/essentials/nvim/lua/user/zk.lua b/config/essentials/nvim/lua/user/zk.lua index 41072a6..2c3d9b5 100644 --- a/config/essentials/nvim/lua/user/zk.lua +++ b/config/essentials/nvim/lua/user/zk.lua @@ -45,21 +45,6 @@ require('telekasten').setup({ template_new_note = home .. "/" .. "templates/new_note.md", new_note_filename = "title", }, - SoftwareDesign = { - home = home .. "/" .. "SoftwareDesign", - template_new_note = home .. "/" .. "templates/new_note.md", - new_note_filename = "title", - }, - DataEssentials = { - home = home .. "/" .. "DataEssentials", - template_new_note = home .. "/" .. "templates/new_note.md", - new_note_filename = "title", - }, - NetworkEssentials = { - home = home .. "/" .. "NetworkEssentials", - template_new_note = home .. "/" .. "templates/new_note.md", - new_note_filename = "title", - }, C = { home = home .. "/" .. "C", template_new_note = home .. "/" .. "templates/new_note.md", -- cgit v1.2.3 From 149770ce67e3f3c928aefb8e7439473027e0b743 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 20 Sep 2023 12:18:13 +0200 Subject: [nvim (zk)] added new vaults --- config/essentials/nvim/lua/user/zk.lua | 40 +++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) (limited to 'config/essentials') diff --git a/config/essentials/nvim/lua/user/zk.lua b/config/essentials/nvim/lua/user/zk.lua index 2c3d9b5..ee055d6 100644 --- a/config/essentials/nvim/lua/user/zk.lua +++ b/config/essentials/nvim/lua/user/zk.lua @@ -45,16 +45,46 @@ require('telekasten').setup({ template_new_note = home .. "/" .. "templates/new_note.md", new_note_filename = "title", }, - C = { - home = home .. "/" .. "C", + BusinessEnglish = { + home = home .. "/" .. "BusinessEnglish", + template_new_note = home .. "/" .. "templates/new_note.md", + new_note_filename = "title", + }, + DataEssentials = { + home = home .. "/" .. "DataEssentials", + template_new_note = home .. "/" .. "templates/new_note.md", + new_note_filename = "title", + }, + BusinessCommunication = { + home = home .. "/" .. "BusinessCommunication", + template_new_note = home .. "/" .. "templates/new_note.md", + new_note_filename = "title", + }, + AIEssentials = { + home = home .. "/" .. "AIEssentials", template_new_note = home .. "/" .. "templates/new_note.md", new_note_filename = "title", }, - businessIT = { - home = home .. "/" .. "businessIT", + dotNetEssentials = { + home = home .. "/" .. "dotNetEssentials", template_new_note = home .. "/" .. "templates/new_note.md", new_note_filename = "title", - } + }, + iTalent = { + home = home .. "/" .. "iTalent", + template_new_note = home .. "/" .. "templates/new_note.md", + new_note_filename = "title", + }, + SoftwareDesign2 = { + home = home .. "/" .. "SoftwareDesign2", + template_new_note = home .. "/" .. "templates/new_note.md", + new_note_filename = "title", + }, + C = { + home = home .. "/" .. "C", + template_new_note = home .. "/" .. "templates/new_note.md", + new_note_filename = "title", + }, } }) -- cgit v1.2.3 From f62cb53a1951d3d14a8628c9d89b7f32ee66e514 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 20 Sep 2023 12:21:59 +0200 Subject: [nvim (cmp)] added csharp support --- config/essentials/nvim/lua/user/cmp/cs.lua | 6 ++++++ config/essentials/nvim/lua/user/cmp/init.lua | 1 + 2 files changed, 7 insertions(+) create mode 100644 config/essentials/nvim/lua/user/cmp/cs.lua (limited to 'config/essentials') diff --git a/config/essentials/nvim/lua/user/cmp/cs.lua b/config/essentials/nvim/lua/user/cmp/cs.lua new file mode 100644 index 0000000..7921117 --- /dev/null +++ b/config/essentials/nvim/lua/user/cmp/cs.lua @@ -0,0 +1,6 @@ +local pid = vim.fn.getpid() + +require'lspconfig'.omnisharp.setup{ + cmd = { "/usr/bin/omnisharp", "--languageserver" , "--hostPID", tostring(pid) } + -- Additional configuration can be added here +} diff --git a/config/essentials/nvim/lua/user/cmp/init.lua b/config/essentials/nvim/lua/user/cmp/init.lua index a545f12..255534a 100644 --- a/config/essentials/nvim/lua/user/cmp/init.lua +++ b/config/essentials/nvim/lua/user/cmp/init.lua @@ -3,6 +3,7 @@ require("user.cmp.setup") require("user.cmp.arduino") require("user.cmp.bash") require("user.cmp.clangd") +require("user.cmp.cs") require("user.cmp.html") require("user.cmp.css") require("user.cmp.java") -- cgit v1.2.3 From 3193a36d5306845e5bf51839f8e884e2aca17808 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 20 Sep 2023 12:22:29 +0200 Subject: [aliases] fixed find showing error --- config/essentials/zsh/aliases.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/essentials') diff --git a/config/essentials/zsh/aliases.sh b/config/essentials/zsh/aliases.sh index 67aa74a..ea1c719 100644 --- a/config/essentials/zsh/aliases.sh +++ b/config/essentials/zsh/aliases.sh @@ -243,7 +243,7 @@ alias cdrs='cd /srv/' # fzf aliases alias ppj='cd ~/proj/personal/"$(find ~/proj/personal -mindepth 1 -maxdepth 1 -type d -printf "%f\n"| fzf)"' alias fil='$EDITOR ~/docs/filios/"$(find ~/docs/filios -type f -printf "%f\n" | fzf)"' -alias cfg='find -L ~/src/dotfiles -type f | fzf | xargs -r $EDITOR' +alias cfg='find -L ~/src/dotfiles -type f 2> /dev/null | fzf | xargs -r $EDITOR' alias fzps='ps aux | tail +2 | fzf | tee /dev/stderr | awk '\''{print $2}'\'' | clipp' alias asf='alias | fzf' alias fzh="tac $HISTFILE | fzf | tee /dev/stderr | clipp" -- cgit v1.2.3