kakounedotcom / connect.kak

Connect a program to Kakoune clients

Home Page:https://kakoune.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`connect-repl` not working

basbebe opened this issue · comments

When I try to call connect-repl I get an error and nothing happens.

Error: 1:1: 'connect-repl' 2:5: 'connect' no such command: 'repl-new'

I'm using latest versions of kakoune and connect.kak and kitty.

my kakrc:

# Plugins

# source custom plugins
source "~/git/pandoc.kak/rc/pandoc.kak"

# source plug.kak script
source "%val{config}/plugins/plug.kak/rc/plug.kak"

# call plug.kak with `plug' command
plug "robertmeta/plug.kak" noload config %{
    # configure plug.kak here
}        
plug "ul/kak-lsp" do %{
    cargo build --release --locked
    cargo install --force --path .
} config %{

    # uncomment to enable debugging
    # eval %sh{echo ${kak_opt_lsp_cmd} >> /tmp/kak-lsp.log}
    # set global lsp_cmd "kak-lsp -s %val{session} -vvv --log /tmp/kak-lsp.log"

    # this is not necessary; the `lsp-enable-window` will take care of it
    # eval %sh{${kak_opt_lsp_cmd} --kakoune -s $kak_session}

    set global lsp_diagnostic_line_error_sign '║'
    set global lsp_diagnostic_line_warning_sign '┊'

    define-command ne -docstring 'go to next error/warning from lsp' %{ lsp-find-error --include-warnings }
    define-command pe -docstring 'go to previous error/warning from lsp' %{ lsp-find-error --previous --include-warnings }
    define-command ee -docstring 'go to current error/warning from lsp' %{ lsp-find-error --include-warnings; lsp-find-error --previous --include-warnings }

    define-command lsp-restart -docstring 'restart lsp server' %{ lsp-stop; lsp-start }
    hook global WinSetOption filetype=(c|cpp|cc|rust|javascript|typescript) %{
        set-option window lsp_auto_highlight_references true
        set-option window lsp_hover_anchor false
        lsp-auto-hover-enable
        echo -debug "Enabling LSP for filtetype %opt{filetype}"
        lsp-enable-window
    }

    hook global WinSetOption filetype=(rust) %{
        set window lsp_server_configuration rust.clippy_preference="on"
    }

    hook global WinSetOption filetype=rust %{
        hook window BufWritePre .* %{
            evaluate-commands %sh{
                test -f rustfmt.toml && printf lsp-formatting-sync
            }
        }
    }

    hook global KakEnd .* lsp-exit
}

plug 'delapouite/kakoune-buffers' %{
    # Suggested hook

    hook global WinDisplay .* info-buffers

    # Suggested mappings

    map global user b ':enter-buffers-mode<ret>'              -docstring 'buffers…'
    map global user B ':enter-user-mode -lock buffers<ret>'   -docstring 'buffers (lock)…'

    # Suggested aliases

    alias global bd delete-buffer
    alias global bf buffer-first
    alias global bl buffer-last
    alias global bo buffer-only
    alias global bo! buffer-only-force
}
plug "jdugan6240/powerline.kak" defer powerline %{
    # set-option global powerline_format 'git bufname filetype mode_info line_column position'
    # powerline-toggle line_column off
    powerline-separator triangle
    powerline-theme gruvbox
} config %{
    powerline-start
}
plug "caksoylar/kakoune-smooth-scroll" config %{
     hook global WinCreate .* %{ hook -once window WinDisplay .* smooth-scroll-enable }
}
plug "alexherbo2/prelude.kak"
plug "alexherbo2/connect.kak" %{
    require-module connect
    require-module connect-nnn
}
plug 'alexherbo2/palette.kak'
plug 'occivink/kakoune-sudo-write '
plug 'evanrelf/number-toggle.kak' %{
    set-option global number_toggle_params -hlcursor
}
plug 'alexherbo2/surround.kak' %{
    require-module surround
    ## Quoting
    map -docstring 'Surround' global normal q ': enter-user-mode surround<ret>'
    map -docstring 'Surround insert' global normal Q ': surround-enter-insert-mode<ret>'

    ## Move macros to ^
    map -docstring 'Play macro' global normal ^ q
    map -docstring 'Record macro' global normal <a-^> Q
}
plug 'alexherbo2/auto-pairs.kak' %{
    require-module auto-pairs
    hook global WinCreate .* %{ auto-pairs-enable }
}
plug 'laelath/kakoune-show-matching-insert'
plug 'alexherbo2/snippets.kak'

