diff --git a/files/nvim/.config/nvim/init.lua b/files/nvim/.config/nvim/init.lua index 9eea322..155221a 100644 --- a/files/nvim/.config/nvim/init.lua +++ b/files/nvim/.config/nvim/init.lua @@ -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 diff --git a/files/nvim/.config/nvim/lua/mappings.lua b/files/nvim/.config/nvim/lua/mappings.lua index f4b53ed..3d61206 100644 --- a/files/nvim/.config/nvim/lua/mappings.lua +++ b/files/nvim/.config/nvim/lua/mappings.lua @@ -23,20 +23,21 @@ telescope.setup({ } } }) -map("n", "", " Telescope find_files hidden=true", default_opts) -- Show files -map("n", "", " Telescope live_grep", default_opts) -- Grep through current directory -map("n", "", " Telescope keymaps", default_opts) -- Show all keys +map("n", "", " Telescope find_files hidden=true", default_opts) -- Show files +map("n", "", " Telescope live_grep", default_opts) -- Grep through current directory +map("n", "", " Telescope keymaps", default_opts) -- Show all keys +map("n", "", " Noice telescope", default_opts) -- Show all notifications -- Telescope + LSP -map("n", "la", " lua vim.lsp.buf.code_action()", default_opts) -- Apply LSP code action -map("n", "ld", " Telescope lsp_definitions", default_opts) -- Show all LSP definitions (or jump if only 1) -map("n", "le", " Telescope diagnostics", default_opts) -- Show errors and warnings -map("n", "lf", " lua vim.lsp.buf.formatting()", default_opts) -- Format buffer with LSP -map("n", "lh", " lua vim.lsp.buf.hover()", default_opts) -- Show info of symbol (double tap to enter) -map("n", "ln", " lua vim.lsp.buf.rename()", default_opts) -- Rename LSP symbol -map("n", "lr", " Telescope lsp_references", default_opts) -- Show all LSP references +map("n", "la", " lua vim.lsp.buf.code_action()", default_opts) -- Apply LSP code action +map("n", "ld", " Telescope lsp_definitions", default_opts) -- Show all LSP definitions (or jump if only 1) +map("n", "le", " Telescope diagnostics", default_opts) -- Show errors and warnings +map("n", "lf", " lua vim.lsp.buf.formatting()", default_opts) -- Format buffer with LSP +map("n", "lh", " lua vim.lsp.buf.hover()", default_opts) -- Show info of symbol (double tap to enter) +map("n", "ln", " lua vim.lsp.buf.rename()", default_opts) -- Rename LSP symbol +map("n", "lr", " Telescope lsp_references", default_opts) -- Show all LSP references map("n", "ls", " Telescope lsp_workspace_symbols", default_opts) -- Search for LSP symbols -map("n", "lt", " TodoTelescope", default_opts) -- Search for LSP symbols +map("n", "lt", " TodoTelescope", default_opts) -- Show all TODOs in a project wk.register({ [""] = { l = { @@ -54,7 +55,7 @@ wk.register({ }) -- git -map("n", "gs", " Neogit", default_opts) +map("n", "gs", " lua require('neogit').open()", default_opts) map("n", "gb", " Git blame", default_opts) wk.register({ [""] = { @@ -66,9 +67,10 @@ wk.register({ }) -- Telescope + telescope-symbols -map("n", "ie", " lua require'telescope.builtin'.symbols{ sources = { 'emoji', 'gitmoji' } }", default_opts) -- Show emojis -map("n", "im", " lua require'telescope.builtin'.symbols{ sources = { 'julia' } }", default_opts) -- Show math symbols -map("n", "in", " lua require'telescope.builtin'.symbols{ sources = { 'nerd' } }", default_opts) -- Show nerd icons +map("n", "ie", " lua require'telescope.builtin'.symbols{ sources = { 'emoji', 'gitmoji' } }", + default_opts) -- Show emojis +map("n", "im", " lua require'telescope.builtin'.symbols{ sources = { 'julia' } }", default_opts) -- Show math symbols +map("n", "in", " lua require'telescope.builtin'.symbols{ sources = { 'nerd' } }", default_opts) -- Show nerd icons wk.register({ [""] = { i = { @@ -135,7 +137,7 @@ cmp.setup({ -- file tree map("n", "", " NvimTreeFindFileToggle", default_opts) -- Show file tree -map("n", "tc", " NvimTreeCollapse", default_opts) -- Collapse tree +map("n", "tc", " NvimTreeCollapse", default_opts) -- Collapse tree wk.register({ [""] = { t = { diff --git a/files/nvim/.config/nvim/lua/plugins/init.lua b/files/nvim/.config/nvim/lua/plugins/init.lua index 0f7fa10..00c7555 100644 --- a/files/nvim/.config/nvim/lua/plugins/init.lua +++ b/files/nvim/.config/nvim/lua/plugins/init.lua @@ -2,6 +2,9 @@ -- Define all plugins in this file, -- but maintain config in -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 diff --git a/files/nvim/.config/nvim/lua/plugins/lualine-conf.lua b/files/nvim/.config/nvim/lua/plugins/lualine-conf.lua index 35e1e9e..0533469 100644 --- a/files/nvim/.config/nvim/lua/plugins/lualine-conf.lua +++ b/files/nvim/.config/nvim/lua/plugins/lualine-conf.lua @@ -57,7 +57,7 @@ require('lualine').setup({ }, lualine_c = {}, lualine_x = { - 'lsp_progress' + -- 'lsp_progress' -- noice already shows this.. better }, lualine_y = {}, lualine_z = {} diff --git a/files/tmux/.tmux.conf b/files/tmux/.tmux.conf index 498b75a..07321d3 100644 --- a/files/tmux/.tmux.conf +++ b/files/tmux/.tmux.conf @@ -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 diff --git a/files/vim/.vimrc b/files/vim/.vimrc index 94d33b6..bd625ac 100644 --- a/files/vim/.vimrc +++ b/files/vim/.vimrc @@ -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