diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-04-24 23:22:53 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-04-24 23:22:53 +0900 |
| commit | 80dc4c043549c21777d98bf7b76472c478bce3be (patch) | |
| tree | c0323837ddf8c6df3b787cfdb7900cfd15a081cc | |
| parent | bce8fa266790766fe6b039e96c9b43ca4dd2ae46 (diff) | |
| download | dotfiles-80dc4c043549c21777d98bf7b76472c478bce3be.tar.gz dotfiles-80dc4c043549c21777d98bf7b76472c478bce3be.tar.zst dotfiles-80dc4c043549c21777d98bf7b76472c478bce3be.zip | |
nvim: set laststatus=3
| -rw-r--r-- | .config/nvim/lua/init/01-options.lua | 5 | ||||
| -rw-r--r-- | .config/nvim/lua/init/04-mappings.lua | 32 | ||||
| -rw-r--r-- | .config/nvim/lua/init/05-appearance.lua | 69 |
3 files changed, 55 insertions, 51 deletions
diff --git a/.config/nvim/lua/init/01-options.lua b/.config/nvim/lua/init/01-options.lua index 3eb813a..14255ea 100644 --- a/.config/nvim/lua/init/01-options.lua +++ b/.config/nvim/lua/init/01-options.lua @@ -45,6 +45,11 @@ O.colorcolumn = '+1' OPT.spelloptions:append('camel') +-- Statusline {{{1 + +O.laststatus = 3 + + -- Multiple windows {{{1 O.winminheight = 0 diff --git a/.config/nvim/lua/init/04-mappings.lua b/.config/nvim/lua/init/04-mappings.lua index e9db72e..747cf93 100644 --- a/.config/nvim/lua/init/04-mappings.lua +++ b/.config/nvim/lua/init/04-mappings.lua @@ -331,27 +331,29 @@ K.set('n', 'tg', choose_window_interactively) K.set('n', 'T', '<Nop>') K.set('n', 'Ta', '<Cmd>AutosaveToggle<CR>') -K.set('n', 'Tb', ':<C-u>if &background == "dark" <Bar>set background=light <Bar>else <Bar>set background=dark <Bar>endif<CR>', { silent=true }) -K.set('n', 'Tc', ':<C-u>set cursorcolumn! <Bar>set cursorline!<CR>', { silent=true }) -K.set('n', 'Td', ':<C-u>if &diff <Bar>diffoff <Bar>else <Bar>diffthis <Bar>endif<CR>', { silent=true }) +K.set('n', 'Tb', '<Cmd>if &background == "dark" <Bar>set background=light <Bar>else <Bar>set background=dark <Bar>endif<CR>') +K.set('n', 'Tc', '<Cmd>set cursorcolumn! <Bar>set cursorline!<CR>') +K.set('n', 'Td', '<Cmd>if &diff <Bar>diffoff <Bar>else <Bar>diffthis <Bar>endif<CR>') K.set('n', 'Te', '<Cmd>set expandtab!<CR>') K.set('n', 'Th', '<Cmd>set hlsearch!<CR>') +K.set('n', 'Tl', '<Cmd>if &laststatus ==# 3 <Bar>set laststatus=2 <Bar>else <Bar>set laststatus=3 <Bar>endif<CR>') K.set('n', 'Tn', '<Cmd>set number!<CR>') K.set('n', 'Ts', '<Cmd>set spell!<CR>') -K.set('n', 'T8', ':<C-u>if &textwidth ==# 80 <Bar>set textwidth=0 <Bar>else <Bar>set textwidth=80 <Bar>endif<CR>', { silent=true }) -K.set('n', 'T0', ':<C-u>if &textwidth ==# 100 <Bar>set textwidth=0 <Bar>else <Bar>set textwidth=100 <Bar>endif<CR>', { silent=true }) -K.set('n', 'T2', ':<C-u>if &textwidth ==# 120 <Bar>set textwidth=0 <Bar>else <Bar>set textwidth=120 <Bar>endif<CR>', { silent=true }) +K.set('n', 'T8', '<Cmd>if &textwidth ==# 80 <Bar>set textwidth=0 <Bar>else <Bar>set textwidth=80 <Bar>endif<CR>') +K.set('n', 'T0', '<Cmd>if &textwidth ==# 100 <Bar>set textwidth=0 <Bar>else <Bar>set textwidth=100 <Bar>endif<CR>') +K.set('n', 'T2', '<Cmd>if &textwidth ==# 120 <Bar>set textwidth=0 <Bar>else <Bar>set textwidth=120 <Bar>endif<CR>') K.set('n', 'Tw', '<Cmd>set wrap!<CR>') -K.set('n', 'TA', 'Ta', { remap=true }) -K.set('n', 'TB', 'Tb', { remap=true }) -K.set('n', 'TC', 'Tc', { remap=true }) -K.set('n', 'TD', 'Td', { remap=true }) -K.set('n', 'TE', 'Te', { remap=true }) -K.set('n', 'TH', 'Th', { remap=true }) -K.set('n', 'TN', 'Tn', { remap=true }) -K.set('n', 'TS', 'Ts', { remap=true }) -K.set('n', 'TW', 'Tw', { remap=true }) +K.set('n', 'TA', 'Ta', { remap = true }) +K.set('n', 'TB', 'Tb', { remap = true }) +K.set('n', 'TC', 'Tc', { remap = true }) +K.set('n', 'TD', 'Td', { remap = true }) +K.set('n', 'TE', 'Te', { remap = true }) +K.set('n', 'TH', 'Th', { remap = true }) +K.set('n', 'TL', 'Tl', { remap = true }) +K.set('n', 'TN', 'Tn', { remap = true }) +K.set('n', 'TS', 'Ts', { remap = true }) +K.set('n', 'TW', 'Tw', { remap = true }) diff --git a/.config/nvim/lua/init/05-appearance.lua b/.config/nvim/lua/init/05-appearance.lua index 1c9c396..14968c5 100644 --- a/.config/nvim/lua/init/05-appearance.lua +++ b/.config/nvim/lua/init/05-appearance.lua @@ -19,7 +19,7 @@ function vimrc.statusline.build() if not is_active then return ' ' .. fname end - local mode, mode_hl = vimrc.statusline.mode() + local mode = vimrc.statusline.mode() local ro = vimrc.statusline.readonly(bufnr) local mod = vimrc.statusline.modified(bufnr) local extra_info = vimrc.statusline.extra_info(bufnr, winid) @@ -29,8 +29,7 @@ function vimrc.statusline.build() local ff = vimrc.statusline.ff(bufnr) local ft = vimrc.statusline.filetype(bufnr) return string.format( - '%%#statusLineMode%s# %s %%#statusLine# %s%s%s %%= %s%s %s%s%s %s ', - mode_hl, + ' %s %s%s%s %%= %s%s %s%s%s %s ', mode, ro and ro .. ' ' or '', fname, @@ -45,39 +44,37 @@ end function vimrc.statusline.mode() local mode_map = { - n = { 'N', 'Normal' }, - no = { 'O', 'Operator' }, - nov = { 'Oc', 'Operator' }, - noV = { 'Ol', 'Operator' }, - [vimrc.term('no<C-v>')] = { 'Ob', 'Operator' }, - niI = { 'In', 'Insert' }, - niR = { 'Rn', 'Replace' }, - niV = { 'Rn', 'Replace' }, - v = { 'V', 'Visual' }, - V = { 'Vl', 'Visual' }, - [vimrc.term('<C-v>')] = { 'Vb', 'Visual' }, - s = { 'S', 'Visual' }, - S = { 'Sl', 'Visual' }, - [vimrc.term('<C-s>')] = { 'Sb', 'Visual' }, - i = { 'I', 'Insert' }, - ic = { 'I?', 'Insert' }, - ix = { 'I?', 'Insert' }, - R = { 'R', 'Replace' }, - Rc = { 'R?', 'Replace' }, - Rv = { 'R', 'Replace' }, - Rx = { 'R?', 'Replace' }, - c = { 'C', 'Command' }, - cv = { 'C', 'Command' }, - ce = { 'C', 'Command' }, - r = { '-', 'Other' }, - rm = { '-', 'Other' }, - ['r?'] = { '-', 'Other' }, - ['!'] = { '-', 'Other' }, - t = { 'T', 'Terminal' }, + n = 'N', + no = 'O', + nov = 'Oc', + noV = 'Ol', + [vimrc.term('no<C-v>')] = 'Ob', + niI = 'In', + niR = 'Rn', + niV = 'Rn', + v = 'V', + V = 'Vl', + [vimrc.term('<C-v>')] = 'Vb', + s = 'S', + S = 'Sl', + [vimrc.term('<C-s>')] = 'Sb', + i = 'I', + ic = 'I?', + ix = 'I?', + R = 'R', + Rc = 'R?', + Rv = 'R', + Rx = 'R?', + c = 'C', + cv = 'C', + ce = 'C', + r = '-', + rm = '-', + ['r?'] = '-', + ['!'] = '-', + t = 'T', } - local vim_mode_and_hl = mode_map[F.mode(true)] or { '-', 'Other' } - local vim_mode = vim_mode_and_hl[1] - local hl = vim_mode_and_hl[2] + local vim_mode = mode_map[F.mode(true)] or '-' local skk_mode if F.exists('*skkeleton#mode') == 1 then @@ -92,7 +89,7 @@ function vimrc.statusline.mode() skk_mode = '' end - return vim_mode .. skk_mode, hl + return vim_mode .. skk_mode end function vimrc.statusline.readonly(bufnr) |
