[nvim,tmux] add noice, update statuslines

add noice for cmd input and notification.
Also update statuslines (vim and tmux) to now show redundant data.
This commit is contained in:
Marco Thomas
2022-10-25 23:45:41 +02:00
parent 96ef8bd3d5
commit ddcf7f4077
6 changed files with 55 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
-- Make sure to update packer with `:PackerInstall` and `:PackerSync` -- Make sure to update packer with `:PackerInstall` and `:PackerSync`
-- Treesitter with `:TSUpdate` -- Treesitter with `:TSUpdate` after every nvim update.
-- LSP with `:LSPInstall`, log with `:LSPInfo` -- LSP with `:LSPInstall`, log with `:LSPInfo`
-- --
-- Rollback possible with packer.nvim -- Rollback possible with packer.nvim

View File

@@ -26,6 +26,7 @@ telescope.setup({
map("n", "<C-f>", "<cmd> Telescope find_files hidden=true<CR>", default_opts) -- Show files map("n", "<C-f>", "<cmd> Telescope find_files hidden=true<CR>", default_opts) -- Show files
map("n", "<C-s>", "<cmd> Telescope live_grep<CR>", default_opts) -- Grep through current directory map("n", "<C-s>", "<cmd> Telescope live_grep<CR>", default_opts) -- Grep through current directory
map("n", "<C-k>", "<cmd> Telescope keymaps<CR>", default_opts) -- Show all keys map("n", "<C-k>", "<cmd> Telescope keymaps<CR>", default_opts) -- Show all keys
map("n", "<C-n>", "<cmd> Noice telescope<CR>", default_opts) -- Show all notifications
-- Telescope + LSP -- Telescope + LSP
map("n", "<leader>la", "<cmd> lua vim.lsp.buf.code_action()<CR>", default_opts) -- Apply LSP code action map("n", "<leader>la", "<cmd> lua vim.lsp.buf.code_action()<CR>", default_opts) -- Apply LSP code action
@@ -36,7 +37,7 @@ map("n", "<leader>lh", "<cmd> lua vim.lsp.buf.hover()<CR>", default_opts)
map("n", "<leader>ln", "<cmd> lua vim.lsp.buf.rename()<CR>", default_opts) -- Rename LSP symbol map("n", "<leader>ln", "<cmd> lua vim.lsp.buf.rename()<CR>", default_opts) -- Rename LSP symbol
map("n", "<leader>lr", "<cmd> Telescope lsp_references<CR>", default_opts) -- Show all LSP references map("n", "<leader>lr", "<cmd> Telescope lsp_references<CR>", default_opts) -- Show all LSP references
map("n", "<leader>ls", "<cmd> Telescope lsp_workspace_symbols<CR>", default_opts) -- Search for LSP symbols map("n", "<leader>ls", "<cmd> Telescope lsp_workspace_symbols<CR>", default_opts) -- Search for LSP symbols
map("n", "<leader>lt", "<cmd> TodoTelescope<CR>", default_opts) -- Search for LSP symbols map("n", "<leader>lt", "<cmd> TodoTelescope<CR>", default_opts) -- Show all TODOs in a project
wk.register({ wk.register({
["<leader>"] = { ["<leader>"] = {
l = { l = {
@@ -54,7 +55,7 @@ wk.register({
}) })
-- git -- git
map("n", "<leader>gs", "<cmd> Neogit<CR>", default_opts) map("n", "<leader>gs", "<cmd> lua require('neogit').open()<CR>", default_opts)
map("n", "<leader>gb", "<cmd> Git blame<CR>", default_opts) map("n", "<leader>gb", "<cmd> Git blame<CR>", default_opts)
wk.register({ wk.register({
["<leader>"] = { ["<leader>"] = {
@@ -66,7 +67,8 @@ wk.register({
}) })
-- Telescope + telescope-symbols -- Telescope + telescope-symbols
map("n", "<leader>ie", "<cmd> lua require'telescope.builtin'.symbols{ sources = { 'emoji', 'gitmoji' } }<CR>", default_opts) -- Show emojis map("n", "<leader>ie", "<cmd> lua require'telescope.builtin'.symbols{ sources = { 'emoji', 'gitmoji' } }<CR>",
default_opts) -- Show emojis
map("n", "<leader>im", "<cmd> lua require'telescope.builtin'.symbols{ sources = { 'julia' } }<CR>", default_opts) -- Show math symbols map("n", "<leader>im", "<cmd> lua require'telescope.builtin'.symbols{ sources = { 'julia' } }<CR>", default_opts) -- Show math symbols
map("n", "<leader>in", "<cmd> lua require'telescope.builtin'.symbols{ sources = { 'nerd' } }<CR>", default_opts) -- Show nerd icons map("n", "<leader>in", "<cmd> lua require'telescope.builtin'.symbols{ sources = { 'nerd' } }<CR>", default_opts) -- Show nerd icons
wk.register({ wk.register({

View File

@@ -2,6 +2,9 @@
-- Define all plugins in this file, -- Define all plugins in this file,
-- but maintain config in <PLUGIN-NAME>-conf.lua -- but maintain config in <PLUGIN-NAME>-conf.lua
-- Mention all dependencies in 'requires', but create their own entry,
-- if they need configuration.
local fn = vim.fn local fn = vim.fn
-- This should auto install packer, if it is not installed on system -- This should auto install packer, if it is not installed on system
@@ -146,6 +149,18 @@ return require('packer').startup(function(use)
config = function() require('plugins.nvim-tree-conf') end config = function() require('plugins.nvim-tree-conf') end
} }
-- cooler cmd line and notifications
use({
"folke/noice.nvim",
event = "VimEnter",
config = function()
require("noice").setup()
end,
requires = {
"MunifTanjim/nui.nvim", -- frontend for cmdline
},
})
-- Automatically set up your configuration after cloning packer.nvim -- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins -- Put this at the end after all plugins
if packer_bootstrap then if packer_bootstrap then

View File

@@ -57,7 +57,7 @@ require('lualine').setup({
}, },
lualine_c = {}, lualine_c = {},
lualine_x = { lualine_x = {
'lsp_progress' -- 'lsp_progress' -- noice already shows this.. better
}, },
lualine_y = {}, lualine_y = {},
lualine_z = {} lualine_z = {}

View File

@@ -57,6 +57,9 @@ set -s command-alias[1] respawn='respawn-pane -k'
# make escape bindings of programs work in tmux # make escape bindings of programs work in tmux
set -s escape-time 5 set -s escape-time 5
# renumber windows, when one gets closed
set-option -g renumber-windows on
# enable mouse # enable mouse
set-option -g mouse on set-option -g mouse on

View File

@@ -63,13 +63,24 @@ set laststatus=1 " 1: only if there are at least two windows
set showtabline=1 " 1: only if there are at least two tab pages set showtabline=1 " 1: only if there are at least two tab pages
let g:airline_powerline_fonts = 1 let g:airline_powerline_fonts = 1
" let g:tmuxline_preset = {
" \'a' : ['#H'],
" \'win' : ['#I', '#W'],
" \'cwin' : ['#[fg=black,bold]#I', '#W'],
" \'y' : ['%R'],
" \'z' : ['#S']}
" let g:tmuxline_status_justify = 'left'
let g:tmuxline_preset = { let g:tmuxline_preset = {
\'a' : ['#H'], \'a' : '',
\'b' : '',
\'c' : '',
\'win' : ['#I', '#W'], \'win' : ['#I', '#W'],
\'cwin' : ['#[fg=black,bold]#I', '#W'], \'cwin' : ['#[fg=black,bold]#I', '#W'],
\'y' : ['%R'], \'x' : '',
\'z' : ['#S']} \'y' : '',
let g:tmuxline_status_justify = 'left' \'z' : ''}
let g:tmuxline_status_justify = 'centre'
" ============================== Indents and Whitespaces " ============================== Indents and Whitespaces
set list set list