From 35f38e418022802047fa0af3782987435e01ebfc Mon Sep 17 00:00:00 2001 From: ksyasuda Date: Tue, 8 Feb 2022 17:40:44 -0800 Subject: [PATCH] update --- nvim/coc-settings.json | 14 +++++++- nvim/init.vim | 10 ++++-- nvim/plugins/neogit.lua | 73 +++++++++++++++++++++++++++++++++++++++ nvim/plugins/nvimtree.lua | 4 +-- 4 files changed, 96 insertions(+), 5 deletions(-) create mode 100644 nvim/plugins/neogit.lua diff --git a/nvim/coc-settings.json b/nvim/coc-settings.json index 7a3a0b3..a8f5c3d 100644 --- a/nvim/coc-settings.json +++ b/nvim/coc-settings.json @@ -34,5 +34,17 @@ "command": "pyright", "filetypes": ["python", "py"] } - } + }, + "hover.floatConfig": { + "border": true, + "shadow": true, + "focusable": true, + "highlight": "CocFloating", + "borderhighlight": "CocFloating" + }, + "diagnostic.virtualText": true, + "diagnostic.virtualTextLines": 5, + "diagnostic.virtualTextLevel": "information", + "codeLens.enable": true, + "codeLens.position": "eol" } diff --git a/nvim/init.vim b/nvim/init.vim index 288b58c..8a4a5b6 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -86,6 +86,7 @@ if has('nvim') Plug 'kyazdani42/nvim-web-devicons' Plug 'kyazdani42/nvim-tree.lua' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} + Plug 'TimUntersberger/neogit' Plug 'NTBBloodbath/doom-one.nvim' Plug 'Mofiqul/dracula.nvim' @@ -112,6 +113,7 @@ if has('nvim') source ~/.config/nvim/plugins/dashboard-nvim.lua source ~/.config/nvim/plugins/nvimtree.lua source ~/.config/nvim/plugins/treesitter.lua + source ~/.config/nvim/plugins/neogit.lua source ~/.config/nvim/plugins/doomone.lua @@ -225,7 +227,7 @@ command! -bang -nargs=? -complete=dir AllFiles "------------------------------------------------------------------------------ let g:ale_sh_shellcheck_executable = '/usr/bin/shellcheck' -let g:ale_sh_shellcheck_options = '-s bash -o all -e 2250' +let g:ale_sh_shellcheck_options = '-S info -s bash -o all -e 2250' let g:ale_sh_shfmt_options = '-i=4 -ci -sr' let g:ale_fix_on_save = 1 " let g:ale_set_quickfix = 1 @@ -610,7 +612,11 @@ nmap :bprev " git nmap gc :CocCommand fzf-preview.GitLogs nmap gf :CocCommand fzf-preview.GitFiles -nmap gg :FloatermNew --title=lazygit --opener=vsplit --width=1.0 --height=1.0 lazygit +if has('nvim') + nmap gg :Neogit +else + nmap gg :FloatermNew --title=lazygit --opener=vsplit --width=1.0 --height=1.0 lazygit +endif nmap gs :CocCommand fzf-preview.GitStatus nmap gr :CocCommand fzf-preview.CocReferences " help/history diff --git a/nvim/plugins/neogit.lua b/nvim/plugins/neogit.lua new file mode 100644 index 0000000..d7e0e0e --- /dev/null +++ b/nvim/plugins/neogit.lua @@ -0,0 +1,73 @@ +local neogit = require("neogit") + +neogit.setup { + disable_signs = false, + disable_hint = false, + disable_context_highlighting = false, + disable_commit_confirmation = false, + auto_refresh = true, + disable_builtin_notifications = false, + use_magit_keybindings = false, + commit_popup = { + kind = "split", + }, + -- Change the default way of opening neogit + kind = "tab", + -- kind = "vsplit", + -- customize displayed signs + signs = { + -- { CLOSED, OPENED } + section = { ">", "v" }, + item = { ">", "v" }, + hunk = { "", "" }, + }, + integrations = { + -- Neogit only provides inline diffs. If you want a more traditional way to look at diffs, you can use `sindrets/diffview.nvim`. + -- The diffview integration enables the diff popup, which is a wrapper around `sindrets/diffview.nvim`. + -- + -- Requires you to have `sindrets/diffview.nvim` installed. + -- use { + -- 'TimUntersberger/neogit', + -- requires = { + -- 'nvim-lua/plenary.nvim', + -- 'sindrets/diffview.nvim' + -- } + -- } + -- + diffview = false + }, + -- Setting any section to `false` will make the section not render at all + sections = { + untracked = { + folded = false + }, + unstaged = { + folded = false + }, + staged = { + folded = false + }, + stashes = { + folded = true + }, + unpulled = { + folded = true + }, + unmerged = { + folded = false + }, + recent = { + folded = true + }, + }, + -- override/add mappings + mappings = { + -- modify status buffer mappings + status = { + -- Adds a mapping with "B" as key that does the "BranchPopup" command + ["B"] = "BranchPopup", + -- Removes the default mapping of "s" + ["s"] = "", + } + } +} diff --git a/nvim/plugins/nvimtree.lua b/nvim/plugins/nvimtree.lua index 50ce741..afd5b8e 100644 --- a/nvim/plugins/nvimtree.lua +++ b/nvim/plugins/nvimtree.lua @@ -39,8 +39,8 @@ require'nvim-tree'.setup { timeout = 500, }, view = { - width = 45, - height = 45, + width = 35, + height = 35, hide_root_folder = false, side = 'left', auto_resize = false,