Skip to content

Commit

Permalink
feat: enable nushell IDE completion
Browse files Browse the repository at this point in the history
  • Loading branch information
Suya1671 committed Jun 8, 2024
1 parent ac724cf commit 9f1c1b8
Showing 1 changed file with 56 additions and 34 deletions.
90 changes: 56 additions & 34 deletions users/modules/nushell/config/config.nu
Original file line number Diff line number Diff line change
Expand Up @@ -220,30 +220,39 @@ $env.config = {
description_text: yellow
}
}
# {
# name: ide_completion_menu
# only_buffer_difference: false
# marker: "| "
# type: {
# layout: ide
# min_completion_width: 0,
# max_completion_width: 50,
# # max_completion_height: 10, # will be limited by the available lines in the terminal
# padding: 0,
# border: false,
# cursor_offset: 0,
# description_mode: "prefer_right"
# min_description_width: 0
# max_description_width: 50
# max_description_height: 10
# description_offset: 1
# }
# style: {
# text: green
# selected_text: green_reverse
# description_text: yellow
# }
# }
{
name: ide_completion_menu
only_buffer_difference: false
marker: "| "
type: {
layout: ide
min_completion_width: 0,
max_completion_width: 50,
max_completion_height: 10, # will be limited by the available lines in the terminal
padding: 0,
border: true,
cursor_offset: 0,
description_mode: "prefer_right"
min_description_width: 0
max_description_width: 50
max_description_height: 10
description_offset: 1
# If true, the cursor pos will be corrected, so the suggestions match up with the typed text
#
# C:\> str
# str join
# str trim
# str split
correct_cursor_pos: false
}
style: {
text: green
selected_text: { attr: r }
description_text: yellow
match_text: { attr: u }
selected_match_text: { attr: ur }
}
}
{
name: history_menu
only_buffer_difference: true
Expand Down Expand Up @@ -359,17 +368,30 @@ $env.config = {
]
keybindings: [
{
name: completion_menu
modifier: none
keycode: tab
mode: [emacs vi_normal vi_insert]
event: {
until: [
{ send: menu name: completion_menu }
{ send: menunext }
]
}
name: ide_completion_menu
modifier: none
keycode: tab
mode: [emacs vi_normal vi_insert]
event: {
until: [
{ send: menu name: ide_completion_menu }
{ send: menunext }
{ edit: complete }
]
}
}
# {
# name: completion_menu
# modifier: none
# keycode: tab
# mode: [emacs vi_normal vi_insert]
# event: {
# until: [
# { send: menu name: completion_menu }
# { send: menunext }
# ]
# }
# }
{
name: completion_previous
modifier: shift
Expand Down

0 comments on commit 9f1c1b8

Please sign in to comment.