From 2582c9325b0b9399a25ae91b2c948e2d990391db Mon Sep 17 00:00:00 2001 From: ksyasuda Date: Thu, 10 Feb 2022 23:02:09 -0800 Subject: [PATCH] updates --- nvim/init.vim | 120 ++++++++++++++------------- nvim/keybindings.vim | 127 +++++++++++++++-------------- nvim/plugin-confs/git-blame.lua | 2 + nvim/plugin-confs/gitsigns.lua | 43 ++++++++++ nvim/plugin-confs/goto-preview.lua | 6 +- nvim/plugin-confs/lspconfig.lua | 54 ++++++------ nvim/plugin-confs/null-ls.lua | 1 + 7 files changed, 207 insertions(+), 146 deletions(-) create mode 100644 nvim/plugin-confs/git-blame.lua create mode 100644 nvim/plugin-confs/gitsigns.lua diff --git a/nvim/init.vim b/nvim/init.vim index e3f9157..5afad48 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -57,63 +57,69 @@ autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) call plug#begin('~/.vim/plugged') -Plug 'tpope/vim-fugitive' -Plug 'tpope/vim-commentary' -Plug 'tpope/vim-surround' +Plug 'ap/vim-css-color' +Plug 'github/copilot.vim' +Plug 'jiangmiao/auto-pairs' Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'junegunn/fzf.vim' -Plug 'wakatime/vim-wakatime' -Plug 'voldikss/vim-floaterm' -Plug 'pechorin/any-jump.vim' -Plug 'jiangmiao/auto-pairs' -Plug 'ap/vim-css-color' -Plug 'prettier/vim-prettier', { 'do': 'yarn install' } -Plug 'sheerun/vim-polyglot' Plug 'osyo-manga/vim-over' -Plug 'github/copilot.vim' +Plug 'pechorin/any-jump.vim' +Plug 'tpope/vim-commentary' +Plug 'tpope/vim-surround' +Plug 'voldikss/vim-floaterm' +Plug 'wakatime/vim-wakatime' " Plug 'dense-analysis/ale' " Plug 'neoclide/coc.nvim', {'branch': 'release'} +let g:mapleader = "\" +let g:maplocalleader = ',' + if has('nvim') + Plug 'nvim-lua/plenary.nvim' + + " Plug 'TimUntersberger/neogit' Plug 'akinsho/bufferline.nvim' - " Plug 'chentau/marks.nvim' + Plug 'f-person/git-blame.nvim' Plug 'folke/which-key.nvim' Plug 'glepnir/dashboard-nvim' - Plug 'kyazdani42/nvim-web-devicons' Plug 'kyazdani42/nvim-tree.lua' - Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} - Plug 'TimUntersberger/neogit' - Plug 'ojroques/nvim-lspfuzzy' + Plug 'kyazdani42/nvim-web-devicons' + Plug 'lewis6991/gitsigns.nvim' + Plug 'lewis6991/gitsigns.nvim' Plug 'nvim-lualine/lualine.nvim' + Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} + Plug 'ojroques/nvim-lspfuzzy' - Plug 'neovim/nvim-lspconfig' - Plug 'williamboman/nvim-lsp-installer' - Plug 'ray-x/lsp_signature.nvim' - Plug 'simrat39/symbols-outline.nvim' - Plug 'jose-elias-alvarez/null-ls.nvim' - Plug 'hrsh7th/cmp-nvim-lsp' + Plug 'L3MON4D3/LuaSnip' + Plug 'folke/trouble.nvim' Plug 'hrsh7th/cmp-buffer' + Plug 'hrsh7th/cmp-nvim-lsp' Plug 'hrsh7th/cmp-path' Plug 'hrsh7th/nvim-cmp' + Plug 'jose-elias-alvarez/null-ls.nvim' + Plug 'neovim/nvim-lspconfig' Plug 'onsails/lspkind-nvim' - Plug 'saadparwaiz1/cmp_luasnip' - Plug 'L3MON4D3/LuaSnip' + Plug 'ray-x/lsp_signature.nvim' Plug 'rmagatti/goto-preview', - Plug 'folke/trouble.nvim' + Plug 'saadparwaiz1/cmp_luasnip' + Plug 'simrat39/symbols-outline.nvim' + Plug 'williamboman/nvim-lsp-installer' - Plug 'olimorris/onedarkpro.nvim' - Plug 'NTBBloodbath/doom-one.nvim' Plug 'Mofiqul/dracula.nvim' + Plug 'NTBBloodbath/doom-one.nvim' + Plug 'olimorris/onedarkpro.nvim' Plug 'projekt0n/github-nvim-theme' else Plug 'ap/vim-buftabline' - Plug 'ryanoasis/vim-devicons' + Plug 'itchyny/lightline.vim' + Plug 'liuchengxu/vim-which-key', { 'on': ['WhichKey', 'WhichKey!'] } + Plug 'maximbaz/lightline-ale' Plug 'mhinz/vim-startify' Plug 'preservim/nerdtree' | Plug 'Xuyuanp/nerdtree-git-plugin' - Plug 'liuchengxu/vim-which-key', { 'on': ['WhichKey', 'WhichKey!'] } - Plug 'itchyny/lightline.vim' - Plug 'maximbaz/lightline-ale' + Plug 'ryanoasis/vim-devicons' + Plug 'sheerun/vim-polyglot' + Plug 'tpope/vim-fugitive' Plug 'joshdick/onedark.vim' Plug 'kaicataldo/material.vim', { 'branch': 'main' } @@ -124,33 +130,36 @@ endif call plug#end() if has('nvim') + set completeopt=menu,menuone,noselect + source ~/.config/nvim/keybindings.vim + source ~/.config/nvim/plugin-confs/bufferline.lua - " source ~/.config/nvim/plugin-confs/marks.lua - source ~/.config/nvim/plugin-confs/whichkey.lua - source ~/.config/nvim/plugin-confs/dashboard-nvim.lua source ~/.config/nvim/plugin-confs/dashboard-art.vim - source ~/.config/nvim/plugin-confs/nvimtree.lua - source ~/.config/nvim/plugin-confs/treesitter.lua - source ~/.config/nvim/plugin-confs/neogit.lua + source ~/.config/nvim/plugin-confs/dashboard-nvim.lua + source ~/.config/nvim/plugin-confs/git-blame.lua + source ~/.config/nvim/plugin-confs/gitsigns.lua source ~/.config/nvim/plugin-confs/lspfuzzy.lua source ~/.config/nvim/plugin-confs/lualine.lua + " source ~/.config/nvim/plugin-confs/neogit.lua + source ~/.config/nvim/plugin-confs/nvimtree.lua + source ~/.config/nvim/plugin-confs/treesitter.lua + source ~/.config/nvim/plugin-confs/whichkey.lua - set completeopt=menu,menuone,noselect source ~/.config/nvim/plugin-confs/code_actions.lua - source ~/.config/nvim/plugin-confs/lspconfig.lua + source ~/.config/nvim/plugin-confs/goto-preview.lua + source ~/.config/nvim/plugin-confs/lsp-kind.lua source ~/.config/nvim/plugin-confs/lsp-signature.lua - source ~/.config/nvim/plugin-confs/symbols-outline.lua + source ~/.config/nvim/plugin-confs/lspconfig.lua source ~/.config/nvim/plugin-confs/null-ls.lua source ~/.config/nvim/plugin-confs/nvim-cmp.lua - source ~/.config/nvim/plugin-confs/lsp-kind.lua - source ~/.config/nvim/plugin-confs/goto-preview.lua + source ~/.config/nvim/plugin-confs/symbols-outline.lua source ~/.config/nvim/plugin-confs/trouble.lua + source ~/.vim/plugin-confs/floaterm.vim source ~/.vim/plugin-confs/fzf.vim + source ~/.vim/plugin-confs/lightline.vim source ~/.vim/plugin-confs/vim-closetag.vim source ~/.vim/plugin-confs/wakatime.vim - source ~/.vim/plugin-confs/lightline.vim - source ~/.vim/plugin-confs/floaterm.vim source ~/.config/nvim/plugin-confs/doomone.lua source ~/.config/nvim/plugin-confs/dracula.lua @@ -170,6 +179,8 @@ if has('nvim') autocmd TermOpen * setlocal nonumber norelativenumber else + source ~/.vim/keybindings.vim + source ~/.vim/plugin-confs/nerdtree.vim source ~/.vim/plugin-confs/whichkey.vim source ~/.vim/plugin-confs/ale.vim @@ -231,13 +242,16 @@ endif "------------------------------------------------------------------------------ " custom commands "------------------------------------------------------------------------------ -" command! -bang -nargs=? -complete=dir Files -" \ call fzf#run(fzf#wrap('files', fzf#vim#with_preview({'dir': , 'sink': 'e', 'source': 'rg --files --hidden'}), 0)) command! -bang -nargs=? -complete=dir Files - \ call fzf#vim#files(, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline']}), 0) + \ call fzf#vim#files(, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline', '--preview', '~/.vim/plugged/fzf.vim/bin/preview.sh']}), 0) command! -bang -nargs=? -complete=dir AllFiles - \ call fzf#run(fzf#wrap('allfiles', fzf#vim#with_preview({'dir': , 'sink': 'e', 'source': 'rg --files --hidden --no-ignore'}), 0)) + \ call fzf#run(fzf#wrap('allfiles', fzf#vim#with_preview({'dir': , 'sink': 'e', 'source': 'rg --files --hidden --no-ignore', 'options': ['--layout=reverse', '--preview', '~/.vim/plugged/fzf.vim/bin/preview.sh']}), 0)) + +command! Lines call fzf#vim#lines(, fzf#vim#with_preview({'options': ['--layout=reverse']}), 0) + +command! -bang -nargs=? -complete=dir Buffers + \ call fzf#vim#buffers(, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline', '--preview', '~/.vim/plugged/fzf.vim/bin/preview.sh']}), 0) command! Reload execute "source ~/.vimrc" command! Config execute ":e ~/.vimrc" @@ -245,13 +259,3 @@ command! Env execute ":Dotenv .env" command! MakeTags !ctags -R . command! Ovewrite execute ":w !sudo tee %" command! Aniwrapper execute ":FloatermNew aniwrapper -qtdoomone -D 144" -"------------------------------------------------------------------------------ -"KEYBINDINGS -"------------------------------------------------------------------------------ -let g:mapleader = "\" -let g:maplocalleader = ',' -if has('nvim') - source ~/.config/nvim/keybindings.vim -else - source ~/.vim/keybindings.vim -endif diff --git a/nvim/keybindings.vim b/nvim/keybindings.vim index 3cb90ad..58fbbb8 100644 --- a/nvim/keybindings.vim +++ b/nvim/keybindings.vim @@ -1,97 +1,106 @@ -" KEYBINDINGS -" imap nmap :set paste!set paste? nmap :! -" nmap :NERDTreeToggle -nmap :NvimTreeToggle -" nnoremap :wa:vertical botright term ++kill=term -nmap Q !!$SHELL " reselect visual selection after indent vnoremap < >gv -" open file under cursor, create if necessary -nnoremap gF :edit +" for toggling/hiding the vsplit-term +tnoremap :FloatermToggle floatingterm +tnoremap +tnoremap tt :FloatermToggle vsplit-term -" fzf +nmap :bnext +nmap :bprev +nmap :wa:FloatermToggle floatingterm +nmap :NvimTreeToggle + +" open file under cursor, create if necessary nnoremap // :Lines nnoremap ?? :BLines -" aniwrapper/ani-cli (until i find better use for a keys) +nmap ca :lua vim.lsp.buf.code_action() + +nmap gD :lua vim.lsp.buf.declaration() +nmap gF :edit +nmap gT :lua vim.lsp.buf.type_definition() +nmap gb :lua vim.lsp.buf.document_symbol() +nmap gd :lua vim.lsp.buf.definition() +nmap gi :lua vim.lsp.buf.implementation() +nmap gl :lua vim.lsp.buf.code_lens() +nmap gr :lua vim.lsp.buf.references() +nmap gs :lua vim.lsp.buf.signature_help() + +nmap Q !!$SHELL + +nmap rn :lua vim.lsp.buf.rename() + +nmap wa :lua vim.lsp.buf.add_workspace_folder() +nmap wl :lua print(vim.inspect(vim.lsp.buf.list_workspace_folders())) +nmap wr :lua vim.lsp.buf.remove_workspace_folder() + nmap as :FloatermNew --title=aniwrapper aniwrapper -qtdoomone -D144 nmap ad :FloatermNew --title=aniwrapper ani-cli -q720p -cd/home/sudacode/Videos/sauce -D144 -" buffers -" nmap bB :CocCommand fzf-preview.AllBuffers + nmap bb :Buffers nmap bk :bdelete nmap bn :bnext nmap bp :bprev -nmap :bnext -nmap :bprev + nmap cd :LspDiagnostics -" git -nmap gc :CocCommand fzf-preview.GitLogs +nnoremap cn :DashboardNewFile + +nmap ff :CocCommand fzf-preview.ProjectFiles +nmap fa :DashboardFindWord +nmap fb :DashboardJumpMark +nmap fh :DashboardFindHistory + +nmap gb :GitBlameToggle +nmap gc :Commits nmap gf :GitFiles -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 +" nmap gg :Neogit +nmap gg :FloatermNew --title=lazygit --width=1.0 --height=1.0 --opener=vsplit lazygit +nnoremap gP lua require('goto-preview').close_all_win() +nnoremap gR TroubleToggle lsp_references nnoremap gpc lua require('goto-preview').close_all_win() nnoremap gpd lua require('goto-preview').goto_preview_definition() nnoremap gpi lua require('goto-preview').goto_preview_implementation() -nnoremap gP lua require('goto-preview').close_all_win() -nnoremap gR TroubleToggle lsp_references -" Only set if you have telescope installed -" nnoremap gpr lua require('goto-preview').goto_preview_references() -" help/history + nmap hc :Commands +nmap hh :Helptags nmap hk :Maps -" insert snippets + nmap isp :-1read $HOME/Templates/python.py4jw -" any jump plugin + nmap j :AnyJump + +nmap K :lua vim.lsp.buf.hover() + nmap n :NvimTreeToggle -" toggle/open + nmap ob :FloatermNew --title=bpytop --opener=vsplit bpytop nmap od :FloatermNew --title=lazydocker --opener=vsplit lazydocker nmap on :FloatermNew --title=ncmpcpp --opener=vsplit ncmpcpp nmap oo :OverCommandLine nmap or :FloatermNew --title=ranger --opener=vsplit ranger --cmd="cd $PWD" -" nmap ot :vertical botright ter ++kill=terminal ++close nmap ot :FloatermNew --title=floaterm --name=vsplit-term --wintype=vsplit --position=botright --width=0.5 -" refresh nvimtree for now + nmap r :NvimTreeRefresh -" search + +nmap sl :SessionLoad +nmap ss :SessionSave +nmap sF :AllFiles nmap sc :nohls nmap sf :Files -nmap sF :AllFiles -" toggle coc outline -nmap to :SymbolsOutline -" terminal -nmap tt :FloatermToggle vsplit-term -nmap :wa:FloatermToggle floatingterm -" for toggling/hiding the vsplit-term -tnoremap tt :FloatermToggle vsplit-term -tnoremap :FloatermToggle floatingterm -tnoremap +nmap sh :History: +nmap s/ :History/ -nnoremap xx TroubleToggle -nnoremap xw TroubleToggle workspace_diagnostics -nnoremap xd TroubleToggle document_diagnostics -nnoremap xq TroubleToggle quickfix -nnoremap xl TroubleToggle loclist - -nmap ss :SessionSave -nmap sl :SessionLoad -nnoremap fh :DashboardFindHistory -" search fzf, refs, impls, defs -nmap ff :CocCommand fzf-preview.ProjectFiles -" nnoremap ff :DashboardFindFile nnoremap tc :DashboardChangeColorscheme -nnoremap fa :DashboardFindWord -nnoremap fb :DashboardJumpMark -nnoremap cn :DashboardNewFile +nmap to :SymbolsOutline +nmap tt :FloatermToggle vsplit-term + +nnoremap xd TroubleToggle document_diagnostics +nnoremap xl TroubleToggle loclist +nnoremap xq TroubleToggle quickfix +nnoremap xw TroubleToggle workspace_diagnostics +nnoremap xx TroubleToggle diff --git a/nvim/plugin-confs/git-blame.lua b/nvim/plugin-confs/git-blame.lua new file mode 100644 index 0000000..8bdf974 --- /dev/null +++ b/nvim/plugin-confs/git-blame.lua @@ -0,0 +1,2 @@ +vim.g.gitblame_highlight_group = "Question" +vim.g.gitblame_enabled = 0 diff --git a/nvim/plugin-confs/gitsigns.lua b/nvim/plugin-confs/gitsigns.lua new file mode 100644 index 0000000..35ad93e --- /dev/null +++ b/nvim/plugin-confs/gitsigns.lua @@ -0,0 +1,43 @@ +require('gitsigns').setup { + signs = { + add = {hl = 'GitSignsAdd' , text = '│', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, + change = {hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, + delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, + topdelete = {hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, + changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, + }, + 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 = { + interval = 1000, + 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_opts = { + relative_time = false + }, + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, + preview_config = { + -- Options passed to nvim_open_win + border = 'single', + style = 'minimal', + relative = 'cursor', + row = 0, + col = 1 + }, + yadm = { + enable = false + }, +} diff --git a/nvim/plugin-confs/goto-preview.lua b/nvim/plugin-confs/goto-preview.lua index 2bbc509..ef8aa7d 100644 --- a/nvim/plugin-confs/goto-preview.lua +++ b/nvim/plugin-confs/goto-preview.lua @@ -1,10 +1,10 @@ require('goto-preview').setup { width = 120; -- Width of the floating window - height = 15; -- Height of the floating window + height = 20; -- Height of the floating window border = {"↖", "─" ,"┐", "│", "┘", "─", "└", "│"}; -- Border characters of the floating window default_mappings = false; -- Bind default mappings debug = false; -- Print debug information - opacity = nil; -- 0-100 opacity level of the floating window where 100 is fully transparent. + opacity = 25; -- 0-100 opacity level of the floating window where 100 is fully transparent. resizing_mappings = false; -- Binds arrow keys to resizing the floating window. post_open_hook = nil; -- A function taking two arguments, a buffer and a window to be ran as a hook. references = { -- Configure the telescope UI for slowing the references cycling window. @@ -13,6 +13,6 @@ require('goto-preview').setup { -- These two configs can also be passed down to the goto-preview definition and implementation calls for one off "peak" functionality. focus_on_open = true; -- Focus the floating window when opening it. dismiss_on_move = false; -- Dismiss the floating window when moving the cursor. - force_close = true, -- passed into vim.api.nvim_win_close's second argument. See :h nvim_win_close + force_close = false, -- passed into vim.api.nvim_win_close's second argument. See :h nvim_win_close bufhidden = "wipe", -- the bufhidden option to set on the floating window. See :h bufhidden } diff --git a/nvim/plugin-confs/lspconfig.lua b/nvim/plugin-confs/lspconfig.lua index 354a31e..d4a8a28 100644 --- a/nvim/plugin-confs/lspconfig.lua +++ b/nvim/plugin-confs/lspconfig.lua @@ -12,31 +12,33 @@ local on_attach = function(client, bufnr) -- Mappings. -- See `:help vim.lsp.*` for documentation on any of the below functions - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', 'lua vim.lsp.buf.declaration()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', 'lua vim.lsp.buf.definition()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', 'lua vim.lsp.buf.hover()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', 'lua vim.lsp.buf.implementation()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', '', 'lua vim.lsp.buf.signature_help()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'D', 'lua vim.lsp.buf.type_definition()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'rn', 'lua vim.lsp.buf.rename()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'ca', 'lua vim.lsp.buf.code_action()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', 'lua vim.lsp.buf.references()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'f', 'lua vim.lsp.buf.formatting()', opts) - if client.resolved_capabilities.document_highlight then - vim.cmd [[ - hi! LspReferenceRead cterm=bold ctermbg=red guibg=LightYellow - hi! LspReferenceText cterm=bold ctermbg=red guibg=LightYellow - hi! LspReferenceWrite cterm=bold ctermbg=red guibg=LightYellow - augroup lsp_document_highlight - autocmd! * - autocmd! CursorHold lua vim.lsp.buf.document_highlight() - autocmd! CursorMoved lua vim.lsp.buf.clear_references() - augroup END - ]] - end + -- set in ~/.config/nvim/keybindings.vim + -- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', 'lua vim.lsp.buf.declaration()', opts) + -- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', 'lua vim.lsp.buf.definition()', opts) + -- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', 'lua vim.lsp.buf.hover()', opts) + -- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', 'lua vim.lsp.buf.implementation()', opts) + -- vim.api.nvim_buf_set_keymap(bufnr, 'n', '', 'lua vim.lsp.buf.signature_help()', opts) + -- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) + -- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) + -- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) + -- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'D', 'lua vim.lsp.buf.type_definition()', opts) + -- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'rn', 'lua vim.lsp.buf.rename()', opts) + -- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'ca', 'lua vim.lsp.buf.code_action()', opts) + -- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', 'lua vim.lsp.buf.references()', opts) + -- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'f', 'lua vim.lsp.buf.formatting()', opts) + -- highlighting things under cursor + -- if client.resolved_capabilities.document_highlight then + -- vim.cmd [[ + -- hi! LspReferenceRead cterm=bold ctermbg=red guibg=LightYellow + -- hi! LspReferenceText cterm=bold ctermbg=red guibg=LightYellow + -- hi! LspReferenceWrite cterm=bold ctermbg=red guibg=LightYellow + -- augroup lsp_document_highlight + -- autocmd! * + -- autocmd! CursorHold lua vim.lsp.buf.document_highlight() + -- autocmd! CursorMoved lua vim.lsp.buf.clear_references() + -- augroup END + -- ]] + -- end end vim.cmd [[autocmd! ColorScheme * highlight NormalFloat guibg=#1f2335]] @@ -109,7 +111,7 @@ vim.diagnostic.config({ signs = true, underline = true, update_in_insert = false, - severity_sort = false, + severity_sort = true, }) local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } diff --git a/nvim/plugin-confs/null-ls.lua b/nvim/plugin-confs/null-ls.lua index 78cecbd..f88849f 100644 --- a/nvim/plugin-confs/null-ls.lua +++ b/nvim/plugin-confs/null-ls.lua @@ -14,6 +14,7 @@ require("null-ls").setup({ end, sources = { require("null-ls").builtins.completion.spell, + require("null-ls").builtins.code_actions.gitsigns, require("null-ls").builtins.formatting.shfmt.with({ filetypes = {"sh", "bash"}, extra_args = { "-i", "4", "-ci", "-sr" }