Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No tabs bar #1

Open
basbebe opened this issue Nov 30, 2020 · 7 comments
Open

No tabs bar #1

basbebe opened this issue Nov 30, 2020 · 7 comments

Comments

@basbebe
Copy link

basbebe commented Nov 30, 2020

Hi!
I'm trying out tabs.kak becaouse it looks promising.
However, I don't see a tab bar.

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 "enricozb/tabs.kak" %{
  set-option global modelinefmt_tabs '%val{cursor_line}:%val{cursor_char_column} {{context_info}} {{mode_info}}'
  map global user b ': enter-user-mode tabs<ret>' -docstring 'tabs'
  map global user B ': enter-user-mode -lock tabs<ret>' -docstring 'tabs (lock)'
}
# 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>
}}

## commenting

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 ' … '

@enricozb
Copy link
Owner

Thanks for sharing your kakrc, I got a few reports of this not working at all on macOS, any chance that's what you're running? If not, what environment are you on?

@basbebe
Copy link
Author

basbebe commented Nov 30, 2020

macOS 10.15.17 …

@enricozb
Copy link
Owner

enricozb commented Dec 2, 2020

Sorry for the delay, took me a while to get ahold of a mac. I just pushed 421578d which should fix your issue. Please :plug-update and tell me if it's resolved.

I'm not 100% sure I understand the issue but, I was using the extended ASCII symbol as the tab separators, but this doesn't seem to render properly on some terminals on a mac. Either way, you can configure what character you'd like the tab_separator to be now, and the default configuration is |, instead of the extended ASCII symbol, which should work out of the box.

@basbebe
Copy link
Author

basbebe commented Dec 2, 2020

Thank you!

I just tried it out and terminal.app, kitty and iterm all seem to render correctly.

The update didn't make a difference in my case I'm afraid.

But what I noticed is that when I use tabs.kak to got to next or previous buffer, my powerline plugin stops working afterwards.

@enricozb
Copy link
Owner

enricozb commented Dec 2, 2020

When I tested it out, the kitty and terminal.app render without issue, but they have bizarre behavior when I insert in the statusline. They render ~T~B, which look like ncurses locale errors. Either way, the tabs still don't appear for you? Can you send a screenshot of your statusline when opening a file? Also I'm almost certain that tabs.kak won't work with the powerline plugin. Both tabs.kak and powerline.kak do some mangling of modelinefmt.

I don't use powerline.kak so I didn't build this around it. I'll try to see how hard it is to get tabs.kak working with powerline, but it's unlikely that both of them combined would be that great of an experience.

It's likely that the tabs aren't appearing because of powerline.kak. If you can try unloading powerline.kak and seeing if tabs.kak shows up, you could confirm this.

@basbebe
Copy link
Author

basbebe commented Dec 2, 2020

Thus is what my window with powerline looks like:
Bildschirmfoto 2020-12-02 um 13 44 38

With powerline disabled and tabs installed it still looks like this:
Bildschirmfoto 2020-12-02 um 13 48 49
Bildschirmfoto 2020-12-02 um 13 52 30
Bildschirmfoto 2020-12-02 um 13 53 08

Curiously, if I have tabs and powerline installed, it also looks like this (as if powerline wasn't there) after the first tab switch.

@enricozb
Copy link
Owner

enricozb commented Dec 2, 2020

Ok so, powerline likely sets up a modelinefmt once, whereas I override it for each buffer, and periodically due to some hooks (when buffers close or new ones open). Kakoune has only a single status line. Either powerline or the tabs.kak will be there. If you check out my screenshots, you'll notice that I have no statusline at the bottom, that's because I moved the statusline to the top using set global ui_options ncurses_status_on_top=yes.

In your last three screenshots, this is the correct behavior. The tabs will take up space on the statusline.

It might get crowded with powerline.kak, but I'll spend some time to see how easily they can work together.

So, for now, powerline.kak and tabs.kak are incompatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants