Skip to content

Commit

Permalink
feat: add border config for SSH and keymaps help window (#299)
Browse files Browse the repository at this point in the history
* feat: add config for ssh window border

* chore: add documentation for ssh window border

* feat: add config for keymaps help window border

* chore: add documentatoin for keymaps help window border
  • Loading branch information
iamreinder authored Feb 20, 2024
1 parent bf753c3 commit e27cc4e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ require("oil").setup({
["g."] = "actions.toggle_hidden",
["g\\"] = "actions.toggle_trash",
},
-- Configuration for the floating keymaps help window
keymaps_help = {
border = "rounded",
},
-- Set to false to disable all of the above keymaps
use_default_keymaps = true,
view_options = {
Expand Down Expand Up @@ -268,6 +272,10 @@ require("oil").setup({
winblend = 0,
},
},
-- Configuration for the floating SSH window
ssh = {
border = "rounded",
},
})
```

Expand Down
8 changes: 8 additions & 0 deletions doc/oil.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ CONFIG *oil-confi
["g."] = "actions.toggle_hidden",
["g\\"] = "actions.toggle_trash",
},
-- Configuration for the floating keymaps help window
keymaps_help = {
border = "rounded",
},
-- Set to false to disable all of the above keymaps
use_default_keymaps = true,
view_options = {
Expand Down Expand Up @@ -159,6 +163,10 @@ CONFIG *oil-confi
winblend = 0,
},
},
-- Configuration for the floating SSH window
ssh = {
border = "rounded",
},
})
<

Expand Down
3 changes: 2 additions & 1 deletion lua/oil/adapters/ssh/connection.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local config = require("oil.config")
local layout = require("oil.layout")
local util = require("oil.util")

Expand Down Expand Up @@ -277,7 +278,7 @@ function SSHConnection:open_terminal()
row = row,
col = col,
style = "minimal",
border = "rounded",
border = config.ssh.border,
})
vim.cmd.startinsert()
end
Expand Down
8 changes: 8 additions & 0 deletions lua/oil/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ local default_config = {
["g."] = "actions.toggle_hidden",
["g\\"] = "actions.toggle_trash",
},
-- Configuration for the floating keymaps help window
keymaps_help = {
border = "rounded",
},
-- Set to false to disable all of the above keymaps
use_default_keymaps = true,
view_options = {
Expand Down Expand Up @@ -142,6 +146,10 @@ local default_config = {
winblend = 0,
},
},
-- Configuration for the floating SSH window
ssh = {
border = "rounded",
},
}

-- The adapter API hasn't really stabilized yet. We're not ready to advertise or encourage people to
Expand Down
3 changes: 2 additions & 1 deletion lua/oil/keymap_util.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local actions = require("oil.actions")
local config = require("oil.config")
local layout = require("oil.layout")
local util = require("oil.util")
local M = {}
Expand Down Expand Up @@ -111,7 +112,7 @@ M.show_help = function(keymaps)
height = math.min(editor_height, #lines),
zindex = 150,
style = "minimal",
border = "rounded",
border = config.keymaps_help.border,
})
local function close()
if vim.api.nvim_win_is_valid(winid) then
Expand Down

0 comments on commit e27cc4e

Please sign in to comment.