mirror of
https://github.com/mawww/kakoune.git
synced 2026-11-04 14:06:36 +01:00
Page:
The window scope
Pages
Ambiguous Keys
Annotated examples of "Kakoune script"
Avoid the escape key
Bar
Bc
Building
Clang
Community
Ctags
Distinguish between focused and unfocused clients in Tmux
Documenting Plugins
Dynamic Window Title
EditorConfig
Eval Exec
Fuzzy finder
Git integration via Tig
Grep
HTML editing
Hacking
Header files
Highlighters
Home
IDE
Implementing user mode
Increment and Decrement
Indentation and Tabulation
Info boxes
Installing Plugins
Integrating Other CLI apps
JSON RPC
Jumplist
Kak daemon helper : 1 session per project
Languages
Line flags
Manipulating dates with Chronic
Migrating from Vim popular plugins
Migrating from Vim
Normal mode commands
OpenBSD
Plugin Managers
Qalculate
Ranger
Readline
Regex
Registers & Clipboard
Registers Clipboard
Reverse search
Running commands at startup
Rust
Selections combinations
Selections
Setting Plugin Options
Shell scripting
Status line
String syntax
TUI
The window scope
Tips for building from source
Undo tree
Wc
Windows tips
Wrapping
Writing Plugins
kak ‐p
macOS tips
zsh zle
No results
1
The window scope
Dan Rosén edited this page 2018-06-01 11:07:26 +03:00
What is the window scope? It is actually not a window from a client, but a view of a buffer. mawww writes this on IRC May 3 2017:
09:26 < danr> mawww: in what order are options looked for if they are defined in different scopes?
09:26 < danr> buffer, then window then global?
09:26 < mawww> window -> buffer -> global
09:26 < danr> What is the 'current' scope?
09:27 < danr> Oh, window first?
09:27 < mawww> A window is not a client
09:27 < mawww> a window is linked to a buffer, the window's buffer never changes
09:28 < danr> Oh so WinCreate means... a new view into one and the same buffer forever?
09:28 < mawww> when you switch to a buffer, Kakoune tries to find a free window on that buffer, and then displays it in a client
09:28 < danr> I thought it meant new client ;)
09:28 < mawww> yeah, window was a bad choice of name for that
09:29 < mawww> so, there is a N:1 relationship between windows and buffers
09:29 < danr> So you might get a different 'window' when switching using many clients?
09:30 < mawww> Yep, if you have two clients displaying the same buffer, then you have two windows
09:30 < mawww> a window stores a set of selections as well
09:31 < mawww> so when you switch back to a buffer, you usually get back to the selections and window position on the buffer you had
09:31 < ironzorg> that makes sense, e.g. for collaborative editing or even as a tool (different highlighters of the same data)
09:31 < danr> Ah, I see: I got two clients to change the 'window' (and their cursors) by switching around buffers
09:32 < danr> I thought the selections were bound to the client somehow
09:32 < danr> So not much is bound to the clients, I presume?
09:32 < mawww> Yep, as windows options are looked up first, you can have a window on a buffer using one filetype, and another
window on the same buffer using another filetype
09:33 < danr> oh that could potentially be handy (or confusing! :) )
09:33 < mawww> Well, in reallity the selections are bound to the client, but when a window gets hidden, we add it to a free window
list along with the selections
09:34 < mawww> and when we grab a window from the free list, we restore the associated selections
09:36 < danr> Thinking about the name, view, viewport or bufferView might be better than window
Wiki Home Page
Onboarding
Keys
- Normal mode commands
- Avoid the escape key
- Implementing user mode (Leader key)
- Kakoune explain
- Kakoune TV
Editing
User Interface
Integration with OS and other tools
- Languages
- IDE
- Bar
- Dynamic Window Title
- Kak daemon helper : 1 session per project
- Registers & Clipboard
- macOS tips
- Windows tips
- Fuzzy finders
- JSON-RPC UI
- bc
- Qalculate!
- wc
- Shell Scripting
- Manipulating dates with Chronic
- Integrating Other CLI apps
