Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ A beautiful toggleable floating window for managing terminal buffers within Neov
}
```

## Border styles
To change border style, use
```lua

{
border = true -- Defaults to "single". Set to "rounded" or "double" for those styles.
}
```

## Mappings

This are the mappings for sidebar
Expand Down
15 changes: 10 additions & 5 deletions lua/floaterm/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ M.open = function()
local usr_terms = type(conf.terminals) == "table" and conf.terminals or conf.terminals()
state.terminals = state.terminals or vim.tbl_deep_extend("force", {}, usr_terms)

local border_style = "single"
if type(state.config.border) == "string" then
border_style = state.config.border
end

utils.gen_term_bufs()
state.buf = state.buf or state.terminals[1].buf

Expand All @@ -30,8 +35,8 @@ M.open = function()

local sidebar_w = 20

if conf.position then
conf.position = type(conf.position) == 'table' and conf.position or conf.position()
if conf.position then
conf.position = type(conf.position) == "table" and conf.position or conf.position()
end

local pos_row = conf.position and conf.position.row or (vim.o.lines / 2 - state.h / 2) - 1
Expand All @@ -44,7 +49,7 @@ M.open = function()
height = state.h,
relative = "editor",
style = "minimal",
border = "single",
border = border_style,
zindex = 100,
}

Expand All @@ -69,7 +74,7 @@ M.open = function()
height = state.h - 3,
relative = "win",
style = "minimal",
border = bordered and "single" or colored_border,
border = bordered and border_style or colored_border,
zindex = 100,
}

Expand All @@ -83,7 +88,7 @@ M.open = function()
height = 1,
relative = "win",
style = "minimal",
border = "single",
border = border_style,
zindex = 100,
}

Expand Down