leap and bufferline

This commit is contained in:
Christian Nieves
2023-08-23 07:46:28 +00:00
parent fb1185cc2d
commit 87ac7d3773
8 changed files with 135 additions and 122 deletions

View File

@ -1,19 +1,6 @@
local use_google = require("utils").use_google
return {
-- {
-- "rcarriga/nvim-notify",
-- config = function()
-- local colors = require("catppuccin.palettes").get_palette()
-- require("notify").setup({
-- background_colour = colors.base,
-- fps = 10, -- default 30
-- stages = "slide", -- default fade_in_slide_out
-- timeout = 5000, -- default 5000
-- })
-- vim.notify = require("notify")
-- end,
-- },
-- Pretty symbols
{
"nvim-tree/nvim-web-devicons",
@ -34,7 +21,6 @@ return {
},
"ntpeters/vim-better-whitespace",
"junegunn/fzf.vim",
"nathanaelkane/vim-indent-guides",
"tversteeg/registers.nvim",
"jremmen/vim-ripgrep",
"nvim-lua/plenary.nvim",

View File

@ -0,0 +1,36 @@
return {
-- {
-- "tiagovla/scope.nvim",
-- config = function()
-- -- vim.opt.sessionoptions = { -- required
-- -- "buffers",
-- -- "tabpages",
-- -- "globals",
-- -- }
-- require("scope").setup({})
-- end,
-- },
{
"akinsho/bufferline.nvim",
version = "*",
dependencies = "nvim-tree/nvim-web-devicons",
config = function()
vim.opt.termguicolors = true
require("bufferline").setup({
options = {
mode = "tabs",
diagnostics = "nvim_lsp",
diagnostics_indicator = function(count, level, diagnostics_dict, context)
local symbols = { error = "", warning = "", info = "", hint = "" }
local icon = symbols[level] or level
return "" .. icon .. count
end,
max_name_length = 30,
truncate_name = false,
show_close_icon = false,
show_buffer_close_icons = false,
},
})
end,
},
}

View File

@ -134,67 +134,33 @@ return {
dir = "/google/src/cloud/cnieves/google-comments/google3/experimental/users/chmnchiang/neovim/google-comments/",
dependencies = { "rktjmp/time-ago.vim", "rcarriga/nvim-notify", "nvim-lua/plenary.nvim" },
config = function()
-- vim.notify = require("notify")
-- Here are all the options and their default values:
require("google.comments").setup({
-- command = {'/google/bin/releases/editor-devtools/get_comments.par', '--full', '--json', "-x=''"},
stubby = true,
-- command = {
-- "/google/bin/releases/editor-devtools/get_comments.par",
-- "--json",
-- "--full",
-- "--noresolved",
-- "--cl_comments",
-- "--file_comments",
-- },
command = {
'stubby --output_json call blade:codereview-rpc CodereviewRpcService.GetComments "changelist_number: $(/google/data/ro/teams/fig/bin/vcstool pending-change-number)"',
},
-- Define your own icon by `vim.fn.sign_define('ICON_NAME', {text = ' '})`.
-- See :help sign_define
-- The sign property passed to setup should be the 'ICON_NAME' in the define
-- example above.
sign = "COMMENT_ICON",
-- Fetch the comments after calling `setup`.
auto_fetch = true,
display = {
-- CTN
virtual_text = true,
-- The width of the comment display window.
width = 50,
-- When showing file paths, use relative paths or not.
relative_path = true,
--- Enable viewing comments through floating window
floating = true,
--- Options used when creating the floating window.
floating_window_options = floating_window_options,
},
})
function floating_window_options(parent_win_id)
local parent_width = vim.api.nvim_win_get_width(parent_win_id)
local parent_height = vim.api.nvim_win_get_height(parent_win_id)
return {
relative = "win",
anchor = "NW",
width = math.floor(parent_width * 0.5),
height = math.floor(parent_height * 0.3),
row = vim.api.nvim_win_get_cursor(parent_win_id)[1],
col = math.floor(parent_width * 0.25),
border = "rounded",
}
end
local map = require("utils").map
-- here are some mappings you might want:
map("n", "]c", [[<Cmd>GoogleCommentsGotoNextComment<CR>]])
map("n", "[c", [[<Cmd>GoogleCommentsGotoPrevComment<CR>]])
map("n", "<Leader>nc", [[<Cmd>GoogleCommentsGotoNextComment<CR>]])
map("n", "<Leader>pc", [[<Cmd>GoogleCommentsGotoPrevComment<CR>]])
map("n", "<Leader>lc", [[<Cmd>GoogleCommentsToggleLineComments<CR>]])
map("n", "<Leader>ac", [[<Cmd>GoogleCommentsToggleAllComments<CR>]])
map("n", "<Leader>fc", [[<Cmd>GoogleCommentsFetchComments<CR>]])
map("n", "<Leader>tc", [[<Cmd>GoogleCommentsTelescope<CR>]])
vim.fn.sign_define("COMMENT_ICON", { text = "" })
end,

View File

@ -0,0 +1,6 @@
return {
"ggandor/leap.nvim",
config = function()
require("leap").add_default_mappings()
end,
}

View File

@ -53,7 +53,7 @@ return {
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
-- tabline = 1000,
winbar = 1000,
},
},
@ -73,42 +73,42 @@ return {
lualine_y = { "progress" },
lualine_z = { "location" },
},
tabline = {
lualine_a = {
{
"tabs",
mode = 1,
use_mode_colors = true,
max_length = (vim.o.columns / 5) * 4,
fmt = function(name, context)
-- Show + if buffer is modified in tab
local buflist = vim.fn.tabpagebuflist(context.tabnr)
local winnr = vim.fn.tabpagewinnr(context.tabnr)
local bufnr = buflist[winnr]
local mod = vim.fn.getbufvar(bufnr, "&mod")
return name .. (mod == 1 and " +" or "")
end,
},
},
lualine_b = { "branch" },
-- lualine_c = { "filename" },
lualine_c = {
{
"diagnostics",
sources = { "nvim_workspace_diagnostic" },
symbols = { error = "", warn = "", info = "", hint = "" },
},
},
-- lualine_y = { getLGTMs }
lualine_z = {
{
"filename",
file_status = false, -- displays file status (readonly status, modified status)
path = 2, -- 0 = just filename, 1 = relative path, 2 = absolute path
},
},
},
-- tabline = {
-- lualine_a = {
-- {
-- "tabs",
-- mode = 1,
-- use_mode_colors = true,
-- max_length = (vim.o.columns / 5) * 4,
-- fmt = function(name, context)
-- -- Show + if buffer is modified in tab
-- local buflist = vim.fn.tabpagebuflist(context.tabnr)
-- local winnr = vim.fn.tabpagewinnr(context.tabnr)
-- local bufnr = buflist[winnr]
-- local mod = vim.fn.getbufvar(bufnr, "&mod")
--
-- return name .. (mod == 1 and " +" or "")
-- end,
-- },
-- },
-- lualine_b = { "branch" },
-- -- lualine_c = { "filename" },
-- lualine_c = {
-- {
-- "diagnostics",
-- sources = { "nvim_workspace_diagnostic" },
-- symbols = { error = " ", warn = " ", info = " ", hint = " " },
-- },
-- },
-- -- lualine_y = { getLGTMs }
-- lualine_z = {
-- {
-- "filename",
-- file_status = false, -- displays file status (readonly status, modified status)
-- path = 2, -- 0 = just filename, 1 = relative path, 2 = absolute path
-- },
-- },
-- },
})
end,
}

View File

@ -0,0 +1,14 @@
return {
"rcarriga/nvim-notify",
event = "VimEnter",
lazy = true,
config = function()
local colors = require("catppuccin.palettes").get_palette()
require("notify").setup({
background_colour = colors.base,
fps = 10, -- default 30
stages = "slide", -- default fade_in_slide_out
timeout = 5000, -- default 5000
})
end,
}