[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`
-- Treesitter with `:TSUpdate`
-- Treesitter with `:TSUpdate` after every nvim update.
-- LSP with `:LSPInstall`, log with `:LSPInfo`
--
-- Rollback possible with packer.nvim

View File

@@ -23,20 +23,21 @@ telescope.setup({
}
}
})
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-k>", "<cmd> Telescope keymaps<CR>", default_opts) -- Show all keys
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-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
map("n", "<leader>la", "<cmd> lua vim.lsp.buf.code_action()<CR>", default_opts) -- Apply LSP code action
map("n", "<leader>ld", "<cmd> Telescope lsp_definitions<CR>", default_opts) -- Show all LSP definitions (or jump if only 1)
map("n", "<leader>le", "<cmd> Telescope diagnostics<CR>", default_opts) -- Show errors and warnings
map("n", "<leader>lf", "<cmd> lua vim.lsp.buf.formatting()<CR>", default_opts) -- Format buffer with LSP
map("n", "<leader>lh", "<cmd> lua vim.lsp.buf.hover()<CR>", default_opts) -- Show info of symbol (double tap to enter)
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>la", "<cmd> lua vim.lsp.buf.code_action()<CR>", default_opts) -- Apply LSP code action
map("n", "<leader>ld", "<cmd> Telescope lsp_definitions<CR>", default_opts) -- Show all LSP definitions (or jump if only 1)
map("n", "<leader>le", "<cmd> Telescope diagnostics<CR>", default_opts) -- Show errors and warnings
map("n", "<leader>lf", "<cmd> lua vim.lsp.buf.formatting()<CR>", default_opts) -- Format buffer with LSP
map("n", "<leader>lh", "<cmd> lua vim.lsp.buf.hover()<CR>", default_opts) -- Show info of symbol (double tap to enter)
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>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({
["<leader>"] = {
l = {
@@ -54,7 +55,7 @@ wk.register({
})
-- 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)
wk.register({
["<leader>"] = {
@@ -66,9 +67,10 @@ wk.register({
})
-- Telescope + telescope-symbols
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>in", "<cmd> lua require'telescope.builtin'.symbols{ sources = { 'nerd' } }<CR>", default_opts) -- Show nerd icons
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>in", "<cmd> lua require'telescope.builtin'.symbols{ sources = { 'nerd' } }<CR>", default_opts) -- Show nerd icons
wk.register({
["<leader>"] = {
i = {
@@ -135,7 +137,7 @@ cmp.setup({
-- file tree
map("n", "<C-t>", "<cmd> NvimTreeFindFileToggle<CR>", default_opts) -- Show file tree
map("n", "<leader>tc", "<cmd> NvimTreeCollapse<CR>", default_opts) -- Collapse tree
map("n", "<leader>tc", "<cmd> NvimTreeCollapse<CR>", default_opts) -- Collapse tree
wk.register({
["<leader>"] = {
t = {

View File

@@ -2,6 +2,9 @@
-- Define all plugins in this file,
-- 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
-- This should auto install packer, if it is not installed on system
@@ -35,7 +38,7 @@ return require('packer').startup(function(use)
"nvim-lualine/lualine.nvim",
requires = {
"kyazdani42/nvim-web-devicons", -- All icons in bar
"arkav/lualine-lsp-progress", -- Show lsp loading progress
"arkav/lualine-lsp-progress", -- Show lsp loading progress
"SmiteshP/nvim-navic", -- Show breadcrumbs (loaded in lualine-conf)
"neovim/nvim-lspconfig", -- for nvim-navic (loaded later)
},
@@ -77,7 +80,7 @@ return require('packer').startup(function(use)
"williamboman/nvim-lsp-installer", -- Easy to install LSP servers
"simrat39/rust-tools.nvim" -- Cooler LSP stuff for Rust
},
config = function () require('plugins.nvim-lspconfig-conf') end,
config = function() require('plugins.nvim-lspconfig-conf') end,
})
-- Snippets
@@ -146,6 +149,18 @@ return require('packer').startup(function(use)
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
-- Put this at the end after all plugins
if packer_bootstrap then

View File

@@ -57,7 +57,7 @@ require('lualine').setup({
},
lualine_c = {},
lualine_x = {
'lsp_progress'
-- 'lsp_progress' -- noice already shows this.. better
},
lualine_y = {},
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
set -s escape-time 5
# renumber windows, when one gets closed
set-option -g renumber-windows on
# enable mouse
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
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 = {
\'a' : ['#H'],
\'a' : '',
\'b' : '',
\'c' : '',
\'win' : ['#I', '#W'],
\'cwin' : ['#[fg=black,bold]#I', '#W'],
\'y' : ['%R'],
\'z' : ['#S']}
let g:tmuxline_status_justify = 'left'
\'x' : '',
\'y' : '',
\'z' : ''}
let g:tmuxline_status_justify = 'centre'
" ============================== Indents and Whitespaces
set list