From: Huck Boles Date: Wed, 19 Apr 2023 00:37:44 +0000 (-0500) Subject: help window autocommand X-Git-Url: https://git.huck.website/?a=commitdiff_plain;h=0dfcdc0696b9556190034e31dd5483f413c99b36;p=nvim.git help window autocommand --- diff --git a/init.lua b/init.lua index 6641e8d..62d51f8 100644 --- a/init.lua +++ b/init.lua @@ -35,4 +35,5 @@ require("lazy").setup("plugins", { require('settings') require('map') +require('functions') require('theme') diff --git a/lua/functions.lua b/lua/functions.lua new file mode 100644 index 0000000..e7bb86f --- /dev/null +++ b/lua/functions.lua @@ -0,0 +1,6 @@ +vim.api.nvim_create_autocmd("BufWinEnter", { + pattern = { "*.txt" }, + callback = function() + if vim.o.filetype == 'help' then vim.cmd.wincmd("L") end + end +}) diff --git a/lua/map.lua b/lua/map.lua index 7edea0a..a04ee37 100644 --- a/lua/map.lua +++ b/lua/map.lua @@ -2,7 +2,7 @@ vim.keymap.set( 'n', 'h', ":vsplit " ) vim.keymap.set( 'n', 'v', ":split " ) vim.keymap.set( 'n', 't', ':tabnew ' ) -vim.keymap.set( 'n', 'B', 'bnext' ) +vim.keymap.set( 'n', 'b', 'bnext' ) -- move through virtual lines vim.keymap.set( 'n', 'j', 'gj' ) diff --git a/lua/plugins.lua b/lua/plugins.lua index ac3c652..8df9510 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -23,18 +23,11 @@ return { -- end -- }, - { - 'junegunn/fzf', - keys = { - { 'H', "call fzf#run({ 'sink': 'vertical botright split', 'window': { 'width': 0.9, 'height': 0.6, 'relative': v:true} })" }, - { 'V', "call fzf#run({ 'sink': 'botright split', 'window': { 'width': 0.9, 'height': 0.6, 'relative': v:true} })" }, - {'T', "call fzf#run({ 'sink': 'tabnew', 'window': { 'width': 0.9, 'height': 0.6, 'relative': v:true} })"}, - }, - }, - { 'junegunn/fzf.vim', - dependencies = {'fzf'}, + dependencies = { + 'junegunn/fzf' + }, keys = { { 'f', 'GFiles' }, { 'F', 'Files' }, diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 42bc60e..5841a8a 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -22,9 +22,9 @@ return { mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, diff --git a/lua/settings.lua b/lua/settings.lua index 25c5792..310b5d3 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -42,7 +42,7 @@ vim.o.expandtab = true vim.o.shiftround = true vim.o.showcmd = true -vim.o.cmdheight = 1 +vim.o.cmdheight = 0 vim.o.cmdwinheight = 10 vim.o.backupdir = '/home/huck/.local/state/nvim/backup'