Set window title in Neovim, unset in Zsh preprompt
This commit is contained in:
parent
074b29c7a1
commit
90ac84a759
|
@ -36,6 +36,27 @@ vim.keymap.set('n', '<leader>fb', tbuiltin.buffers, {})
|
||||||
vim.keymap.set('n', '<leader>fh', tbuiltin.help_tags, {})
|
vim.keymap.set('n', '<leader>fh', tbuiltin.help_tags, {})
|
||||||
vim.keymap.set('n', '<leader>fs', tbuiltin.spell_suggest, {})
|
vim.keymap.set('n', '<leader>fs', tbuiltin.spell_suggest, {})
|
||||||
|
|
||||||
|
-- set terminal title
|
||||||
|
function _G.current_tab()
|
||||||
|
local curr_buf = vim.fn.bufnr()
|
||||||
|
local total = 0
|
||||||
|
local curr_tab
|
||||||
|
|
||||||
|
for i = 1, vim.fn.tabpagenr('$') do
|
||||||
|
total = total + 1
|
||||||
|
for _, bufnr in ipairs(vim.fn.tabpagebuflist(i)) do
|
||||||
|
if bufnr == curr_buf then
|
||||||
|
curr_tab = i
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return string.format('(%d of %d)', curr_tab, total)
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.opt.title = true
|
||||||
|
vim.opt.titlestring = [[%f %h%m%r%w - %{v:progname} %{luaeval('current_tab()')}]]
|
||||||
|
|
||||||
-- vimsense (rich presence) options
|
-- vimsense (rich presence) options
|
||||||
vim.g.vimsense_small_text = "NeoVim"
|
vim.g.vimsense_small_text = "NeoVim"
|
||||||
vim.g.vimsense_small_image = "neovim"
|
vim.g.vimsense_small_image = "neovim"
|
||||||
|
|
6
zsh.nix
6
zsh.nix
|
@ -21,6 +21,12 @@
|
||||||
fi
|
fi
|
||||||
export NOTESDIR="$HOME/Notes"
|
export NOTESDIR="$HOME/Notes"
|
||||||
export PATH="$HOME/.bin:$HOME/.local/bin:$NOTESDIR/bin:$PATH"
|
export PATH="$HOME/.bin:$HOME/.local/bin:$NOTESDIR/bin:$PATH"
|
||||||
|
function set_win_title(){
|
||||||
|
echo -ne "\033]0;\007"
|
||||||
|
}
|
||||||
|
|
||||||
|
precmd_functions+=(set_win_title)
|
||||||
|
|
||||||
fortune
|
fortune
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue