nvim/vim: re-haul statusline
This commit is contained in:
@@ -5,6 +5,7 @@ local default_opts = { noremap = true, silent = true }
|
||||
vim.g.mapleader = ' '
|
||||
|
||||
map("n", "<C-_>", "<cmd> noh<CR>", default_opts)
|
||||
map("n", "<C-n>", "<cmd> messages<CR>", default_opts)
|
||||
|
||||
-- Telescope
|
||||
local telescope = require 'telescope'
|
||||
@@ -23,11 +24,9 @@ telescope.setup({
|
||||
}
|
||||
}
|
||||
})
|
||||
map("n", "<C-t>", "<cmd> Telescope telescope-tabs list_tabs<CR>", default_opts) -- Show all tabs
|
||||
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<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
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
-- Define all plugins in this file,
|
||||
-- but maintain config in <PLUGIN-NAME>-conf.lua
|
||||
|
||||
-- NOTE:
|
||||
-- Run `checkhealth` after first install
|
||||
|
||||
-- Mention all dependencies in 'requires', but create their own entry,
|
||||
-- if they need configuration.
|
||||
|
||||
@@ -55,15 +58,6 @@ return require('packer').startup(function(use)
|
||||
config = function() require('plugins.telescope-conf') end,
|
||||
})
|
||||
|
||||
-- browse tabs in telescope
|
||||
use {
|
||||
'LukasPietzschmann/telescope-tabs',
|
||||
requires = { 'nvim-telescope/telescope.nvim' },
|
||||
config = function()
|
||||
require'telescope-tabs'.setup{}
|
||||
end
|
||||
}
|
||||
|
||||
-- Auto Indentation
|
||||
use({
|
||||
'nmac427/guess-indent.nvim',
|
||||
@@ -148,14 +142,10 @@ return require('packer').startup(function(use)
|
||||
config = function() require('plugins.nvim-colorizer-conf') end
|
||||
})
|
||||
|
||||
-- cooler cmd line and notifications
|
||||
-- fancy lsp loading animation
|
||||
use({
|
||||
"folke/noice.nvim",
|
||||
requires = {
|
||||
"MunifTanjim/nui.nvim", -- frontend for cmdline
|
||||
},
|
||||
event = "VimEnter",
|
||||
config = function() require("plugins.noice-conf") end,
|
||||
'j-hui/fidget.nvim',
|
||||
config = function() require"fidget".setup{} end,
|
||||
})
|
||||
|
||||
-- latex synctex
|
||||
|
||||
@@ -46,34 +46,34 @@ require('lualine').setup({
|
||||
-- lualine comes with 'everforest' theme
|
||||
theme = 'everforest',
|
||||
},
|
||||
tabline = {
|
||||
lualine_a = {
|
||||
-- function()
|
||||
-- return mode_map[vim.api.nvim_get_mode().mode] or "__"
|
||||
-- end
|
||||
function()
|
||||
return '裡'
|
||||
end,
|
||||
},
|
||||
lualine_b = {
|
||||
{
|
||||
'tabs',
|
||||
mode = 2,
|
||||
max_length = vim.o.columns / 2
|
||||
}
|
||||
},
|
||||
lualine_c = {
|
||||
|
||||
},
|
||||
lualine_x = {
|
||||
-- 'lsp_progress' -- noice already shows this.. better
|
||||
},
|
||||
lualine_y = {
|
||||
require('nvim-navic').get_location
|
||||
},
|
||||
lualine_z = {
|
||||
}
|
||||
},
|
||||
-- tabline = {
|
||||
-- lualine_a = {
|
||||
-- -- function()
|
||||
-- -- return mode_map[vim.api.nvim_get_mode().mode] or "__"
|
||||
-- -- end
|
||||
-- function()
|
||||
-- return '裡'
|
||||
-- end,
|
||||
-- },
|
||||
-- lualine_b = {
|
||||
-- {
|
||||
-- 'tabs',
|
||||
-- mode = 2,
|
||||
-- max_length = vim.o.columns / 2
|
||||
-- }
|
||||
-- },
|
||||
-- lualine_c = {
|
||||
--
|
||||
-- },
|
||||
-- lualine_x = {
|
||||
-- -- 'lsp_progress' -- noice already shows this.. better
|
||||
-- },
|
||||
-- lualine_y = {
|
||||
-- require('nvim-navic').get_location
|
||||
-- },
|
||||
-- lualine_z = {
|
||||
-- }
|
||||
-- },
|
||||
-- all sections from left to right
|
||||
sections = {
|
||||
lualine_a = {
|
||||
@@ -101,13 +101,15 @@ require('lualine').setup({
|
||||
},
|
||||
},
|
||||
lualine_y = {
|
||||
'filetype',
|
||||
'encoding',
|
||||
'fileformat',
|
||||
'filetype',
|
||||
},
|
||||
lualine_z = {
|
||||
-- show wordcount in md and tex file
|
||||
-- show precise count when selecting
|
||||
function()
|
||||
if vim.bo.filetype == "md" or vim.bo.filetype == "tex" then
|
||||
if vim.bo.filetype == "markdown" or vim.bo.filetype == "tex" then
|
||||
if vim.fn.wordcount().visual_words == 1 then
|
||||
return tostring(vim.fn.wordcount().visual_words) .. " word"
|
||||
elseif not (vim.fn.wordcount().visual_words == nil) then
|
||||
@@ -118,16 +120,13 @@ require('lualine').setup({
|
||||
else
|
||||
return ""
|
||||
end
|
||||
end
|
||||
},
|
||||
lualine_z = {
|
||||
'progress',
|
||||
end,
|
||||
'location',
|
||||
-- Show trailing whitespace
|
||||
function()
|
||||
local space = vim.fn.search([[\s\+$]], 'nwc')
|
||||
return space ~= 0 and "TW:" .. space or ""
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1 +1,19 @@
|
||||
require("noice").setup({})
|
||||
require("noice").setup({
|
||||
lsp = {
|
||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
progress = {
|
||||
view = "mini",
|
||||
}
|
||||
},
|
||||
messages = {
|
||||
enabled = true, -- enables the Noice messages UI
|
||||
view = "mini", -- default view for messages
|
||||
view_error = "mini", -- view for errors
|
||||
view_warn = "mini", -- view for warnings
|
||||
},
|
||||
})
|
||||
|
||||
@@ -10,6 +10,9 @@ require('nvim-treesitter.configs').setup({
|
||||
"python",
|
||||
"rust",
|
||||
"yaml",
|
||||
"vim",
|
||||
"markdown",
|
||||
"markdown_inline"
|
||||
},
|
||||
auto_intall = true,
|
||||
highlight = {
|
||||
|
||||
@@ -7,7 +7,7 @@ require('telescope').setup({
|
||||
layout_strategy = "vertical",
|
||||
layout_config = {
|
||||
vertical = {
|
||||
width = 120,
|
||||
width = 160,
|
||||
prompt_position = "top",
|
||||
mirror = true,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user