From 470741071d6ebbb971198049dfa4950bc63d2d79 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Fri, 21 Jan 2022 17:41:25 -0800 Subject: [PATCH] nvim: add indent-blankline.nvim, committia, conflict-marker, and modify listchars --- .config/nvim/lua/blake/other.lua | 17 +++++++++ .config/nvim/lua/blake/plugins.lua | 55 +++++++++++++++-------------- .config/nvim/lua/blake/settings.lua | 3 +- 3 files changed, 47 insertions(+), 28 deletions(-) diff --git a/.config/nvim/lua/blake/other.lua b/.config/nvim/lua/blake/other.lua index 48e092c..42e4e13 100644 --- a/.config/nvim/lua/blake/other.lua +++ b/.config/nvim/lua/blake/other.lua @@ -169,6 +169,23 @@ M.neoscroll = function() end -- <<< +-- indent_blankline >>> +M.indent_blankline = function() + vim.cmd [[ + let g:indent_blankline_show_first_indent_level = v:true + let g:indent_blankline_show_foldtext = v:false + let g:indent_blankline_buftype_exclude = ['terminal'] + let g:indent_blankline_use_treesitter = v:true + let g:indent_blankline_show_current_context = v:true + ]] + require("indent_blankline").setup { + -- for example, context is off by default, use this to turn it on + show_current_context = true, + show_current_context_start = true, + } +end +-- <<< + -- ZenMode >>> M.zenmode = function() -- map :ZM to :ZenMode diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index 284586a..24b9dd5 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -223,19 +223,14 @@ return require('packer').startup({function() -- 'ggandor/lightspeed.nvim', -- } use { -- indentline: Line indent indicators - 'Yggdroot/indentLine', + 'lukas-reineke/indent-blankline.nvim', config = function() - vim.cmd [[ - let g:indentLine_char = '▏' - let g:indentLine_conceallevel = 1 - let g:indentLine_fileTypeExclude = ['markdown', 'help', 'packer'] - autocmd TermOpen * IndentLinesDisable - ]] + require('blake.other').indent_blankline() end } - use { -- targets.vim: fix ci' and other things to work right - 'wellle/targets.vim', - } + -- use { -- targets.vim: fix ci' and other things to work right + -- 'wellle/targets.vim', + -- } -- Conveniences use { -- Ghost: Web browser integration @@ -250,26 +245,29 @@ return require('packer').startup({function() vim.api.nvim_set_keymap('n', '', 'UndotreeToggle', { noremap = true, silent = true, }) end } --- use { -- Dim inactive window --- 'sunjon/shade.nvim', --- config = function() --- require'shade'.setup({ --- overlay_opacity = 50, --- opacity_step = 1, --- keys = { --- brightness_up = '', --- brightness_down = '', --- toggle = 's', --- } --- }) --- end --- } + -- use { -- Dim inactive window + -- 'sunjon/shade.nvim', + -- config = function() + -- require'shade'.setup({ + -- overlay_opacity = 50, + -- opacity_step = 1, + -- keys = { + -- brightness_up = '', + -- brightness_down = '', + -- toggle = 's', + -- } + -- }) + -- end + -- } use { -- Quote pairing 'windwp/nvim-autopairs', config = function() require('nvim-autopairs').setup() end } + use { -- accelerated jk movement + 'rhysd/accelerated-jk' + } use { -- Alignment 'junegunn/vim-easy-align', } @@ -284,10 +282,8 @@ return require('packer').startup({function() -- Only calculate commentstring for tsx filetypes if vim.bo.filetype == 'typescriptreact' then local U = require('Comment.utils') - -- Detemine whether to use linewise or blockwise commentstring local type = ctx.ctype == U.ctype.line and '__default' or '__multiline' - -- Determine the location where to calculate commentstring from local location = nil if ctx.ctype == U.ctype.block then @@ -295,7 +291,6 @@ return require('packer').startup({function() elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then location = require('ts_context_commentstring.utils').get_visual_start_location() end - return require('ts_context_commentstring.internal').calculate_commentstring({ key = type, location = location, @@ -305,6 +300,12 @@ return require('packer').startup({function() } end } + use { -- rhysd: committia: better commit editing window + 'rhysd/committia.vim', + } + use { -- rhysd: conflict-marker: mark git conflicts - [x ]x + 'rhysd/conflict-marker.vim', + } -- use { -- lewis6991: spellsitter: Spell checking in treesitter files -- 'lewis6991/spellsitter.nvim', -- config = function() diff --git a/.config/nvim/lua/blake/settings.lua b/.config/nvim/lua/blake/settings.lua index 50c2755..e422cc2 100644 --- a/.config/nvim/lua/blake/settings.lua +++ b/.config/nvim/lua/blake/settings.lua @@ -38,7 +38,8 @@ set.showcmd = true set.signcolumn = 'yes' set.makeprg = 'make -j$(nproc)' set.ruler = false -set.listchars = "eol:↴,trail:~,tab:'»',nbsp:␣,space:·" +set.listchars = "trail:~,tab:│ ,nbsp:␣,lead:·,extends:…,precedes:…" +set.list = false ---------------------------------------------- --- Key bindings (needs to be translated?) ---