plug "jbomanson/search-doc.kak" config %{
        require-module search-doc
}

plug "andreyorst/smarttab.kak" defer smarttab %{
    # when `backspace' is pressed, 4 spaces are deleted at once
    set-option global softtabstop 4
} config %{
    # these languages will use `expandtab' behavior
    hook global WinSetOption filetype=.* expandtab
    # these languages will use `noexpandtab' behavior
    hook global WinSetOption filetype=(makefile|gas) noexpandtab
    # these languages will use `smarttab' behavior
    hook global WinSetOption filetype=(c|cpp|java) smarttab
}
plug "andreyorst/fzf.kak"

# Key Mappings

## quick safe

map global user w -docstring 'safe file' ':w<ret>'

## edit kakrc
map global user <,> -docstring 'edit kakrc' ':e "%val{config}/kakrc"<ret>'
map global user <a-,> -docstring 'source kakrc' ':source "%val{config}/kakrc"<ret>'

map global user <a-<> -docstring 'source current buffer' ':source "%val{buffile}<ret>'

## jj to escape
hook global InsertChar j %{ try %{
  exec -draft hH <a-k>jj<ret> d
  exec <esc>
}}

## comments

map global user c -docstring '(un-)comment line' ':comment-line<ret>'
map global user C -docstring '(un-)comment block' ':comment-block<ret>'

## Mac Clipboard
hook global NormalKey y|d|c %{ nop %sh{
      printf %s "$kak_main_reg_dquote" | pbcopy
}}
map global user P -docstring 'Paste above' '!pbpaste<ret>'
map global user p -docstring 'Paste below' '<a-!>pbpaste<ret>'
map global user R -docstring 'Replace' '|pbpaste<ret>'

# general Configuration

##verbose autoinfo
set-option -add global autoinfo normal

## case insensitive search by default
map global normal / "/(?i)"

# Pandoc
set-option global pandoc_options "-d default"
 
# Appearance

colorscheme gruvbox

add-highlighter global/ number-lines -relative -hlcursor
add-highlighter global/ show-whitespaces

add-highlighter global/ line '%val{cursor_line}' default,rgb:3c3735
add-highlighter global/ column 81 default,red
add-highlighter global/ wrap -indent -word -marker ' … '

Do you have a repl-new command?

Do you have a repl-new command?

I fear I do not.

In kitty, repl-new should be aliased to kitty-repl.

hm…
kitty-repl works fine, thanks.
So should I have added an alias myself or is this a bug in kakoune?

It is automatic. Be sure the version you use has repl-new implemented.

I'm on Kakoune 2020.09.01 and I don't have repl-new implemented… 🤔
kitty-repl has the alias repl

mawww/kakoune@87f9be6

It was only commited on September 1st though – I'm not sure if it was in the release

You can get the path to the runtime directory with:

echo %val{runtime}

Try Alt + | with:

xdg-open "$kak_runtime"

and search for kitty.kak.

/usr/local/Cellar/kakoune/2020.09.01/share/kak/rc/windowing/repl/kitty.kak

[…]

alias global repl kitty-repl
alias global send-text kitty-send-text

}

@basbebe If you have the dolphin module enabled, you can even do:

dolphin %val{runtime}

and have the files to open in the client ❤️.

I guess you have to wait the next release or build master.

For the time being, just add an alias to your kakrc.

nice!
thanks for the hint.
I just used nnn %val{runtime} now!

By the way: I have a few environment variables set for nnn.
Would be nice if they were used by default by the module.

I guess you have to wait the next release or build master.

For the time being, just add an alias to your kakrc.

thanks, will do!

I rebuilt from latest head.

Now I see a short flash when the window is created (kitty) but it disappears immediately.

I think this is related to kitty since it works with tmux